/* Styles specific to the 4th Grade Math Worksheets page (index.php) */

/* Ensure headers are centered with consistent width */
.centered-header {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 950px; /* Match worksheet-grid max-width for alignment */
}

/* Ensure worksheet sections are centered consistently with .section */
.worksheet-section {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 1200px; /* Match .section max-width */
}

/* ─── Worksheet Table of Contents (theme-aligned) ───────────────────── */
html { scroll-behavior: smooth; }        /* keep the nice auto-scroll   */

#toc {
    background: #fefdfb;                /* same as page bg             */
    border: 2px solid #3186f5;          /* site accent blue            */
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.07);
    max-width: 500px;
    margin: 2.5rem auto;                /* centers the block           */
    padding: 1.2rem 2.4rem;
    font-family: 'Abel', sans-serif;    /* match global font           */
    text-align: center;
}

#toc .toc-title {
    margin: 0 0 1rem;
    font-size: 1.6rem;                  /* ~38 px on base 24 px body   */
    color: #444;
    padding-bottom: 20px;
}

#toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;                      /* tidy horizontal layout      */
    flex-wrap: wrap;
    gap: 1.2rem;                        /* uniform spacing             */
    justify-content: center;
    text-align: center;                 /* ensure content is centered  */
}

#toc li {
    flex: 0 1 auto;                     /* allow natural width         */
    display: inline-flex;               /* center link within li       */
    justify-content: center;
}

#toc a {
    color: #3186f5;                     /* link color already in use   */
    font-weight: 600;
    text-decoration: none;
    padding: .45rem 1.1rem;
    border: 2px solid transparent;
    border-radius: 6px;
    display: block;                     /* full-width clickable area   */
    transition: background .2s, border .2s, color .2s, transform .2s;
}

#toc a:hover,
#toc a:focus {
    background: #CCFFFF;                /* same aqua hover as top menu */
    color: #000;
    border-color: #3186f5;
    transform: translateY(-2px);
}

/* Stack links vertically on narrow screens */
@media (max-width: 600px) {
    #toc ul {
        flex-direction: column;
        text-align: center;             /* maintain centering on mobile */
    }
    #toc li {
        width: 100%;
        display: block;                 /* stack items naturally       */
    }
    #toc a {
        display: block;
        width: 100%;                    /* full-width links            */
        box-sizing: border-box;         /* include padding in width    */
    }
}
/* ───────────────────────────────────────────────────────────────────── */