/* ── TOKENS ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap');

.full-bleed {
  width: 95vw;
  margin-left: calc(50% - 47.5vw);
  margin-right: calc(50% - 47.5vw);
}

:root {
  --max-width: 860px;
  --accent: #b5451b;        /* warm terracotta */
  --accent2: #d4622e;
  --bg: #faf9f7;            /* warm off-white */
  --bg2: #f2f0ec;
  --surface: #fff;
  --border: #e4e0d8;
  --text: #1c1917;
  --text2: #57534e;
  --text3: #a8a29e;
  --serif: 'Lora', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
}

/* ── RESET ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); text-decoration: underline; }

/* ── LAYOUT ──────────────────────────────────────────────────────────── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* ── HEADER ──────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
  flex-wrap: wrap;
}
.site-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.site-title a { color: var(--text); }
.site-title a:hover { color: var(--accent); text-decoration: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}
.site-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text2);
  padding: .3rem .65rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.site-nav a:hover {
  background: var(--bg2);
  color: var(--text);
  text-decoration: none;
}
.site-nav a.active { color: var(--accent); }

/* Search */
.site-search { position: relative; }
#site-search-input {
  font-family: var(--sans);
  font-size: .85rem;
  padding: .3rem .75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg2);
  color: var(--text);
  width: 220px;
  outline: none;
  transition: border-color .15s, width .2s;
}
#site-search-input:focus {
  border-color: var(--accent);
  width: 260px;
}
#site-search-results {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
}

/* ── MAIN ────────────────────────────────────────────────────────────── */
.site-main { padding: 2rem 0 3rem; flex: 1; }

/* ── FOOTER ──────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: .875rem;
  color: var(--text3);
}

/* ── HOME: CATEGORY GROUPS ───────────────────────────────────────────── */
.main-category { margin-top: 2.5rem; }
.main-category:first-child { margin-top: 0; }
.main-category-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .75rem;
  padding-left: .75rem;
  border-left: 3px solid var(--accent);
}
.sub-category-title {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  margin: 1.25rem 0 .5rem;
}

/* ── POST GRID ───────────────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
/* Single post stretches full width */
.post-grid:has(.post-card:only-child) {
  grid-template-columns: 1fr;
}
.post-grid:has(.post-card:only-child) .post-card {
  flex-direction: row;
  max-width: 100%;
}
.post-grid:has(.post-card:only-child) .post-thumb {
  flex: 0 0 240px;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.post-thumb { aspect-ratio: 16/9; overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-thumb img { transform: scale(1.03); }
.post-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.post-card .post-link {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -.01em;
}
.post-card .post-link:hover { color: var(--accent); text-decoration: none; }
.post-card .post-date { font-size: .78rem; color: var(--text3); letter-spacing: .01em; }
.post-card .post-excerpt { font-size: .875rem; color: var(--text2); margin-top: auto; padding-top: .35rem; }

/* ── POST PAGE ───────────────────────────────────────────────────────── */
.post-header { padding: 1.5rem 0 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.post-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: .5rem;
}
.post-meta { font-size: .875rem; color: var(--text3); }
.post-description { font-size: 1.05rem; color: var(--text2); margin-top: .5rem; }
.post-hero { margin: 1.5rem 0; }
.post-hero img { border-radius: var(--radius); width: 100%; max-height: 420px; object-fit: cover; }

/* ── PROSE ───────────────────────────────────────────────────────────── */
.post-content h1, .post-content h2, .post-content h3 {
  font-family: var(--serif);
  margin: 1.75rem 0 .6rem;
  line-height: 1.25;
}
.post-content h2 { font-size: 1.35rem; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.post-content h3 { font-size: 1.1rem; color: var(--text2); }
.post-content p { margin-bottom: 1rem; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.post-content li { margin-bottom: .3rem; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: .5rem 1rem;
  color: var(--text2);
  font-style: italic;
}
.post-content code {
  background: var(--bg2);
  border-radius: 4px;
  padding: .1em .4em;
  font-size: .875em;
}
.post-content pre {
  background: #1c1917;
  color: #e7e5e4;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.25rem 0;
}
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content img { border-radius: var(--radius); margin: 1rem 0; }
.post-content a { color: var(--accent); text-decoration: underline; }

/* ── SHOWCASE / PROJECTS ─────────────────────────────────────────────── */
.showcase-hero {
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  color: #e7e5e4;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.showcase-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(181,69,27,.15) 0%, transparent 60%);
}
.showcase-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  position: relative;
  margin-bottom: .5rem;
}
.showcase-hero h1 span { color: #d4622e; }
.showcase-hero p { position: relative; color: #a8a29e; font-size: 1.05rem; max-width: 520px; }
.showcase-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(181,69,27,.2);
  border: 1px solid rgba(181,69,27,.4);
  color: #d4622e;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25rem .7rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  position: relative;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.feature-card-icon { font-size: 1.5rem; margin-bottom: .5rem; }
.feature-card h3 { font-size: .95rem; font-weight: 600; margin-bottom: .25rem; }
.feature-card p { font-size: .85rem; color: var(--text2); margin: 0; }

.howto-steps { counter-reset: step; display: flex; flex-direction: column; gap: .75rem; margin: 1.5rem 0; }
.howto-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.howto-step::before {
  counter-increment: step;
  content: counter(step);
  background: var(--accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.howto-step p { margin: 0; font-size: .9rem; }
.howto-step strong { display: block; margin-bottom: .2rem; }

.screenshot-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}
.screenshot-wrap img { width: 100%; }
.screenshot-caption {
  background: var(--bg2);
  padding: .5rem 1rem;
  font-size: .8rem;
  color: var(--text3);
  border-top: 1px solid var(--border);
}

/* ── TOUR IFRAMES ────────────────────────────────────────────────────── */
.tour-iframe--stats { height: 1200px; }
.tour-iframe--map   { height: 700px; }
@media (max-width: 640px) {
  .tour-iframe--stats { height: 1600px; }
  .tour-iframe--map   { height: 75vw; min-height: 320px; }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header .container { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .site-nav { gap: 0; }
  .site-nav a { padding: .5rem .65rem; }
  .post-grid { grid-template-columns: 1fr; }
  .post-grid:has(.post-card:only-child) .post-card { flex-direction: column; }
  .post-grid:has(.post-card:only-child) .post-thumb { flex: unset; aspect-ratio: 16/9; }
  .feature-grid { grid-template-columns: 1fr; }
  .showcase-hero { padding: 1.5rem 1.25rem; }
  #site-search-input { width: 130px; }
  #site-search-input:focus { width: 170px; }
}
