/*
Theme Name: St. Mary Weather
Theme URI: https://stmaryweather.com/
Author: St. Mary Weather
Description: A professional, Elementor-compatible local weather theme with broadcast-style weather layouts, alert styling, forecast cards, radar sections, and reusable weather shortcodes.
Version: 1.3.3
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: st-mary-weather
Tags: weather, elementor, news, custom-logo, custom-menu, featured-images, responsive-layout
*/

:root {
  --smw-navy: #071b33;
  --smw-deep-blue: #0a315a;
  --smw-blue: #0878d1;
  --smw-bright-blue: #18a7f2;
  --smw-sky: #75cfff;
  --smw-ice: #edf6fc;
  --smw-white: #ffffff;
  --smw-text: #132238;
  --smw-muted: #64748b;
  --smw-line: #d9e8f3;
  --smw-danger: #d7263d;
  --smw-warning: #f59e0b;
  --smw-success: #0e9f6e;
  --smw-radius: 18px;
  --smw-shadow: 0 12px 35px rgba(7, 27, 51, .10);
  --smw-max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--smw-text);
  background: #f5f9fc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
a { color: var(--smw-blue); text-decoration: none; }
a:hover { color: var(--smw-deep-blue); }
img { max-width: 100%; height: auto; }
.smw-container { width: min(calc(100% - 36px), var(--smw-max)); margin-inline: auto; }
.smw-site-main { min-height: 50vh; }

