/*
 * lv-shared.css — LocVox St. Thomas
 * Shared CSS for the white header, teal status strip, and mobile nav overlay.
 * Loaded on all pages via wp_enqueue_style('lv-shared') in functions.php.
 * Source of truth: front-page.php (Civic Light design system).
 */

/* ═══════════════════════════════
   CSS VARIABLE ADDITIONS
   (--teal-mid was missing from secondary pages)
═══════════════════════════════ */
:root {
  --teal-mid: #14a085;
}

/* ═══════════════════════════════
   HEADER
═══════════════════════════════ */
.lv-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.lv-logo {
  flex-shrink: 0;
  text-decoration: none;
  display: block;
}

/* Search */
.lv-search {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border: 1.5px solid #c2cdd8;
  border-radius: 50px;
  overflow: visible;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.lv-search:hover:not(:focus-within) {
  border-color: #9aafc0;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
}

.lv-search:hover .lv-search-icon {
  color: var(--text-mid);
}

.lv-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,115,119,0.12);
}

.lv-search-icon {
  padding: 0 12px 0 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.18s ease;
}

.lv-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
}

.lv-search input::placeholder { color: var(--text-muted); }

/* Engine picker */
.lv-engine-picker {
  position: relative;
  border-left: 1.5px solid var(--border);
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
}
.lv-search .lv-engine-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-mid);
  min-height: unset;
  line-height: inherit;
  text-transform: none;
  letter-spacing: normal;
}
.lv-search .lv-engine-trigger:hover { background: rgba(0,0,0,0.03); }
.lv-search .lv-engine-trigger:focus { outline: none; background: transparent; box-shadow: none; }
.lv-engine-chevron { transition: transform 0.18s ease; }
.lv-engine-picker.open .lv-engine-chevron { transform: rotate(180deg); }
.lv-engine-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 160px;
  overflow: hidden;
  z-index: 200;
}
.lv-engine-picker.open .lv-engine-dropdown { display: block; }
.lv-engine-dropdown .lv-engine-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  min-height: unset;
  text-transform: none;
  letter-spacing: normal;
}
.lv-engine-dropdown .lv-engine-option:hover { background: var(--teal-light); color: var(--teal); }
.lv-engine-dropdown .lv-engine-option.active { background: var(--teal-light); color: var(--teal); font-weight: 600; }

/* Letter badges */
.badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  line-height: 1;
}
.badge-g { background: #4285F4; }
.badge-b { background: #00809D; }
.badge-d { background: #DE5833; }

.lv-search-btn {
  background: var(--teal);
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  align-self: stretch;
  border-radius: 0 50px 50px 0;
  transition: background 0.2s;
}

.lv-search-btn:hover { background: #0a5e62; }
.lv-search-btn:hover i { transform: translateX(2px); transition: transform 0.15s ease; }

/* Header right */
.lv-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

.lv-updated-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

/* Back link (secondary pages only) */
.lv-back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--teal-light);
  transition: background 0.15s;
}
.lv-back-link:hover { background: #c9e8e8; }

/* ═══════════════════════════════
   STATUS STRIP
═══════════════════════════════ */
.lv-status-strip {
  background: var(--teal);
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

.lv-strip-pills {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  overflow-x: auto;
  padding: 0 24px;
  scrollbar-width: none;
}
.lv-strip-pills::-webkit-scrollbar { display: none; }

.lv-strip-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border: none !important;
  border-left: 1px solid rgba(255,255,255,0.2) !important;
  color: #ffffff !important;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: none !important;
  min-height: unset !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: inherit !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.lv-strip-menu-btn:hover { background: rgba(255,255,255,0.2); }

@media (max-width: 768px) {
  .lv-strip-menu-btn { display: flex !important; }
  .lv-pill-scramble { display: none !important; }
}

.lv-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.9);
  font-size: 0.82rem;
  font-weight: 600;
  border-right: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
  cursor: default;
  transition: background 0.15s;
}

.lv-status-pill:hover { background: rgba(255,255,255,0.08); }
.lv-status-pill:last-child { border-right: none; }

.lv-pill-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.6);
}

.lv-pill-value {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}

