/* Main menu "More" dropdown and the phone bottom bar (added September 27, 2026). */
.navlinks { align-items: center; }
.nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; opacity: 0.88; padding: 6px 0; border-bottom: 2px solid transparent; font-weight: 600; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: " \25BE"; font-size: 0.85em; }
.nav-more[open] > summary, .nav-more > summary:hover { opacity: 1; border-bottom-color: var(--amber); }
.nav-more-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 210px; background: #1f2420; border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,0.35); padding: 8px; display: grid; }
.nav-more-menu a { padding: 10px 12px; border-radius: 8px; border-bottom: 0 !important; opacity: 1; font-size: 14px; white-space: nowrap; }
.nav-more-menu a:hover, .nav-more-menu a.active { background: rgba(255,255,255,0.08); color: var(--amber-bright); }

.bottom-bar { display: none; }
@media (max-width: 700px) {
  /* The top menu scrolls sideways on phones, which would clip a dropdown, so "More" lives in the bottom bar there. */
  .navlinks .nav-more { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bottom-bar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: #161a17; border-top: 1px solid rgba(255,255,255,0.14); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .bottom-bar a, .bottom-bar summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; color: #e9ece6; font-size: 11px; font-weight: 800; letter-spacing: 0.02em; text-decoration: none; border-radius: 10px; cursor: pointer; list-style: none; }
  .bottom-bar summary::-webkit-details-marker { display: none; }
  .bottom-bar .bi { font-size: 20px; line-height: 1; }
  .bottom-bar a.active, .bottom-bar a:hover, .bottom-bar details[open] > summary { color: var(--amber-bright); background: rgba(255,255,255,0.06); }
  .bottom-bar .alerts-link { color: #ff8a80; }
  .bottom-bar details { position: static; }
  .bottom-bar .more-sheet { position: fixed; left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); background: #1f2420; border: 1px solid rgba(255,255,255,0.14); border-radius: 14px; box-shadow: 0 -10px 30px rgba(0,0,0,0.4); padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .bottom-bar .more-sheet a { flex-direction: row; justify-content: flex-start; min-height: 46px; padding: 0 12px; font-size: 14px; font-weight: 700; }
}

/* Back-to-top button (pwa.js adds it once the visitor has scrolled well down the page). */
.to-top { position: fixed; right: 16px; bottom: 20px; z-index: 65; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; background: #1f2420; color: #f3f5f1; font: 800 13px/1 inherit; letter-spacing: 0.03em; box-shadow: 0 8px 22px rgba(0,0,0,0.35); cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover, .to-top:focus-visible { background: #2a312b; color: var(--amber-bright); }
.to-top .arrow { font-size: 16px; }
@media (max-width: 700px) {
  /* Sit just above the phone bottom bar. */
  .to-top { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 42px; padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* Free watch & warning alerts (alerts.js): the opener button and its panel. */
.alerts-optin { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 12px; padding: 0 16px; border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; background: rgba(0,0,0,0.25); color: #fff; font: 800 14px/1.2 var(--sans); cursor: pointer; }
.alerts-optin:hover, .alerts-optin:focus-visible { background: rgba(0,0,0,0.4); color: var(--amber-bright); }
.alerts-optin.on-light { border-color: var(--forest); background: #fff; color: var(--forest); }
.alerts-optin.on-light:hover, .alerts-optin.on-light:focus-visible { background: var(--forest); color: #fff; }
.alerts-dialog fieldset { border: 0; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.alerts-dialog legend { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--amber); margin-bottom: 4px; }
.alerts-dialog label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,0.08); font-size: 15px; cursor: pointer; }
.alerts-dialog input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--amber); }
.alerts-dialog .alerts-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.1); }
.alerts-dialog .alerts-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.alerts-dialog .alerts-actions .btn { flex: 1 1 140px; justify-content: center; }
.alerts-dialog .alerts-status { min-height: 1.4em; margin-top: 12px; font-weight: 700; color: #fff; }
.alerts-dialog .alerts-fine { margin-top: 10px; font-size: 12.5px; color: #c9cfc6; }
.alerts-dialog .alerts-fine a { color: var(--amber-bright); }
.alerts-dialog [hidden] { display: none !important; }   /* .btn's inline-flex would otherwise show hidden buttons */
.alerts-dialog .alerts-list { display: grid; gap: 8px; }
.alerts-dialog .alerts-county { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 4px 6px 4px 12px; border-radius: 10px; background: rgba(255,255,255,0.08); font-size: 15px; font-weight: 700; }
.alerts-dialog .alerts-county .btn { min-height: 36px; padding: 0 12px; }
.alerts-dialog .alerts-empty { margin: 0; color: #c9cfc6; }
.alerts-dialog .alerts-add { display: grid; gap: 12px; margin-top: 14px; }
.alerts-dialog .alerts-here { justify-content: center; }
.alerts-dialog .alerts-search label { display: block; min-height: 0; padding: 0; background: none; font-size: 13px; font-weight: 800; }
.alerts-dialog .alerts-search input { width: 100%; }
@media print { .bottom-bar, .nav-more, .to-top, .alerts-optin { display: none !important; } }

/* Menu groups (September 30, 2026): the More menu and the phone sheet are grouped so the
   weather stays on top and everything else is one tap away. */
.nav-more-menu { grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 2px 10px; min-width: 400px; max-height: calc(100vh - 110px); overflow-y: auto; }
.nav-grp, .sheet-grp { display: grid; align-content: start; }
.nav-group { padding: 10px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
@media (max-width: 700px) {
  .bottom-bar .more-sheet { max-height: calc(100vh - 110px); overflow-y: auto; align-content: start; }
  .bottom-bar .more-sheet .nav-group { padding: 8px 12px 2px; font-size: 10.5px; }
}
