/* The next 10 days (web/daily.js). Self-contained: loaded by the resort pages
 * and the homepage, which each have their own palette variables, so nothing
 * here depends on either. Everything is under .dly. */

.dly { --d-ink: #1c2733; --d-muted: #5b6b7a; --d-line: #dde5ec; --d-blue: #1c5cab;
       --d-snow: #5598e7; --d-mix: #a99ad6; --d-rain: #57a86b; color: var(--d-ink); }
.dly[hidden] { display: none; }
.dly-sec { position: relative; }

.dly-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.dly-head > h2, .dly-head > h4 { margin: 0; }
.dly-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dly-where { font-size: .78rem; color: var(--d-muted); }
.dly-subline { margin: .2rem 0 .7rem; font-size: .84rem; color: var(--d-muted); }
.dly-ctl { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .6rem; }

.dly-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #e9eef3; }
.dly-seg button { font: 600 .78rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
                  padding: .45rem .8rem; border: 0; border-radius: 999px; background: none; color: var(--d-muted); cursor: pointer; }
.dly-seg button.on { background: #fff; color: var(--d-ink); box-shadow: 0 1px 3px rgba(28, 39, 51, .18); }
.dly-seg button:focus-visible { outline: 2px solid var(--d-blue); outline-offset: 1px; }
.dly-legend { display: inline-flex; gap: .2rem .8rem; flex-wrap: wrap; font-size: .76rem; color: var(--d-muted); }
.dly-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.dly-legend i { display: inline-block; width: .9rem; height: .5rem; border-radius: 2px; }

/* "?" boxes. On a phone the tip hangs off the whole section (full width, just
   under its "?"), so it can never push the page wider than the screen. */
.dly-q { position: relative; display: inline-flex; align-items: center; justify-content: center; width: .95rem; height: .95rem;
         margin-left: .3rem; border-radius: 50%; background: var(--d-muted); color: #fff; font-size: .6rem; font-weight: 700;
         border: 0; padding: 0; cursor: help; vertical-align: 1px; text-transform: none; letter-spacing: normal; }
.dly-q::after { content: attr(data-tip); position: absolute; right: -.4rem; top: calc(100% + 6px); width: 14rem; padding: .45rem .6rem;
                border-radius: 7px; background: var(--d-ink); color: #fff; font-size: .76rem; font-weight: 400; line-height: 1.4;
                text-align: left; opacity: 0; visibility: hidden; z-index: 6; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); white-space: normal; }
.dly-q.l::after { right: auto; left: -.4rem; }
.dly-q:hover::after, .dly-q:focus::after { opacity: 1; visibility: visible; }
.dly-q:focus-visible { outline: 2px solid var(--d-blue); outline-offset: 2px; }

/* the daily score: a colour dot and the weekly score's word; its reasons are the tip */
.dly-dot { display: inline-block; flex: none; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; }
.dly-sc { position: relative; display: inline-flex; align-items: center; margin: 0; padding: 0; border: 0; background: none;
          font: inherit; font-size: .84rem; font-weight: 600; color: var(--d-ink); text-align: left; white-space: nowrap; cursor: help; }
.dly-sc::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); width: 14rem; padding: .45rem .6rem;
                 border-radius: 7px; background: var(--d-ink); color: #fff; font-size: .76rem; font-weight: 400; line-height: 1.4;
                 text-align: left; opacity: 0; visibility: hidden; z-index: 6; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); white-space: normal; }
.dly-sc:hover::after, .dly-sc:focus::after { opacity: 1; visibility: visible; }
.dly-sc:focus-visible { outline: 2px solid var(--d-blue); outline-offset: 2px; border-radius: 3px; }
.dly-tbl td.dly-scc { white-space: nowrap; }

/* ---- table (wide) ---- */
.dly-tbl { width: 100%; border-collapse: collapse; font-size: .85rem; table-layout: auto; }
.dly-tbl th, .dly-tbl td { padding: .5rem .4rem; border-bottom: 1px solid var(--d-line); text-align: left; vertical-align: middle; white-space: normal; }
.dly-tbl th:first-child, .dly-tbl td:first-child { padding-left: 0; }
.dly-tbl th:last-child, .dly-tbl td:last-child { padding-right: 0; }
.dly-tbl thead th { font-size: .66rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--d-muted);
                    padding-top: 0; white-space: nowrap; }