/* Header */
.smw-topbar {
  background: linear-gradient(135deg, var(--smw-navy), var(--smw-deep-blue) 55%, var(--smw-blue));
  color: #fff;
}
.smw-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 22px 0; }
.smw-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.smw-brand .custom-logo { max-height: 66px; width: auto; }
.smw-brand-text strong { display: block; color: #fff; font-size: clamp(1.35rem, 2.5vw, 2.05rem); line-height: 1.05; letter-spacing: -.03em; }
.smw-brand-text span { display: block; margin-top: 4px; color: #bfe8ff; font-size: .87rem; letter-spacing: .04em; text-transform: uppercase; }
.smw-header-condition { display: flex; align-items: center; gap: 14px; text-align: right; }
.smw-header-temp { font-size: 2.7rem; line-height: .9; font-weight: 800; letter-spacing: -.05em; }
.smw-header-meta strong, .smw-header-meta span { display: block; }
.smw-header-meta span { color: #bfe8ff; font-size: .84rem; }

.smw-nav-wrap { background: rgba(255,255,255,.98); border-bottom: 1px solid var(--smw-line); box-shadow: 0 5px 22px rgba(7,27,51,.06); position: relative; z-index: 20; }
.smw-nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 20px; }
.smw-primary-menu, .smw-primary-menu ul { list-style: none; margin: 0; padding: 0; }
.smw-primary-menu { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.smw-primary-menu a { display: block; padding: 18px 13px; color: var(--smw-navy); font-size: .83rem; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.smw-primary-menu a:hover { color: var(--smw-blue); }
.smw-menu-toggle { display: none; border: 0; background: var(--smw-blue); color: #fff; border-radius: 10px; padding: 9px 12px; font-weight: 700; }

/* Alert bar */
.smw-alertbar { background: var(--smw-warning); color: #251700; font-weight: 700; }
.smw-alertbar.is-danger { background: var(--smw-danger); color: #fff; }
.smw-alertbar-inner { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.smw-alertbar-badge { padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.12); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }

/* Hero */
.smw-weather-hero { background: radial-gradient(circle at 80% 10%, rgba(117,207,255,.34), transparent 26%), linear-gradient(135deg, #082342 0%, #0b5287 55%, #0c8bd1 100%); color: #fff; padding: 42px 0 54px; }
.smw-hero-grid { display: grid; grid-template-columns: 1.65fr .8fr; gap: 24px; align-items: stretch; }
.smw-radar-card, .smw-condition-card, .smw-panel { background: #fff; border: 1px solid rgba(217,232,243,.95); border-radius: var(--smw-radius); box-shadow: var(--smw-shadow); overflow: hidden; }
.smw-radar-card { min-height: 430px; background: linear-gradient(145deg, rgba(5,31,56,.96), rgba(9,85,131,.94)); position: relative; color: #fff; }
.smw-radar-grid { position: absolute; inset: 0; opacity: .15; background-image: linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px); background-size: 42px 42px; }
.smw-radar-content { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; min-height: 430px; padding: 28px; }
.smw-kicker { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--smw-bright-blue); }
.smw-radar-card .smw-kicker { color: #9ee1ff; }
.smw-radar-card h1 { max-width: 760px; margin: 7px 0 8px; font-size: clamp(2.1rem, 5vw, 4rem); line-height: 1; letter-spacing: -.045em; }
.smw-radar-card p { max-width: 690px; color: #cdefff; margin: 0; }
.smw-radar-placeholder { display: flex; align-items: center; justify-content: center; min-height: 230px; border: 1px solid rgba(255,255,255,.2); border-radius: 15px; background: rgba(1,15,28,.3); backdrop-filter: blur(2px); text-align: center; color: #d9f4ff; }
.smw-radar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.smw-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; font-size: .78rem; font-weight: 700; }

.smw-condition-card { color: var(--smw-text); padding: 28px; display: flex; flex-direction: column; justify-content: space-between; }
.smw-condition-title { color: var(--smw-muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; }
.smw-current-temp { margin: 8px 0 0; font-size: 5rem; line-height: .9; font-weight: 850; letter-spacing: -.07em; color: var(--smw-navy); }
.smw-current-condition { color: var(--smw-blue); font-weight: 800; font-size: 1.1rem; }
.smw-condition-location { color: var(--smw-muted); font-size: .9rem; }
.smw-metric-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.smw-metric { background: var(--smw-ice); border-radius: 12px; padding: 12px; }
.smw-metric span { display: block; font-size: .75rem; color: var(--smw-muted); }
.smw-metric strong { display: block; margin-top: 1px; color: var(--smw-navy); font-size: 1rem; }

/* Sections */
.smw-section { padding: 46px 0; }
.smw-section + .smw-section { padding-top: 12px; }
.smw-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.smw-section-head h2 { margin: 0; color: var(--smw-navy); font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.smw-section-head p { margin: 0; color: var(--smw-muted); }
.smw-forecast-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.smw-forecast-day { min-width: 130px; background: #fff; border: 1px solid var(--smw-line); border-radius: 15px; padding: 18px 14px; text-align: center; box-shadow: 0 7px 22px rgba(7,27,51,.05); }
.smw-forecast-day.is-today { border-color: var(--smw-bright-blue); box-shadow: 0 8px 24px rgba(24,167,242,.16); }
.smw-forecast-day strong { display: block; color: var(--smw-navy); }
.smw-weather-icon { font-size: 2rem; margin: 10px 0; }
.smw-forecast-hi { font-size: 1.25rem; font-weight: 850; color: var(--smw-navy); }
.smw-forecast-lo { color: var(--smw-muted); }
.smw-forecast-desc { margin-top: 7px; color: var(--smw-muted); font-size: .78rem; }

.smw-three-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.smw-panel { padding: 24px; }
.smw-panel h3 { margin: 0 0 10px; color: var(--smw-navy); font-size: 1.2rem; }
.smw-big-stat { font-size: 2.1rem; font-weight: 850; color: var(--smw-blue); letter-spacing: -.04em; }
.smw-stat-sub { color: var(--smw-muted); font-size: .9rem; }

.smw-tropical { background: linear-gradient(135deg, #071b33, #0c4f7d); color: #fff; }
.smw-tropical .smw-section-head h2, .smw-tropical .smw-section-head p { color: #fff; }
.smw-tropical .smw-section-head p { opacity: .75; }
.smw-tropical-card { border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.08); padding: 22px; border-radius: 16px; }
.smw-tropical-card strong { display: block; font-size: 1.15rem; }
.smw-tropical-card span { color: #c8ecff; }

/* Posts */
.smw-post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.smw-post-card { background: #fff; border: 1px solid var(--smw-line); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(7,27,51,.05); }
.smw-post-thumb { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #d6efff, #7bcaff); overflow: hidden; }
.smw-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.smw-post-card-body { padding: 19px; }
.smw-post-card h3 { margin: 4px 0 7px; font-size: 1.08rem; line-height: 1.25; }
.smw-post-card h3 a { color: var(--smw-navy); }
.smw-post-meta { color: var(--smw-muted); font-size: .78rem; }
.smw-post-excerpt { color: #4f6177; font-size: .9rem; }

/* Content */
.smw-content-shell { width: min(calc(100% - 36px), 900px); margin: 42px auto 70px; }
.smw-entry { background: #fff; border: 1px solid var(--smw-line); border-radius: 18px; padding: clamp(24px, 5vw, 48px); box-shadow: var(--smw-shadow); }
.smw-entry-title { margin: 0 0 14px; color: var(--smw-navy); font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.03; letter-spacing: -.04em; }
.smw-entry-content > *:first-child { margin-top: 0; }
.smw-entry-content > *:last-child { margin-bottom: 0; }
.smw-entry-content { font-size: 1.02rem; }
.smw-entry-content h2, .smw-entry-content h3 { color: var(--smw-navy); line-height: 1.2; }
.smw-entry-content iframe { max-width: 100%; }

/* Footer */
.smw-footer { background: #06182d; color: #d5e8f7; margin-top: 30px; }
.smw-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding: 42px 0; }
.smw-footer h3 { color: #fff; margin-top: 0; }
.smw-footer a { color: #c5eaff; }
.smw-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; color: #91adc3; font-size: .82rem; }
.smw-footer-menu { list-style: none; padding: 0; margin: 0; }
.smw-footer-menu li { margin: 7px 0; }

/* Elementor friendliness */
.elementor-page .smw-content-shell { width: 100%; max-width: none; margin: 0; }
.elementor-page .smw-entry { border: 0; border-radius: 0; padding: 0; box-shadow: none; background: transparent; }
.elementor-page .smw-entry-title { display: none; }
.smw-elementor-fullwidth .smw-content-shell { width: 100%; max-width: none; margin: 0; }
.smw-elementor-fullwidth .smw-entry { padding: 0; border: 0; box-shadow: none; border-radius: 0; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .smw-hero-grid { grid-template-columns: 1fr; }
  .smw-radar-card, .smw-radar-content { min-height: 360px; }
  .smw-three-grid, .smw-post-grid { grid-template-columns: 1fr 1fr; }
  .smw-footer-grid { grid-template-columns: 1fr 1fr; }
  .smw-header-condition { display: none; }
  .smw-menu-toggle { display: inline-flex; }
  .smw-primary-menu { display: none; position: absolute; left: 18px; right: 18px; top: 58px; flex-direction: column; align-items: stretch; padding: 8px; background: #fff; border: 1px solid var(--smw-line); border-radius: 14px; box-shadow: var(--smw-shadow); }
  .smw-primary-menu.is-open { display: flex; }
  .smw-primary-menu a { padding: 11px 12px; border-radius: 8px; }
}

@media (max-width: 640px) {
  .smw-container { width: min(calc(100% - 24px), var(--smw-max)); }
  .smw-header-inner { padding: 16px 0; }
  .smw-brand-text span { display: none; }
  .smw-brand .custom-logo { max-height: 48px; }
  .smw-weather-hero { padding: 24px 0 34px; }
  .smw-radar-card, .smw-radar-content { min-height: 330px; }
  .smw-radar-content { padding: 20px; }
  .smw-current-temp { font-size: 4rem; }
  .smw-three-grid, .smw-post-grid, .smw-footer-grid { grid-template-columns: 1fr; }
  .smw-section { padding: 34px 0; }
  .smw-section-head { align-items: start; flex-direction: column; }
  .smw-alertbar-inner { padding: 9px 0; font-size: .83rem; }
}


/* Elementor compatibility */
.smw-page,
.smw-page-content { width: 100%; margin: 0; padding: 0; }
.smw-elementor-home-zone { width: 100%; position: relative; }
.smw-elementor-home-zone > .elementor,
.smw-page-content > .elementor { width: 100%; }
body.smw-elementor-fullwidth .smw-site-main { width: 100%; }
body.smw-elementor-fullwidth .smw-site-main > * { width: 100%; }
