/* Resources page overrides and layout tweaks */

/* ==========================================================================
   HEADER OVERRIDES
   ========================================================================== */

/* Scope using body.resources to avoid leaking styles */
body.resources .header.has-subnav {
    height: 150px;
}

body.resources .header.has-subnav .header-container {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

body.resources .header-top {
    height: 96px;
}

body.resources .header-nav {
    height: 96px;
    gap: 36px;
}

/* ==========================================================================
   HERO SECTION - IMAGE-BASED DESIGN
   ========================================================================== */

.resources-hero {
    margin-top: 145px; /* Account for fixed header height */
    position: relative;
    overflow: unset;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resources-hero-image {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
}

.resources-hero-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-width: 100%;
}

/* Picture tag handles image selection based on media queries */

.resources-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    height: 38px;
    background: var(--text-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 2;
}

/* ==========================================================================
   RESOURCES OVERVIEW SECTION
   ========================================================================== */

.resources-overview-section {
    padding: 40px 0;
    background: var(--text-white);
    text-align: center;
}

.resources-overview-container {
    max-width: 908px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.resources-overview-title {
    font-size: calc(var(--font-size-4xl) * var(--base-font-scale, 1));
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    margin-bottom: 30px;
    position: relative;
}

.resources-overview-text {
    font-size: calc(var(--font-size-lg) * var(--base-font-scale, 1));
    font-weight: var(--font-weight-normal);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==========================================================================
   PATIENT BROCHURES SECTION
   ========================================================================== */

.patient-brochures-section {
    background: var(--text-white);
    padding: 0 0 var(--spacing-l) 0;
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.brochures-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 100px;
    
}

.brochures-title {
    font-size: calc(var(--font-size-3xl) * var(--base-font-scale, 1));
    font-weight: var(--font-weight-black);
    color: var(--color-primary);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.brochures-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xxl);
    max-width: 1000px;
    margin: 0 auto;
}

.brochure-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brochure-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.brochure-image {
    width: 100%;
    max-width: 165px;
    margin-bottom: var(--spacing-md);
    position: relative;
}

.brochure-image::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 260%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, rgba(92, 6, 140, 0) 100%);
}

.brochure-cover {
    width: 100%;
    height: auto;
    box-shadow: 0 4px 12px rgba(92, 6, 140, 0.15);
    transition: var(--transition-normal);
}

.brochure-cover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(92, 6, 140, 0.25);
}

.brochure-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    width: 85%;
}

.brochure-title {
    font-size: calc(var(--font-size-base) * var(--base-font-scale, 1));
    font-weight: var(--font-weight-black);
    color: var(--color-primary);
    margin: 0;
    line-height: 1.4;
    text-align: center;
}

.brochure-description {
    font-size: calc(var(--font-size-base) * var(--base-font-scale, 1));
    font-weight: var(--font-weight-normal);
    color: var(--color-primary);
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

.brochure-download-link {
    font-size: calc(18px * var(--base-font-scale, 1));
    font-weight: var(--font-weight-black);
    color: var(--color-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 4px solid var(--color-primary-light);
    padding-bottom: 2px;
    transition: var(--transition-normal);
    display: inline-block;
}

.brochure-download-link:hover {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-primary-dark);
    transform: translateY(-1px);
}


/* ==========================================================================
   OTHER RESOURCES SECTION
   ========================================================================== */

.other-resources-section {
    background: var(--text-white);
    padding: var(--spacing-xxl) 0;
    text-align: center;
}

.other-resources-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.other-resources-title {
    font-size: calc(30px * var(--base-font-scale, 1));
    font-weight: var(--font-weight-black);
    color: var(--color-primary);
    margin-bottom: var(--spacing-xl);
    text-align: center;
    text-decoration: none;
}

.resources-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.resource-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.resource-name {
    font-size: calc(var(--font-size-lg) * var(--base-font-scale, 1));
    font-weight: var(--font-weight-black);
    color: var(--text-dark);
    line-height: 1.4;
    margin: 0 0 0px 0;
    text-align: center;
}

.resource-url {
    font-size: calc(var(--font-size-base) * var(--base-font-scale, 1));
    font-weight: var(--font-weight-normal);
    color: var(--color-primary);
    text-decoration: underline;
    transition: var(--transition-normal);
    margin: 0;
    text-align: center;
}

.resource-url:hover {
    text-decoration: underline;
    color: var(--color-primary-dark);
}

.resource-note {
    color: var(--color-primary);
    text-decoration: none;
}

/* ==========================================================================
   FINANCIAL ASSISTANCE SECTION
   ========================================================================== */

.financial-assistance-section {
    background: var(--text-white);
    padding: 0 0 var(--spacing-xxl) 0;
    text-align: center;
}

.financial-assistance-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-xxl);
}

