/**
 * Case Studies Category Page Styles
 * Based on Figma design specifications
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --case-studies-bg: #FFFFFF;
    --case-studies-text: #2A3447;
    --case-studies-placeholder: #EDCCAD;
    --case-studies-card-spacing: 24px;
    --case-studies-image-radius: 32px;
    --case-studies-max-width: 1440px;
    --breadcrumb-link-color: rgba(0, 0, 0, 0.45);
    --breadcrumb-current-color: rgba(0, 0, 0, 0.88);
    --breadcrumb-separator-color: rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.case-studies-breadcrumbs {
    margin-bottom: 40px !important;
    padding: 25px 0 !important;
    height: 70px !important;
    display: flex !important;
    align-items: center !important;
}

.breadcrumb-container {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100% !important;
}

.breadcrumb-item {
    display: inline-block !important;
}

.breadcrumb-link {
    display: inline-block !important;
    text-decoration: none !important;
    color: var(--breadcrumb-link-color) !important;
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.43 !important;
    letter-spacing: 0.01em !important;
    transition: color 0.3s ease !important;
}

.breadcrumb-link:hover {
    color: var(--case-studies-text) !important;
}

.breadcrumb-link.current {
    color: var(--breadcrumb-current-color) !important;
    cursor: default !important;
}

.breadcrumb-text {
    white-space: nowrap !important;
}

.breadcrumb-separator {
    color: var(--breadcrumb-separator-color) !important;
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.43 !important;
    letter-spacing: 0.01em !important;
    margin: 0 8px !important;
}

/* ==========================================================================
   Case Studies Archive Container
   ========================================================================== */

.case-studies-archive-container {
    background-color: var(--case-studies-bg) !important;
    min-height: 100vh !important;
    padding: 40px 0 !important;
}

.case-studies-content {
    max-width: var(--case-studies-max-width) !important;
    margin: 0 auto !important;
    padding: 0 !important;
}



/* ==========================================================================
   Case Studies Grid
   ========================================================================== */

.case-studies-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--case-studies-card-spacing) !important;
    margin-bottom: 80px !important;
    margin-top: 40px !important;
}

/* ==========================================================================
   Case Study Cards
   ========================================================================== */

.case-study-card {
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 384px !important;
    height: auto !important;
    min-height: 440px !important; /* Increased to accommodate button */
    display: flex !important;
    flex-direction: column !important;
}

.case-study-card__content {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
}

/* ==========================================================================
   Case Study Image
   ========================================================================== */

.case-study-card__image {
    width: 100% !important;
    height: 216px !important;
    border-radius: var(--case-studies-image-radius) !important;
    overflow: hidden !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.case-study-card__image a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    text-decoration: none !important;
}

.case-study-card__img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: var(--case-studies-image-radius) !important;
    border: 1px solid #D9D9D9 !important;
    transition: transform 0.3s ease !important;
}

.case-study-card__img-placeholder {
    width: 100% !important;
    height: 100% !important;
    background-color: var(--case-studies-placeholder) !important;
    border-radius: var(--case-studies-image-radius) !important;
    border: 1px solid #D9D9D9 !important;
    transition: transform 0.3s ease !important;
}

.case-study-card__image:hover .case-study-card__img,
.case-study-card__image:hover .case-study-card__img-placeholder {
    transform: scale(1.05) !important;
}

/* ==========================================================================
   Case Study Info
   ========================================================================== */

.case-study-card__info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    justify-content: space-between !important; /* Ensure button stays at bottom */
    min-height: 140px !important; /* Ensure enough space for content + button */
}

