/*
Time & Weather (Weather.gov) - front-end styles

This file styles:
- The [weather] shortcode output (location bar, radar image, current temperature, and forecast accordion)
- The [time] shortcode output (JS-updated time string)

You can:
- Leave this file in the plugin, OR
- Copy/paste it into your theme/child theme and disable the plugin CSS enqueue if you prefer.
*/

/* Move Meow AI Engine chatbot up so it doesn't overlap the weather widget */
#mwai-chatbot-default {
  bottom: 150px !important;
}

.forecast-container {
  max-width: 900px;
  margin: 0 auto;
  /* Make all weather-page text scale sensibly across screen sizes */
  font-size: clamp(14px, 0.9vw + 0.6rem, 18px);
}

/* On very small screens, keep time readable but let conditions be the hero */
@media (max-width: 420px) {
  .forecast-container {
    font-size: clamp(13px, 3.2vw, 17px);
  }
  .taw-time {
    font-size: clamp(13px, 3.2vw, 17px);
  }
}

/* [time] shortcode: allow wrapping only between time and date */
.taw-time {
  font-size: inherit;
  line-height: 1.35;
  white-space: normal;
}

.taw-time-part,
.taw-date-part {
  white-space: nowrap;
}

/* Location bar */
.taw-location-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 0 14px 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
}

/* Inline location bar (matches the time/date line styling on the weather page) */
.taw-location-bar.taw-location-bar--inline {
  padding: 0;
  margin: 0 0 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  justify-content: flex-start;
}

.taw-location-bar.taw-location-bar--inline .taw-location-display {
  font-weight: 400;
  font-size: inherit;
  color: inherit;
}

.taw-location-bar.taw-location-bar--inline .taw-location-prefix {
  opacity: 1;
  color: inherit;
}

.taw-location-bar.taw-location-bar--inline .taw-location-controls {
  margin-left: 10px;
}



.taw-location-display {
  font-weight: 600;
}

.taw-location-prefix {
  margin-right: 6px;
  opacity: 0.85;
}

.taw-location-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.taw-btn {
  appearance: none;
  border: 1px solid #003366;
  background: #003366;
  color: #ffffff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.1;
}

.taw-btn.taw-btn-secondary {
  background: #ffffff;
  color: #003366;
}

.taw-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.taw-input {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 210px;
}

.taw-status {
  margin: 8px 0 0 0;
  font-size: 0.95em;
  color: #334155;
}

/* Radar */
.taw-radar {
  margin: 10px 0 18px 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.taw-radar-title {
  font-weight: 700;
  margin: 0 0 10px 0;
}

.taw-radar-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* Avoid broken-image icon before JS sets a src for auto radar mode */
.taw-radar-img:not([src]),
.taw-radar-img[src=""] {
  display: none;
}

/* Current conditions summary (responsive; can wrap only at separator) */
#current-temp {
  /* Bigger than base body copy on small screens; still restrained on desktop */
  font-size: clamp(15px, 1.2vw + 0.8rem, 20px);
  font-weight: 700;
  color: #b00020;
  margin-top: 5px;
  line-height: 1.25;
  display: block;
}

/* Highlight just the temperature value within current conditions */
.taw-cc-temp {
  color: #0b57d0; /* blue */
}

/* Keep the first segment intact; allow wrapping between segments only */
.taw-cc-main {
  white-space: nowrap;
}

.taw-cc-sep {
  display: inline;
}

.taw-cc-sep::before {
  content:" \2014 ";
}

/* On small screens, replace the dash separator with a clean wrap point */
@media (max-width: 600px) {
  .taw-cc-sep {
    display: block;
    height: 0;
    line-height: 0;
  }
  .taw-cc-sep::before {
    content: "";
  }
}

/* On phone widths, make the first line (location + temp) the largest item */
@media (max-width: 420px) {
  .taw-cc-main {
    display: block;
    font-size: clamp(18px, 5.5vw, 26px);
    line-height: 1.15;
  }

  .taw-cc-extras {
    display: block;
    font-size: clamp(13px, 3.6vw, 18px);
    line-height: 1.25;
    margin-top: 2px;
  }
}

/* On very small screens, shrink the location changer input/buttons to match the text scale */
@media (max-width: 420px) {
  .taw-input {
    min-width: 0;
    width: 100%;
    font-size: clamp(13px, 3.6vw, 16px);
    padding: 7px 9px;
    border-radius: 10px;
  }

  .taw-btn {
    font-size: clamp(12px, 3.4vw, 15px);
    padding: 7px 10px;
    border-radius: 10px;
  }

  .taw-location-controls {
    gap: 6px;
  }
}

