/* ========================================
   WORKSHEET DETAIL PAGE — V2
======================================== */

.worksheet-page {

    max-width: 1300px;

    margin: 60px auto;

    padding: 20px;

    display: grid;

    grid-template-columns: 46% 1fr;

    grid-template-areas:
        "image details"
        "description description"
        "buttons buttons";

    column-gap: 55px;

    row-gap: 0;

    box-sizing: border-box;
}


/* ========================================
   WORKSHEET IMAGE
======================================== */

.worksheet-image {

    grid-area: image;

    width: 100%;

    display: flex;

    justify-content: center;

    align-items: flex-start;

    box-sizing: border-box;
}


.worksheet-image img {

    display: block;

    width: 100%;

    max-width: 560px;

    height: auto;

    border-radius: var(--radius-card);

    box-shadow: var(--shadow-card);

    border: 1px solid var(--border);

    transition:
        box-shadow var(--transition),
        border-color var(--transition);
}


/* ========================================
   WORKSHEET DETAILS
======================================== */

.worksheet-details {

    grid-area: details;

    min-width: 0;

    box-sizing: border-box;
}


.worksheet-details h1 {

    font-size: 42px;

    line-height: 1.15;

    color: var(--heading);

    margin: 0 0 25px;

    font-weight: 800;
}


/* ========================================
   INFORMATION GRID
======================================== */

.info-grid {

    display: grid;

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

    gap: 14px;

    margin: 0;
}


/* ========================================
   INFORMATION CARD
======================================== */

.info-card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius-small);

    padding: 18px 15px;

    min-height: 76px;

    text-align: center;

    box-shadow: var(--shadow-small);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    box-sizing: border-box;

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background-color var(--transition),
        border-color var(--transition);
}


.info-card:hover {

    transform: translateY(-3px);

    box-shadow: var(--shadow-card);
}


.info-card span {

    font-size: 28px;

    line-height: 1;

    margin-bottom: 7px;
}


.info-card h3 {

    margin: 0 0 5px;

    color: var(--heading);

    font-size: 15px;
}


.info-card p {

    margin: 0;

    color: var(--text-muted);

    font-size: 14px;

    line-height: 1.4;
}


/* ========================================
   OLD INFO BOX SUPPORT
======================================== */

.info-box {

    margin: 30px 0;

    background: var(--surface-teal);

    border: 1px solid var(--border);

    padding: 25px;

    border-radius: var(--radius-small);

    box-sizing: border-box;
}


.info-box p {

    margin: 0 0 12px;

    color: var(--text-muted);
}


.info-box p:last-child {

    margin-bottom: 0;
}


/* ========================================
   FULL WIDTH DESCRIPTION
======================================== */

.worksheet-description {

    grid-area: description;

    width: 100%;

    margin-top: 35px;

    padding: 0 5px;

    box-sizing: border-box;
}


.worksheet-description p {

    width: 100%;

    margin: 0;

    color: var(--text-muted);

    font-size: 19px;

    line-height: 1.8;

    text-align: left;
}


/* ========================================
   DOWNLOAD / PRINT BUTTONS
======================================== */

.button-group {

    grid-area: buttons;

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 15px;

    margin-top: 25px;

    padding-bottom: 10px;

    flex-wrap: wrap;
}


.button-group a,
.button-group button {

    text-decoration: none;

    background: var(--primary);

    color: #ffffff;

    border: none;

    padding: 15px 25px;

    border-radius: var(--radius-pill);

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);

    box-sizing: border-box;
}


.button-group a:hover {

    background: var(--primary-dark);

    transform: translateY(-2px);

    box-shadow: var(--shadow-small);
}


.button-group button {

    background: var(--coral);
}


.button-group button:hover {

    background: var(--coral);

    transform: translateY(-2px);

    box-shadow: var(--shadow-small);
}


/* ========================================
   LEARNING BENEFITS
======================================== */

.learning-box {

    width: 100%;

    margin-top: 35px;

    margin-bottom: 35px;

    box-sizing: border-box;
}


.learning-box > .container {

    width: 100%;

    max-width: 1300px;

    margin: 0 auto;

    box-sizing: border-box;
}


.learning-box h2 {

    width: 100%;

    margin: 0 auto 30px;

    padding: 0;

    color: var(--heading);

    font-size: 34px;

    line-height: 1.25;

    text-align: center !important;

    box-sizing: border-box;
}


