/* =========================================================================
   Mary's K-5 Curriculum — Styles
   ========================================================================= */

/* ---------------------------------------------------------------------------
   Curriculum Nav
   --------------------------------------------------------------------------- */
.curriculum-nav {
    background: #fafaf8;
    border-bottom: 2px solid #e8e4d9;
    padding: 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.curriculum-nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.curriculum-nav-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #2d5016;
    text-decoration: none;
    white-space: nowrap;
    margin-right: 1rem;
}

.curriculum-nav-brand:hover {
    color: #4a7a25;
}

.curriculum-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}

.curriculum-nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #555;
    margin: 4px 0;
}

.curriculum-nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.cn-link, .cn-parent {
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.cn-link:hover, .cn-parent:hover {
    background: #f0ede4;
    color: #2d5016;
}

.cn-link.active {
    background: #2d5016;
    color: white;
}

.cn-caret { font-size: 0.7rem; }

.cn-group {
    position: relative;
}

.cn-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0ddd4;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 0.4rem 0;
    min-width: 180px;
    z-index: 100;
}

.cn-group:hover .cn-submenu {
    display: block;
}

.cn-sublink {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    color: #555;
    text-decoration: none;
}

.cn-sublink:hover {
    background: #f5f3ec;
    color: #2d5016;
}

.cn-sublink.active {
    color: #2d5016;
    font-weight: 600;
}

.cn-search {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
}

.cn-search input {
    padding: 4px 8px;
    border: 1px solid #d4d0c8;
    border-radius: 4px;
    font-size: 0.8rem;
    width: 130px;
}

