/* =====================================================
   Home Page — Warm Playful Classroom
   Design direction: soft, warm, child-friendly, clear
   ===================================================== */

:root {
    --hp-bg:          #FFF6EE;
    --hp-surface:     #FFFFFF;
    --hp-border:      #E8DDD4;
    --hp-text:        #1E1B18;
    --hp-muted:       #7A706A;
    --hp-accent:      #E05A1A;
    --hp-accent-bg:   #FFF0E8;
    --hp-green:       #2B8C5A;
    --hp-green-bg:    #E8F7EE;
    --hp-radius-lg:   16px;
    --hp-radius-md:   12px;
    --hp-radius-sm:   8px;
    --hp-shadow-card: 0 2px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    --hp-shadow-lift: 0 8px 28px rgba(0,0,0,0.13), 0 2px 6px rgba(0,0,0,0.08);
}

/* ---- Page shell ---- */
body.hp-page {
    background: var(--hp-bg);
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 100vh;
}

#home-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */
.hp-header {
    background: var(--hp-surface);
    border-bottom: 2px solid var(--hp-border);
    padding: 20px 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.hp-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.hp-logo {
    font-size: 2.4em;
    flex-shrink: 0;
    line-height: 1;
}

.hp-header-text h1 {
    font-size: 1.45em;
    font-weight: 800;
    color: var(--hp-text);
    text-align: left;
    margin: 0 0 4px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.hp-header-text p {
    font-size: 0.95em;
    color: var(--hp-muted);
    margin: 0;
}

/* ---- Main content ---- */
.hp-main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 40px 32px 60px;
}

.hp-section-title {
    font-size: 1.05em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hp-muted);
    margin: 0 0 20px;
}

/* ---- Featured cards ---- */
.hp-featured-section {
    margin-bottom: 56px;
}

.hp-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.hp-featured-card {
    background: var(--hp-surface);
    border-radius: var(--hp-radius-lg);
    box-shadow: var(--hp-shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.hp-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hp-shadow-lift);
    border-color: var(--hp-accent);
}

.hp-featured-card:hover .hp-featured-btn {
    background: var(--hp-accent);
    color: white;
}

.hp-featured-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--hp-accent-bg);
    display: block;
}

.hp-featured-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--hp-accent-bg) 0%, #FFE8D6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
}

.hp-featured-body {
    padding: 20px 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hp-featured-parent {
    font-size: 0.75em;
    font-weight: 400;
    color: #888;
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.4;
}

.hp-featured-title {
    font-size: 1.25em;
    font-weight: 800;
    color: var(--hp-text);
    margin: 0 0 auto;
    line-height: 1.3;
}

.hp-featured-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: var(--hp-accent-bg);
    color: var(--hp-accent);
    border: 2px solid var(--hp-accent);
    border-radius: var(--hp-radius-md);
    font-size: 1em;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    text-align: center;
}

/* ---- Day groups ---- */
.hp-days-section {}

.hp-days-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.hp-day-group {}

.hp-day-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hp-surface);
    background: var(--hp-text);
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 12px;
}

/* Cycle day label colors */
.hp-day-group:nth-child(4n+1) .hp-day-label { background: #4A90D9; }
.hp-day-group:nth-child(4n+2) .hp-day-label { background: #E05A1A; }
.hp-day-group:nth-child(4n+3) .hp-day-label { background: #2B8C5A; }
.hp-day-group:nth-child(4n+0) .hp-day-label { background: #8B5CF6; }

.hp-day-topics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.hp-topic-card {
    background: var(--hp-surface);
    border-radius: var(--hp-radius-md);
    box-shadow: var(--hp-shadow-card);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border: 2px solid var(--hp-border);
}

.hp-topic-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hp-shadow-lift);
    border-color: var(--hp-accent);
}

.hp-topic-icon {
    font-size: 1.8em;
    flex-shrink: 0;
    line-height: 1;
}

.hp-topic-info {
    flex: 1;
    min-width: 0;
}

.hp-topic-title {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--hp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.hp-topic-btn {
    flex-shrink: 0;
    background: var(--hp-green-bg);
    color: var(--hp-green);
    border: none;
    border-radius: var(--hp-radius-sm);
    padding: 6px 12px;
    font-size: 0.8em;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.hp-topic-card:hover .hp-topic-btn {
    background: var(--hp-green);
    color: white;
}

/* ---- Footer ---- */
.hp-footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--hp-border);
    color: var(--hp-muted);
    font-size: 0.85em;
    background: var(--hp-surface);
}

/* ---- Loading state ---- */
.hp-loading {
    text-align: center;
    padding: 40px;
    color: var(--hp-muted);
    font-size: 1.1em;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .hp-featured-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .hp-featured-img,
    .hp-featured-img-placeholder {
        height: 160px;
    }

    .hp-day-topics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hp-header {
        padding: 16px;
        position: static;
    }

    .hp-header-text h1 {
        font-size: 1.15em;
    }

    .hp-main {
        padding: 24px 16px 48px;
    }

    .hp-featured-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hp-featured-img,
    .hp-featured-img-placeholder {
        height: 180px;
    }

    .hp-day-topics {
        grid-template-columns: 1fr;
    }
}
