/* ============================================
   Gizem Güleç Mimarlık — base styles
   Warm editorial system, tweakable via CSS vars
   ============================================ */

:root {
  /* Theme: cream (default) */
  --bg: #F2EDE3;
  --bg-alt: #ECE5D6;
  --fg: #1B1815;
  --muted: #6B6358;
  --line: rgba(27, 24, 21, 0.16);
  --line-soft: rgba(27, 24, 21, 0.08);
  --accent: #A0763A;
  --card: #E8E0CE;

  /* Type pair: editorial (default) */
  --font-display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --font-body: "Geist", "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Scale */
  --display-tight: 0.92;
  --body-tight: 1.45;
}

/* Theme: bone */
[data-theme="bone"] {
  --bg: #FBFAF6;
  --bg-alt: #F2F0E9;
  --fg: #14130F;
  --muted: #6F6A60;
  --line: rgba(20, 19, 15, 0.14);
  --line-soft: rgba(20, 19, 15, 0.06);
  --accent: #5B5A3E;
  --card: #ECE9DE;
}

/* Theme: ink (dark) */
[data-theme="ink"] {
  --bg: #14110D;
  --bg-alt: #1B1814;
  --fg: #EFE8D8;
  --muted: #8A8275;
  --line: rgba(239, 232, 216, 0.16);
  --line-soft: rgba(239, 232, 216, 0.08);
  --accent: #C89B5F;
  --card: #221E18;
}

/* Theme: stone */
[data-theme="stone"] {
  --bg: #E6E2DA;
  --bg-alt: #DAD5C9;
  --fg: #2A2823;
  --muted: #6D6759;
  --line: rgba(42, 40, 35, 0.18);
  --line-soft: rgba(42, 40, 35, 0.08);
  --accent: #3C5B47;
  --card: #DBD5C4;
}

/* Type pair: modern */
[data-type="modern"] {
  --font-display: "Geist", "Inter", system-ui, sans-serif;
  --font-body: "Geist", "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --display-tight: 0.95;
}

/* Type pair: classic */
[data-type="classic"] {
  --font-display: "Cormorant Garamond", "Instrument Serif", Georgia, serif;
  --font-body: "Newsreader", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --display-tight: 0.95;
}

/* Type pair: brutalist */
[data-type="brutalist"] {
  --font-display: "Geist Mono", ui-monospace, monospace;
  --font-body: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --display-tight: 1.0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: var(--body-tight);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 240ms ease, color 240ms ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button, input, textarea { max-width: 100%; }
img, svg, canvas, video { display: block; max-width: 100%; }

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

/* Typography helpers */
.t-display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--display-tight);
  letter-spacing: -0.015em;
}
.t-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.t-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.t-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Layout shells */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Grid/flex öğelerinin varsayılan min-width:auto değeri, geniş içeriğin
   (ör. yatay kayan şerit) tüm sayfayı germesine yol açıyor. */
.app-shell > * {
  min-width: 0;
}

/* Reusable */
.divider {
  height: 1px; background: var(--line); border: 0;
}
.divider-soft { height: 1px; background: var(--line-soft); border: 0; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.tag[data-active="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* Placeholder image */
.ph {
  position: relative;
  overflow: hidden;
  background: var(--card);
}
.ph-meta {
  position: absolute;
  left: 12px; bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.55;
  z-index: 1;
}

/* Page enter animation */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.page-in { animation: pageIn 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@keyframes lineIn {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Scroll behavior */
html { scroll-behavior: smooth; }

@supports not (overflow: clip) {
  html, body { overflow-x: hidden; }
}

/* Mobile guardrails: keep the site as one vertical canvas, no sideways drift. */
@media (max-width: 760px) {
  html,
  body,
  #root {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 14px;
  }

  .app-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding-left: 0 !important;
  }

  main,
  article,
  section,
  header,
  footer,
  .page-in {
    max-width: 100vw;
  }

  main,
  article,
  .page-in {
    overflow-x: clip;
  }

  .page-in > header,
  .page-in > section,
  .page-in > div,
  article > header,
  article > section,
  article > nav,
  article > div,
  footer {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  header[style*="position: sticky"] > div {
    padding: 14px 18px !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
  }

  header[style*="position: sticky"] nav {
    width: 100%;
    order: 3;
    justify-content: space-between;
    gap: 10px !important;
  }

  header[style*="position: sticky"] > div > div:last-child {
    display: none !important;
  }

  header[style*="position: fixed"] {
    left: 18px !important;
    right: 18px !important;
  }

  header[style*="position: fixed"] + div[style*="position: fixed"] {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  aside[style*="position: fixed"] {
    max-width: 100vw !important;
  }

  .page-in [style*="grid-template-columns"],
  article [style*="grid-template-columns"],
  footer [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .page-in [style*="display: flex"],
  article [style*="display: flex"],
  footer [style*="display: flex"] {
    flex-wrap: wrap !important;
  }

  .page-in h1.t-display,
  article h1.t-display {
    font-size: clamp(42px, 14vw, 72px) !important;
    line-height: 0.98 !important;
    overflow-wrap: anywhere;
  }

  .page-in p,
  article p {
    max-width: 100%;
  }

  .tag {
    white-space: normal;
  }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
