:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1a202c;
  --text-muted: #5a6578;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --sun: #f59e0b;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.logo span {
  color: var(--accent);
}

.search-form {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-end;
  max-width: 420px;
}

.search-form input {
  flex: 1;
  padding: 0.55rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-form button {
  padding: 0.55rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.search-form button:hover {
  background: var(--accent-dark);
}

/* Hero */
.hero {
  padding: 2.5rem 0 1.5rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 0 2rem;
}

.location-hero {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 1.5rem;
  align-items: start;
}

.hero-sub {
  color: var(--text-muted);
  margin: -0.5rem 0 1rem;
}

.current-weather {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.current-icon {
  font-size: 4rem;
  line-height: 1;
}

.current-temp {
  display: block;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
}

.current-label {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.current-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.current-meta strong {
  color: var(--text);
}

/* Cards */
.card, .today-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.today-card h2,
.card h2 {
  margin-top: 0;
  font-size: 1.15rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.day-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #edf2f7;
}

.day-row:last-child {
  border-bottom: none;
}

.day-row.large {
  padding: 1rem 0;
}

.day-icon {
  font-size: 2.2rem;
  width: 2.5rem;
  text-align: center;
}

.day-temps {
  display: flex;
  flex-direction: column;
  min-width: 3.2rem;
}

.max {
  font-size: 1.4rem;
  font-weight: 700;
}

.min {
  font-size: 1rem;
  color: var(--text-muted);
}

.day-meta {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  text-align: right;
  font-size: 0.95rem;
}

.day-name {
  min-width: 7.5rem;
  font-weight: 600;
}

.day-name small,
.mini-day small {
  display: block;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.day-label {
  flex: 1;
  color: var(--text-muted);
}

.day-rain,
.day-wind {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 5.5rem;
  text-align: right;
}

.sun-times {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Hourly */
.hourly-section {
  margin: 1.5rem 0;
}

.hourly-section h2,
.long-range h2,
.seo-text h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.hourly-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  scrollbar-width: thin;
}

.hour-cell {
  flex: 0 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 0.7rem;
  text-align: center;
  min-width: 4.2rem;
}

.hour-time {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hour-icon {
  display: block;
  font-size: 1.8rem;
  margin: 0.35rem 0;
}

.hour-temp {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
}

.hour-rain {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.mini-forecast {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mini-forecast li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #edf2f7;
}

.mini-forecast li:last-child {
  border-bottom: none;
}

.mini-day {
  flex: 1;
  font-weight: 600;
}

.mini-icon {
  font-size: 1.4rem;
}

.mini-temps {
  min-width: 4.5rem;
  text-align: right;
  font-weight: 600;
}

/* Long range */
.long-range {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.days-table .day-row {
  padding: 0.9rem 0;
}

/* Home */
.home-hero {
  text-align: center;
}

.home-hero h1 {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.home-hero .lead {
  margin-left: auto;
  margin-right: auto;
}

.quick-links {
  margin-top: 2.5rem;
}

.quick-links h2 {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.pill {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.pill:hover {
  border-color: var(--accent);
  background: #eff6ff;
}

/* SEO text */
.seo-text {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.seo-text p {
  color: var(--text-muted);
  margin: 0.75rem 0;
}

.seo-text a {
  color: var(--accent);
}

code {
  background: #eef2ff;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.9em;
}

/* Error */
.error-banner {
  background: #fee2e2;
  color: #991b1b;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin: 1.5rem 0 0;
}

/* Forms */
.forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
  text-align: left;
}

.forms-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.form-card h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.form-card p {
  color: var(--text-muted);
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
}

.ajax-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ajax-form input,
.ajax-form textarea,
.ajax-form select {
  padding: 0.65rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ajax-form input:focus,
.ajax-form textarea:focus,
.ajax-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ajax-form textarea {
  resize: vertical;
}

.ajax-form button {
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.ajax-form button:hover {
  background: var(--accent-dark);
}

.form-message {
  margin: 0;
  font-size: 0.9rem;
  min-height: 1.3rem;
}

.form-message.success {
  color: #15803d;
}

.form-message.error {
  color: #b91c1c;
}

/* Footer */
.site-footer {
  background: var(--card);
  border-top: 1px solid #e2e8f0;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-popular {
  text-align: center;
  margin-bottom: 1.5rem;
}

.footer-popular h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.footer-copy {
  text-align: center;
  margin: 0;
}

.site-footer a {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .search-form {
    order: 3;
    max-width: none;
    width: 100%;
    margin-top: 0.5rem;
  }

  .location-hero {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .day-row {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .day-name {
    min-width: auto;
    width: 100%;
  }

  .day-label {
    width: 100%;
    order: 5;
  }

  .day-rain,
  .day-wind {
    text-align: left;
    min-width: auto;
  }

  .forms-grid,
  .forms-grid.two-col {
    grid-template-columns: 1fr;
  }
}
