/* layout.css — wrap, bölüm ritmi, başlık blokları. */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ------------------------------------------------------------ BÖLÜMLER */
.chapter {
  position: relative;
  padding-block: var(--chapter);
}

.chapter--alt { background: var(--paper-2); }
.chapter--flush { padding-bottom: calc(var(--chapter) * .55); }

section[id], main > span[id] { scroll-margin-top: calc(var(--hdr-h) + var(--s-2)); }

/* Aynı zemine sahip ardışık bölümler arasında ince ayraç */
.chapter + .chapter:not(.chapter--alt)::before {
  content: "";
  position: absolute;
  inset: 0 var(--gutter) auto;
  height: 1px;
  background: var(--line-2);
}
.chapter--alt + .chapter--alt::before {
  content: "";
  position: absolute;
  inset: 0 var(--gutter) auto;
  height: 1px;
  background: var(--line-2);
}

.chapter__head {
  max-width: 60ch;
  margin-bottom: clamp(var(--s-6), 6vw, var(--s-9));
}

.chapter__head--split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(var(--s-4), 5vw, var(--s-8));
  align-items: end;
  max-width: none;
}

.chapter__no {
  font-family: var(--f-ui);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-2);
}
.chapter__no--gold { color: var(--gold-ink); }
.chapter__no--aqua { color: var(--aqua-ink); }

.chapter__head .dsp + .lead { margin-top: var(--s-3); }

/* Küçük uyarı / dipnot bloğu */
.note {
  margin-top: clamp(var(--s-4), 4vw, var(--s-6));
  padding: var(--s-3) var(--s-4);
  border-left: 2px solid var(--aqua);
  background: var(--aqua-a);
  border-radius: 0 var(--r-2) var(--r-2) 0;
  font-size: var(--fs-small);
  color: var(--ink-2);
  max-width: 78ch;
}

/* ---------------------------------------------------------- YARDIMCILAR */
.stack   { display: flex; flex-direction: column; gap: var(--s-3); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

/* ------------------------------------------------------------ KIRILMA */
@media (max-width: 900px) {
  .chapter__head--split { grid-template-columns: 1fr; align-items: start; }
}

/* Mobil dock son bloğu örtmesin */
@media (max-width: 860px) {
  .ftr { padding-bottom: calc(var(--s-9) + env(safe-area-inset-bottom, 0px)); }
}