.cn-search button {
    padding: 4px 8px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 4px;
    margin-left: 3px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Breadcrumb
   --------------------------------------------------------------------------- */
.breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: #2d5016;
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.bc-sep {
    margin: 0 0.4rem;
    color: #bbb;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: #2d5016;
    color: white;
}

.btn-primary:hover { background: #3a6b1d; }

.btn-secondary {
    background: #f0ede4;
    color: #2d5016;
    border: 1px solid #d4d0c8;
}

.btn-secondary:hover { background: #e8e4d9; }

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
}

/* ---------------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-grade { color: white; }
.badge-amber { background: #d97706; }
.badge-sky { background: #0284c7; }
.badge-forest { background: #2d5016; }
.badge-gray { background: #6b7280; }

.badge-subject { background: #f0ede4; color: #555; }
.badge-time { background: #f3f1eb; color: #666; }
.badge-noprep { background: #fef3c7; color: #92400e; }
.badge-print { background: #dbeafe; color: #1e40af; }
.badge-prep { background: #f3f1eb; color: #666; }
.badge-type { background: #e0e7ff; color: #3730a3; }
.badge-diff { background: #fce7f3; color: #9d174d; }
.badge-parent { background: #ecfdf5; color: #065f46; }
.badge-season { background: #fff7ed; color: #9a3412; }
.badge-count { background: #f3f1eb; color: #555; }

/* ---------------------------------------------------------------------------
   Prose (rendered markdown)
   --------------------------------------------------------------------------- */
.prose h2 { margin-top: 1.5rem; margin-bottom: 0.5rem; color: #2d5016; }
.prose h3 { margin-top: 1.2rem; margin-bottom: 0.4rem; color: #3a3a3a; }
.prose p { margin-bottom: 0.8rem; line-height: 1.65; }
.prose ul, .prose ol { margin-bottom: 0.8rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.3rem; line-height: 1.6; }
.prose strong { color: #2a2a2a; }
.prose blockquote {
    border-left: 3px solid #d4d0c8;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

/* ---------------------------------------------------------------------------
   Landing Page
   --------------------------------------------------------------------------- */
.curriculum-hero {
    text-align: center;
    padding: 2.5rem 1rem;
    background: linear-gradient(135deg, #f8f7f2 0%, #eef5e6 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.curriculum-hero h1 {
    font-size: 1.8rem;
    color: #2d5016;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 0.8rem;
}

.hero-text {
    color: #666;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-section {
    margin-bottom: 2.5rem;
}

.landing-section h2 {
    font-size: 1.3rem;
    color: #2d5016;
    margin-bottom: 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #e8e4d9;
}

.landing-stat {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    padding: 1rem;
}

/* Grade cards */
.grade-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.grade-card {
    display: block;
    padding: 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid transparent;
}

.grade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.grade-card h3 { margin: 0.5rem 0 0.3rem; font-size: 1.1rem; }
.grade-card p { font-size: 0.88rem; color: #666; margin: 0; }
.grade-emoji { font-size: 1.8rem; }

.grade-card-k1 { background: #fef9ee; border-color: #fcd34d; }
.grade-card-23 { background: #eef6ff; border-color: #93c5fd; }
.grade-card-45 { background: #eef7ee; border-color: #86efac; }

/* Subject grid */
.subject-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subject-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f5f3ec;
    border: 1px solid #e0ddd4;
    border-radius: 20px;
    font-size: 0.88rem;
    color: #555;
    text-decoration: none;
    transition: background 0.15s;
}

.subject-pill:hover { background: #e8e4d9; color: #2d5016; }
.subject-pill.active { background: #2d5016; color: white; border-color: #2d5016; }

/* Quick links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.quick-link {
    display: block;
    padding: 1rem;
    background: #fafaf8;
    border: 1px solid #e8e4d9;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: background 0.15s;
}

.quick-link:hover { background: #f0ede4; }

/* ---------------------------------------------------------------------------
   Lesson Cards
   --------------------------------------------------------------------------- */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.lesson-card {
    display: block;
    padding: 1.2rem;
    background: white;
    border: 1px solid #e8e4d9;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.lesson-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    border-color: #c8c3b5;
}

.lesson-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.lesson-emoji { font-size: 1.3rem; flex-shrink: 0; }

.lesson-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: #2a2a2a;
    line-height: 1.3;
}

.lesson-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.lesson-card-desc {
    font-size: 0.82rem;
    color: #666;
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Hub Pages
   --------------------------------------------------------------------------- */
.hub-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.hub-emoji { font-size: 2rem; }

.hub-header h1 { margin: 0; color: #2d5016; }

.hub-body { margin-bottom: 2rem; }

.hub-stats { margin-bottom: 2rem; }
.hub-stats h2 { font-size: 1.1rem; margin-bottom: 0.75rem; color: #333; }

.stat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: #f5f3ec;
    border: 1px solid #e0ddd4;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #555;
    text-decoration: none;
}

.stat-pill:hover { background: #e8e4d9; }

.stat-count {
    background: #2d5016;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.hub-subpages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.subpage-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: #fafaf8;
    border: 1px solid #e8e4d9;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: background 0.15s;
}

.subpage-card:hover { background: #f0ede4; }
.subpage-emoji { font-size: 1.2rem; }
.subpage-title { font-weight: 500; font-size: 0.9rem; }

.hub-lessons { margin-top: 2rem; }
.hub-lessons h2 { font-size: 1.2rem; color: #2d5016; margin-bottom: 1rem; }

/* ---------------------------------------------------------------------------
   Lesson Page
   --------------------------------------------------------------------------- */
.lesson-header { margin-bottom: 1.5rem; }

.lesson-header h1 {
    font-size: 1.6rem;
    color: #2d5016;
    margin-bottom: 0.75rem;
}

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.lesson-materials {
    background: #fef9ee;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 3px solid #d97706;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.lesson-body { margin-bottom: 2rem; }

.lesson-download { margin-bottom: 1.5rem; }

/* Expandable sections */
.lesson-expand {
    margin-bottom: 0.75rem;
    border: 1px solid #e8e4d9;
    border-radius: 8px;
    overflow: hidden;
}

.lesson-expand summary {
    padding: 0.75rem 1rem;
    background: #fafaf8;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lesson-expand summary::-webkit-details-marker { display: none; }

.lesson-expand summary::after {
    content: '▸';
    margin-left: auto;
    transition: transform 0.2s;
    color: #999;
}

.lesson-expand[open] summary::after {
    transform: rotate(90deg);
}

.lesson-expand[open] summary {
    border-bottom: 1px solid #e8e4d9;
}

.expand-body {
    padding: 1rem;
}

.lesson-actions {
    margin: 1.5rem 0;
    display: flex;
    gap: 0.75rem;
}

.lesson-unit-context {
    padding: 0.75rem 1rem;
    background: #f0f7ff;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.lesson-unit-context a { color: #2d5016; font-weight: 600; }

.lesson-related { margin-top: 2.5rem; }
.lesson-related h2 { font-size: 1.2rem; color: #2d5016; margin-bottom: 1rem; }

/* ---------------------------------------------------------------------------
   Library Filters
   --------------------------------------------------------------------------- */
.library-filters {
    background: #fafaf8;
    border: 1px solid #e8e4d9;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.filter-row:last-child { margin-bottom: 0; }

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-group select {
    padding: 0.35rem 0.5rem;
    border: 1px solid #d4d0c8;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.filter-row-toggles {
    align-items: center;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: #555;
}

.library-intro { color: #666; margin-bottom: 1rem; }
.library-empty { text-align: center; padding: 2rem; color: #888; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e8e4d9;
}

.page-link {
    color: #2d5016;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.page-info { color: #888; font-size: 0.85rem; }

/* ---------------------------------------------------------------------------
   Today's Help
   --------------------------------------------------------------------------- */
.curriculum-today { max-width: 700px; }

.today-intro { color: #666; margin-bottom: 1.5rem; }

.today-form {
    background: #fafaf8;
    border: 1px solid #e8e4d9;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.today-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.today-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.today-field select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #d4d0c8;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.today-results { margin-top: 1.5rem; }
.today-results h2 { color: #2d5016; margin-bottom: 1rem; }
.today-empty { text-align: center; padding: 1.5rem; color: #888; }

/* ---------------------------------------------------------------------------
   Printables
   --------------------------------------------------------------------------- */
.printables-intro { color: #666; margin-bottom: 1rem; }

.printable-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------------------
   Units
   --------------------------------------------------------------------------- */
.units-intro { color: #666; margin-bottom: 1.5rem; }

.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.unit-card {
    display: block;
    padding: 1.2rem;
    background: white;
    border: 1px solid #e8e4d9;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s, box-shadow 0.12s;
}

.unit-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}

.unit-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.unit-emoji { font-size: 1.5rem; }
.unit-card h3 { font-size: 1rem; margin: 0; }
.unit-card-meta { display: flex; gap: 0.3rem; margin-bottom: 0.4rem; }
.unit-card-desc { font-size: 0.85rem; color: #666; margin: 0; }

/* Unit detail */
.unit-header { margin-bottom: 1.5rem; }
.unit-header h1 { color: #2d5016; margin-bottom: 0.5rem; }
.unit-meta { display: flex; gap: 0.35rem; }
.unit-body { margin-bottom: 2rem; }

.unit-lessons h2 { font-size: 1.2rem; color: #2d5016; margin-bottom: 1rem; }

.unit-lesson-list {
    padding-left: 1.5rem;
}

.unit-lesson-list li {
    margin-bottom: 0.75rem;
}

.unit-lesson-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.unit-lesson-link:hover { color: #2d5016; }
.unit-lesson-meta { display: flex; gap: 0.3rem; }

/* ---------------------------------------------------------------------------
   Search
   --------------------------------------------------------------------------- */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #d4d0c8;
    border-radius: 6px;
    font-size: 1rem;
}

.search-info { color: #888; margin-bottom: 1rem; font-size: 0.9rem; }

/* ---------------------------------------------------------------------------
   Print Styles
   --------------------------------------------------------------------------- */
@media print {
    .curriculum-nav,
    .main-nav,
    header,
    footer,
    .breadcrumb,
    .lesson-actions,
    .lesson-related,
    .lesson-unit-context,
    .hero-actions,
    .cn-search,
    .btn { display: none !important; }

    .lesson-expand { border: none; }
    .lesson-expand[open] summary { border-bottom: 1px solid #ccc; }
    details.lesson-expand { open: true; }
    .lesson-expand .expand-body { display: block !important; }

    .curriculum-hero { background: none; padding: 0; }
    body { font-size: 12pt; }
    .lesson-header h1 { font-size: 16pt; }
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .curriculum-nav-toggle { display: block; }

    .curriculum-nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 0.5rem;
    }

    .curriculum-nav-links.open {
        display: flex;
    }

    .cn-group { width: 100%; }
    .cn-submenu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
    }

    .cn-link, .cn-parent { padding: 0.5rem 0.6rem; }

    .curriculum-hero h1 { font-size: 1.4rem; }

    .lesson-grid {
        grid-template-columns: 1fr;
    }

    .grade-cards {
        grid-template-columns: 1fr;
    }

    .today-fields {
        grid-template-columns: 1fr;
    }

    .filter-row {
        flex-direction: column;
    }

    .cn-search {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}
