/* ═══════════════════════════════════════════════════════════
   ReTurntables Workshop Journal - shared styles
   Tokens mirror the main site stylesheet exactly.
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:       #F6EFE2;
  --cream-dark:  #EDE2CC;
  --parchment:   #E0D1B4;
  --bark:        #2B1F0E;
  --bark-light:  #4A3520;
  --oak:         #7A5C2E;
  --gold:        #C4962A;
  --gold-light:  #E8D5A3;
  --ink:         #1A1208;
  --muted:       #7A6040;
  --muted-light: #A08B65;
  --serif:       'Playfair Display', Georgia, serif;
  --sans:        'Lato', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
}

/* ── HEADER (as main site) ─────────────────────────────────── */
header {
  background: var(--bark);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--gold);
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo-wrap { display: flex; align-items: center; gap: 14px; text-decoration: none; }

.logo-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold);
}

.logo-text {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

nav { display: flex; align-items: center; gap: 32px; }

nav a {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-light);
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover { color: var(--gold-light); }
nav a.nav-active { color: var(--gold-light); border-bottom: 2px solid var(--gold); padding-bottom: 4px; }

nav .nav-cta {
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 8px 18px;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}
nav .nav-cta:hover { background: var(--gold); color: var(--bark); }

/* ── JOURNAL HERO ──────────────────────────────────────────── */
.journal-hero {
  background: var(--bark);
  padding: 56px 32px 52px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.journal-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 110%, rgba(196,150,42,0.18) 0%, transparent 65%);
  pointer-events: none;
}
.journal-hero .hero-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
}
.journal-hero h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.12;
  margin-bottom: 16px;
}
.journal-hero h1 em { font-style: italic; color: var(--gold); }
.journal-hero .hero-sub {
  font-size: 15px; font-weight: 300; color: var(--muted-light);
  max-width: 560px; margin: 0 auto; line-height: 1.7;
}

/* ── FILTER PILLS ──────────────────────────────────────────── */
.journal-filters {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 36px 32px 0;
}
.filter-pill {
  background: transparent;
  border: 1px solid var(--parchment);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 18px; border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-pill:hover { border-color: var(--gold); color: var(--oak); }
.filter-pill.active {
  background: var(--bark);
  border-color: var(--bark);
  color: var(--gold-light);
}

/* ── JOURNAL GRID ──────────────────────────────────────────── */
#journal { padding: 40px 32px 72px; max-width: 1160px; margin: 0 auto; }

.journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.post-card {
  background: #fff;
  border: 1px solid var(--parchment);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(42,28,8,0.14);
}

.post-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
.post-card.featured .post-img { aspect-ratio: auto; height: 100%; min-height: 300px; }

.post-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--cream-dark);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.post-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.post-img svg { width: 46%; height: auto; opacity: 0.9; }

.post-body { padding: 24px 26px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card.featured .post-body { padding: 36px 40px; justify-content: center; }

.post-badge {
  display: inline-block; align-self: flex-start;
  font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--oak); background: var(--cream);
  border: 1px solid var(--parchment);
  padding: 3px 9px; border-radius: 2px; margin-bottom: 12px;
}
.post-badge.buildlog {
  color: var(--gold-light); background: var(--bark); border-color: var(--bark);
}

.post-title {
  font-family: var(--serif);
  font-size: 21px; font-weight: 700; color: var(--ink);
  line-height: 1.25; margin-bottom: 8px;
}
.post-card.featured .post-title { font-size: 28px; }

.post-excerpt {
  font-size: 13.5px; color: var(--muted); line-height: 1.65;
  margin-bottom: 16px; flex: 1;
}

.post-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-light);
  padding-top: 14px;
  border-top: 1px solid var(--cream-dark);
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--parchment); flex-shrink: 0; }
.post-meta .read-link { margin-left: auto; color: var(--oak); }
.post-card:hover .read-link { color: var(--gold); }

/* ── LOADING / EMPTY / ERROR STATES ────────────────────────── */
.journal-state {
  text-align: center;
  padding: 72px 32px;
  color: var(--muted);
  font-size: 14px;
}
.journal-state .spin {
  width: 34px; height: 34px;
  border: 2px solid var(--parchment);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: rtspin 0.9s linear infinite;
}
@keyframes rtspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .journal-state .spin { animation: none; }
  html { scroll-behavior: auto; }
}