.financial-assistance-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 75%;
    margin: 0 auto;
}

.financial-assistance-image {
    width: 143px;
    max-width: 186px;
    margin-bottom: var(--spacing-md);
    position: relative;
}

.financial-assistance-image::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 360%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, rgba(92, 6, 140, 0) 100%);
}

.assistance-brochure-image {
    width: 100%;
    height: auto;
    box-shadow: 0 4px 12px rgba(92, 6, 140, 0.15);
    transition: var(--transition-normal);
}

.assistance-brochure-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(92, 6, 140, 0.25);
}

.financial-assistance-title {
    font-size: calc(16px * var(--base-font-scale, 1));
    line-height: 24px;
    font-weight: var(--font-weight-black);
    color: var(--color-primary);
    margin: var(--spacing-md);
    text-align: center;
    line-height: 1.3;
    width: 80%;
}

.financial-assistance-description {
    font-size: calc(16px * var(--base-font-scale, 1));
    line-height: 24px;
    font-weight: var(--font-weight-normal);
    color: var(--color-primary);
    line-height: 1.6;
    margin: 0;
    text-align: center;
    max-width: 600px;
    width: 80%;
}

/* Province Select Container - Reusing existing styles with modifications */
.financial-assistance-section .province-select-container {
    position: relative;
    margin: var(--spacing-md) 0 var(--spacing-sm);
    width: 100%;
    max-width: 400px;
}

.financial-assistance-section .province-select {
    width: 100%;
    height: 60px;
    background: var(--text-white);
    border: 4px solid var(--text-dark);
    border-radius: var(--radius-md);
    padding: 0 17px;
    font-family: var(--font-family);
    font-size: calc(20px * var(--base-font-scale, 1));
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-normal);
    box-shadow: 1px 6px 20px rgba(0, 0, 0, 0.22);
}

.financial-assistance-section .province-select:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(92, 6, 140, 0.15);
}

.financial-assistance-section .province-options {
    position: absolute;
    top: 100%;
    min-width: 100%;
    background: var(--text-white);
    border: 2px solid #ffffff;
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 4px 12px rgba(92, 6, 140, 0.15);
    z-index: var(--z-sticky);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    text-align: left;
}

.financial-assistance-section .province-options.show {
    display: block;
    margin-top: -10px;
}

.financial-assistance-section .province-option {
    padding: 12px 17px;
    font-family: var(--font-family);
    font-size: calc(18px * var(--base-font-scale, 1));
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--bg-light);
}

.financial-assistance-section .province-option:last-child {
    border-bottom: none;
}

.financial-assistance-section .province-option:hover {
    background: var(--bg-light-pink);
    color: var(--color-primary-dark);
}

