/* ==========================================================================
   Turkish Waters — retro / minimal personal site
   Monospace, narrow column, slash-nav, light + dark themes.
   ========================================================================== */

:root {
  --bg:      #f6f5f0;
  --fg:      #17140f;
  --muted:   #6c665b;
  --accent:  #b0451f;
  --accent2: #1f5fa8;
  --line:    #ddd7c9;
  --card:    #fffdf8;
  --maxw:    820px;
  --mono: "IBM Plex Mono", "DejaVu Sans Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg:      #100f0d;
  --fg:      #d8d3c7;
  --muted:   #8b8578;
  --accent:  #e07a45;
  --accent2: #6fa8dc;
  --line:    #2a2823;
  --card:    #16150f;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
  transition: background .15s ease, color .15s ease;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--fg); }

h1, h2, h3 { line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.5rem; margin: 0 0 .2rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

code, pre { font-family: var(--mono); background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
code { padding: 1px 5px; font-size: .9em; }
pre { padding: 16px 16px; overflow: auto; }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.brand { display: inline-block; font-weight: 700; font-size: 1.05rem; color: var(--fg); text-decoration: none; white-space: nowrap; line-height: 1; }
.brand:hover { color: var(--accent); }
.brand .sig { color: var(--accent); }
.brand .logo { height: 28px; width: auto; display: inline-block; vertical-align: middle; margin-right: 10px; }
.brand .wordmark { display: inline; }

.menu { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.menu a { color: var(--muted); text-decoration: none; }
.menu a:hover { color: var(--accent); }
.menu a.active { color: var(--fg); text-decoration: underline; }
.theme-toggle { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 2px 4px; }
.theme-toggle:hover { color: var(--accent); }

/* ---------- Page content ---------- */
main { padding: 32px 0 10px; }
.page-intro { margin-bottom: 8px; }
.page-intro p { color: var(--muted); margin: .4rem 0 0; }
.lead { color: var(--muted); }

/* ---------- Post feed ---------- */
.feed { margin: 0; }
.entry { padding: 24px 0; border-bottom: 1px solid var(--line); }
.entry:first-child { padding-top: 12px; }
.entry h2 { margin: 0 0 6px; }
.entry h2 a { color: var(--fg); text-decoration: none; }
.entry h2 a:hover { color: var(--accent); text-decoration: underline; }
.meta { color: var(--muted); font-size: .82rem; margin: 0 0 10px; }
.meta .tag { color: var(--accent); }
.entry p { margin: 0 0 10px; }
.more { font-size: .85rem; }

/* ---------- Category / section index (tab pages) ---------- */
.sections { color: var(--muted); font-size: .85rem; margin: 6px 0 24px; }
.sections .label { color: var(--fg); }
.sections a { color: var(--accent); text-decoration: none; margin-right: 4px; }
.sections a:hover { text-decoration: underline; }

.sections a.on { color: var(--fg); text-decoration: underline; }

.cat { margin-top: 24px; }
.cat > h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 0 0 10px; scroll-margin-top: 16px; }
.cat[hidden] { display: none; }

/* Archive-style rows: date + title on one line, no summaries */
.rows { margin: 0; }
.row { display: flex; gap: 16px; align-items: baseline; padding: 5px 0; }
.row .date { color: var(--muted); font-size: .85rem; white-space: nowrap; min-width: 5.5em; }
.row a { color: var(--fg); text-decoration: none; }
.row a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 520px) {
  .row { flex-direction: column; gap: 0; padding: 8px 0; }
  .row .date { min-width: 0; }
}

/* ---------- Single post page ---------- */
.post-head { margin-bottom: 16px; }
.post-head h1 { font-size: 1.45rem; margin-bottom: 6px; }
.post-head .meta { margin: 0; }
.post-body { margin-top: 6px; }
.post-body h2 { margin: 24px 0 8px; font-size: 1.05rem; }
.post-body p { margin: 0 0 16px; }
.post-body ul, .post-body ol { padding-left: 20px; margin: 0 0 16px; }
.post-body li { margin: 4px 0; }
.post-body blockquote {
  margin: 0 0 16px; padding: 10px 16px;
  border-left: 3px solid var(--accent); background: var(--card); color: var(--muted);
}
.post-nav { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .9rem; }
.note { color: var(--muted); font-size: .85rem; margin-top: 24px; }

/* ---------- Simple prose blocks (about/contact) ---------- */
.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.kv { list-style: none; padding: 0; margin: 0; }
.kv li { margin: 6px 0; }
.kv b { color: var(--fg); }

/* ---------- Form ---------- */
form { margin: 0; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 12px 0 4px; }
input, textarea {
  width: 100%; font-family: var(--mono); font-size: .95rem;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 4px; padding: 8px 11px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
.btn {
  display: inline-block; margin-top: 16px; cursor: pointer;
  font-family: var(--mono); font-size: .9rem; font-weight: 700;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 4px; padding: 8px 16px; text-decoration: none;
}
.btn:hover { background: transparent; color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tagline { color: var(--muted); font-style: italic; }
.site-footer .meta { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .topbar .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .menu { gap: 4px 12px; }
}

/* ---------- Accessibility & motion ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--fg); color: var(--bg);
  padding: 8px 16px; text-decoration: none; font-size: .9rem;
}
.skip-link:focus { left: 8px; top: 8px; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Contact: the email is the primary action */
.email-lead { font-size: 1.25rem; margin: 0 0 8px; }
.email-lead a { text-decoration: underline; text-underline-offset: 3px; }

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