/* =========================================================
	EPINOZIA | SHARED COMPONENTS
    LEARN HUB
========================================================= */


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

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


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

.learn-header {
    width: min(92%, var(--reading-max-width, 800px));
    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
========================================================= */

.learn-layout {
    width: min(92%, var(--site-max-width, 1200px));
    margin-inline: auto;
    display: block;
}

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

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

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

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

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


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

.learn-topic-card {

    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 DESIGN
   EPINOZIA STANDARDS
========================================================= */

@media (max-width: 1023px) {

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

    .learn-header {
        width: min(92%, 720px);
    }
}

@media (max-width: 599px) {

    .learn-layout,
    .learn-header {
        width: calc(100% - 32px);
    }

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

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

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

    .learn-topic-card {
        padding: 22px;
    }
}