:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #e6e2da;
  --accent: #1f5f6b;
  --accent-ink: #ffffff;
  --accent-soft: #e3eef0;
  --warn-soft: #fbf1dc;
  --warn-ink: #7a5410;
  --danger: #a33a2c;
  --ok-soft: #e4f2e6;
  --ok-ink: #24613a;
  --err-soft: #f9e3df;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1c1d20;
    --ink: #ecebe8;
    --muted: #9d9ca2;
    --line: #2e2f33;
    --accent: #7cc0cc;
    --accent-ink: #0d1f22;
    --accent-soft: #1d3236;
    --warn-soft: #3a2f17;
    --warn-ink: #f0cd85;
    --danger: #ec8a7c;
    --ok-soft: #1b3122;
    --ok-ink: #9bd8ad;
    --err-soft: #3d221e;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: 1.45rem; margin-top: 2.2rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 2rem; padding-bottom: 4rem; }
.narrow { max-width: 440px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.inline { display: inline; margin: 0; }
.empty { color: var(--muted); padding: 2rem 0; }

/* ---- Header ---- */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); text-decoration: none; margin-right: auto; }
.nav, .account { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav a, .account a, .linklike {
  color: var(--muted); text-decoration: none; padding: .35rem .6rem; border-radius: 6px; font-size: .95rem;
}
.nav a:hover, .account a:hover, .linklike:hover { color: var(--ink); background: var(--bg); }
.nav a.active, .account a.active { color: var(--ink); font-weight: 600; }
.account .btn { color: var(--accent-ink); }
.account .btn:hover { color: var(--accent-ink); background: var(--accent); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; }
@media (max-width: 720px) {
  .header-inner { gap: .25rem; }
  .brand { width: 100%; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; margin: 0 -.6rem; }
  .account { margin-left: auto; }
  .site-header { position: static; }
}

.badge { display: inline-block; min-width: 1.3em; padding: 0 .4em; border-radius: 99px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.5; }

/* ---- Buttons & forms ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  padding: .6rem 1.1rem; border-radius: 8px; font: 600 .95rem var(--sans);
  text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); border-color: currentColor; }
.btn-block { width: 100%; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.5rem; }

label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 1rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  display: block; width: 100%; margin-top: .35rem;
  padding: .6rem .7rem; font: 400 1rem var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92rem; }
input[type=file] { margin-top: .5rem; font-size: .9rem; max-width: 100%; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin-bottom: .6rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 600; font-size: .92rem; padding: 0 .4rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.thumb { display: block; max-width: 160px; max-height: 120px; border-radius: 8px; margin-bottom: .6rem; object-fit: cover; }
.thumb.round { width: 96px; height: 96px; border-radius: 50%; }

.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; }
@media (max-width: 480px) { .form-card { padding: 1.25rem; } }
.note { background: var(--warn-soft); color: var(--warn-ink); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; }
.flash ul { margin: 0; padding-left: 1.2rem; }
.flash-ok { background: var(--ok-soft); color: var(--ok-ink); }
.flash-err { background: var(--err-soft); color: var(--danger); }

/* ---- Home ---- */
.hero { display: flex; gap: 2rem; align-items: flex-start; padding: 1rem 0 1.5rem; }
.hero-photo { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 4px solid var(--surface); box-shadow: 0 1px 0 var(--line); }
.tagline { font-size: 1.15rem; color: var(--muted); margin-top: -.2rem; }
.about { max-width: 65ch; }
.hero-links { display: flex; gap: 1.25rem; flex-wrap: wrap; font-weight: 600; }
.hero-links a { text-decoration: none; }
@media (max-width: 640px) { .hero { flex-direction: column; gap: 1rem; } .hero-photo { width: 110px; height: 110px; } }

.section-head, .page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { margin-bottom: .8rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: .2rem; }
.home-section { border-top: 1px solid var(--line); margin-top: 2.5rem; }

.cta { margin-top: 3rem; padding: 1.5rem; border-radius: var(--radius); background: var(--accent-soft); display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta h2 { margin: 0 0 .3rem; }
.cta p { margin: 0; }
.cta-actions { display: flex; gap: .6rem; }

/* ---- Entries ---- */
.subtitle { color: var(--muted); margin-bottom: .4rem; }
.summary { margin-bottom: .4rem; }
.meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.tag { display: inline-block; font: 600 .72rem var(--sans); letter-spacing: .02em; padding: .12rem .5rem; border-radius: 99px; vertical-align: middle; }
.tag-members { background: var(--warn-soft); color: var(--warn-ink); }
.tag-members::before { content: "🔒 "; }
.tag-draft { background: var(--line); color: var(--muted); }
.tag-public { background: var(--accent-soft); color: var(--accent); }

/* timeline (ozgecmis) */
.entries-timeline { border-left: 2px solid var(--line); margin-left: .4rem; }
.tl-item { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: 0 0 1.75rem 1.5rem; }
.tl-item::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-period { color: var(--muted); font-size: .9rem; padding-top: .15rem; }
.tl-body h3 { margin-bottom: .2rem; }
@media (max-width: 640px) { .tl-item { grid-template-columns: 1fr; gap: .1rem; } }

/* list (yayinlar) */
.pub { display: grid; grid-template-columns: 70px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-year { font-family: var(--serif); font-size: 1.05rem; color: var(--muted); padding-top: .1rem; }
.pub h3 { margin-bottom: .2rem; font-size: 1.08rem; }
.pub h3 a { color: var(--ink); text-decoration: none; }
.pub h3 a:hover { color: var(--accent); }
.pub-links { display: flex; gap: 1rem; font-size: .9rem; margin: 0; }
@media (max-width: 520px) { .pub { grid-template-columns: 1fr; gap: 0; } }

/* cards / grid */
.entries-cards, .entries-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.entries-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img { display: block; aspect-ratio: 16 / 10; background: var(--bg); }
.entries-grid .card-img { aspect-ratio: 1 / 1; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-locked { display: grid; place-items: center; font-size: 2rem; text-decoration: none; background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 10px, var(--surface) 10px, var(--surface) 20px); }
.card-body { padding: 1rem 1.1rem 1.1rem; }
.card h3 { margin-bottom: .25rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.locked .summary { display: none; }

/* ---- Detail ---- */
.detail { max-width: 720px; }
.crumb { font-size: .9rem; margin-bottom: 1.25rem; }
.crumb a { text-decoration: none; }
.lead { font-size: 1.1rem; }
.detail-img { margin: 1.5rem 0; }
.detail-img img { border-radius: var(--radius); display: block; }
.admin-inline { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px dashed var(--line); font-size: .9rem; }

.prose { max-width: 70ch; }
.prose img { border-radius: 8px; }
.prose pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); padding: 1rem; border-radius: 8px; }
.prose code { font-size: .9em; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .6rem; }

.center-card { text-align: center; padding-top: 2rem; }
.center-card .actions { justify-content: center; }
.lock-icon { font-size: 2.6rem; margin-bottom: .5rem; }
.err-code { font-family: var(--serif); font-size: 3.5rem; color: var(--muted); margin: 0; line-height: 1; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0 0 1.5rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Admin ---- */
.subnav { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.75rem; padding-bottom: .5rem; }
.subnav a, .filters a { padding: .35rem .7rem; border-radius: 6px; text-decoration: none; color: var(--muted); font-size: .92rem; }
.subnav a.active, .filters a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.filters { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.stat:hover { border-color: var(--accent); }
.stat-label { font-size: .85rem; color: var(--muted); }
.stat-value { font: 600 2rem var(--serif); }
.stat-sub { font-size: .75rem; color: var(--muted); }
.quick-add { display: flex; gap: .5rem; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; white-space: nowrap; }
.status { font-size: .8rem; font-weight: 600; }
.status-pending { color: var(--warn-ink); }
.status-active { color: var(--ok-ink); }
.status-disabled { color: var(--muted); }
.admin-form { max-width: 820px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .85rem; }
