/* =========================================================================
   SAYFA: İlçe 15 günlük hava durumu (services/districtPages.js)
   İl SEO sayfalarının şablonunu (seoPages.layout) ve renk değişkenlerini kullanır.
   Buradaki her kural .ilce-sayfa ile başlar.
   ========================================================================= */

.ilce-sayfa {
  --warm: #ea580c;
  --warm-soft: #fff7ed;
  --cold: #0284c7;
  --cold-soft: #f0f9ff;
  --today: #7c3aed;
  --sk: #e2e8f0;
  --sk-hi: #f1f5f9;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  .ilce-sayfa {
    --warm: #fb923c;
    --warm-soft: #2a1608;
    --cold: #38bdf8;
    --cold-soft: #071a2a;
    --today: #a78bfa;
    --sk: #1f2937;
    --sk-hi: #273449;
  }
}

.ilce-sayfa .ilce-hero h1 { margin-bottom: 8px; }
.ilce-sayfa .ilce-hero .lead { margin-top: 0; }
.ilce-sayfa .ilce-eyebrow {
  margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--brand);
}
.ilce-sayfa .ilce-blok { margin: 22px 0; }
.ilce-sayfa .ilce-blok > h2 { margin-top: 32px; }

/* ---------- Hava alanı geçişi ---------- */
.ilce-sayfa .ilce-hava { position: relative; min-height: 420px; }
.ilce-sayfa .ilce-hava.is-ready { min-height: 0; }
.ilce-sayfa .ilce-blocks { animation: ilceIn .6s var(--ease) both; }
.ilce-sayfa .ilce-blocks > * { animation: ilceIn .6s var(--ease) both; }
.ilce-sayfa .ilce-blocks > :nth-child(2) { animation-delay: 80ms; }
.ilce-sayfa .ilce-blocks > :nth-child(3) { animation-delay: 160ms; }
.ilce-sayfa .ilce-blocks > :nth-child(4) { animation-delay: 240ms; }
.ilce-sayfa .ilce-loading.is-leaving { animation: ilceOut .35s ease both; }
@keyframes ilceIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ilceOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Yükleme katmanı ---------- */
.ilce-sayfa .ilce-loading { position: relative; margin: 20px 0; }
.ilce-sayfa .ilce-loading-card {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; padding: 28px 20px; margin: 0 auto 18px; max-width: 640px;
  background: linear-gradient(160deg, var(--card), var(--soft));
  box-shadow: 0 12px 40px -18px rgba(37, 99, 235, .35);
}
.ilce-sayfa .ilce-loading-icons { position: relative; width: 120px; height: 104px; }
.ilce-sayfa .ilce-loading-icons img {
  position: absolute; inset: 0; margin: auto; width: 104px; height: 104px; opacity: 0;
  animation: ilceIconCycle 4.5s infinite;
}
.ilce-sayfa .ilce-loading-icons img:nth-child(2) { animation-delay: 1.5s; }
.ilce-sayfa .ilce-loading-icons img:nth-child(3) { animation-delay: 3s; }
@keyframes ilceIconCycle {
  0% { opacity: 0; transform: scale(.85); }
  6%, 30% { opacity: 1; transform: scale(1); }
  38%, 100% { opacity: 0; transform: scale(.9); }
}
.ilce-sayfa .ilce-loading-text { margin: 0; max-width: 520px; font-size: 16px; font-weight: 600; color: var(--fg); }
.ilce-sayfa .ilce-loading-bar { width: min(320px, 80%); height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; }
.ilce-sayfa .ilce-loading-bar i {
  display: block; width: 40%; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  animation: ilceBar 1.4s ease-in-out infinite;
}
@keyframes ilceBar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
.ilce-sayfa .ilce-loading-error { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.ilce-sayfa .ilce-loading-error button {
  margin-top: 10px; font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 9px 16px;
  background: var(--brand); color: #fff; cursor: pointer;
}

.ilce-sayfa .ilce-skeleton { display: grid; gap: 14px; }
.ilce-sayfa .sk {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--sk) 25%, var(--sk-hi) 45%, var(--sk) 65%) 0 0 / 300% 100%;
  animation: ilceShimmer 1.4s linear infinite;
}
.ilce-sayfa .sk-now { height: 190px; }
.ilce-sayfa .sk-row { display: flex; gap: 10px; overflow: hidden; }
.ilce-sayfa .sk-hour { flex: 0 0 84px; height: 130px; }
.ilce-sayfa .sk-chart { height: 260px; }
.ilce-sayfa .sk-days { height: 320px; }
@keyframes ilceShimmer { to { background-position: -150% 0; } }

