/* =========================================================
   Temel stiller (a02 Palet): sıfırlama, tipografi, odak,
   yerleşim sınıfları, yardımcılar, yazdırma.
   ========================================================= */

/* ---------- Sıfırlama ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* ---------- Tipografi ---------- */
:where(h1, h2, h3, h4, h5, h6) {
  margin: 0 0 0.5em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-4xl);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-2xl);
}

h3 {
  font-size: var(--fs-xl);
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--fs-lg);
  letter-spacing: -0.005em;
}

h5,
h6 {
  font-size: var(--fs-base);
  letter-spacing: 0;
}

:where(p, ul, ol, dl, blockquote, figure, pre, table, address) {
  margin: 0 0 1rem;
}

/* metin akışında başlık öncesi nefes payı */
:where(p, ul, ol, dl, blockquote, pre, table, figure) + :where(h2, h3, h4) {
  margin-top: 1.5em;
}

:where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, blockquote, figure, pre, table, address):last-child {
  margin-bottom: 0;
}

:where(ul, ol) {
  padding-left: 1.4em;
}

:where(ul, ol):not([class]) > li + li {
  margin-top: 0.35em;
}

:where(ul):not([class]) > li::marker {
  color: var(--primary);
}

:where(a) {
  color: var(--primary);
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease), text-decoration-thickness var(--dur-fast) var(--ease);
}

:where(a:hover) {
  color: var(--primary-hover);
  text-decoration-thickness: 0.14em;
}

strong,
b {
  font-weight: 700;
}

small {
  font-size: var(--fs-sm);
}

sup,
sub {
  line-height: 0;
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

address {
  font-style: normal;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code,
kbd {
  padding: 0.1em 0.35em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

pre {
  overflow-x: auto;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

blockquote {
  margin-inline: 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  border-left: 4px solid var(--accent);
  font-size: var(--fs-lg);
}

hr {
  height: 0;
  margin: var(--space-6) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

table {
  border-collapse: collapse;
}

/* ---------- Medya ---------- */
img,
picture,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  flex-shrink: 0;
}

.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ---------- Form öğeleri ---------- */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"],
input[type="range"],
progress {
  accent-color: var(--primary);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  font-weight: 700;
}

textarea {
  resize: vertical;
}

/* ---------- Odak ve seçim ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* yönlendirici başlığa programla odaklanır: halka gerekmez */
:where(h1, h2, h3)[tabindex="-1"]:focus {
  outline: none;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------- Yerleşim ---------- */
.container,
.container-narrow {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.container-narrow {
  width: min(var(--container-narrow), 100% - 2 * var(--gutter));
}

/* iç içe kullanımda ikinci kez kenar boşluğu ekleme */
:is(.container, .container-narrow) .container-narrow {
  width: min(var(--container-narrow), 100%);
}

.section {
  padding-block: clamp(3rem, 2rem + 4vw, 6rem);
}

.section-tight {
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.section-alt {
  background: var(--bg-alt);
}

/* .stack: dikey akış (alt öğeler doğal genişliğini korur) */
.stack,
.stack-sm,
.stack-lg {
  --stack-gap: var(--space-4);
}

.stack-sm {
  --stack-gap: var(--space-2);
}

.stack-lg {
  --stack-gap: var(--space-6);
}

:is(.stack, .stack-sm, .stack-lg) > * {
  margin-block: 0;
}

:is(.stack, .stack-sm, .stack-lg) > * + * {
  margin-block-start: var(--stack-gap);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.grid,
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--space-5);
}

.grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.grid-2,
.grid-3,
.grid-4 {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(var(--space-6), 4vw, var(--space-8));
  }
}

/* ---------- Yardımcılar ---------- */
.text-center {
  text-align: center;
}

.text-start {
  text-align: start;
}

.text-center .lead,
.lead.text-center {
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

.small {
  font-size: var(--fs-sm);
}

.lead {
  max-width: 65ch;
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--muted);
}

.nowrap {
  white-space: nowrap;
}

.mx-auto {
  margin-inline: auto;
}

.mt-0 {
  margin-top: 0 !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.w-full {
  width: 100%;
}

/* ---------- Hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Yazdırma ---------- */
@media print {
  :root,
  :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #fff;
    --bg-alt: #fff;
    --surface: #fff;
    --surface-2: #f3f3f3;
    --text: #000;
    --muted: #333;
    --border: #bbb;
    --border-strong: #777;
    --primary: #1f6b3a;
    --primary-hover: #1f6b3a;
    --on-primary: #fff;
    --accent: #b8f04a;
    --on-accent: #000;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  :where(a) {
    color: #000;
  }

  :where(a[href^="http"]):not(.btn)::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
    word-break: break-all;
  }

  .section,
  .section-tight {
    padding-block: 1rem;
  }

  img,
  figure,
  tr,
  pre,
  blockquote {
    break-inside: avoid;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }
}
