/* =========================================================
   Brown Family Disney World — styles
   Mobile-first: base styles are for phones; the @media
   (min-width) blocks at the bottom add layout for wider screens.
   ========================================================= */

/* ---------- Fonts (self-hosted so they work offline) ---------- */
@font-face {
    font-family: "Fredoka";
    src: url("fonts/fredoka-latin.woff2") format("woff2");
    font-weight: 300 700;
    font-display: swap;
}
@font-face {
    font-family: "Nunito";
    src: url("fonts/nunito-latin.woff2") format("woff2");
    font-weight: 200 1000;
    font-display: swap;
}

/* ---------- Design tokens (change colors here) ---------- */
:root {
    /* Storybook palette: night sky, royal blue, castle pink, pixie-dust gold */
    --night: #0e1a40;
    --royal: #1f3a93;
    --dusk: #5b3a9e;
    --pink: #f4a6c6;
    --gold: #f2c14e;

    --bg: #f6f4fc;
    --surface: #ffffff;
    --text: #1b1f3b;
    --muted: #5d6285;
    --line: #e4e0f2;
    --accent: var(--royal);      /* overridden per park below */
    --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
    --today: #d63a7a;
    --radius: 18px;
    --shadow: 0 1px 2px rgb(14 26 64 / 0.06), 0 8px 24px rgb(14 26 64 / 0.07);

    --font-display: "Fredoka", "Avenir Next Rounded", system-ui, sans-serif;
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a1030;
        --surface: #141c48;
        --text: #eef0ff;
        --muted: #aeb3dc;
        --line: #283271;
        --today: #ff8fbf;
        --shadow: none;
        color-scheme: dark;
    }
}