.financial-download-link {
    font-size: calc(var(--font-size-lg) * var(--base-font-scale, 1));
    font-weight: var(--font-weight-black);
    color: var(--color-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 6px solid var(--color-primary-light);
    padding-bottom: 4px;
    transition: var(--transition-normal);
    display: inline-block;
    margin-top: 0px;
}

.financial-download-link:hover {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.financial-download-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet screens (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .resources-hero {
        margin-top: 150px; /* Account for fixed header height on tablet */
    }
    
    .resources-hero-image {
        width: 100%;
    }
    
    .resources-hero-img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* Picture tag handles image selection automatically */
}

/* Large screens (1200px and below) */
@media (max-width: 1200px) {
    .brochures-container {
        padding: 0 20px;
    }
    
    .brochures-grid {
        gap: 40px;
    }
}

/* Medium screens (900px and below) */
@media (max-width: 900px) {
    body.resources .myfembree-usage .usage-points-container {
        grid-template-columns: 1fr;
    }
}

/* Tablet screens (768px and below) */
@media (max-width: 768px) {
    /* Header adjustments */
    body.resources .header.has-subnav { 
        height: 120px; 
    }
    
    body.resources .header-nav { 
        height: 80px; 
        gap: 20px; 
    }
    
    /* Hero section mobile layout */
    .resources-hero {
        margin-top: 100px; /* Account for fixed header height on mobile */
    }
    
    .resources-hero-image {
        width: 100%;
    }
    
    .resources-hero-img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* Picture tag handles image selection automatically */

    .resources-hero::after {
        width: 100%;
        max-width: 1000px;
        height: 30px;
        border-radius: 20px 20px 0 0;
    }

    /* Resources overview section */
    .resources-overview-section {
        padding: 30px 0;
    }
    
    .resources-overview-title::after {
        width: 100%;
    }

    /* Patient Brochures Section - Tablet */
    .patient-brochures-section {
        padding: 60px 0;
    }

    .brochures-title {
        font-size: calc(28px * var(--base-font-scale, 1));
        font-weight: 700;
        color: #5C068C;
        margin-bottom: 40px;
    }

    .brochures-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        max-width: 500px;
    }

    .brochure-image {
        max-width: 250px;
    }

    .brochure-image::after {
        width: 170%;
        left: 50%;
        transform: translateX(-50%);
    }

    .brochure-title {
        font-size: calc(18px * var(--base-font-scale, 1));
        margin-bottom: 10px;
    }

    .brochure-description {
        font-size: calc(16px * var(--base-font-scale, 1));
        line-height: 24px;
    }

    /* Other Resources Section - Tablet */
    .other-resources-section {
        padding: 60px 0;
    }

    .financial-assistance-image::after {
        width: 300%;
    }
    
    .other-resources-title {
        font-size: calc(28px * var(--base-font-scale, 1));
        color: #5C068C;
        margin-bottom: 40px;
        text-decoration: none;
    }

    .resource-link-item {
        max-width: 500px;
    }

    .resource-name {
        font-size: calc(var(--font-size-lg) * var(--base-font-scale, 1));
        font-weight: black;
        line-height: 22px;
        margin-bottom: 6px;
    }

    .resource-url {
        font-size: calc(16px * var(--base-font-scale, 1));
    }

    /* Financial Assistance Section - Tablet */
    .financial-assistance-section {
        padding: 60px 0;
    }

    .financial-assistance-title {
        font-size: calc(28px * var(--base-font-scale, 1));
        font-weight: 700;
        color: #5C068C;
        margin-bottom: 20px;
    }

    .financial-assistance-description {
        font-size: calc(16px * var(--base-font-scale, 1));
        line-height: 24px;
        max-width: 500px;
    }

    .financial-assistance-image {
        max-width: 300px;
    }

    .financial-assistance-section .province-select-container {
        max-width: 350px;
    }

    .financial-assistance-section .province-select {
        height: 52px;
        font-size: 16px;
    }

    .financial-download-link {
        font-size: calc(16px * var(--base-font-scale, 1));
    }

    /* Reduce padding for all containers on tablet */
    .resources-overview-container,
    .brochures-container,
    .other-resources-container,
    .financial-assistance-container {
        padding: 0 20px;
    }

}

/* Mobile screens (480px and below) */
@media (max-width: 480px) {
    /* Header adjustments */
    body.resources .header.has-subnav { 
        height: 100px; 
    }
    
    body.resources .header-nav { 
        height: 72px; 
        gap: 14px; 
    }    
    
    body.resources .header-top {
        height: 0;
    }

    .resources-hero {
        margin-top: 100px; /* Account for fixed header height on small mobile */
    }
    
    .resources-hero-image {
        width: 100%;
    }
    
    .resources-hero-img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .resources-overview-title {
        font-size: calc(26px * var(--base-font-scale, 1));
    }

    .resources-hero::after {
        width: 100%;
        max-width: 1000px;
        height: 30px;
        border-radius: 20px 20px 0 0;
    }

    /* Resources overview section */
    .resources-overview-section {
        padding: 20px 0;
    }
    
    .resources-overview-title::after {
        width: 100%;
    }

    /* Patient Brochures Section - Mobile */
    .patient-brochures-section {
        padding: 50px 0;
    }

    .brochures-title {
        font-size: calc(20px * var(--base-font-scale, 1));
        font-weight: 800;
        color: #5C068C;
        margin-bottom: 35px;
    }

    .brochures-grid {
        gap: 35px;
        max-width: 100%;
    }

    .brochure-image {
        max-width: 200px;
    }

    .brochure-title {
        font-size: calc(16px * var(--base-font-scale, 1));
        margin-bottom: 8px;
    }

    .brochure-description {
        font-size: calc(16px * var(--base-font-scale, 1));
        line-height: 24px;
    }

    .brochure-download-link {
        font-size: calc(14px * var(--base-font-scale, 1));
    }

    .financial-assistance-content {
        width: 100%;
        margin: 0 auto;
        font-size: calc(16px * var(--base-font-scale, 1));
        line-height: 24px;
        
    }

    /* Other Resources Section - Mobile */
    .other-resources-section {
        padding: 50px 0;
    }

    .other-resources-title {
        font-size: calc(23px * var(--base-font-scale, 1));
        color: #5C068C;
        margin-bottom: 35px;
        text-decoration: none;
    }

    .resource-link-item {
        max-width: 100%;
        gap: 4px;
    }

    .resource-name {
        font-size: calc(18px * var(--base-font-scale, 1));
        font-weight: var(--font-weight-black);
        line-height: 20px;
        margin-bottom: 4px;
    }

    .resource-url {
        font-size: calc(var(--font-size-base) * var(--base-font-scale, 1));
    }

    /* Financial Assistance Section - Mobile */
    .financial-assistance-section {
        padding: 0px 0;
    }

    .financial-assistance-title {
        font-size: calc(16px * var(--base-font-scale, 1));
        line-height: 24px;
        padding: 0 0px;
        font-weight: var(--font-weight-black);
        color: #5C068C;
        width: 100%;
        margin: 15px auto 25px auto;
    }

    .financial-assistance-description {
        font-size: calc(16px * var(--base-font-scale, 1));
        line-height: 22px;
        width: 100%;
    }

    .financial-assistance-image {
        max-width: 250px;
    }

    
    .brochure-info {
        width: 95%;
    }

    .financial-assistance-image::after {
        width: 85vw;
        left: 50%;
        transform: translateX(-50%);
    }

    .financial-assistance-section .province-select-container {
        max-width: 100%;
    }

    /* Reduce padding for all containers on mobile */
    .resources-overview-container,
    .brochures-container,
    .other-resources-container,
    .financial-assistance-container {
        padding: 0 15px;
    }

    .financial-assistance-section .province-select {
        height: 60px;
        font-size: calc(20px * var(--base-font-scale, 1));
        padding: 0 12px;
    }

    .financial-assistance-section .province-option {
        padding: 10px 12px;
        font-size: calc(18px * var(--base-font-scale, 1));
    }

    .financial-download-link {
        font-size: calc(14px * var(--base-font-scale, 1));
        margin-top: 0px;
    }

}
