/* 2 Week Daily cards, calendar layout. Markup comes from 14-day-cards.js.
   Used by local_wx.php and local_wx_pro.php (linked in each page's head). */

/* The host: one centred column, the same width as the charts, holding one sheet. */
#forecast-cards-container { display: block; width: 100%; max-width: 1400px; min-width: 0; margin: 0 auto; padding: .25rem 0 1rem; }

.fc2-sheet { position: relative; container-type: inline-size; container-name: fc2; color: #0f172a; font-variant-numeric: tabular-nums; }
.fc2-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.fc2-wd { font-size: 12.5px; font-weight: 600; color: #64748b; text-align: center; padding: 2px 0; }

/* ---------- card ---------- */
.fc2-day {
  background: rgba(255,255,255,.85); -webkit-backdrop-filter: saturate(1.2) blur(16px); backdrop-filter: saturate(1.2) blur(16px);
  border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.05);
  display: flex; flex-direction: column; min-width: 0; padding: .7rem 0 0; overflow: hidden;
  text-align: center; font-size: .9rem; line-height: 1.25; cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.fc2-day:hover, .fc2-day.on { transform: translateY(-2px); border-color: rgba(4,120,87,.45); box-shadow: 0 6px 16px rgba(4,120,87,.14); }
.fc2-day:focus-visible { outline: 2px solid #047857; outline-offset: 2px; }
.fc2-day.out {
  background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-style: dashed; box-shadow: none;
  color: #a8b3c2; font-weight: 600; font-size: .85rem; cursor: default; transform: none;
  justify-content: flex-start; padding: .7rem 0;
}
.fc2-day.out:hover { transform: none; border-color: #e2e8f0; box-shadow: none; }

.fc2-date { padding: 0 .5rem; font-size: .95rem; color: #0f172a; }
.fc2-date b { font-weight: 700; }
.fc2-wdn { display: none; }
.fc2-day.today .fc2-date b { background: #047857; color: #fff; border-radius: 999px; padding: 1px 9px; }

/* conditions icon beside the high and low */
.fc2-hero { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .3rem .5rem 0; }
/* the icon files carry their own padding, so the box is pulled in a little */
.fc2-icon { width: 60px; height: 60px; margin: -4px -2px; flex: none; display: block; }
.fc2-temps { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.fc2-hi { color: #991b1b; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.fc2-lo { color: #1e40af; font-size: 1.05rem; font-weight: 600; line-height: 1; margin-top: 3px; }
.fc2-cond { font-size: .8rem; color: #64748b; padding: .1rem .5rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* label over value */
.fc2-kv { min-width: 0; }
.fc2-kv span { display: block; font-size: .72rem; line-height: 1.25; color: #64748b; white-space: nowrap; }
.fc2-kv span i { font-style: normal; color: #94a3b8; }
.fc2-kv b { display: block; font-size: .84rem; font-weight: 700; line-height: 1.25; color: #0f172a; white-space: nowrap; }
.fc2-kv b small { font-size: .8em; font-weight: 600; color: #64748b; }

/* precip: its own line, larger values */
.fc2-precip { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .25rem; padding: .4rem .5rem 0; }
.fc2-precip .fc2-kv b { font-size: 1.15rem; line-height: 1.2; }
.fc2-precip.is-dry .fc2-kv:first-child b { color: #94a3b8; font-weight: 600; }

/* wind, gust, ET0, snow or vs normal */
.fc2-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .25rem;
  margin: .45rem .6rem .5rem; padding-top: .45rem; border-top: 1px solid #e2e8f0;
}

/* hourly temperature line + precip bars, edge to edge at the foot of the card */
.fc2-strip { display: block; width: 100%; height: 70px; margin-top: auto; }

/* ---------- narrower sections ---------- */
@container fc2 (max-width: 1150px) {
  .fc2-cal { gap: 8px; }
  .fc2-hero { gap: .3rem; padding-left: .3rem; padding-right: .3rem; }
  .fc2-icon { width: 48px; height: 48px; margin: -3px -2px; }
  .fc2-hi { font-size: 1.5rem; }
  .fc2-lo { font-size: .95rem; }
  .fc2-precip { padding-left: .3rem; padding-right: .3rem; }
  .fc2-precip .fc2-kv b { font-size: 1rem; }
  .fc2-grid { margin-left: .35rem; margin-right: .35rem; }
  .fc2-kv b { font-size: .78rem; }
  .fc2-kv span { font-size: .68rem; }
}
/* too narrow for seven columns: fewer per row, no blanks, the weekday moves into each card */
@container fc2 (max-width: 959px) {
  .fc2-cal { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .fc2-wd, .fc2-day.out { display: none; }
  .fc2-wdn { display: inline; }
  .fc2-hero { gap: .5rem; padding-left: .5rem; padding-right: .5rem; }
  .fc2-icon { width: 56px; height: 56px; margin: -4px -2px; }
  .fc2-hi { font-size: 1.7rem; }
  .fc2-lo { font-size: 1.05rem; }
  .fc2-precip { padding-left: .5rem; padding-right: .5rem; }
  .fc2-precip .fc2-kv b { font-size: 1.1rem; }
  .fc2-grid { margin-left: .6rem; margin-right: .6rem; }
  .fc2-kv b { font-size: .84rem; }
  .fc2-kv span { font-size: .72rem; }
}

/* ---------- day detail (opens on click) ---------- */
/* A child of <body>, placed by the script: it floats over the page and never changes its height.
   Above page content and maps, below the site nav and open menus. */
#fc2-pop {
  position: absolute; z-index: 1150; box-sizing: border-box; width: 680px; max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; font-variant-numeric: tabular-nums;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.2);
  padding: 14px 16px 12px; text-align: left; font-size: 12px; line-height: 1.35; color: #0f172a;
  animation: fc2grow .12s ease-out;
}
@keyframes fc2grow { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #fc2-pop { animation: none; } .fc2-day { transition: none; } }

#fc2-pop .fc2-x {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; min-width: 0; padding: 0; margin: 0;
  display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; box-shadow: none;
  color: #64748b; cursor: pointer; font: inherit;
}
#fc2-pop .fc2-x:hover { background: #f1f5f9; color: #0f172a; }
#fc2-pop .fc2-x:focus-visible { outline: 2px solid #047857; outline-offset: 1px; }

#fc2-pop .fc2-ph { margin: 0 34px 8px 0; }
#fc2-pop .fc2-pd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 17px; font-weight: 700; line-height: 1.2; }
#fc2-pop .fc2-pd img { width: 30px; height: 30px; flex: none; }
#fc2-pop .fc2-pd small { font-size: 12px; font-weight: 400; color: #64748b; }
#fc2-pop .fc2-pg { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: 8px 20px; align-items: start; }
#fc2-pop table { border-collapse: collapse; width: 100%; font-size: 12px; margin: 0; }
#fc2-pop table + table { margin-top: 10px; }
#fc2-pop th, #fc2-pop td { text-align: right; padding: 4px 0 4px 8px; font-weight: 400; border: 0; border-bottom: 1px solid #e2e8f0; white-space: nowrap; background: none; }
#fc2-pop th:first-child, #fc2-pop td:first-child { text-align: left; padding-left: 0; color: #64748b; }
#fc2-pop thead th { font-size: 11px; font-weight: 600; color: #64748b; }
#fc2-pop tr.fc td { font-size: 18px; font-weight: 700; padding-block: 2px; }
#fc2-pop tr.fc td:first-child { font-size: 12px; font-weight: 400; }
#fc2-pop tr.fc td small { font-size: 12px; font-weight: 400; color: #64748b; }
#fc2-pop tr:last-child td { border-bottom: 0; }
#fc2-pop .fc2-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
#fc2-pop .fc2-sw-hi { background: #dc2626; } #fc2-pop .fc2-sw-lo { background: #2563eb; } #fc2-pop .fc2-sw-pr { background: #00b894; }
#fc2-pop .fc2-charts svg { display: block; width: 100%; height: auto; }
#fc2-pop .fc2-charts svg + svg, #fc2-pop .fc2-cap + svg { margin-top: 8px; }
#fc2-pop .fc2-cap { font-size: 11px; color: #64748b; margin-top: 2px; }
:is(.fc2-sheet, #fc2-pop) svg text { font-family: inherit; }
#fc2-pop .fc2-mods {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 2px 14px;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #e2e8f0; font-size: 11.5px; color: #64748b;
}
#fc2-pop .fc2-mods div { display: flex; justify-content: space-between; gap: 6px; white-space: nowrap; }
#fc2-pop .fc2-mods b { color: #0f172a; font-weight: 600; }
#fc2-pop .fc2-mods .fc2-modnote { grid-column: 1 / -1; justify-content: flex-start; }

/* free page: a short Pro prompt in place of the detail */
#fc2-pop.fc2-lock { width: 360px; padding: 16px 18px 16px; }
#fc2-pop.fc2-lock .fc2-pd { margin-right: 34px; }
#fc2-pop .fc2-lockp { margin: 8px 0 12px; font-size: 14px; line-height: 1.5; color: #475569; }
#fc2-pop .fc2-cta {
  display: inline-flex; align-items: center; background: #047857; color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 600; border-radius: 999px; padding: 8px 16px;
}
#fc2-pop .fc2-cta:hover { background: #065f46; color: #fff; }

#fc2-pop.fc2-narrow .fc2-pg { grid-template-columns: minmax(0, 1fr); }

/* ==========================================================================
   Dark look (the site's stage layer: <html class="stage">, tokens in design_lab/stage/slate.css).
   Everything above is the light card, which is also what a Download / Share picture shows: the
   export drops the stage class, so these rules stop applying and the SVG attributes (light) win.
   ========================================================================== */
/* the stage sheet recipe is aimed at the old cards (every direct child of the container); the new
   sheet is only a wrapper, so it carries no surface of its own */
html.stage #forecast-cards-container > .fc2-sheet,
html.stage #forecast-cards-container > .fc2-sheet:hover { background: none; border-color: transparent; box-shadow: none; }
html.stage .fc2-sheet { color: var(--sg-ink); }
html.stage .fc2-wd { color: var(--sg-muted); }

html.stage .fc2-day {
  background: var(--sheet-bg); -webkit-backdrop-filter: none; backdrop-filter: none;
  border-color: var(--sheet-border); box-shadow: var(--sheet-shadow);
}
html.stage .fc2-day:hover, html.stage .fc2-day.on { border-color: rgba(110,231,183,.55); box-shadow: var(--sheet-shadow); }
html.stage .fc2-day:focus-visible { outline-color: #6ee7b7; }
html.stage .fc2-day.out, html.stage .fc2-day.out:hover { background: none; border-color: var(--sg-line); box-shadow: none; color: var(--sg-faint); }
html.stage .fc2-date { color: var(--sg-ink); }
html.stage .fc2-icon, html.stage #fc2-pop .fc2-pd img { filter: drop-shadow(0 2px 5px rgba(0,0,0,.35)); }   /* pale cloud icons need an edge on glass */
html.stage .fc2-hi { color: var(--lw-high); }
html.stage .fc2-lo { color: var(--lw-low); }
html.stage .fc2-cond { color: var(--sg-muted); }
html.stage .fc2-kv span { color: var(--sg-muted); }
html.stage .fc2-kv span i { color: var(--sg-faint); }
html.stage .fc2-kv b { color: var(--sg-ink); }
html.stage .fc2-kv b small { color: var(--sg-muted); }
html.stage .fc2-precip.is-dry .fc2-kv:first-child b { color: var(--sg-faint); }
html.stage .fc2-grid { border-top-color: var(--sg-line); }

/* charts: the same shapes, re-coloured */
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-norm { fill: rgba(255,255,255,.13); }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-line { stroke: #e8eef6; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-hi { fill: #ff8a7a; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-lo { fill: #8db8ff; }
html.stage :is(.fc2-sheet, #fc2-pop) path.fc2-c-hi, html.stage :is(.fc2-sheet, #fc2-pop) path.fc2-c-lo { fill-opacity: .38; }
html.stage :is(.fc2-sheet, #fc2-pop) circle.fc2-c-hi, html.stage :is(.fc2-sheet, #fc2-pop) circle.fc2-c-lo { fill-opacity: .7; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-pr { fill: #2dd4bf; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-rule { stroke: rgba(255,255,255,.14); }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-rule2 { stroke: rgba(255,255,255,.26); }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-frz { stroke: #b9c5d6; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-pill { fill: #64748b; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-c-mark { stroke: #f8fafc; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-t { fill: #b9c5d6; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-t-ink { fill: #f8fafc; }
html.stage :is(.fc2-sheet, #fc2-pop) .fc2-t-on { fill: #ffffff; }

/* day detail: it passes over the cards, so it takes the menu surface (nothing shows through) */
html.stage #fc2-pop { background: var(--menu-bg); border-color: var(--menu-border); box-shadow: var(--menu-shadow); color: var(--sg-ink); }
html.stage #fc2-pop .fc2-x { color: var(--sg-muted); }
html.stage #fc2-pop .fc2-x:hover { background: var(--menu-hover); color: #fff; }
html.stage #fc2-pop .fc2-x:focus-visible { outline-color: #6ee7b7; }
html.stage #fc2-pop .fc2-pd small { color: var(--sg-muted); }
html.stage #fc2-pop th, html.stage #fc2-pop td { border-bottom-color: var(--sg-line); color: var(--sg-ink); }
html.stage #fc2-pop th:first-child, html.stage #fc2-pop td:first-child, html.stage #fc2-pop thead th,
html.stage #fc2-pop tr.fc td small, html.stage #fc2-pop td small { color: var(--sg-muted); }
html.stage #fc2-pop .fc2-sw-hi { background: #ff8a7a; }
html.stage #fc2-pop .fc2-sw-lo { background: #8db8ff; }
html.stage #fc2-pop .fc2-sw-pr { background: #2dd4bf; }
html.stage #fc2-pop .fc2-cap { color: var(--sg-muted); }
html.stage #fc2-pop .fc2-mods { border-top-color: var(--sg-line); color: var(--sg-muted); }
html.stage #fc2-pop .fc2-mods b { color: var(--sg-ink); }
html.stage #fc2-pop .fc2-lockp { color: var(--sg-soft); }