/* When the conditions split into two lines, scale the first line up */
@media (max-width: 420px) {
  .taw-cc-main {
    display: block;
    /* Make the current temp/condition line the visual priority */
    font-size: clamp(18px, 5.2vw, 26px);
    line-height: 1.15;
  }
  .taw-cc-extras {
    display: block;
    font-size: clamp(13px, 3.4vw, 18px);
    line-height: 1.25;
    margin-top: 2px;
  }
}

/* "(change location)" link-style button */
.taw-change-location {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 0 0 6px;
  margin: 0;
  color: inherit;
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
  opacity: 0.9;
}

.taw-change-location:hover {
  opacity: 1;
}

/* 7-Day Forecast Accordion
   Modern "glass" cards + responsive type.
   - Keeps the full at-a-glance header text (no truncation).
   - Uses day/night tinting that preserves readable contrast.
*/

/* Container card */
.taw-accordion-item{
  margin:12px 0;
}

/* Header button (the clickable row) */
.taw-accordion-header{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  text-align:left;

  padding:12px 14px;
  border-radius:14px;

  /* Glass look */
  background:rgba(255,255,255,0.55);
  border:1px solid rgba(0,0,0,0.08);
  box-shadow:0 8px 20px rgba(0,0,0,0.08);

  /* Type */
  font-weight:700;
  font-size:clamp(14px, 2.2vw, 18px);
  line-height:1.25;
  color:rgba(0,0,0,0.86);

  cursor:pointer;
  -webkit-tap-highlight-color: transparent;

  /* Nice on supporting browsers; safe fallback elsewhere */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  scroll-margin-top:10px;
}

/* Day/night labels (applied by JS via NWS isDaytime flag) */
.taw-accordion-header.day-label{
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)), #0b57d0 !important;
  border-color: rgba(255,255,255,0.25) !important;
  color: rgba(255,255,255,0.95) !important;
}

.taw-accordion-header.night-label{
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)), #0b0f1a !important;
  border-color: rgba(255,255,255,0.16) !important;
  color: rgba(255,255,255,0.95) !important;
}

/* Hover/active polish */
.taw-accordion-header:hover{
  box-shadow:0 10px 26px rgba(0,0,0,0.12);
}

.taw-accordion-header:active{
  transform: translateY(1px);
}

/* Chevron indicator */
.taw-accordion-header::after{
  content:"›"; /* single chevron */
  flex:0 0 auto;
  margin-left:12px;
  font-size:22px;
  line-height:1;
  opacity:0.75;
  transform: rotate(0deg);
  transition: transform 180ms ease, opacity 180ms ease;
}

.taw-accordion-header[aria-expanded="true"]::after{
  transform: rotate(90deg);
  opacity:0.95;
}

/* Accordion content (collapsed by default) */
.taw-accordion-content{
  max-height:0;
  overflow:hidden;
  transition:max-height 0.28s ease;
  will-change:max-height;

  margin-top:8px;
  padding:0 14px;
  border-radius:14px;

  background:rgba(255,255,255,0.70);
  border:1px solid rgba(0,0,0,0.06);
  box-shadow:0 10px 26px rgba(0,0,0,0.06);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  font-size:clamp(13px, 2vw, 16px);
  line-height:1.45;
  color:rgba(0,0,0,0.78);
}

/* Expanded accordion content (height set inline by JS) */
.taw-accordion-content.expanded{
  padding:14px;
}

/* Inside content formatting */
.taw-accordion-content hr{
  margin:12px 0;
  border:0;
  border-top:1px solid rgba(0,0,0,0.10);
}

.taw-accordion-content .info-line{
  margin:8px 0;
}

/* Weather Icons sizing inside accordion content only */
.taw-accordion-content i.wi{
  font-size:1.5em;
  margin-right:10px;
  vertical-align:middle;
  display:inline-block;
  width:1.5em;
  text-align:center;
}

/* Mobile fine-tuning */
@media (max-width: 420px){
  .taw-accordion-header{
    padding:12px 12px;
    font-size:clamp(15px, 4.4vw, 18px);
  }
  .taw-accordion-content{
    font-size:clamp(13px, 4vw, 15px);
  }
}

/* Debug/utility output */
.taw-weather-text {
  white-space: pre-wrap;
  background: #f6f8fa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}


/* Radar style selector */
.taw-radar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px 0;
  flex-wrap: wrap;
}