/* Park accent colors: each element with data-kind="..." picks one */
[data-kind="ak"]     { --accent: #2e7d4f; }
[data-kind="hs"]     { --accent: #c0392b; }
[data-kind="epcot"]  { --accent: #6a3fc7; }
[data-kind="mk"]     { --accent: #1f5fbf; }
[data-kind="resort"] { --accent: #0d8a8f; }
[data-kind="travel"] { --accent: #6b6f8f; }

@media (prefers-color-scheme: dark) {
    [data-kind="ak"]     { --accent: #6fd39a; }
    [data-kind="hs"]     { --accent: #ff8a7a; }
    [data-kind="epcot"]  { --accent: #b39bff; }
    [data-kind="mk"]     { --accent: #7db8ff; }
    [data-kind="resort"] { --accent: #52d6d9; }
    [data-kind="travel"] { --accent: #b3b7d6; }
}

/* Re-mix the soft tint on each park element so it uses that park's color */
[data-kind] { --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface)); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0625rem;           /* 17px: readable in sunlight */
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    margin: 0;
}
p { margin: 0; }
a { color: inherit; }

.wrap {
    max-width: 46rem;
    margin: 0 auto;
    padding-inline: 16px;
}

.muted { color: var(--muted); }

/* ---------- Views: app.js shows one at a time ---------- */
.js .view:not(.is-shown) { display: none; }

/* ---------- Header: night sky with pixie dust ---------- */
.site-head {
    color: #fff;
    padding: max(26px, env(safe-area-inset-top)) 0 18px;
    background:
        radial-gradient(1.5px 1.5px at 12% 30%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 28% 70%, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 46% 22%, var(--gold) 50%, transparent 51%),
        radial-gradient(1px 1px at 63% 58%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 78% 28%, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 90% 66%, var(--pink) 50%, transparent 51%),
        radial-gradient(1px 1px at 36% 45%, #fff 50%, transparent 51%),
        linear-gradient(160deg, var(--night) 0%, var(--royal) 62%, var(--dusk) 100%);
}
.eyebrow {
    color: var(--gold);
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 6px;
}
.site-head h1 { font-size: 1.45rem; font-weight: 500; }
.site-head h1 span {
    display: block;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 18px rgb(242 193 78 / 0.35);
}

/* ---------- Tabs (sticky) ---------- */
.tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--night);
    padding: 8px 0;
    box-shadow: 0 4px 14px rgb(14 26 64 / 0.25);
}
.tabs-inner {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1.35fr;
    gap: 6px;
}
.tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;               /* comfortable finger-size tap target */
    padding: 6px 8px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.98rem;
    white-space: nowrap;
    background: rgb(255 255 255 / 0.08);
    transition: background 0.15s;
}
.tab:hover { background: rgb(255 255 255 / 0.16); }
.tab[aria-current="page"] {
    background: var(--gold);
    color: var(--night);
    font-weight: 600;
}
.tab:focus-visible,
.tab-select:focus-within {
    outline: 2px solid var(--pink);
    outline-offset: 2px;
}
.chevron { font-size: 0.8em; opacity: 0.8; }

/* The real <select> sits invisibly on top of the tab, so tapping the tab
   opens the phone's own day picker, while the label shows what's chosen. */
.tab-select select {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 16px;                /* stops iPhone from zooming in */
}

/* ---------- Main area ---------- */
main { padding-block: 18px 40px; }

.trip-note,
.next-up {
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 600;
}
.trip-note {
    background: color-mix(in srgb, var(--pink) 30%, var(--surface));
}
.next-up {
    background: var(--night);
    color: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.next-up strong {
    color: var(--gold);
    font-family: var(--font-display);
    font-weight: 600;
    margin-right: 4px;
}
.next-up strong::before { content: "✨ "; }

.view-title { font-size: 1.6rem; }
.view-intro { color: var(--muted); margin: 4px 0 16px; }

/* ---------- Cards / days ---------- */
.card, .day, .rest {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    padding: 20px 16px;
    margin-bottom: 16px;
}
.day { border-top: 6px solid var(--accent); }

.day-head { margin-bottom: 14px; }
.day-date {
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.day.is-today .day-date::after {
    content: "Today";
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--today);
    color: #fff;
    font-size: 0.72rem;
    vertical-align: 1px;
}
.day h2 { font-size: 1.7rem; margin-top: 2px; }
.card h2 { font-size: 1.2rem; margin-bottom: 8px; }
.day h3 {
    font-size: 1.05rem;
    font-weight: 500;
    margin: 22px 0 8px;
    color: var(--muted);
}

.note {
    margin-top: 12px;
    padding: 9px 13px;
    border-radius: 10px;
    background: var(--accent-soft);
    font-size: 0.95rem;
}

/* Park hours */
.hours {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--accent-soft);
}
.hours dt { font-size: 0.8rem; color: var(--muted); }
.hours dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Rope drop */
.rope { margin: 0; padding-left: 1.3rem; }
.rope li { font-weight: 700; }
.rope li::marker { content: "✦  "; color: var(--accent); }

/* ---------- Timeline of events ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.event {
    display: grid;
    grid-template-columns: 5.4rem 1fr;
    gap: 10px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}
.event:first-child { border-top: 0; }
.event > time, .time-tbd {
    font-family: var(--font-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    white-space: nowrap;
}
.time-tbd { color: var(--muted); font-weight: 500; }
.ev-title { font-weight: 700; }
.ev-meta { color: var(--muted); font-size: 0.93rem; }
.event.highlight .ev-title::before { content: "⭐ "; }
.event.is-next {
    background: var(--accent-soft);
    border-radius: 12px;
    padding-inline: 8px;
    margin-inline: -8px;
}

/* ---------- Confirmation placeholder ---------- */
.conf { margin-top: 6px; font-size: 0.88rem; }
.conf summary {
    cursor: pointer;
    color: var(--muted);
    display: inline-block;
    padding: 4px 0;               /* bigger tap target */
}
.conf p {
    margin-top: 4px;
    padding: 8px 11px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 8px 8px 0;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    padding: 8px 15px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.pager {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

/* ---------- Stay card ---------- */
.stay-name { font-size: 1.05rem; }
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 12px 0 4px;
}

/* ---------- Restaurants ---------- */
.rest-list { list-style: none; margin: 0; padding: 0; }
.rest { border-left: 6px solid var(--accent); }
.rest h3 { font-size: 1.3rem; }
.rest-meta { color: var(--muted); font-size: 0.93rem; margin: 2px 0 10px; }
.visits {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}
.visits a {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
}
.visits a:hover { text-decoration: underline; }

/* ---------- Lightning Lane table ---------- */
/* Phones: each row becomes a small card. Wider screens: a normal table. */
.ll { width: 100%; border-collapse: collapse; }
.ll thead {
    /* visually hidden on phones but still read by screen readers */
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.ll tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}
.ll tbody tr:first-child { border-top: 0; }
.ll td { display: block; padding: 0; }
.ll td[data-th="Return"] {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.ll td[data-th="Ride"] { grid-column: 1 / -1; grid-row: 2; }
.ll td[data-th="Height"] { grid-column: 1 / -1; grid-row: 3; color: var(--muted); font-size: 0.9rem; }
.ll td[data-th="Tier"] { grid-column: 2; grid-row: 1; }
.ll tr.is-next {
    background: var(--accent-soft);
    border-radius: 12px;
    padding-inline: 8px;
    margin-inline: -8px;
}
.ride-type { display: block; color: var(--muted); font-size: 0.88rem; }
.tier {
    display: inline-block;
    min-width: 1.7rem;
    text-align: center;
    padding: 1px 7px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid var(--line);
    color: var(--muted);
}
.tier-a { background: var(--gold); border-color: var(--gold); color: var(--night); }

/* ---------- Footer ---------- */
.site-foot {
    color: var(--muted);
    font-size: 0.85rem;
    padding: 0 0 max(32px, env(safe-area-inset-bottom));
    text-align: center;
}

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
    .site-head { padding-block: 34px 24px; }
    .site-head h1 { font-size: 1.7rem; }
    .site-head h1 span { font-size: 2.8rem; }
    .tabs-inner { grid-template-columns: repeat(3, minmax(0, 11rem)); }
    .card, .day, .rest { padding: 24px 26px; }
    .day h2 { font-size: 2rem; }

    .ll thead { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
    .ll tr { display: table-row; }
    .ll td, .ll th { display: table-cell; padding: 10px 8px; vertical-align: top; text-align: left; }
    .ll th { font-size: 0.8rem; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
    .ll tbody tr { border-top: 1px solid var(--line); }
    .ll td[data-th="Return"] { white-space: nowrap; }
    .ll td[data-th="Height"] { font-size: 0.92rem; }
    .ll tr.is-next td { background: var(--accent-soft); }
}

@media (prefers-reduced-motion: reduce) {
    .tab { transition: none; }
}