.learning-grid {

    width: 100%;

    display: grid;

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

    gap: 20px;

    box-sizing: border-box;
}


.learn-card {

    background: var(--surface);

    border: 1px solid var(--border);

    padding: 25px;

    border-radius: var(--radius-card);

    text-align: center;

    box-shadow: var(--shadow-card);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background-color var(--transition),
        border-color var(--transition);

    box-sizing: border-box;
}


.learn-card:hover {

    transform: translateY(-5px);

    box-shadow: var(--shadow-hover);
}


.learn-card h3 {

    margin: 15px 0 10px;

    color: var(--heading);
}


.learn-card p {

    font-size: 16px;

    margin: 0;

    color: var(--text-muted);

    line-height: 1.6;
}


/* ========================================
   VIDEO SECTION
======================================== */

.video-section {

    width: 100%;

    max-width: 1300px;

    margin: 80px auto;

    padding: 0 20px;

    box-sizing: border-box;
}


.video-section .container {

    width: 100%;

    max-width: 1300px;

    margin: 0 auto;

    box-sizing: border-box;
}


.video-section h2 {

    color: var(--heading);

    font-size: 38px;

    margin: 0 0 15px;
}


.video-section > .container > p {

    color: var(--text-muted);

    font-size: 18px;

    margin: 0 0 25px;

    line-height: 1.6;
}


/* ========================================
   VIDEO CONTAINER
======================================== */

.video-container {

    width: 100%;

    min-height: 420px;

    border-radius: var(--radius-card);

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);

    box-shadow: var(--shadow-card);

    position: relative;

    box-sizing: border-box;
}


/* ========================================
   YOUTUBE IFRAME
======================================== */

.video-container iframe {

    width: 100%;

    height: 550px;

    border: none;

    display: none;
}


/* ========================================
   VIDEO PLACEHOLDER
======================================== */

.video-placeholder {

    width: 100%;

    min-height: 420px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    padding: 40px;

    box-sizing: border-box;

    background: var(--surface-warm);
}


.video-placeholder-icon {

    width: 70px;

    height: 50px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: var(--coral);

    color: #ffffff;

    border-radius: var(--radius-small);

    font-size: 25px;

    margin-bottom: 20px;
}


.video-placeholder h3 {

    margin: 0 0 10px;

    color: var(--heading);

    font-size: 26px;

    font-weight: 800;
}


.video-placeholder p {

    margin: 0;

    max-width: 550px;

    color: var(--text-muted);

    font-size: 17px;

    line-height: 1.7;
}


/* ========================================
   TEACHER & PARENT TIPS
======================================== */

.teacher-tips {

    background: var(--surface-warm);

    border: 1px solid var(--border);

    padding: 40px 50px;

    border-radius: var(--radius-card);

    margin: 45px 0;

    text-align: center;

    box-sizing: border-box;
}


.teacher-tips h2 {

    color: var(--heading);

    margin: 0 0 25px;

    text-align: center;
}


.teacher-tips ul {

    max-width: 800px;

    margin: 0 auto;

    padding: 0;

    list-style-position: inside;

    text-align: center;
}


.teacher-tips li {

    margin-bottom: 15px;

    color: var(--text-muted);

    line-height: 1.8;
}


/* ========================================
   BREADCRUMB
======================================== */

.breadcrumb {

    background: var(--surface);

    padding: 18px 0;

    border-bottom: 1px solid var(--border);

    box-sizing: border-box;
}


.breadcrumb .container {

    max-width: 1300px;

    margin: auto;

    padding: 0 20px;

    display: flex;

    align-items: center;

    gap: 12px;

    font-size: 15px;

    box-sizing: border-box;
}


.breadcrumb a {

    text-decoration: none;

    color: var(--primary);

    font-weight: 600;
}


.breadcrumb a:hover {

    color: var(--heading);
}


.breadcrumb span {

    color: var(--text-light);
}


.current {

    color: var(--heading);

    font-weight: 700;
}


/* ========================================
   PREVIOUS / NEXT NAVIGATION
======================================== */

.worksheet-navigation {

    max-width: 1300px;

    margin: 70px auto;

    padding: 0 20px;

    display: flex;

    justify-content: space-between;

    gap: 25px;

    box-sizing: border-box;
}


