/* Dünyaya Dair — server-rendered pages (notes, projects, archive). Mirrors the main site's design. */
:root {
  --ink: #1e3033; --text: #3a514b; --muted: #7c8f8c; --line: #dfe7e3; --paper: #fafcf8; --canvas: #f6f7f5;
  --night: #162a2e; --night-2: #12272a; --turq: #57c9bf; --accent: #0b918c; --serif: Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --display: Manrope, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--turq); outline-offset: 3px; }
.page-container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Reading progress: pure CSS (scroll-driven animation), no JavaScript. */
.page-progress { position: fixed; inset: 0 0 auto; height: 2px; background: var(--turq); transform-origin: left; transform: scaleX(0); z-index: 50; pointer-events: none; }
@supports (animation-timeline: scroll()) {
  .page-progress { animation: page-progress linear both; animation-timeline: scroll(root); }
  @keyframes page-progress { to { transform: scaleX(1); } }
}

/* Header: same as the main site */
.page-header { background: #fff; border-bottom: 1px solid #e5eae7; position: relative; z-index: 20; }
.page-header-inner { min-height: 84px; display: flex; align-items: center; gap: 28px; }
.page-logo img { display: block; width: 200px; height: 80px; object-fit: contain; }
.page-nav { display: flex; gap: clamp(14px, 2vw, 30px); margin-left: auto; align-items: center; }
.page-nav a { font-size: 12.5px; font-weight: 700; color: #4e5c5e; text-decoration: none; white-space: nowrap; transition: color .2s; }
.page-nav a:hover, .page-nav a[aria-current="page"] { color: #079b92; }
.page-lang-slot { flex: none; }
.page-lang { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #4e5c5e; }
.page-lang select { font: inherit; font-size: 13px; color: inherit; background: transparent; border: 1px solid rgba(128,145,152,.4); border-radius: 9px; padding: 8px; max-width: 150px; }

/* Title band: dark like the hero */
.page-hero { background: var(--night); color: #f0f6f2; position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 50% 70% at 92% 0%, rgba(30,112,108,.28), transparent 70%), radial-gradient(ellipse 45% 60% at 0% 110%, rgba(17,94,92,.25), transparent 70%); }
.page-hero-inner { position: relative; padding: 46px 0 52px; }
.page-crumbs { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700; color: #7bcac2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-crumbs a { color: #a9d9d2; text-decoration: none; }
.page-crumbs a:hover { color: #fff; }
.page-crumbs span[aria-hidden] { color: #4f8f88; }
.page-hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 5vw, 58px); line-height: 1.12; letter-spacing: -.035em; margin: 22px 0 0; max-width: 900px; overflow-wrap: anywhere; }
.page-hero-meta { display: none; flex-wrap: wrap; gap: 6px 12px; margin: 16px 0 0; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: #9fd3cb; }
.page-hero .page-lead { color: #c7d6d4; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.75; max-width: 760px; margin: 18px 0 0; }

/* Reading layout: quiet facts in the margin, text in a comfortable column */
.page-body { background: var(--paper); }
.reading { display: grid; grid-template-columns: 190px minmax(0, 700px); gap: clamp(32px, 6vw, 90px); justify-content: center; padding: 58px 0 70px; }
.reading-meta { font-size: 12px; color: var(--muted); line-height: 1.6; }
.reading-meta-sticky { position: sticky; top: 28px; display: grid; gap: 14px; padding-top: 6px; border-top: 1px solid var(--line); }
.reading-meta dt { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: #9aaba7; }
.reading-meta dd { margin: 2px 0 0; color: #5f7470; }
.reading-meta-inline { display: none; }
.prose { font-size: 17px; line-height: 1.9; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-translation-status, .project-translation-status { display: block; margin-top: 14px; font-size: 12px; color: var(--muted); }
.page-hero .project-translation-status { color: #9fbdb8; }
.cover { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; border-radius: 14px; margin: 0 0 34px; background: #e7eeeb; }
.external-link { display: inline-flex; gap: 8px; margin-top: 26px; font-weight: 700; font-size: 14px; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 3px; }

/* End of article */
.article-end { margin-top: 54px; padding-top: 30px; border-top: 1px solid var(--line); display: grid; gap: 34px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share-label { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: #9aaba7; margin-right: 6px; }
.share a, .share button { font: 600 12px var(--sans); color: #2c4c4a; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; text-decoration: none; cursor: pointer; transition: border-color .2s, color .2s, transform .2s; }
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: grid; gap: 6px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.pager a:hover { border-color: #9fd9d1; transform: translateY(-2px); }
.pager small { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: #9aaba7; }
.pager strong { font-family: var(--display); font-size: 15px; line-height: 1.4; }
.pager .next { text-align: right; grid-column: 2; }
.related h2, .comments h2 { font-family: var(--display); font-size: 20px; letter-spacing: -.02em; margin: 0 0 14px; color: var(--ink); }
.related ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.related li { border-bottom: 1px solid var(--line); }
.related a { display: flex; justify-content: space-between; gap: 18px; padding: 14px 2px; text-decoration: none; color: var(--ink); font-weight: 600; }
.related a:hover { color: var(--accent); }
.related time, .related small { color: var(--muted); font-weight: 400; font-size: 12px; white-space: nowrap; }

/* Comments */
.comments { margin-top: 10px; }
.comment { border-top: 1px solid var(--line); padding: 16px 0; }
.comment strong { color: var(--ink); }
.comment small { color: var(--muted); }
.comment .prose { font-size: 15px; margin-top: 6px; }
.form-field { display: grid; gap: 6px; margin: 14px 0; font-size: 13px; font-weight: 600; color: #3f5b57; }
.form-field input, .form-field textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #cfdcd7; background: #fff; color: var(--ink); font: 400 15px var(--sans); }
.btn { display: inline-flex; align-items: center; gap: 10px; border: 0; padding: 13px 20px; border-radius: 10px; background: #18363a; color: #fff; font: 700 13px var(--sans); cursor: pointer; transition: background .2s, transform .2s; }
.btn:hover { background: #167e7c; transform: translateY(-1px); }

/* Archive listings */
.listing { padding: 50px 0 80px; display: grid; gap: 16px; max-width: 860px; margin: 0 auto; }
.listing-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; transition: border-color .2s, transform .25s; }
.listing-card:hover { border-color: #9fd9d1; transform: translateY(-2px); }
.listing-meta { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: #8aa19c; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.listing-card h2 { font-family: var(--display); font-size: clamp(20px, 2.2vw, 25px); letter-spacing: -.02em; line-height: 1.3; margin: 10px 0 10px; }
.listing-card h2 a { color: var(--ink); text-decoration: none; }
.listing-card h2 a:hover { color: var(--accent); }
.listing-card .prose { font-size: 15px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700; text-decoration: none; }
.pagination { display: flex; justify-content: space-between; margin-top: 10px; font-weight: 700; font-size: 14px; }

/* Footer: same as the main site */
.page-footer { background: var(--night-2); color: #879e99; padding: 30px 0; }
.page-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.page-footer-brand { color: #ecf2ee; text-decoration: none; font: 800 18px var(--display); letter-spacing: -.8px; }
.page-footer-brand span { color: #3fbbaa; }
.page-footer p { margin: 5px 0 0; font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase; }
.page-footer small { font-size: 11px; }
.page-footer a.to-top { color: #879e99; font-size: 12px; font-weight: 700; text-decoration: none; }
.page-footer a.to-top:hover { color: #88e2d7; }

@media (max-width: 1120px) {
  .page-header-inner { flex-wrap: wrap; gap: 6px 18px; padding: 10px 0; min-height: 0; }
  .page-logo img { width: 150px; height: 60px; }
  .page-lang-slot { margin-left: auto; }
  .page-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; gap: 20px; }
  .page-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 980px) {
  .reading { grid-template-columns: minmax(0, 1fr); padding: 34px 0 56px; gap: 0; }
  .reading-meta { display: none; }
  .page-hero-meta { display: flex; }
  .reading-meta-inline { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin: 0 0 22px; }
  .prose { font-size: 16px; line-height: 1.85; }
}
@media (max-width: 560px) {
  .page-container { width: calc(100% - 32px); }
  .page-lang select { max-width: 116px; }
  .page-hero-inner { padding: 32px 0 38px; }
  .page-crumbs > :last-child, .page-crumbs > span[aria-hidden]:nth-last-child(2) { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .listing-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Yollardan Kalanlar: a dark exhibition room with printed photos ---------- */
.archive-room { background: #152427; color: #eef5f3; padding: 54px 0 80px; border-top: 1px solid #23393d; }
.archive-summary { margin: 0 0 34px; font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700; color: #72d5cf; }
.archive-empty { color: #a9c2be; font-size: 16px; margin: 0; }
.archive-fans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 46px 28px; }
.archive-fan { display: grid; justify-items: center; text-align: center; color: inherit; text-decoration: none; padding: 10px 0; }
.archive-stack { position: relative; width: 168px; height: 214px; margin-bottom: 22px; }
.archive-print { position: absolute; inset: 0; background: #f4f1ea; padding: 8px 8px 26px; border-radius: 2px; box-shadow: 0 14px 30px rgba(0,0,0,.35); transition: transform .55s cubic-bezier(.2,.8,.2,1), filter .55s; }
.archive-print img { display: block; width: 100%; height: 100%; object-fit: cover; background: #29403f center / cover no-repeat; }
.archive-print.back-left { transform: rotate(-7deg) translateX(-6px); filter: brightness(.82); }
.archive-print.back-right { transform: rotate(6deg) translateX(6px); filter: brightness(.82); }
.archive-print.front { transform: rotate(-1deg); }
.archive-fan:hover .back-left, .archive-fan:focus-visible .back-left { transform: rotate(-16deg) translate(-52px, 6px); filter: none; }
.archive-fan:hover .back-right, .archive-fan:focus-visible .back-right { transform: rotate(15deg) translate(52px, 6px); filter: none; }
.archive-fan:hover .front, .archive-fan:focus-visible .front { transform: rotate(0) translateY(-6px) scale(1.04); }
.archive-fan:focus-visible { outline: 2px solid #72d5cf; outline-offset: 8px; border-radius: 6px; }
.archive-name { font-family: var(--serif); font-size: 21px; color: #f2f7f5; }
.archive-rule { width: 28px; height: 1px; background: #57c9bf; margin: 9px auto; }
.archive-count { font-size: 12px; color: #9fbab6; }
.archive-coords { display: inline-block; margin-top: 8px; font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 10.5px; letter-spacing: .8px; color: #8fe0d6; border: 1px solid rgba(114,213,207,.35); border-radius: 3px; padding: 2px 7px; }

/* Country gallery: photos keep their proportions, printed on white */
.archive-gallery { columns: 3 280px; column-gap: 22px; }
.archive-photo { break-inside: avoid; margin: 0 0 26px; }
.archive-photo a { display: block; background: #f4f1ea; padding: 8px 8px 10px; border-radius: 2px; box-shadow: 0 12px 26px rgba(0,0,0,.32); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.archive-photo a:hover { transform: translateY(-4px) rotate(-.4deg); }
.archive-photo img { display: block; width: 100%; height: auto; background: #29403f center / cover no-repeat; }
.archive-photo figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 2px 0; font-size: 13px; color: #c9dad7; line-height: 1.5; }
.archive-photo figcaption .archive-place, .archive-photo figcaption time { color: #8fb0ab; font-size: 12px; }
.archive-photo figcaption .archive-coords { margin-top: 2px; }
.archive-others { margin-top: 40px; border-top: 1px solid #2a4246; padding-top: 26px; }
.archive-others h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0 0 12px; color: #f2f7f5; }
.archive-others ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.archive-others a { display: inline-flex; gap: 8px; align-items: baseline; padding: 9px 14px; border: 1px solid #2f4b4f; border-radius: 999px; color: #e3efec; text-decoration: none; }
.archive-others a:hover { border-color: #72d5cf; }
.archive-others small { color: #8fb0ab; }
.archive-room .read-more { color: #72d5cf; }

/* Full-screen viewer */
.lightbox { position: fixed; inset: 0; z-index: 9900; display: grid; grid-template-rows: auto 1fr auto; background: rgba(6,14,16,.96); color: #e9f2ef; animation: lightbox-in .3s ease-out; }
.lightbox.is-closing { opacity: 0; transition: opacity .25s; }
@keyframes lightbox-in { from { opacity: 0; } }
.lightbox-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 13px; color: #9fbdb8; }
.lightbox-top button, .lightbox-nav { background: transparent; color: #e9f2ef; border: 1px solid rgba(114,213,207,.4); border-radius: 50%; width: 42px; height: 42px; font-size: 20px; cursor: pointer; }
.lightbox-top button:hover, .lightbox-nav:hover { background: rgba(114,213,207,.14); }
.lightbox-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 64px; }
.lightbox-stage img { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; border: 8px solid #f4f1ea; border-radius: 2px; background: #29403f center / cover no-repeat; transition: opacity .25s; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 12px; } .lightbox-nav.next { right: 12px; }
.lightbox-bar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; justify-content: center; padding: 14px 18px 18px; border-top: 1px solid rgba(114,213,207,.18); font-size: 14px; }
.lightbox-bar .muted { color: #9fbdb8; font-size: 13px; }
@media (max-width: 700px) {
  .archive-fans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 10px; }
  .archive-stack { width: 124px; height: 160px; }
  .archive-fan:hover .back-left { transform: rotate(-14deg) translate(-30px, 6px); }
  .archive-fan:hover .back-right { transform: rotate(13deg) translate(30px, 6px); }
  .archive-gallery { columns: 2; column-gap: 12px; }
  .archive-photo figcaption { font-size: 12px; }
  .lightbox-stage { padding: 0 8px; }
  .lightbox-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .archive-print, .archive-photo a, .lightbox, .lightbox-stage img { transition: none !important; }
}

/* ---------- Day / night switch (same component as the home page) ---------- */
.page-lang-slot { display: flex; align-items: center; gap: 12px; }
.theme-toggle { position: relative; flex: none; width: 58px; height: 28px; padding: 0 7px; border-radius: 999px; border: 1px solid rgba(114,213,207,.38); background: #1b3134; color: #8fb3ad; display: inline-flex; align-items: center; justify-content: space-between; cursor: pointer; transition: border-color .3s, background .3s; }
.theme-toggle:hover { border-color: #72d5cf; }
.theme-toggle-icon { display: flex; opacity: .75; }
.theme-toggle-knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #f3f7f5; color: #c58a1a; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .45s cubic-bezier(.3,1.35,.5,1), background .3s, color .3s; }
.theme-toggle.is-night { background: #121e20; border-color: rgba(216,180,106,.5); }
.theme-toggle.is-night .theme-toggle-knob { transform: translateX(30px); background: #d8b46a; color: #14211f; }
.logo-night { display: none !important; }
html[data-theme="dark"] .logo-day { display: none !important; }
html[data-theme="dark"] .logo-night { display: block !important; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal .75s cubic-bezier(.4,0,.2,1); }
@keyframes theme-reveal { from { clip-path: circle(0 at var(--theme-x, 100%) var(--theme-y, 0)); } to { clip-path: circle(var(--theme-r, 150vmax) at var(--theme-x, 100%) var(--theme-y, 0)); } }

/* ---------- Night: ink paper, hairline outlines, brass accents, graticule behind the text ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9f1ef; --text: #c9d8d4; --muted: #8aa39e; --line: rgba(114,213,207,.16); --paper: #0f1a1d; --canvas: #0c1416;
  --night: #0b1517; --night-2: #070d0f; --accent: #5fd6c8; --brass: #d8b46a; --brass-hair: rgba(216,180,106,.42);
}
html[data-theme="dark"] ::selection { background: #d8b46a; color: #14211f; }
html[data-theme="dark"] .page-progress { background: var(--brass); }
html[data-theme="dark"] .page-header { background: rgba(12,20,22,.97); border-bottom-color: rgba(114,213,207,.18); }
html[data-theme="dark"] .page-nav a, html[data-theme="dark"] .page-lang { color: #b9cbc7; }
html[data-theme="dark"] .page-nav a:hover, html[data-theme="dark"] .page-nav a[aria-current="page"] { color: var(--brass); }
html[data-theme="dark"] .page-lang select { border-color: rgba(114,213,207,.34); }
html[data-theme="dark"] .page-lang select option { background: #101b1e; color: #e3ece9; }
html[data-theme="dark"] .page-body { background-color: var(--paper); background-image: linear-gradient(rgba(114,213,207,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(114,213,207,.04) 1px, transparent 1px); background-size: 56px 56px; }
html[data-theme="dark"] .page-hero { border-bottom: 1px solid rgba(216,180,106,.22); }
html[data-theme="dark"] .reading-meta-sticky { border-top-color: var(--brass-hair); }
html[data-theme="dark"] .reading-meta dt { color: var(--brass); }
html[data-theme="dark"] .reading-meta dd { color: #a6bbb6; }
html[data-theme="dark"] .cover { background: #152326; border-radius: 4px; border: 1px solid var(--brass-hair); filter: brightness(.9); }
html[data-theme="dark"] .article-end { border-top-color: var(--brass-hair); }
html[data-theme="dark"] :is(.share a, .share button) { background: transparent; color: #cfe0dc; border-color: rgba(114,213,207,.3); }
html[data-theme="dark"] :is(.share a, .share button):hover { border-color: var(--brass); color: var(--brass); }
html[data-theme="dark"] .pager a, html[data-theme="dark"] .listing-card { background: #101b1e; border-radius: 4px; }
html[data-theme="dark"] .pager a:hover, html[data-theme="dark"] .listing-card:hover { border-color: var(--brass-hair); }
html[data-theme="dark"] .listing-card { border-left: 2px solid var(--brass); }
html[data-theme="dark"] .listing-meta { color: var(--brass); }
html[data-theme="dark"] :is(.related a:hover, .listing-card h2 a:hover) { color: var(--brass); }
html[data-theme="dark"] :is(.form-field input, .form-field textarea) { background: #0c1416; color: var(--ink); border-color: rgba(114,213,207,.3); border-radius: 4px; }
html[data-theme="dark"] .btn { background: transparent; color: #ead6a6; border: 1px solid var(--brass-hair); border-radius: 4px; }
html[data-theme="dark"] .btn:hover { background: var(--brass); color: #14211f; }
html[data-theme="dark"] .archive-room { background-color: #0c1416; background-image: linear-gradient(rgba(114,213,207,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(114,213,207,.045) 1px, transparent 1px); background-size: 56px 56px; }
