/* Weather Dashboard — matches the Kumar portfolio. Single stylesheet, no dependencies. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #1a1d21;
  --muted: #5b6470;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --border: #e4e7ec;
  --error: #b91c1c;
  --radius: 12px;
  --max-width: 860px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted { color: var(--muted); }

/* Header */
.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.back-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
}
.back-link:hover { color: var(--text); text-decoration: none; }

/* Layout */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 40px;
}

main h2 {
  margin: 0 0 16px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

/* Hero */
.hero { padding: 56px 0 8px; }
.hero h1 {
  margin: 0;
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.hero-tagline {
  max-width: 560px;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Search */
.search-section { position: relative; padding: 24px 0 8px; }

#search-form { display: flex; gap: 12px; }

#city-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
}
#city-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }

.suggestions {
  list-style: none;
  margin: 8px 0 0;
  padding: 6px;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.suggestions li { margin: 0; padding: 0; }
.suggestion {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.suggestion:hover { background: var(--bg-soft); }
.suggestion-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.status { min-height: 1.5em; margin: 12px 0 0; color: var(--muted); }
.status.error { color: var(--error); font-weight: 600; }

/* Current conditions */
.current-card {
  margin-top: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.current-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.current-top h2 { margin: 0; font-size: 1.4rem; }
.current-top .muted { margin: 4px 0 0; font-size: 0.95rem; }
.current-icon { font-size: 3rem; line-height: 1; }

.current-temp {
  margin: 12px 0 0;
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.temp-unit { font-size: 1.6rem; font-weight: 600; color: var(--muted); }
.current-condition { margin: 8px 0 0; font-size: 1.15rem; font-weight: 600; }

.current-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat .label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Forecast */
#forecast-section { padding-top: 48px; }
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}
.forecast-card {
  padding: 16px 12px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.forecast-card p { margin: 6px 0; }
.forecast-day { font-weight: 700; }
.forecast-icon { font-size: 2rem; line-height: 1.2; }
.forecast-cond { font-size: 0.85rem; color: var(--muted); min-height: 2.6em; }
.forecast-temps { font-weight: 600; }
.forecast-temps .low { color: var(--muted); font-weight: 400; }
.forecast-precip { font-size: 0.85rem; color: var(--muted); }

.attribution {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Small screens */
@media (max-width: 560px) {
  .hero { padding-top: 36px; }
  .hero h1 { font-size: 2.1rem; }
  .current-card { padding: 20px; }
  .current-temp { font-size: 2.6rem; }
  #search-form { flex-wrap: wrap; }
  #city-input { flex-basis: 100%; }
}