.nav-card {

    flex: 1;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius-card);

    padding: 25px;

    text-decoration: none;

    box-shadow: var(--shadow-card);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background-color var(--transition),
        border-color var(--transition);

    box-sizing: border-box;
}


.nav-card:hover {

    transform: translateY(-5px);

    box-shadow: var(--shadow-hover);
}


.nav-card span {

    color: var(--primary);

    font-size: 15px;

    font-weight: 600;
}


.nav-card h3 {

    margin: 12px 0 0;

    color: var(--heading);
}


/* ========================================
   RELATED WORKSHEETS
======================================== */

.related-section {

    padding: 80px 0;

    box-sizing: border-box;
}


.related-section .container {

    max-width: 1300px;

    margin: auto;

    padding: 0 20px;

    box-sizing: border-box;
}


.related-section h2 {

    text-align: center;

    font-size: 42px;

    font-weight: 800;

    color: var(--heading);

    margin: 0 0 45px;
}


/* ========================================
   RELATED GRID
======================================== */

#relatedWorksheets {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );

    gap: 30px;
}


/* ========================================
   RELATED CARD
======================================== */

.related-card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius-card);

    overflow: hidden;

    box-shadow: var(--shadow-card);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background-color var(--transition),
        border-color var(--transition);
}


.related-card:hover {

    transform: translateY(-6px);

    box-shadow: var(--shadow-hover);
}


/* ========================================
   RELATED IMAGE
======================================== */

.related-image {

    display: block;

    width: 100%;

    aspect-ratio: 4 / 3;

    object-fit: cover;
}


/* ========================================
   RELATED CONTENT
======================================== */

.related-content {

    padding: 22px;

    text-align: center;
}


.related-content h3 {

    font-size: 24px;

    color: var(--heading);

    margin: 0 0 10px;
}


.related-content p {

    color: var(--text-muted);

    margin: 0 0 20px;
}


/* ========================================
   RELATED BUTTON
======================================== */

.related-content .worksheet-btn {

    display: inline-block;

    padding: 12px 28px;

    background: var(--primary);

    color: #ffffff;

    text-decoration: none;

    border-radius: var(--radius-button);

    font-weight: 700;

    transition:
        background-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}