/* ── POST HERO ─────────────────────────────────────────────── */
.post-hero {
  background: var(--bark);
  padding: 52px 32px 48px;
  position: relative;
  overflow: hidden;
}
.post-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(196,150,42,0.16) 0%, transparent 60%);
  pointer-events: none;
}
.post-hero-inner { max-width: 800px; margin: 0 auto; position: relative; }

.breadcrumb {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted-light); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 24px; transition: color 0.2s;
}
.breadcrumb:hover { color: var(--gold-light); }

.post-hero .post-badge {
  margin-bottom: 14px;
  background: rgba(196,150,42,0.12);
  border-color: rgba(196,150,42,0.35);
  color: var(--gold-light);
}

.post-hero h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700; color: var(--gold-light);
  line-height: 1.15; margin-bottom: 18px;
}

.post-hero-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-light);
}
.post-hero-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(196,150,42,0.4); }
.post-hero-meta .model-tag {
  border: 1px solid rgba(196,150,42,0.35);
  color: var(--gold-light);
  padding: 4px 12px; border-radius: 40px;
}

/* ── ARTICLE BODY (markdown output) ────────────────────────── */
article { max-width: 800px; margin: 0 auto; padding: 56px 32px 72px; }

article > p:first-of-type {
  font-size: 16px; color: var(--muted); line-height: 1.8;
  font-weight: 300; margin-bottom: 32px;
}

article h2 {
  font-family: var(--serif);
  font-size: 21px; font-weight: 700; color: var(--ink);
  margin: 40px 0 16px;
  padding-bottom: 0;
}
article h2::after {
  content: '';
  display: block;
  width: 36px; height: 2px;
  background: var(--gold);
  margin-top: 8px;
}
article h2:first-child { margin-top: 0; }

article h3 {
  font-family: var(--serif);
  font-size: 17px; font-weight: 700; color: var(--ink);
  margin: 28px 0 10px;
}

article p {
  font-size: 14.5px; color: var(--bark-light); line-height: 1.8;
  margin-bottom: 14px;
}

article a { color: var(--oak); text-decoration-color: var(--gold); }
article a:hover { color: var(--gold); }

article strong { color: var(--ink); }

article ul, article ol { list-style: none; padding: 0; margin: 14px 0; }
article ul li, article ol li {
  font-size: 13.5px; color: var(--bark-light);
  padding: 8px 0 8px 20px;
  border-bottom: 1px solid var(--cream-dark);
  position: relative; line-height: 1.6;
}
article ul li:last-child, article ol li:last-child { border-bottom: none; }
article ul li::before {
  content: '\2014';
  position: absolute; left: 0; color: var(--gold);
  font-size: 10px; top: 11px;
}
article ol { counter-reset: rt; }
article ol li { counter-increment: rt; padding-left: 26px; }
article ol li::before {
  content: counter(rt);
  position: absolute; left: 0; top: 8px;
  font-family: var(--serif);
  font-weight: 700; font-size: 13px; color: var(--gold);
}

article hr {
  border: none;
  height: 1px; background: var(--parchment);
  margin: 40px 0;
}

/* Images -> figures (wrapped by blog.js) */
article figure { margin: 28px 0; }
article figure img {
  width: 100%;
  border: 1px solid var(--parchment);
  border-radius: 4px;
  display: block;
}
article figcaption {
  font-size: 12px; color: var(--muted-light);
  margin-top: 10px; text-align: center;
  font-style: italic;
  font-family: var(--serif);
}

/* Blockquote -> gold callout */
article blockquote {
  background: var(--cream-dark);
  border: 1px solid var(--parchment);
  border-left: 3px solid var(--gold);
  border-radius: 3px;
  padding: 16px 18px;
  margin: 22px 0;
}
article blockquote p {
  font-size: 13px; color: var(--bark-light); line-height: 1.65;
  margin: 0;
}

/* Tables -> parts table */
article table {
  width: 100%; border-collapse: collapse;
  margin: 18px 0;
  background: #fff;
  border: 1px solid var(--parchment);
  border-radius: 4px;
  overflow: hidden;
  font-size: 13px;
}
article th {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-light); background: var(--bark);
  text-align: left; padding: 10px 14px;
}
article td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--cream-dark);
  color: var(--bark-light);
  vertical-align: top;
}
article tr:last-child td { border-bottom: none; }
article td:first-child { font-weight: 700; color: var(--ink); }

