/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f2ec;
  --surface:   #ffffff;
  --border:    #e0dbd0;
  --text:      #1a1814;
  --muted:     #7a756a;
  --accent:    #2d5a3d;
  --accent-lt: #e8f0eb;
  --chip-bg:   #f0ede6;
  --radius:    14px;
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
}

/* ── Layout ── */
.app {
  max-width: 680px;
  margin: 0 auto;
}

/* ── Header ── */
header { margin-bottom: 2rem; }

h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 1rem;
}

/* ── Search ── */
.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus { border-color: var(--accent); }
input[type="text"]::placeholder { color: var(--muted); }

button {
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

button:hover  { opacity: 0.88; }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; }

/* ── Gender toggle ── */
.gender-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.gender-label {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}

.gender-toggle {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.gender-btn {
  padding: 0.4rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--chip-bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}

.gender-btn:hover {
  background: var(--accent-lt);
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.gender-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.gender-btn.active:hover { opacity: 0.88; }

/* ── Error ── */
.error {
  background: #fdf0f0;
  border: 1.5px solid #f5c6c6;
  color: #8b2020;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.card h2 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ── Conditions card ── */
.conditions-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.city-name {
  font-size: 1.25rem;
  font-weight: 500;
}

.condition-text {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.temp-block {
  display: flex;
  align-items: flex-start;
  line-height: 1;
}

.temp-value {
  font-family: var(--font-head);
  font-size: 3.5rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.temp-unit {
  font-size: 1.25rem;
  color: var(--muted);
  margin-top: 0.5rem;
  margin-left: 2px;
}

.stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat {
  background: var(--chip-bg);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
  flex: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 500;
}

/* ── Outfit card ── */
.outfit-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.outfit-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-lt);
  color: var(--accent);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 500;
}

.outfit-chip .icon { font-size: 1rem; }

.outfit-tip {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  border-left: 3px solid var(--accent-lt);
  padding-left: 0.75rem;
}

/* ── Daily ── */
.daily-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--chip-bg);
  border-radius: 10px;
  padding: 10px 14px;
}

.day-name { font-size: 0.9rem; font-weight: 500; flex: 1; }
.day-icon { font-size: 1.2rem; }
.day-desc { font-size: 0.82rem; color: var(--muted); flex: 2; }
.day-temps { font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.day-temps .low { color: var(--muted); font-weight: 400; margin-left: 6px; }
.day-rain { font-size: 0.8rem; color: #4a7fbf; min-width: 36px; text-align: right; }

/* ── Footer ── */
footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

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

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Loading shimmer ── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--chip-bg) 25%, var(--border) 50%, var(--chip-bg) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body { padding: 1.25rem 0.75rem 3rem; }

  .card { padding: 1rem 1rem; }

  /* Conditions */
  .conditions-top { flex-direction: column-reverse; gap: 0.5rem; }
  .temp-value { font-size: 2.75rem; }

  /* Stats: 2×2 grid on narrow screens */
  .stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { min-width: 0; flex: unset; }

  /* 3-day forecast: hide description text, let name/icon/temps breathe */
  .day-desc { display: none; }
  .day-row { gap: 8px; }
}

@media (max-width: 380px) {
  .temp-value { font-size: 2.25rem; }
  .search-row { flex-direction: column; }
  .search-row button { width: 100%; }
}