.related-content .worksheet-btn:hover {

    background: var(--primary-dark);

    transform: translateY(-2px);

    box-shadow: var(--shadow-small);
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 992px) {

    .worksheet-page {

        grid-template-columns: 44% 1fr;

        column-gap: 35px;

        margin: 50px auto;
    }


    .worksheet-details h1 {

        font-size: 40px;
    }


    .info-grid {

        gap: 10px;
    }


    .info-card {

        padding: 15px 12px;

        min-height: 68px;
    }


    .button-group a,
    .button-group button {

        padding: 14px 20px;

        font-size: 15px;
    }


    #relatedWorksheets {

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

}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 768px) {

    .worksheet-page {

        width: 100%;

        max-width: none;

        margin: 35px auto;

        padding: 15px 18px;

        display: grid;

        grid-template-columns: 1fr;

        grid-template-areas:
            "image"
            "details"
            "description"
            "buttons";

        gap: 0;

        box-sizing: border-box;
    }


    .worksheet-image {

        width: 100%;

        display: flex;

        justify-content: center;

        align-items: flex-start;

        box-sizing: border-box;
    }


    .worksheet-image img {

        width: 100%;

        max-width: 600px;

        height: auto;

        border-radius: var(--radius-card);
    }


    .worksheet-details {

        width: 100%;

        margin-top: 30px;

        box-sizing: border-box;
    }


    .worksheet-details h1 {

        font-size: 36px;

        line-height: 1.2;

        margin: 0 0 20px;
    }


    .info-grid {

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

        gap: 10px;

        margin: 0;
    }


    .info-card {

        min-height: 80px;

        padding: 15px 10px;

        border-radius: var(--radius-small);
    }


    .info-card span {

        font-size: 25px;
    }


    .info-card h3 {

        font-size: 14px;
    }


    .info-card p {

        font-size: 13px;
    }


    .worksheet-description {

        width: 100%;

        margin-top: 30px;

        padding: 0;

        box-sizing: border-box;
    }


    .worksheet-description p {

        width: 100%;

        font-size: 17px;

        line-height: 1.7;

        text-align: center;

        margin: 0;
    }


    .button-group {

        width: 100%;

        display: flex;

        flex-direction: column;

        gap: 12px;

        margin-top: 22px;

        padding: 0;

        box-sizing: border-box;
    }


    .button-group a,
    .button-group button {

        width: 100%;

        padding: 14px 20px;

        font-size: 16px;

        text-align: center;

        box-sizing: border-box;
    }


    .learning-box {

        margin-top: 45px;
    }


    .learning-box h2 {

        font-size: 30px;

        margin-bottom: 25px;
    }


    .learning-grid {

        grid-template-columns: 1fr;

        gap: 15px;
    }


    .learn-card {

        padding: 22px;
    }


    .video-section {

        margin: 60px 0;
    }


    .video-container iframe {

        height: 250px;
    }


    .video-container {

        min-height: 300px;
    }


    .video-placeholder {

        min-height: 300px;

        padding: 25px 20px;
    }


    .video-placeholder h3 {

        font-size: 22px;
    }


    .video-placeholder p {

        font-size: 15px;
    }


    .video-placeholder-icon {

        width: 60px;

        height: 45px;

        font-size: 22px;
    }


    .teacher-tips {

        padding: 30px 20px;

        margin: 35px 0;

        text-align: center;
    }


    .teacher-tips h2 {

        text-align: center;

        font-size: 28px;
    }


    .teacher-tips ul {

        width: 100%;

        padding: 0;

        text-align: center;
    }


    .teacher-tips li {

        margin-bottom: 14px;

        line-height: 1.7;
    }


    .breadcrumb {

        padding: 14px 0;
    }


    .breadcrumb .container {

        padding: 0 18px;

        gap: 8px;

        font-size: 14px;

        flex-wrap: wrap;
    }


    .worksheet-navigation {

        width: 100%;

        margin: 50px auto;

        padding: 0 18px;

        flex-direction: column;

        gap: 15px;

        box-sizing: border-box;
    }


    .nav-card {

        width: 100%;

        padding: 22px;
    }


    .related-section {

        padding: 55px 0;
    }


    .related-section .container {

        padding: 0 18px;
    }


    .related-section h2 {

        font-size: 32px;

        margin-bottom: 30px;
    }


    #relatedWorksheets {

        grid-template-columns: 1fr;

        gap: 22px;
    }


    .related-content h3 {

        font-size: 21px;
    }

}


/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 480px) {

    .worksheet-page {

        margin: 25px auto;

        padding: 12px 15px;
    }


    .worksheet-image img {

        border-radius: var(--radius-small);
    }


    .worksheet-details {

        margin-top: 25px;
    }


    .worksheet-details h1 {

        font-size: 32px;

        line-height: 1.2;
    }


    .info-grid {

        gap: 9px;
    }


    .info-card {

        min-height: 78px;

        padding: 14px 8px;
    }


    .info-card span {

        font-size: 23px;
    }


    .info-card h3 {

        font-size: 13px;
    }


    .info-card p {

        font-size: 12px;
    }


    .worksheet-description {

        margin-top: 25px;
    }


    .worksheet-description p {

        font-size: 16px;

        line-height: 1.65;

        text-align: center;
    }


    .button-group {

        margin-top: 20px;
    }


    .button-group a,
    .button-group button {

        font-size: 15px;

        padding: 13px 18px;
    }


    .video-container iframe {

        height: 220px;
    }


    .teacher-tips {

        padding: 22px;
    }


    .related-section h2 {

        font-size: 29px;
    }

}


/* ========================================
   LEARNING BENEFITS — FINAL ALIGNMENT
======================================== */

.learning-box {

    width: 100%;

    box-sizing: border-box;
}


.learning-box > .container {

    width: 100%;

    max-width: 1300px;

    margin: 0 auto;

    box-sizing: border-box;
}


.learning-box h2 {

    width: 100%;

    margin: 0 auto 30px;

    padding: 0;

    color: var(--heading);

    font-size: 34px;

    line-height: 1.25;

    text-align: center !important;

    box-sizing: border-box;
}


.learning-grid {

    width: 100%;

    display: grid;

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

    gap: 20px;

    box-sizing: border-box;
}


/* ========================================
   LEARNING CARD
======================================== */