.taw-radar-label {
  font-weight: 600;
}

.taw-select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}


/* -------------------------------------------------
   Sidebar widgets (Appearance > Widgets)
   Apple-Weather-inspired cards with:
   - Day/night background based on SunCalc
   - Weather overlay layer (rain/snow/etc) based on forecast/conditions
   ------------------------------------------------- */

.taw-widget {
  margin: 0 0 16px 0;
}

.taw-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #0b3a67, #08233f);
}

.taw-card > * {
  position: relative;
  z-index: 2;
}

.taw-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
  background: radial-gradient(circle at 10% 15%, rgba(255,255,255,0.22), rgba(255,255,255,0) 45%),
              radial-gradient(circle at 80% 25%, rgba(255,255,255,0.14), rgba(255,255,255,0) 55%);
}

.taw-card::after {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background-size: 200px 200px;
}

/* Day/night */
.taw-card.taw-theme-day {
  background: linear-gradient(135deg, #2b8bcb, #0b3a67);
}

.taw-card.taw-theme-night {
  background: linear-gradient(135deg, #081a33, #050b16);
}

/* Weather overlays */
.taw-card.taw-weather-clear::after {
  opacity: 0.08;
  background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.55), rgba(255,255,255,0) 40%),
                    radial-gradient(circle at 85% 25%, rgba(255,255,255,0.35), rgba(255,255,255,0) 45%);
}

.taw-card.taw-weather-cloudy::after {
  opacity: 0.14;
  background-image: radial-gradient(ellipse at 30% 35%, rgba(255,255,255,0.35), rgba(255,255,255,0) 55%),
                    radial-gradient(ellipse at 70% 40%, rgba(255,255,255,0.25), rgba(255,255,255,0) 60%);
}

.taw-card.taw-weather-rain::after {
  opacity: 0.28;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.40) 0 1px, rgba(255,255,255,0) 1px 10px);
  animation: taw-rain 0.9s linear infinite;
}

@keyframes taw-rain {
  from { background-position: 0 0; }
  to   { background-position: -80px 180px; }
}

.taw-card.taw-weather-snow::after {
  opacity: 0.32;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.85) 0 1px, rgba(255,255,255,0) 2px),
    radial-gradient(circle, rgba(255,255,255,0.65) 0 1px, rgba(255,255,255,0) 2px),
    radial-gradient(circle, rgba(255,255,255,0.55) 0 1px, rgba(255,255,255,0) 2px);
  background-size: 120px 120px, 180px 180px, 220px 220px;
  animation: taw-snow 5s linear infinite;
}

@keyframes taw-snow {
  from { background-position: 0 -120px, 40px -180px, 80px -220px; }
  to   { background-position: 0 240px, 40px 300px, 80px 340px; }
}

.taw-card.taw-weather-thunder::after {
  opacity: 0.16;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0) 60%),
                    radial-gradient(circle at 70% 30%, rgba(255,255,255,0.30), rgba(255,255,255,0) 55%);
  animation: taw-flash 4s ease-in-out infinite;
}

@keyframes taw-flash {
  0%, 92%, 100% { opacity: 0.12; }
  94% { opacity: 0.22; }
  96% { opacity: 0.12; }
  98% { opacity: 0.20; }
}

.taw-card.taw-weather-fog::after {
  opacity: 0.18;
  background-image: linear-gradient(0deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 60%);
}

.taw-card.taw-weather-windy::after {
  opacity: 0.14;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.25) 0 2px, rgba(255,255,255,0) 2px 14px);
  animation: taw-wind 2.4s linear infinite;
}

@keyframes taw-wind {
  from { background-position: 0 0; }
  to   { background-position: 0 200px; }
}

/* Layout */
.taw-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.taw-w-location {
  font-weight: 700;
  letter-spacing: 0.2px;
  opacity: 0.95;
}

/* Widget inline location change control */
.taw-w-location-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Row of location action buttons (Change + Clear) */
.taw-loc-btnrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.taw-w-location-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.taw-loc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75em;
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
}

/* Small clear/reset icon button for visitor location cookies */
.taw-loc-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Keep this truly "icon sized" even if the theme styles buttons */
  padding: 0 !important;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  line-height: 1;

  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;

  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;

  box-shadow: none !important;
  text-decoration: none !important;
}

.taw-loc-clear:hover {
  background: rgba(255, 255, 255, 0.18);
}

.taw-loc-pill:hover {
  background: rgba(255, 255, 255, 0.18);
}