/* ---------- Blok 1: Şu an ---------- */
.ilce-sayfa .ilce-now { padding: 22px; background: linear-gradient(150deg, var(--card) 40%, var(--soft)); }
.ilce-sayfa .ilce-now-main { display: flex; align-items: center; gap: 18px; }
.ilce-sayfa .ilce-now-icon { width: 132px; height: 132px; flex: 0 0 auto; margin: -10px -6px -10px -12px; }
.ilce-sayfa .ilce-now-main h2 { font-size: 13px; margin: 0 0 2px; }
.ilce-sayfa .ilce-now-temp { font-size: clamp(54px, 9vw, 76px); font-weight: 800; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ilce-sayfa .ilce-now-temp span { font-size: .4em; font-weight: 700; color: var(--muted); vertical-align: top; margin-left: 2px; letter-spacing: 0; }
.ilce-sayfa .ilce-now-text { font-size: 18px; font-weight: 650; margin-top: 4px; }
.ilce-sayfa .ilce-now-range { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ilce-sayfa .ilce-now-range b { color: var(--fg); }
.ilce-sayfa .ilce-stats {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0;
}
.ilce-sayfa .ilce-stat { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.ilce-sayfa .ilce-stat dt { font-size: 12px; color: var(--muted); }
.ilce-sayfa .ilce-stat dd { margin: 2px 0 0; font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ilce-sayfa .ilce-wind { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 650; color: var(--muted); margin-left: 2px; }
.ilce-sayfa .ilce-wind i { display: inline-block; font-style: normal; color: var(--brand); }
.ilce-sayfa .ilce-updated { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.ilce-sayfa .ilce-stale { color: var(--warm); }

/* 24 saat — yatay kaydırma */
.ilce-sayfa .ilce-hours-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 8px; }
.ilce-sayfa .ilce-hours-head h3 { margin: 0; }
.ilce-sayfa .ilce-scroll-btns { display: flex; gap: 6px; }
.ilce-sayfa .ilce-scroll-btns button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
  color: var(--fg); font-size: 20px; line-height: 1; cursor: pointer;
}
.ilce-sayfa .ilce-scroll-btns button:hover { border-color: var(--brand); color: var(--brand); }
.ilce-sayfa .ilce-scroll-btns button:disabled { opacity: .35; cursor: default; }
.ilce-sayfa .ilce-hours {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; padding: 2px 2px 10px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.ilce-sayfa .ilce-hours:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 12px; }
.ilce-sayfa .ilce-hour {
  flex: 0 0 84px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  font-variant-numeric: tabular-nums; transition: transform .2s var(--ease), border-color .2s;
}
.ilce-sayfa .ilce-hour:hover { transform: translateY(-2px); border-color: var(--brand); }
.ilce-sayfa .ilce-hour.is-now { background: linear-gradient(170deg, var(--brand), var(--brand2)); border-color: transparent; color: #fff; }
.ilce-sayfa .ilce-hour.is-now .ilce-hour-t,
.ilce-sayfa .ilce-hour.is-now .ilce-hour-p,
.ilce-sayfa .ilce-hour.is-now .ilce-hour-w { color: #e0f2fe; }
.ilce-sayfa .ilce-hour.is-midnight { box-shadow: inset 3px 0 0 var(--brand2); }
.ilce-sayfa .ilce-hour-t { font-size: 13px; font-weight: 700; color: var(--muted); }
.ilce-sayfa .ilce-hour-icon { width: 52px; height: 52px; }
.ilce-sayfa .ilce-hour b { font-size: 18px; }
.ilce-sayfa .ilce-hour-p { font-size: 12px; color: var(--muted); }
.ilce-sayfa .ilce-hour-p.wet { color: var(--cold); font-weight: 700; }
.ilce-sayfa .ilce-hour-w { font-size: 11px; color: var(--muted); }

/* ---------- Blok 2: Bugün vs son 10 yıl ---------- */
.ilce-sayfa .ilce-kiyas { padding: 22px; position: relative; overflow: hidden; }
.ilce-sayfa .ilce-kiyas.is-warmer { background: linear-gradient(150deg, var(--card) 45%, var(--warm-soft)); border-color: color-mix(in srgb, var(--warm) 35%, var(--border)); }
.ilce-sayfa .ilce-kiyas.is-colder { background: linear-gradient(150deg, var(--card) 45%, var(--cold-soft)); border-color: color-mix(in srgb, var(--cold) 35%, var(--border)); }
.ilce-sayfa .ilce-kiyas-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.ilce-sayfa .ilce-kiyas h2 { margin: 0; font-size: clamp(20px, 3.2vw, 27px); line-height: 1.3; }
.ilce-sayfa .ilce-kiyas h2 em { font-style: normal; white-space: nowrap; }
.ilce-sayfa .ilce-kiyas h2 em.is-warm { color: var(--warm); }
.ilce-sayfa .ilce-kiyas h2 em.is-cold { color: var(--cold); }
.ilce-sayfa .ilce-diff {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 96px; height: 96px; border-radius: 50%; color: #fff; background: var(--muted);
}
.ilce-sayfa .is-warmer .ilce-diff { background: linear-gradient(140deg, #f59e0b, var(--warm)); }
.ilce-sayfa .is-colder .ilce-diff { background: linear-gradient(140deg, #22d3ee, var(--cold)); }
.ilce-sayfa .ilce-diff b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.ilce-sayfa .ilce-diff span { font-size: 12px; opacity: .9; }
.ilce-sayfa .ilce-kiyas-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 6px; }
.ilce-sayfa .ilce-kiyas-kpis div { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.ilce-sayfa .ilce-kiyas-kpis span { display: block; font-size: 12px; color: var(--muted); }
.ilce-sayfa .ilce-kiyas-kpis b { font-size: 19px; font-variant-numeric: tabular-nums; }

.ilce-sayfa .ilce-chart {
  position: relative; display: flex; align-items: flex-end; gap: 8px; height: 230px;
  margin: 18px 0 8px; padding: 22px 0 0; border-bottom: 1px solid var(--border);
}
.ilce-sayfa .ilce-bar {
  position: relative; flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.ilce-sayfa .ilce-bar i {
  display: block; width: 100%; max-width: 46px; height: var(--h); border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand2) 70%, transparent), var(--brand));
  transform-origin: bottom; animation: ilceGrow .9s var(--ease) both;
}
.ilce-sayfa .ilce-bar:nth-child(odd) i { animation-delay: 60ms; }
.ilce-sayfa .ilce-bar.is-warmest i { background: linear-gradient(180deg, #fbbf24, var(--warm)); }
.ilce-sayfa .ilce-bar.is-coldest i { background: linear-gradient(180deg, #67e8f9, var(--cold)); }
.ilce-sayfa .ilce-bar.is-today i {
  background: repeating-linear-gradient(135deg, var(--today) 0 6px, color-mix(in srgb, var(--today) 75%, #fff) 6px 12px);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--today) 30%, transparent);
}
.ilce-sayfa .ilce-bar-v { font-size: 12px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ilce-sayfa .ilce-bar-y { position: absolute; bottom: -22px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ilce-sayfa .ilce-bar.is-today .ilce-bar-y { color: var(--today); font-weight: 800; }
.ilce-sayfa .ilce-bar.is-today .ilce-bar-v { color: var(--today); }
.ilce-sayfa .ilce-bar.is-warmest .ilce-bar-v { color: var(--warm); }
.ilce-sayfa .ilce-bar.is-coldest .ilce-bar-v { color: var(--cold); }
@keyframes ilceGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.ilce-sayfa .ilce-avgline {
  position: absolute; left: 0; right: 0; bottom: calc(var(--h) * (208 / 230)); z-index: 1; pointer-events: none;
  border-top: 2px dashed color-mix(in srgb, var(--fg) 45%, transparent);
}
.ilce-sayfa .ilce-avgline span {
  position: absolute; right: 0; top: -22px; font-size: 11px; font-weight: 700; padding: 1px 6px;
  border-radius: 6px; background: var(--card); color: var(--muted); border: 1px solid var(--border);
}
.ilce-sayfa .ilce-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 10px; }
.ilce-sayfa .ilce-badge { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.ilce-sayfa .ilce-badge.warm { background: var(--warm-soft); color: var(--warm); border: 1px solid color-mix(in srgb, var(--warm) 35%, transparent); }
.ilce-sayfa .ilce-badge.cold { background: var(--cold-soft); color: var(--cold); border: 1px solid color-mix(in srgb, var(--cold) 35%, transparent); }
.ilce-sayfa .ilce-kiyas .note { margin: 6px 0 0; }

/* ---------- CTA ---------- */
.ilce-sayfa .ilce-cta {
  display: flex; gap: 18px; align-items: center; margin: 24px 0; padding: 22px 24px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  box-shadow: 0 18px 40px -22px rgba(37, 99, 235, .7);
}
.ilce-sayfa .ilce-cta.is-final { margin-top: 40px; background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #0891b2); }
.ilce-sayfa .ilce-cta-icon { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; }
.ilce-sayfa .ilce-cta-img { width: 72px; height: 72px; }
.ilce-sayfa .ilce-cta h2 { margin: 0 0 6px; color: #fff; font-size: clamp(19px, 2.6vw, 24px); }
.ilce-sayfa .ilce-cta p { margin: 0 0 14px; color: #e0f2fe; max-width: 760px; }
.ilce-sayfa .ilce-cta p strong { color: #fff; }
.ilce-sayfa .ilce-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ilce-sayfa .ilce-cta .btn { background: #fff; color: #1d4ed8 !important; transition: transform .2s var(--ease), box-shadow .2s; }
.ilce-sayfa .ilce-cta .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4); }
.ilce-sayfa .ilce-cta.is-event { background: linear-gradient(135deg, #9d174d, #db2777 45%, #f59e0b); box-shadow: 0 18px 40px -22px rgba(219, 39, 119, .7); }
.ilce-sayfa .ilce-cta.is-event p { color: #fdf2f8; }
.ilce-sayfa .ilce-cta.is-event .btn { color: #9d174d !important; }
.ilce-sayfa .ilce-cta-list { list-style: none; margin: -4px 0 16px; padding: 0; display: grid; gap: 4px; font-size: 15px; font-weight: 600; }
.ilce-sayfa .ilce-cta-link { color: #fff; font-weight: 600; font-size: 14px; }

/* ---------- Blok 3: 14 gün ---------- */
.ilce-sayfa .ilce-days { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--card); overflow: hidden; }
.ilce-sayfa .ilce-day {
  display: grid; align-items: center; gap: 12px; padding: 8px 16px;
  grid-template-columns: 112px 48px minmax(0, 1fr) 92px minmax(170px, 230px);
  border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; transition: background .15s;
}
.ilce-sayfa .ilce-day:last-child { border-bottom: 0; }
.ilce-sayfa .ilce-day:hover { background: var(--soft); }
.ilce-sayfa .ilce-day-name b { display: block; font-size: 15px; }
.ilce-sayfa .ilce-day-name span { font-size: 13px; color: var(--muted); }
.ilce-sayfa .ilce-day.is-weekend .ilce-day-name b { color: var(--brand); }
.ilce-sayfa .ilce-day-icon { width: 48px; height: 48px; }
.ilce-sayfa .ilce-day-text { font-size: 14px; color: var(--muted); }
.ilce-sayfa .ilce-day-p { font-size: 13px; color: var(--muted); }
.ilce-sayfa .ilce-day-p.wet { color: var(--cold); font-weight: 700; }
.ilce-sayfa .ilce-day-p small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.ilce-sayfa .ilce-day-t { display: flex; align-items: center; gap: 8px; }
.ilce-sayfa .ilce-day-t .lo { width: 30px; text-align: right; color: var(--muted); }
.ilce-sayfa .ilce-day-t .hi { width: 30px; font-weight: 750; }
.ilce-sayfa .ilce-range { position: relative; flex: 1; height: 6px; border-radius: 99px; background: var(--border); }
.ilce-sayfa .ilce-range i { position: absolute; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cold), #facc15, var(--warm)); }

/* ---------- SEO / komşu ilçeler ---------- */
.ilce-sayfa .ilce-seo { max-width: 820px; }
.ilce-sayfa .ilce-seo p { color: var(--fg); }

/* ---------- Duyarlı ---------- */
@media (max-width: 900px) {
  .ilce-sayfa .ilce-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ilce-sayfa .ilce-day { grid-template-columns: 96px 44px minmax(0, 1fr) 76px minmax(140px, 190px); }
}
@media (max-width: 640px) {
  .ilce-sayfa .ilce-now { padding: 16px; }
  .ilce-sayfa .ilce-now-main { gap: 8px; }
  .ilce-sayfa .ilce-now-icon { width: 104px; height: 104px; margin-left: -10px; }
  .ilce-sayfa .ilce-now-text { font-size: 16px; }
  .ilce-sayfa .ilce-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ilce-sayfa .ilce-stat dd { font-size: 16px; }
  .ilce-sayfa .ilce-scroll-btns { display: none; }
  .ilce-sayfa .ilce-hours { margin: 0 -16px; padding: 2px 16px 10px; scroll-padding-left: 16px; }
  .ilce-sayfa .ilce-hour { flex-basis: 76px; }

  .ilce-sayfa .ilce-kiyas { padding: 16px; }
  .ilce-sayfa .ilce-diff { width: 70px; height: 70px; }
  .ilce-sayfa .ilce-diff b { font-size: 19px; }
  .ilce-sayfa .ilce-kiyas-kpis { grid-template-columns: 1fr 1fr; }
  .ilce-sayfa .ilce-kiyas-kpis div:last-child { grid-column: 1 / -1; }
  .ilce-sayfa .ilce-chart { gap: 3px; height: 200px; }
  .ilce-sayfa .ilce-avgline { bottom: calc(var(--h) * (178 / 200)); }
  .ilce-sayfa .ilce-bar-v { font-size: 10px; }
  .ilce-sayfa .ilce-bar-y { font-size: 10px; transform: rotate(-45deg); transform-origin: center; bottom: -26px; }
  .ilce-sayfa .ilce-bar i { border-radius: 5px 5px 1px 1px; }
  .ilce-sayfa .ilce-badges { margin-top: 40px; }

  .ilce-sayfa .ilce-cta { flex-direction: column; align-items: flex-start; padding: 18px; }
  .ilce-sayfa .ilce-cta-icon { width: 60px; height: 60px; }
  .ilce-sayfa .ilce-cta-img { width: 52px; height: 52px; }
  .ilce-sayfa .ilce-cta .btn { width: 100%; text-align: center; }

  .ilce-sayfa .ilce-day {
    grid-template-columns: 74px 40px 52px minmax(0, 1fr); gap: 8px; padding: 8px 12px;
  }
  .ilce-sayfa .ilce-day-text { display: none; }
  .ilce-sayfa .ilce-day-icon { width: 40px; height: 40px; }
  .ilce-sayfa .ilce-day-name b { font-size: 14px; }
  .ilce-sayfa .ilce-day-p { font-size: 12px; }
  .ilce-sayfa .ilce-day-t { gap: 6px; }
  .ilce-sayfa .ilce-day-t .lo, .ilce-sayfa .ilce-day-t .hi { width: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .ilce-sayfa *, .ilce-sayfa *::before, .ilce-sayfa *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .ilce-sayfa .ilce-loading-icons img:first-child { opacity: 1; }
  .ilce-sayfa .ilce-hours { scroll-behavior: auto; }
}