.learn-card {

    background: var(--surface);

    border: 1px solid var(--border);

    padding: 25px;

    border-radius: var(--radius-card);

    text-align: center;

    box-shadow: var(--shadow-card);

    box-sizing: border-box;

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background-color var(--transition),
        border-color var(--transition);
}


.learn-card:hover {

    transform: translateY(-5px);

    box-shadow: var(--shadow-hover);
}


/* ========================================
   LEARNING BENEFITS MOBILE
======================================== */

@media (max-width: 768px) {

    .learning-box {

        margin-top: 30px;
    }


    .learning-box > .container {

        width: 100%;

        padding: 0 12px;

        text-align: center;
    }


    .learning-box h2 {

        text-align: center !important;

        font-size: 30px;

        margin-bottom: 25px;
    }


    .learning-grid {

        grid-template-columns: 1fr;

        gap: 15px;
    }

}
/* ========================================
   WORKSHEETS PAGE STRIP
   FINAL COMPACT VERSION
======================================== */

.page-strip.worksheets-hero {

    width: 100%;

    height: 220px !important;

    min-height: 0 !important;

    box-sizing: border-box;

    display: flex;

    align-items: center;

    justify-content: center;

    text-align: center;

    padding: 20px !important;

    margin: 0 !important;

    background:
        linear-gradient(
            135deg,
            var(--surface-warm),
            var(--surface-teal)
        );

    border-bottom: 1px solid var(--border);

}


/* ========================================
   STRIP CONTENT
======================================== */

.page-strip.worksheets-hero .container {

    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

}


/* ========================================
   TITLE
======================================== */

.page-strip.worksheets-hero h1 {

    margin: 0 0 10px !important;

    font-size: 44px !important;

    line-height: 1.15;

    font-weight: 800;

    color: var(--heading);

}


/* ========================================
   SUBTITLE
======================================== */

.page-strip.worksheets-hero p {

    margin: 0 auto !important;

    max-width: 900px;

    font-size: 18px !important;

    line-height: 1.5;

    color: var(--text-muted);

}


/* ========================================
   TABLET
======================================== */

@media (max-width: 900px) {

    .page-strip.worksheets-hero {

        height: 200px !important;

        padding: 18px !important;

    }

    .page-strip.worksheets-hero h1 {

        font-size: 38px !important;

    }

    .page-strip.worksheets-hero p {

        font-size: 17px !important;

    }

}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 768px) {

    .page-strip.worksheets-hero {

        height: 180px !important;

        padding: 15px !important;

    }

    .page-strip.worksheets-hero h1 {

        font-size: 32px !important;

        margin-bottom: 8px !important;

    }

    .page-strip.worksheets-hero p {

        font-size: 16px !important;

    }

}


/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 480px) {

    .page-strip.worksheets-hero {

        height: 165px !important;

        padding: 12px !important;

    }

    .page-strip.worksheets-hero h1 {

        font-size: 28px !important;

    }

    .page-strip.worksheets-hero p {

        font-size: 15px !important;

    }

}

/* CWK_PREVIEW_DOWNLOAD_ONLY_V1 */
.worksheet-image {
    -webkit-touch-callout: none;
    user-select: none;
}

.worksheet-image #worksheetImage {
    pointer-events: none;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-user-drag: none !important;
    -webkit-touch-callout: none;
}

/* =========================================================
   CWK_WORKSHEET_PREVIEW_HEIGHT_V1
   Match worksheet preview height to the complete details panel.
========================================================= */

@media (min-width: 769px) {

    .worksheet-image {
        position: relative;
        align-self: stretch;
        min-height: 0;
        overflow: hidden;
        display: block;
    }

    .worksheet-image #worksheetImage {
        position: absolute;
        inset: 0;

        display: block;
        width: 100%;
        height: 100%;

        max-width: 100%;
        max-height: 100%;

        object-fit: contain;
        object-position: center top;
    }
}

/* Restore natural portrait presentation on mobile */
@media (max-width: 768px) {

    .worksheet-image {
        position: relative;
        display: flex;
        align-self: auto;
        min-height: auto;
        overflow: visible;
    }

    .worksheet-image #worksheetImage {
        position: relative;
        inset: auto;

        width: 100%;
        height: auto;

        max-width: 600px;
        max-height: none;

        object-fit: initial;
        object-position: initial;
    }
}