.taw-loc-pill:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.taw-loc-edit {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.taw-loc-input {
  width: 170px;
  max-width: 65vw;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.16);
  color: #ffffff;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.85em;
}

.taw-loc-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.taw-loc-go {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85em;
  font-weight: 700;
  cursor: pointer;
}

.taw-loc-go:hover {
  background: rgba(255, 255, 255, 0.18);
}

.taw-loc-go:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.taw-w-date {
  text-align: right;
  opacity: 0.9;
  font-size: 0.9em;
}

.taw-w-time {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.taw-w-powered {
  margin-top: 10px;
  font-size: 0.78em;
  opacity: 0.85;
}

.taw-w-powered a {
  /* Golden morning yellow for visibility over background images */
  color: #f6c343 !important;
  text-decoration: none;
}

.taw-w-powered a:hover,
.taw-w-powered a:focus {
  text-decoration: underline;
}

/* Shortcode footer (weather page) */
.taw-powered-by a {
  /* Golden morning yellow for visibility over background images */
  color: #f6c343 !important;
  text-decoration: none;
}

.taw-powered-by a:hover,
.taw-powered-by a:focus {
  text-decoration: underline;
}

.taw-card-summary .taw-w-temp {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 10px;
}

.taw-w-desc {
  opacity: 0.92;
  margin-top: 2px;
}

.taw-w-feels {
  opacity: 0.92;
  margin-top: 4px;
}

.taw-w-hilo {
  opacity: 0.92;
  margin-top: 2px;
}

.taw-w-forecast {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  overflow-x: auto;
  padding-bottom: 6px;
}

.taw-mini-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 48px;
}

.taw-mini-day-label {
  font-size: 0.75em;
  opacity: 0.92;
}

.taw-mini-day i.wi {
  font-size: 1.25em;
}

.taw-mini-day-temps {
  font-size: 0.75em;
  opacity: 0.95;
  font-variant-numeric: tabular-nums;
}

/* Clock widget (weather-forward: temperature is the hero, time is included in the header) */
.taw-card-clock .taw-w-temp {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  margin-top: 10px;
}

.taw-card-clock .taw-w-time {
  font-size: 0.95em;
  opacity: 0.95;
}

/* Compact widget */
.taw-card-compact .taw-w-temp {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
  margin-top: 8px;
}

.taw-card-compact .taw-w-forecast {
  margin-top: 10px;
}

/* ----------------------------
   Weather alerts (NWS)
---------------------------- */

.taw-alerts {
  margin: 12px 0;
}

/* When used on the main [weather] shortcode, we hide the block until alerts exist. */
.taw-alerts[data-taw-alert-hide-empty="1"] {
  display: none;
}

.taw-alerts__status,
.taw-alerts__empty,
.taw-alerts__error {
  border: 1px solid #ddd;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff;
}

.taw-alerts .taw-alert {
  border: 1px solid #ddd;
  border-left: 6px solid #999;
  padding: 10px 12px;
  margin: 12px 0;
  border-radius: 6px;
  background: #fff;
}

.taw-alerts .taw-alert.taw-sev-extreme { border-left-color: #4a148c; }
.taw-alerts .taw-alert.taw-sev-severe { border-left-color: #b71c1c; }
.taw-alerts .taw-alert.taw-sev-moderate { border-left-color: #e65100; }
.taw-alerts .taw-alert.taw-sev-minor { border-left-color: #33691e; }

.taw-alert__title {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.taw-alert__headline {
  margin: 0.35rem 0;
  font-weight: 600;
}

.taw-alert__meta {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.taw-alerts-widget .taw-w-powered {
  margin-top: 8px;
  font-size: 0.78em;
  opacity: 0.8;
}

.taw-alerts-widget .taw-w-powered a {
  /* Match the main widget branding/link color */
  color: #f6c343 !important;
}

/* Sticky banner (optional) */
#taw-alert-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #b71c1c;
  color: #fff;
  padding: 10px 14px;
  font-weight: 600;
  display: none;
  gap: 10px;
  align-items: center;
}

#taw-alert-banner.taw-sev-severe { background: #b71c1c; }
#taw-alert-banner.taw-sev-extreme { background: #4a148c; }
#taw-alert-banner.taw-sev-moderate { background: #e65100; }
#taw-alert-banner.taw-sev-minor { background: #33691e; }

#taw-alert-banner .taw-close {
  margin-left: auto;
  cursor: pointer;
  font-weight: 700;
  opacity: 0.9;
}
