/* =========================================================
   EPINOZIA | FINANCE
   LEARN HUB
========================================================= */


/* =========================================================
   PAGE
========================================================= */

.learn-page {
    width: 100%;
    background-color: #ffffff;
    color: var(--text-dark);
}


/* =========================================================
   HEADER
   Matches the Calculator Hub structure
========================================================= */

.learn-header {
    width: min(90%, 760px);
    margin-inline: auto;

    padding-block:
        clamp(45px, 5vw, 65px)
        clamp(25px, 3vw, 35px);

    text-align: center;
}

.learn-header .learn-eyebrow {
    margin: 0 0 10px;

    color: var(--action-blue);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.learn-header h1 {
    margin: 0 0 15px;

    color: var(--brand-navy);

    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.15;
}

.learn-intro {
    max-width: 620px;
    margin-inline: auto;

    color: var(--text-muted);

    font-size: clamp(15px, 1.5vw, 17px);
    line-height: 1.6;
}


/* =========================================================
   TOPIC SECTION
========================================================= */

.learn-topics {
    padding-bottom: clamp(55px, 6vw, 80px);
}


/* =========================================================
   MAIN LAYOUT
   AD | CONTENT | AD
========================================================= */

.learn-layout {
    width: min(96%, 1600px);
    margin-inline: auto;

    display: grid;

    grid-template-columns:
        minmax(120px, 200px)
        minmax(0, 1100px)
        minmax(120px, 200px);

    justify-content: center;
    align-items: start;

    gap: clamp(20px, 3vw, 40px);
}


/* =========================================================
   AD SPACES
========================================================= */

.learn-ad {
    min-height: 500px;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    padding-top: 10px;

    color: #94a3b8;

    font-size: 10px;
    letter-spacing: 0.5px;
}


/* =========================================================
   TOPIC GRID
========================================================= */

.learn-topic-grid {
    width: 100%;

    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));

    gap: clamp(18px, 2vw, 22px);

    padding-block:
        clamp(15px, 2vw, 20px)
        0;
}


/* =========================================================
   TOPIC CARDS
========================================================= */

.learn-topic-card {
    grid-column: span 2;

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 100%;

    padding: clamp(22px, 2.5vw, 26px);

    background-color: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 12px;
}


/* =========================================================
   CARD HEADER
========================================================= */

.learn-topic-header {
    margin-bottom: 24px;
	position: relative;
    z-index: 0;
}

.learn-topic-header h2 {
    margin: 0;

    text-align: center;

    color: var(--text-dark);

    font-size: clamp(18px, 2vw, 21px);
    line-height: 1.2;
}

.learn-topic-header p:last-child {
    margin: 10px 0 0;

    color: var(--text-muted);

    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   CONCEPT MATRIX
========================================================= */

.learn-concept-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 10px;

    margin-bottom: 24px;
}

.learn-concept {
    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;

    padding: 12px 14px;

    text-align: center;
    text-decoration: none;

    color: var(--text-dark);

    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;

    background-color: var(--background-soft);

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

/* Center odd final concept */

.learn-concept-grid > .learn-concept:last-child:nth-child(odd) {
    grid-column: 1 / -1;

    width: calc(50% - 5px);

    justify-self: center;
}


/* =========================================================
   CONCEPT HOVER
========================================================= */

@media (hover: hover) and (pointer: fine) {

    a.learn-concept:hover {
        background-color: #eff6ff;
        border-color: #bfdbfe;
        color: var(--text-dark);
    }
}


/* =========================================================
   PRACTICE AREA
========================================================= */

.learn-practice {
    margin-top: auto;

    padding-top: 20px;

    border-top: 1px solid #e2e8f0;
}

.learn-practice-label {
    margin: 0 0 12px;

    text-align: center;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.learn-tool-links {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;
}

.learn-tool-link {
    flex: 1 1 160px;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 10px 16px;

    text-align: center;
    text-decoration: none;

    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    background-color: var(--action-blue);

    border-radius: 8px;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {

    .learn-tool-link:hover {
        background-color: #1d4ed8;
        transform: translateY(-1px);
    }
}


/* =========================================================
   RESPONSIVE - STRUCTURAL CHANGES ONLY
========================================================= */

@media (max-width: 1200px) {

    .learn-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .learn-ad {
        display: none;
    }
}

/* Three columns → two columns */

@media (max-width: 1000px) {

    .learn-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .learn-topic-card {
        grid-column: auto;
    }
}

/* Two columns → one column */

@media (max-width: 650px) {

    .learn-topic-grid {
        grid-template-columns: 1fr;
    }

    .learn-concept-grid {
        grid-template-columns: 1fr;
    }

    .learn-concept-grid > .learn-concept:last-child:nth-child(odd) {
        grid-column: auto;
        width: 100%;
    }

    .learn-topic-card {
        padding: 22px;
    }
}
/* =========================================================
   MOBILE / TABLET BOTTOM AD
========================================================= */

.learn-mobile-ad {
    display: none;
}

@media (max-width: 1200px) {

    .learn-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .learn-ad {
        display: none;
    }

    .learn-mobile-ad {
        width: min(92%, 860px);
        min-height: 180px;

        margin: 20px auto 32px;

        display: flex;
        align-items: flex-start;
        justify-content: center;

        padding-top: 28px;

        color: #94a3b8;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
}