.lv-pill-good  { color: #6ee7b7; }
.lv-pill-warn  { color: #fcd34d; }
.lv-pill-alert { color: #fca5a5; }
.lv-pill-beach-good       { color: #6ee7b7; }
.lv-pill-beach-caution    { color: #fcd34d; }
.lv-pill-beach-no_go      { color: #fca5a5; }
.lv-pill-beach-off_season { color: rgba(255,255,255,0.5); }

@keyframes lv-icon-pulse {
  0%   { opacity: 1;   transform: scale(1); }
  50%  { opacity: 0.5; transform: scale(1.2); }
  100% { opacity: 1;   transform: scale(1); }
}
.lv-pill-scramble { cursor: pointer; }
.lv-pill-scramble i,
.lv-pill-scramble svg { color: #f5c842 !important; stroke: #f5c842 !important; }
.lv-pill-scramble:hover { background: rgba(255,255,255,0.08); }

/* Scramble word — spotlight color wave */
@keyframes lv-spot-1 { 0%,18%{color:#fff;} 24%{color:#f5c842;} 30%,100%{color:#fff;} }
@keyframes lv-spot-2 { 0%,18%{color:#fff;} 24%{color:#60a5fa;} 30%,100%{color:#fff;} }
@keyframes lv-spot-3 { 0%,18%{color:#fff;} 24%{color:#f472b6;} 30%,100%{color:#fff;} }
@keyframes lv-spot-4 { 0%,18%{color:#fff;} 24%{color:#34d399;} 30%,100%{color:#fff;} }
@keyframes lv-spot-5 { 0%,18%{color:#fff;} 24%{color:#fb923c;} 30%,100%{color:#fff;} }
@keyframes lv-spot-6 { 0%,18%{color:#fff;} 24%{color:#f5c842;} 30%,100%{color:#fff;} }
@keyframes lv-spot-7 { 0%,18%{color:#fff;} 24%{color:#60a5fa;} 30%,100%{color:#fff;} }
@keyframes lv-spot-8 { 0%,18%{color:#fff;} 24%{color:#f472b6;} 30%,100%{color:#fff;} }
.lv-scramble-wave span { display: inline-block; font-weight: 700; font-size: 0.88rem; color: #fff; }
.lv-scramble-wave span:nth-child(1) { animation: lv-spot-1 4.2s ease-in-out infinite; animation-delay: 0s;    }
.lv-scramble-wave span:nth-child(2) { animation: lv-spot-2 4.2s ease-in-out infinite; animation-delay: 0.42s; }
.lv-scramble-wave span:nth-child(3) { animation: lv-spot-3 4.2s ease-in-out infinite; animation-delay: 0.84s; }
.lv-scramble-wave span:nth-child(4) { animation: lv-spot-4 4.2s ease-in-out infinite; animation-delay: 1.26s; }
.lv-scramble-wave span:nth-child(5) { animation: lv-spot-5 4.2s ease-in-out infinite; animation-delay: 1.68s; }
.lv-scramble-wave span:nth-child(6) { animation: lv-spot-6 4.2s ease-in-out infinite; animation-delay: 2.10s; }
.lv-scramble-wave span:nth-child(7) { animation: lv-spot-7 4.2s ease-in-out infinite; animation-delay: 2.52s; }
.lv-scramble-wave span:nth-child(8) { animation: lv-spot-8 4.2s ease-in-out infinite; animation-delay: 2.94s; }
.lv-pill-scramble:hover .lv-scramble-wave span { animation-play-state: paused; }

.lv-pill-newsletter { cursor: pointer; }
.lv-pill-newsletter i,
.lv-pill-newsletter svg { color: #f59e0b !important; stroke: #f59e0b !important; animation: lv-icon-pulse 2s ease-in-out infinite; }
.lv-pill-newsletter:hover { background: rgba(255,255,255,0.08); }
.lv-pill-newsletter:hover i,
.lv-pill-newsletter:hover svg { animation-play-state: paused; opacity: 1; transform: scale(1); }

/* Waste Pickup pill — desktop only */
.lv-pill-waste { display: none !important; cursor: pointer; }
@media (min-width: 769px) {
  .lv-pill-waste { display: flex !important; }
}
.lv-pill-waste i,
.lv-pill-waste svg { color: rgba(255,255,255,0.75) !important; stroke: rgba(255,255,255,0.75) !important; }
.lv-pill-waste:hover { background: rgba(255,255,255,0.08); }

/* Sub-text line used by the Waste Pickup pill */
.lv-pill-sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.2;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ═══════════════════════════════
   MOBILE NAV OVERLAY
═══════════════════════════════ */
#lv-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
}

#lv-nav-overlay.open { display: flex; }

.lv-nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  cursor: pointer;
}

.lv-nav-panel {
  position: relative;
  width: 300px;
  max-width: 88vw;
  height: 100%;
  background: #fff;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}

#lv-nav-overlay.open .lv-nav-panel {
  transform: translateX(0);
}

.lv-nav-panel-header {
  background: var(--teal);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.lv-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.15) !important;
  border: none !important;
  color: #ffffff !important;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  box-shadow: none !important;
  min-height: unset !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: inherit !important;
  padding: 0 !important;
}

.lv-nav-close:hover { background: rgba(255,255,255,0.28) !important; }

.lv-nav-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.lv-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text);
  min-height: 52px;
  transition: background 0.12s;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

@media (hover: hover) {
  .lv-nav-item:hover { background: var(--teal-light); }
}
.lv-nav-item:active { background: #c9e8e8; }

.lv-nav-icon {
  width: 24px;
  height: 24px;
  background: none;
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lv-nav-text-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.lv-nav-text-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.lv-nav-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 20px;
}

/* ═══════════════════════════════
   MOBILE: portrait phones
   - Hide search bar
   - Compact strip pills
   - Hide homepage pill (only Temp | Commute | Newsletter | Hamburger on mobile)
═══════════════════════════════ */
@media (max-width: 768px) and (orientation: portrait) {
  /* Header: single row — logo left, badge/back-link right, no search */
  .lv-header { display: flex; flex-wrap: nowrap; padding: 12px 16px; gap: 10px; }
  .lv-search { display: none; }
  .lv-header-right { margin-left: auto; flex-shrink: 0; }

  /* Status strip: more compact pills */
  .lv-strip-pills { padding: 0 8px; }
  .lv-status-pill { padding: 8px 10px; gap: 5px; }
  .lv-pill-label { font-size: 0.58rem; letter-spacing: 0.5px; }
  .lv-pill-value { font-size: 0.78rem; }

  /* Hide homepage + scramble + waste pills — only Temp | Commute | Newsletter | Hamburger fits */
  .lv-pill-homepage { display: none; }
  .lv-pill-scramble { display: none !important; }
  .lv-pill-waste    { display: none !important; }

  /* Shrink thermometer icon */
  .lv-status-strip img { width: 22px; height: 22px; }

  /* Safety net: prevent horizontal scroll */
  html, body { overflow-x: hidden; }
  .lv-status-strip { max-width: 100vw; }

  /* Updated badge — smaller on mobile so it doesn't overpower the logo */
  .lv-updated-badge { padding: 3px 8px; font-size: 0.65rem; gap: 4px; }
  .lv-updated-badge i { width: 10px !important; height: 10px !important; }
}

/* ═══════════════════════════════
   SHARED FOOTER
═══════════════════════════════ */
.lv-footer {
  background: #0a5f63;
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  padding: 48px 24px 32px;
}
.lv-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px 48px;
  align-items: start;
}
.lv-footer-brand img { filter: brightness(0) invert(1); opacity: 0.95; }
.lv-footer-tagline {
  margin-top: 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  max-width: 300px;
}
.lv-footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  padding-top: 6px;
}
.lv-footer-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.15s;
}
.lv-footer-links a:hover { color: #ffffff; }
.lv-footer-bottom {
  max-width: 1280px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.2);
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}
@media (max-width: 600px) {
  .lv-footer-inner { grid-template-columns: 1fr; }
  .lv-footer-links { justify-content: flex-start; }
}

/* Waste pickup card — hidden on desktop (front-page mobile-only card) */
@media (min-width: 901px) { .card--waste { display: none !important; } }