.case-study-card__title {
    margin: 0 !important;
    padding: 0 !important;
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 24px !important;
    font-weight: 600 !important;
    line-height: 1.33 !important;
    color: var(--case-studies-text) !important;
    height: 64px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.case-study-card__title a {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.case-study-card__title a:hover {
    color: var(--header-cta-bg) !important;
}

.case-study-card__excerpt {
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: var(--case-studies-text) !important;
    flex: 1 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    max-height: 72px !important;
}

/* ==========================================================================
   No Posts Message
   ========================================================================== */

.case-studies-no-posts {
    grid-column: 1 / -1 !important;
    text-align: center !important;
    padding: 60px 20px !important;
}

.case-studies-no-posts h2 {
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 32px !important;
    font-weight: 600 !important;
    color: var(--case-studies-text) !important;
    margin: 0 0 20px 0 !important;
}

.case-studies-no-posts p {
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    color: var(--case-studies-text) !important;
    opacity: 0.7 !important;
    margin: 0 !important;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.case-studies-pagination {
    margin-top: 60px !important;
    padding-top: 40px !important;
    border-top: 1px solid rgba(42, 52, 71, 0.1) !important;
}

.pagination-wrapper {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    max-width: 400px !important;
    margin: 0 auto !important;
}

.nav-previous,
.nav-next {
    flex: 1 !important;
}

.nav-next {
    text-align: right !important;
}

.nav-previous a,
.nav-next a {
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: var(--case-studies-text) !important;
    text-decoration: none !important;
    padding: 12px 24px !important;
    border: 2px solid var(--case-studies-text) !important;
    border-radius: 100px !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
}

.nav-previous a:hover,
.nav-next a:hover {
    background-color: var(--case-studies-text) !important;
    color: var(--case-studies-bg) !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Large screens (1200px and up) */
@media (max-width: 1400px) {
    .case-studies-content {
        padding: 0 40px !important;
    }
}

/* Medium screens (992px to 1199px) */
@media (max-width: 1199px) {
    .case-studies-content {
        padding: 0 32px !important;
    }
    
    .case-studies-breadcrumbs {
        padding: 20px 0 !important;
        margin-bottom: 32px !important;
    }
    
    .case-studies-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        margin-top: 20px !important;
    }
    
    .case-study-card {
        max-width: none !important;
        min-height: 380px !important;
    }
    
    .case-study-card__image {
        height: 200px !important;
    }
    
    .case-study-card__title {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
    
    .case-study-card__excerpt {
        font-size: 15px !important;
        line-height: 1.4 !important;
    }
}

/* Small screens (768px to 991px) */
@media (max-width: 991px) {
    .case-studies-content {
        padding: 0 24px !important;
    }
    
    .case-studies-breadcrumbs {
        padding: 18px 0 !important;
        height: 60px !important;
        margin-bottom: 28px !important;
    }
    
    .case-studies-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 18px !important;
        margin-top: 18px !important;
    }
    
    .case-study-card {
        min-height: 360px !important;
    }
    
    .case-study-card__image {
        height: 180px !important;
    }
    
    .case-study-card__title {
        font-size: 20px !important;
        line-height: 1.25 !important;
    }
    
    .case-study-card__excerpt {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
}

/* Extra small screens (up to 767px) */
@media (max-width: 767px) {
    .case-studies-content {
        padding: 0 20px !important;
    }
    
    .case-studies-archive-container {
        padding: 16px 0 !important;
    }
    
    .case-studies-breadcrumbs {
        padding: 16px 0 !important;
        height: 52px !important;
        margin-bottom: 24px !important;
    }
    
    .breadcrumb-container {
        gap: 0 !important;
    }
    
    .breadcrumb-link {
        font-size: 13px !important;
        font-weight: 500 !important;
        line-height: 1.43 !important;
        letter-spacing: 0.01em !important;
    }
    
    .breadcrumb-separator {
        font-size: 13px !important;
        font-weight: 500 !important;
        line-height: 1.43 !important;
        letter-spacing: 0.01em !important;
        margin: 0 8px !important;
    }
    
    .case-studies-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-bottom: 48px !important;
        margin-top: 16px !important;
    }
    
    .case-study-card {
        height: auto !important;
        min-height: 340px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }
    
    .case-study-card__image {
        height: 200px !important;
    }
    
    .case-study-card__title {
        font-size: 18px !important;
        height: auto !important;
        min-height: 44px !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }
    
    .case-study-card__excerpt {
        font-size: 14px !important;
        max-height: 66px !important;
        line-height: 1.5 !important;
        margin-bottom: 12px !important;
    }
    
    .case-study-card__info {
        padding: 20px !important;
        min-height: 120px !important;
    }
    
    .pagination-wrapper {
        flex-direction: column !important;
        gap: 16px !important;
        margin-top: 40px !important;
    }
    
    .nav-next {
        text-align: center !important;
    }
    
    .nav-previous a,
    .nav-next a {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }
}

/* Very small screens (up to 480px) */
@media (max-width: 480px) {
    .case-studies-content {
        padding: 0 16px !important;
    }
    
    .case-studies-breadcrumbs {
        padding: 12px 0 !important;
        height: 48px !important;
        margin-bottom: 20px !important;
    }
    
    .breadcrumb-link {
        font-size: 12px !important;
        font-weight: 500 !important;
        line-height: 1.43 !important;
        letter-spacing: 0.01em !important;
    }
    
    .breadcrumb-separator {
        font-size: 12px !important;
        font-weight: 500 !important;
        line-height: 1.43 !important;
        letter-spacing: 0.01em !important;
        margin: 0 6px !important;
    }
    
    .case-studies-grid {
        gap: 16px !important;
        margin-top: 12px !important;
        margin-bottom: 40px !important;
    }
    
    .case-study-card {
        min-height: 320px !important;
    }
    
    .case-study-card__content {
        gap: 14px !important;
    }
    
    .case-study-card__image {
        height: 180px !important;
        border-radius: 24px !important;
    }
    
    .case-study-card__img,
    .case-study-card__img-placeholder {
        border-radius: 24px !important;
    }
    
    .case-study-card__title {
        font-size: 16px !important;
        min-height: 40px !important;
        line-height: 1.25 !important;
    }
    
    .case-study-card__excerpt {
        font-size: 13px !important;
        max-height: 52px !important;
        line-height: 1.4 !important;
    }
    
    .case-study-card__info {
        padding: 16px !important;
        min-height: 110px !important;
    }
    
    .pagination-wrapper {
        margin-top: 32px !important;
        gap: 12px !important;
    }
    
    .nav-previous a,
    .nav-next a {
        padding: 10px 20px !important;
        font-size: 13px !important;
    }
}

/* ==========================================================================
   Read More Button Styles (Based on Case Studies Block)
   ========================================================================== */

/* Removed duplicate - using existing .case-study-card__info styles above */

.case-study-card__content-wrapper {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.case-study-card__button-wrapper {
    display: flex !important;
    justify-content: flex-end !important; /* Right align button as in Figma */
    align-items: center !important;
    margin-top: auto !important;
    margin-bottom: 8px !important; /* Extra space below button */
    flex-shrink: 0 !important; /* Prevent button from shrinking */
}

.case-study-card__read-more {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 16px 24px !important;
    background: none !important;
    border: none !important;
    color: #000 !important;
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 24px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border-radius: 100px !important;
    width: 159px !important; /* Exact Figma width */
    height: 56px !important; /* Exact Figma height */
    justify-content: center !important;
    box-sizing: border-box !important;
}

.case-study-card__read-more:hover {
    background-color: rgb(251, 240, 230) !important; /* Same as block button */
    color: #000 !important;
    text-decoration: none !important;
    transform: translateX(4px) !important;
}

.case-study-card__read-more:focus {
    outline: 2px solid rgb(96, 71, 255) !important;
    outline-offset: 2px !important;
    background-color: rgb(251, 240, 230) !important;
}

.case-study-card__read-more:active {
    background-color: rgb(245, 235, 225) !important;
    transform: translateX(2px) !important;
}

.case-study-card__arrow {
    width: 24px !important;
    height: 25px !important;
    flex-shrink: 0 !important;
    order: -1 !important; /* Put arrow before text as in Figma */
    fill: currentColor !important;
}

.case-study-card__arrow path {
    fill: currentColor !important;
}

/* Responsive adjustments for button */
@media (max-width: 768px) {
    .case-study-card__read-more {
        width: auto !important;
        min-width: 159px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
    
    .case-study-card__arrow {
        width: 20px !important;
        height: 21px !important;
    }
}

/* ==========================================================================
   CTA Hero Block Integration (Bottom of Case Studies Page)
   ========================================================================== */

.case-studies-cta-wrapper {
    margin: 80px 0 60px 0 !important; /* Top spacing from grid, bottom spacing to pagination */
    width: 100% !important;
}

/* Override case studies page container to allow CTA Hero block to use its original styles */
.case-studies-cta-wrapper .wp-block-neve-child-cta-hero {
    margin: 0 !important; /* Remove default block margins only */
}

/* Remove horizontal padding for CTA block on case studies page */
.case-studies-cta-wrapper .wp-block-neve-child-cta-hero .neve-cta-hero-block {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Responsive adjustments for CTA wrapper spacing */
@media (max-width: 1199px) {
    .case-studies-cta-wrapper {
        margin: 60px 0 40px 0 !important;
    }
}

@media (max-width: 991px) {
    .case-studies-cta-wrapper {
        margin: 50px 0 35px 0 !important;
    }
}

@media (max-width: 768px) {
    .case-studies-cta-wrapper {
        margin: 40px 0 30px 0 !important;
    }
}

@media (max-width: 480px) {
    .case-studies-cta-wrapper {
        margin: 32px 0 24px 0 !important;
    }
    
    /* Better mobile spacing for CTA content */
    .case-studies-cta-wrapper .wp-block-neve-child-cta-hero .neve-cta-hero-container {
        padding: 32px 16px !important;
        border-radius: 24px !important;
    }
    
    .case-studies-cta-wrapper .wp-block-neve-child-cta-hero .neve-cta-hero-heading {
        font-size: 28px !important;
        line-height: 1.2 !important;
        margin-bottom: 16px !important;
    }
    
    .case-studies-cta-wrapper .wp-block-neve-child-cta-hero .neve-cta-hero-description {
        font-size: 16px !important;
        line-height: 1.4 !important;
        margin-bottom: 24px !important;
    }
    
    .case-studies-cta-wrapper .wp-block-neve-child-cta-hero .neve-cta-hero-button {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }
}
