/* ------------------------------------------------------------------
   toprakkilic.com: a personal site
   Plain, fast, text-first. Inspired by the old personal web.
   Edit src/ + this file; run the build (see MAINTENANCE.md).
   ------------------------------------------------------------------ */

:root {
  --bg:        #fdfdfa;
  --fg:        #1b1b17;
  --muted:     #6c6c61;
  --faint:     #87877b;
  --line:      #e7e6db;
  --accent:    #8c3b3b;
  --accent-bg: #f4ecec;
  /* Two roles, applied only via these vars; never hardcode a family.
     --serif: reading text (body, h1/h3, nav, prose)
     --mono:  structure & data (h2 labels, meta, code, tables, captions) */
  --serif: Charter, "Bitstream Charter", Cambria, Georgia,
           "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
  --w: 38rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* ---- header / nav ---- */
header {
  max-width: var(--w);
  margin: 0 auto;
  padding: 52px 24px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 22px;
}

a.site-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  border: 0;
}
a.site-name:hover { color: var(--accent); }

nav {
  font-size: 16px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  border: 0;
}
nav a:hover { color: var(--accent); }
nav a[aria-current="page"] { color: var(--fg); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 44px;
}
header + hr { max-width: var(--w); margin-left: auto; margin-right: auto; }

/* ---- typography ---- */
h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 12px 0 6px;
}
h2 {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin: 48px 0 14px;
}
h3 { font-size: 19px; font-weight: 700; margin: 32px 0 8px; }

.lede {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.6;
  margin: 0 0 30px;
}
.updated {
  color: var(--faint);
  font-size: 14px;
  font-family: var(--mono);
  margin: -18px 0 36px;
}

p { margin: 0 0 20px; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
a:hover { border-bottom-color: var(--accent); }

small, .muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 15px; }
code, .kbd {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--accent-bg);
  padding: 1px 5px;
  border-radius: 3px;
}

.elsewhere { color: var(--muted); margin-top: 8px; }

/* ---- tables (radio station, etc.) ---- */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
  margin: 10px 0 24px;
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--faint);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
table.data td.mono { font-family: var(--mono); font-size: 15px; }
table.data td.nowrap { white-space: nowrap; }

/* blog index list */
table.data.posts td { padding-top: 14px; padding-bottom: 14px; }
table.data.posts td a { font-weight: 700; }
table.data.posts .faint { display: block; margin-top: 2px; }

/* ---- photo grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 16px;
}
.grid figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--line);
  cursor: zoom-in;
}
.grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.grid img.in { opacity: 1; }

/* ---- lightbox ---- */
#lb {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 16, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  cursor: zoom-out;
}
#lb.on { display: flex; }
#lb img {
  max-width: 92vw;
  max-height: 85vh;
  object-fit: contain;
}
#lb .cap {
  position: absolute;
  bottom: 22px;
  left: 0; right: 0;
  text-align: center;
  color: #d8d8d0;
  font-family: var(--mono);
  font-size: 13px;
  padding: 0 20px;
}
#lb .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: #cfcfc6;
  font-size: 32px;
  padding: 16px;
  cursor: pointer;
}
#lb .nav-btn:hover { color: #fff; }
#lb .prev { left: 6px; }
#lb .next { right: 6px; }

/* ---- writing / blog post ---- */
.post-meta {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--faint);
  margin: 0 0 32px;
}
article p { margin: 0 0 22px; }
article h2 { margin-top: 44px; }
article ul, article ol { margin: 0 0 22px; padding-left: 24px; }
article li { padding: 4px 0; }

article blockquote {
  margin: 26px 0;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

article pre {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  background: var(--accent-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 22px;
}
article pre code { background: none; padding: 0; font-size: inherit; }

article figure { margin: 28px 0; }
article figure img { width: 100%; display: block; }
article figcaption {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  margin-top: 7px;
}

.post-nav {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 16px;
}
.post-nav a { color: var(--muted); border: 0; }
.post-nav a:hover { color: var(--accent); }

/* ---- footer ---- */
footer {
  max-width: var(--w);
  margin: 72px auto 40px;
  padding: 22px 24px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
footer a { color: var(--muted); border: 0; }
footer a:hover { color: var(--accent); }

@media (max-width: 620px) {
  body { font-size: 18px; }
  header { padding-top: 36px; }
  h1 { font-size: 26px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
