/* index.php page styles. Surfaces, bands, tiles, pills and links come
   from the shared components in styles.css (.surface-listing,
   .surface-panel, .fl-band, .icon-tile, .stat-tile, .surface-inset,
   .status-pill, .empty-state, .text-link); only the home page's own
   layout lives here. */

/* ==========================================
   Hero
   The one page without a .page-hero: a frosted panel centred on the
   page, the listing cards' frame with a heavier brand-red base. The
   glow-and-pinstripe atmosphere behind it is the site-wide html::after
   layer in styles.css.
   ========================================== */
/* The bottom padding plus the .page-shell's top padding keep the
   hero's old breathing room above the cards and panels (about 56px). */
.hero {
    position: relative;
    padding: var(--space-16) var(--page-gutter) var(--space-6);
    text-align: center;
}

.hero-panel {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-12);
    border: var(--frame-w) solid var(--frame-listing);
    border-bottom: 6px solid var(--brand-red);
    border-radius: var(--r-xl);
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--elev-listing);
}

/* The site icon on a disc. Its colour comes inline from SITE_ICON_COLOR. */
.hero-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin: 0 auto var(--space-5);
    border: 2px solid var(--border-soft);
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--elev-1);
    font-size: 2.6rem;
    line-height: 1;
}

.hero-title {
    margin: 0 0 var(--space-4);
    color: var(--text-primary);
    font-size: var(--fs-display);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

/* The lead is rich text from Site Settings: paragraphs, emphasis,
   links, lists. The block keeps its own inner spacing so
   multi-paragraph copy still reads as one unit. */
.hero-tagline {
    min-width: 0;
    max-width: 60ch;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: var(--fs-lead);
    line-height: 1.6;
    white-space: normal;
    overflow-wrap: anywhere;
}

.hero-tagline p { margin: 0 0 0.85rem; }
.hero-tagline p:last-child { margin-bottom: 0; }
.hero-tagline strong { color: var(--text-primary); font-weight: 700; }
.hero-tagline a {
    color: var(--primary-text);
    font-weight: 600;
    text-decoration: none;
}
.hero-tagline a:hover { text-decoration: underline; }
.hero-tagline ul,
.hero-tagline ol {
    display: inline-block;
    margin: 0 0 0.85rem;
    padding-left: 1.4rem;
    text-align: left;
}
.hero-tagline blockquote {
    margin: 0 0 0.85rem;
    padding-left: 1rem;
    border-left: 3px solid var(--brand-red);
    font-style: italic;
}
.hero-tagline img {
    max-width: 100%;
    height: auto;
    border-radius: var(--r-md);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-8);
}

@media (max-width: 768px) {
    .hero {
        padding-top: var(--space-12);
    }

    .hero-panel {
        padding: var(--space-8) var(--space-5);
    }

    .hero-badge {
        width: 68px;
        height: 68px;
        font-size: 2.1rem;
    }

    .hero-actions {
        margin-top: var(--space-6);
    }
}

/* ==========================================
   Module grid (signed out)
   a.surface-listing.lib-card cards in a centred Bootstrap row, so an
   odd card out centres on its own row.
   ========================================== */
.home-module {
    text-align: center;
}

.home-module > .icon-tile {
    margin: 0 auto var(--space-4);
}

.home-module-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--fs-body);
    line-height: 1.55;
}

/* ==========================================
   Dashboard (signed in)
   Banded .surface-panel blocks in a centred row. Each panel is a flex
   column so its call to action sits on the bottom edge; the link's
   .stretched-link covers the panel, which needs the positioning.
   ========================================== */
.home-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.home-panel > * + * {
    margin-top: var(--space-4);
}

.home-panel > .fl-band + * {
    margin-top: 0;
}

/* Bands with and without a chip line up across the row. On a small
   phone the chip (My Schedule's week range) drops under the title
   rather than squeezing it onto two lines. */
.home-panel > .fl-band {
    flex-wrap: wrap;
    row-gap: 0.35rem;
    min-height: 3.4rem;
}

.home-panel > .home-panel-foot {
    margin-top: auto;
    padding-top: var(--space-4);
}

.home-panel-note {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.home-panel-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
}

.home-panel-foot > .text-link {
    margin-left: auto;
    font-weight: 700;
}

/* The arrow sits outside the underline: an inline-block takes no
   text decoration, and the gap is a margin rather than a space. */
.home-panel-foot > .text-link > .ti {
    display: inline-block;
    margin-left: var(--gap-icon);
}

@media (prefers-reduced-motion: no-preference) {
    .home-panel-foot > .text-link > .ti {
        transition: transform var(--dur-fast) ease;
    }

    .home-panel-foot > .text-link:hover > .ti {
        transform: translateX(2px);
    }
}

/* My Schedule: the 7-day strip (Sun to Sat). Today takes the primary
   frame; a day with one of your events takes the success tint and a
   dot. */
.home-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.home-week-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
    min-height: 3.4rem;
    padding: 0.5rem 0.15rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
    background: var(--surface-2);
}

.home-week-day-label {
    color: var(--text-muted);
    font-size: var(--fs-2xs);
    font-weight: 700;
    letter-spacing: var(--ls-eyebrow);
    line-height: 1.3;
    text-transform: uppercase;
}

.home-week-day-num {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.home-week-day.has-mine {
    border-color: var(--success-border);
    background: var(--success-tint);
}

.home-week-day.has-mine .home-week-day-num {
    color: var(--success-text);
}

/* The muted label drops under 4.5:1 on the dark success tint. */
.home-week-day.has-mine .home-week-day-label {
    color: var(--text-secondary);
}

/* The second frame pixel is an inset shadow, so it shows on a
   has-mine day too. */
.home-week-day.is-today {
    border-color: var(--primary-soft);
    box-shadow: inset 0 0 0 1px var(--primary-soft);
}

.home-week-day.is-today .home-week-day-num {
    color: var(--primary-text);
}

.home-week-dot {
    width: 6px;
    height: 6px;
    margin-top: 0.15rem;
    border-radius: var(--r-pill);
    background: var(--success-text);
}

/* The next one or two events, as success rows. */
.home-events {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.home-event-when {
    display: inline-flex;
    align-items: center;
    gap: var(--gap-icon);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.home-event-title {
    margin-top: 0.15rem;
    color: var(--text-primary);
    font-size: var(--fs-body-sm);
    font-weight: 600;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    /* Tighter panels on phones, so two summary tiles still sit side by
       side. */
    .home-panel {
        --panel-pad: var(--space-4);
    }

    .home-week {
        gap: 0.25rem;
    }

    .home-week-day {
        min-height: 3rem;
        padding: 0.4rem 0.1rem;
    }

    .home-week-day-num {
        font-size: 0.95rem;
    }
}