/* Code (component references etc.) */
article code {
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  background: var(--cream-dark);
  border: 1px solid var(--parchment);
  padding: 1px 6px;
  border-radius: 2px;
  color: var(--bark-light);
}

/* Dark verification checklist (raw HTML block in markdown) */
.re-checklist {
  background: var(--bark);
  border-radius: 4px;
  padding: 36px 40px;
  margin: 44px 0 0;
}
.re-checklist-title {
  font-family: var(--serif);
  font-size: 18px; font-weight: 700; color: var(--gold-light);
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(196,150,42,0.3);
}
.re-check-item {
  display: flex; gap: 12px;
  font-size: 13.5px; color: var(--muted-light);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  align-items: flex-start; line-height: 1.5;
}
.re-check-item:last-child { border-bottom: none; }
.re-check-mark { color: var(--gold); font-weight: 700; flex-shrink: 0; }

/* ── POST CTA ──────────────────────────────────────────────── */
.post-cta {
  margin-top: 48px;
  background: #fff;
  border: 1px solid var(--parchment);
  border-radius: 4px;
  padding: 32px 36px;
  text-align: center;
}
.post-cta h3 {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700; color: var(--ink);
  margin-bottom: 8px;
}
.post-cta h3 em { font-style: italic; color: var(--oak); }
.post-cta p { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.btn-enquire {
  display: inline-block;
  background: var(--bark);
  color: var(--gold-light);
  font-family: var(--sans);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 13px 26px; border-radius: 2px; border: none;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-enquire:hover { background: var(--gold); color: var(--bark); }

/* ── RELATED POSTS ─────────────────────────────────────────── */
.related-strip { border-top: 1px solid var(--parchment); margin-top: 56px; padding-top: 40px; }
.related-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 20px; text-align: center;
}
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.related-card {
  background: #fff; border: 1px solid var(--parchment); border-radius: 4px;
  padding: 20px 22px; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: inherit;
  display: block;
}
.related-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(42,28,8,0.12); }
.related-card .post-badge { margin-bottom: 8px; }
.related-card h4 {
  font-family: var(--serif); font-size: 16px; font-weight: 700;
  color: var(--ink); line-height: 1.3;
}

/* ── FOOTER (as main site) ─────────────────────────────────── */
footer {
  background: var(--ink);
  padding: 36px 32px;
  text-align: center;
  border-top: 2px solid var(--gold);
}
.footer-logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 16px; }
.footer-logo img {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold);
}
.footer-logo-text { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--gold-light); }
.footer-tagline { font-size: 12px; color: var(--muted-light); margin-bottom: 20px; }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 20px; }
.footer-links a {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-light); text-decoration: none;
}
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { font-size: 11px; color: rgba(160,139,101,0.5); }

/* ── RESPONSIVE ────────────────────────────────────────────── */
/* Hamburger toggle (mobile nav) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 8px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold-light);
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .header-inner { padding: 0 20px; }
  .nav-toggle { display: block; }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bark);
    border-bottom: 2px solid var(--gold);
    padding: 6px 0 18px;
    box-shadow: 0 18px 30px rgba(0,0,0,0.35);
  }
  nav.open { display: flex; }
  nav a { padding: 13px 24px; font-size: 12px; }
  nav a.nav-active { border-bottom: none; padding-bottom: 13px; }
  nav .nav-cta {
    margin: 10px 24px 0;
    text-align: center;
    padding: 12px 18px;
  }
  .journal-hero { padding: 40px 20px 36px; }
  #journal { padding: 32px 20px 56px; }
  .journal-grid { grid-template-columns: 1fr; }
  .post-card.featured { grid-template-columns: 1fr; }
  .post-card.featured .post-img { min-height: 0; aspect-ratio: 16/10; }
  .post-card.featured .post-body { padding: 24px 26px; }
  article { padding: 40px 20px 56px; }
  .re-checklist { padding: 28px 20px; }
  .related-grid { grid-template-columns: 1fr; }
  .post-cta { padding: 24px 20px; }
  .footer-links { flex-wrap: wrap; gap: 14px; }
}