.dly-tbl .r { text-align: right; }
.dly-tbl .nw { white-space: nowrap; }
.dly-tbl tbody tr { cursor: pointer; }
.dly-tbl tbody tr.on { background: #f4f8fd; }
.dly-tbl tbody tr:last-child td { border-bottom: 0; }
.dly-d { white-space: nowrap; width: 3.6rem; }
.dly-daybtn { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; text-align: left; }
.dly-daybtn.on { color: var(--d-blue); }
.dly-tbl .sub, .dly-tbl td .sub { display: block; font-size: .72rem; color: var(--d-muted); margin-top: 1px; }
.dly-tbl .sub.rain { color: #3f8a52; }
.dly-tbl .sub.dry { color: #8a97a3; }
.dly-tbl td.dly-sn { width: 32%; min-width: 9rem; }
.dly-tbl td.dly-zn { width: 25%; min-width: 8.6rem; }

/* new snow: dark = likely range, tick = likely, faint tail = could reach */
.dly-track { position: relative; height: 8px; background: #eef2f6; border-radius: 4px; margin-top: 4px; }
.dly-track .rng { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: #4a8fd6; }
.dly-track .ext { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: #c5dcf2; }
.dly-track .ml { position: absolute; top: -3px; width: 3px; height: 14px; margin-left: -1px; border-radius: 2px; background: #123f78;
                 box-shadow: 0 0 0 1px #fff; }
.dly-track.mute .ext { background: #dbe5ee; }
.dly-likely, .dly-chance { display: block; margin-top: 4px; font-size: .8rem; color: var(--d-ink); }
.dly-likely b { font-weight: 700; }
.dly-chance { font-weight: 600; margin-top: 0; }
.dly-reach { display: block; margin-top: 1px; font-size: .68rem; color: var(--d-muted); }
.dly-none { font-size: .8rem; color: #8a97a3; }
.dly .odds { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.dly .odds.hi { color: var(--d-blue); }
.dly .odds.mid { color: var(--d-ink); }
.dly .odds.lo { color: #8a97a3; }
/* snow line: base on the left, summit on the right, ticks where the phase changes */
.dly-zone { position: relative; }
.dly-mtn { display: flex; height: 9px; border-radius: 4px; overflow: hidden; background: #e4e8ec; }
.dly-mtn span { display: block; height: 100%; }
.dly-zone .tk { position: absolute; top: -3px; width: 2px; height: 15px; margin-left: -1px; background: var(--d-ink); box-shadow: 0 0 0 1px #fff; border-radius: 1px; }
.dly-ends { display: flex; justify-content: space-between; gap: .3rem; margin-top: 2px; font-size: .62rem; color: #8a97a3; white-space: nowrap; }
.dly-hdr-ends { display: block; margin-top: 2px; font-size: .62rem; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.dly-barkey { margin: 0 0 .2rem; font-size: .72rem; color: var(--d-muted); }
.dly-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .68rem; font-weight: 600;
            background: #f6f8fa; border: 1px solid var(--d-line); color: #3b4a58; }
.dly-chip.warn { background: #fbeee8; border-color: #f0d3c6; color: #9e3423; }
.dly-chip.snow { background: #e3eefa; border-color: #c6dcf3; color: var(--d-blue); }
.dly-chip.mixed { background: #efebf8; border-color: #d9d1ee; color: #5a4a92; }
.dly-chip.rain { background: #e6f3e9; border-color: #c5e2cc; color: #2f7442; }
.dly-chip.dry { background: #f1f3f5; border-color: #e1e5e9; color: #7a8794; }
.dly-tbl td .dly-chip.warn { margin-top: 5px; }

/* ---- plots ---- */
.dly-plots { position: relative; margin-top: 1rem; padding: .7rem .8rem .2rem; border: 1px solid var(--d-line); border-radius: 10px; background: #fbfcfd; }
.dly-plots:empty { display: none; }
.dly-plot .pl { font-size: .78rem; font-weight: 700; margin: .7rem 0 .15rem; }
.dly-plot:first-child .pl { margin-top: 0; }
.dly-plot .pl span { font-weight: 400; color: var(--d-muted); }
.dly-svg { display: block; max-width: 100%; touch-action: pan-y; cursor: crosshair; -webkit-tap-highlight-color: transparent; }
.dly-svg:focus-visible { outline: 2px solid var(--d-blue); outline-offset: 2px; border-radius: 3px; }
.dly-svg .yt { font-size: 9px; }
.dly-svg .holdl { font-size: 9.5px; font-style: italic; fill: #b3542e; }
.dly-tip { position: absolute; z-index: 5; max-width: min(15rem, calc(100% - 8px)); padding: .4rem .55rem; border-radius: 7px;
           background: var(--d-ink); color: #fff; font-size: .74rem; line-height: 1.4; pointer-events: none;
           box-shadow: 0 4px 14px rgba(0, 0, 0, .22); }
.dly-tip[hidden] { display: none; }
.dly-tip b { font-weight: 700; }
.dly-tip > b:first-child { display: block; margin-bottom: 2px; white-space: normal; }
.dly-tip .k { color: #b8c5d2; }
.dly-svg text { font-family: inherit; fill: var(--d-muted); }
.dly-svg .yl { font-size: 10px; }
.dly-svg .yl.warm { fill: #b3542e; }
.dly-svg .tk { font-size: 10px; }
.dly-svg .tk.s { font-size: 9px; fill: #98a5b1; }
.dly-svg .endl { font-size: 11px; font-weight: 700; fill: var(--d-blue); }

.dly-more { display: block; margin: .6rem 0 0; padding: 0; background: none; border: 0; font: inherit; font-size: .8rem; font-weight: 600;
            color: var(--d-blue); cursor: pointer; }
.dly-more[hidden] { display: none; }
.dly-attr { margin: .9rem 0 0; font-size: .7rem; color: var(--d-muted); }

/* ---- day cards (phone) ---- */
.dly-cards { display: none; }
.dly-card { padding: .65rem 0; border-bottom: 1px solid var(--d-line); cursor: pointer; }
.dly-card.on { background: #f4f8fd; margin: 0 -.4rem; padding-left: .4rem; padding-right: .4rem; }
.dly-card .hd { display: flex; align-items: baseline; gap: .5rem; }
.dly-card .hd b { font-size: .95rem; }
.dly-card .dly-sc { font-size: .8rem; }
.dly-card .odds { margin-left: auto; font-size: 1rem; }
.dly-card .odds small { font-size: .68rem; font-weight: 600; color: var(--d-muted); margin-left: 3px; }
.dly-card .dly-sn { margin-top: 2px; }
.dly-card .dly-track { margin-top: 8px; }
.dly-card .dly-none { display: block; margin-top: 4px; }
.dly-card .dly-zn { margin-top: 9px; }
.dly-card .dly-zn .sub { display: block; font-size: .78rem; margin-top: 1px; color: var(--d-muted); }
.dly-card .dly-zn .sub.rain { color: #3f8a52; }
.dly-card .dly-zn .sub.dry { color: #8a97a3; }
.dly-card .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

@media (max-width: 40rem) {
  .dly-tblwrap { display: none; }
  .dly-cards { display: block; }
  .dly-card.late { display: none; }
  .all-days .dly-card.late { display: block; }
  .dly-where { display: none; }
  .dly-seg { display: flex; width: 100%; }
  .dly-seg button { flex: 1; padding: .55rem 0; }
  .dly-plots .extra { display: none; }
  .all-plots .dly-plots .extra { display: block; }
  /* the tip spans the section, just under its "?" */
  .dly-q, .dly-sc { position: static; }
  .dly-q::after, .dly-q.l::after, .dly-sc::after { left: 0; right: 0; top: auto; width: auto; margin-top: 1.4rem; }
  .dly-sc::after { margin-top: 1.9rem; }
}
@media (min-width: 40.01rem) {
  .dly-more[data-more="days"] { display: none; }
  .dly-plots .extra { display: block; }
  .dly-more[data-more="plots"] { display: none; }
}

/* inside a homepage result card */
.daily-host.dly { margin: 1rem 0 .4rem; padding-top: .9rem; border-top: 1px solid var(--d-line); }

/* Shared by the resort pages and the homepage card (resort.css and style.css do not
   both load here, daily.css does). */
/* ---- the forecast switcher: Next 10 days | Next 6 weeks | Season ----
   Script builds the control and shows one panel at a time. Without script every panel
   shows, stacked, and the control never exists. */
.fc-panel + .fc-panel { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.fc-panel:empty, .fc-panel[hidden], .fc:not(.on) .fc-panel.daily { display: none; }
.fc.on .fc-panel + .fc-panel { margin-top: 0; padding-top: 0; border-top: 0; }
.fc-tabs { display: flex; gap: 3px; padding: 3px; margin: 0 0 1.1rem; border-radius: 12px; background: #e9eef3; }
.fc-tabs[hidden] { display: none; }
.fc-tabs button {
  flex: 1 1 0; min-width: 0; font-weight: 700; font-size: .92rem; line-height: 1.2; font-family: inherit;
  padding: .7rem .4rem; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer;
}
.fc-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(28, 39, 51, .2); }
.fc-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 30rem) { .fc-tabs button { font-size: .82rem; padding: .65rem .2rem; } }
.fc.on .fc-panel.weeks > h2, .fc.on .fc-panel.season > h2 { display: none; }
.fc.on .fc-panel.weeks > .sub, .fc.on .fc-panel.season > .sub { margin-top: 0; }
.detail .fc-panel .daily-host.dly { margin-top: 0; padding-top: 0; border-top: 0; }
.detail .fc-tabs { margin-top: .2rem; }
.detail .fc-panel > h4:first-child { margin-top: 0; }
