/* =============================================================
   weather.css — Lenox Weather Bar Component
   lenoxia.com
   ============================================================= */

/* ── .wx-bar: root container + CSS custom properties ──────── */
.wx-bar {
  /* Theme tokens */
  --bg:           #ffffff;
  --text:         #1b1c1c;
  --text-muted:   #42493b;
  --border:       #c2c9b6;
  --accent:       #245100;
  --accent-light: #b4f485;
  --alert-bg:     #ffdad6;
  --alert-text:   #93000a;
  --alert-border: #ba1a1a;
  --warn-bg:      #fff8e1;
  --warn-text:    #5f4200;
  --warn-border:  #d19900;
  
  /* New "All Clear" Alert Theme */
  --safe-bg:      #f5fbf4;
  --safe-text:    #1b5e20;
  --safe-border:  #4caf50;

  /* Layout */
  max-width: 1000px;
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  
  /* Restored Padding & Borders */
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ── Status / loading message ─────────────────────────────── */
.wx-status {
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Current conditions block ─────────────────────────────── */
.wx-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.wx-icon {
  font-size: 2rem;
  line-height: 1;
}

.wx-temp {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.wx-desc {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.wx-feels {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Divider between current and forecast ─────────────────── */
.wx-divider {
  width: 1px;
  height: 2rem;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Forecast strip ───────────────────────────────────────── */
.wx-forecast {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.wx-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 2.75rem;
  font-family: "Inter", system-ui, sans-serif;
}

.wx-day-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.wx-day-hi {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.wx-day-lo {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Detail toggle button ─────────────────────────────────── */
.wx-detail-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  
  /* Increased Hitbox for WCAG Target Size Compliance */
  padding: 0.5rem 1rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  
  font-size: 13px;
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--accent);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.wx-detail-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.wx-detail-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Expanded detail panel ────────────────────────────────── */
.wx-detail {
  display: none;
  width: 100%;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  font-size: 13px;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text-muted);
  gap: 1.5rem;
  flex-wrap: wrap;
}

.wx-detail.show {
  display: flex;
}

.wx-detail-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.wx-detail-label {
  font-weight: 600;
  color: var(--text);
}

/* ── Alert area ───────────────────────────────────────────── */
.wx-alerts {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

/* Row of pill buttons */
.wx-alert-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Individual alert pill — mirrors .wx-detail-btn style */
.wx-alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  min-height: 36px;
  border-radius: 999px;          /* full pill */
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition: filter 150ms ease, box-shadow 150ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.wx-alert-pill.extreme,
.wx-alert-pill.severe {
  background: var(--alert-bg);
  color: var(--alert-text);
  border-color: var(--alert-border);
}

.wx-alert-pill.extreme:hover,
.wx-alert-pill.severe:hover {
  filter: brightness(0.93);
}

.wx-alert-pill.moderate,
.wx-alert-pill.minor {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.wx-alert-pill.moderate:hover,
.wx-alert-pill.minor:hover {
  filter: brightness(0.93);
}

.wx-alert-pill:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.wx-alert-pill[aria-expanded="true"] {
  box-shadow: 0 0 0 2px currentColor;
}

.wx-alert-pill-arrow {
  font-size: 10px;
}

/* Expandable alert detail panel — mirrors .wx-detail */
.wx-alert-detail {
  display: none;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  border-left: 3px solid transparent;
  font-size: 13px;
  line-height: 1.5;
  font-family: "Inter", system-ui, sans-serif;
}

.wx-alert-detail.show {
  display: block;
}

/* Detail panel inherits color from sibling pill's severity via data attr */
.wx-alert-detail.extreme,
.wx-alert-detail.severe {
  background: var(--alert-bg);
  color: var(--alert-text);
  border-left-color: var(--alert-border);
}

.wx-alert-detail.moderate,
.wx-alert-detail.minor {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-left-color: var(--warn-border);
}

.wx-alert-detail a {
  display: inline-block;
  margin-top: 0.5rem;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wx-alert-detail a:hover {
  opacity: 0.8;
}

/* "All Clear" status pill — not interactive */
.wx-alert.safe {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: var(--safe-bg);
  color: var(--safe-text);
  border: 1px solid var(--safe-border);
  font-size: 13px;
  font-weight: 600;
  font-family: "Inter", system-ui, sans-serif;
}

.wx-alert-event {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.wx-alert-headline {
  flex: 1;
}

/* ── Fallback / offline badge ─────────────────────────────── */
.wx-fallback-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .wx-bar {
    gap: 1rem;
    padding: 1.25rem 1rem; /* Explicit, generous padding for mobile */
  }

  .wx-divider {
    display: none;
  }

  .wx-forecast {
    gap: 0.75rem;
    width: 100%; /* Force full width on mobile for cleaner layout */
    justify-content: space-between; /* Spread evenly */
  }

  .wx-detail-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    min-height: 48px; /* Strict WCAG mobile touch target compliance */
    padding: 0.75rem 1rem;
    margin-top: 0.5rem; /* Ensure breathing room from the forecast */
  }

  .wx-fallback-badge {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }

  .wx-alert-pill {
    min-height: 44px;   /* WCAG mobile touch target */
    padding: 0.5rem 1rem;
  }
}