/* ─── RESET ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

/* ─── TOKENS ─────────────────────────────── */
:root {
  --black:   #361308; /* Vast */
  --white:   #FAF7EE; /* Bone */
  --mid:     #988578;
  --rule:    #E6E0D7;
  --accent:  #10C46E; /* Minty Fresh */
  --ff-display: 'Fraunces', serif;
  --ff-body:    'DM Sans', sans-serif;
}

/* ─── BASE ────────────────────────────────── */
body {
  background: var(--white);
  color: var(--black);
  font-family: var(--ff-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }

/* ─── NAV ─────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  background: var(--white);
  border-bottom: 0.5px solid var(--rule);
}

.nav-wordmark {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.nav-links { display: none; gap: 28px; list-style: none; }
.nav-links a { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); transition: color 0.2s; }
.nav-links a.active, .nav-links a:hover { color: var(--black); }

.nav-hamburger { display: flex; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.nav-hamburger span { display: block; width: 22px; height: 1px; background: var(--black); transition: transform 0.2s, opacity 0.2s; }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 52px 0 0 0;
  z-index: 99;
  background: var(--white);
  flex-direction: column;
  padding: 32px 20px;
  border-top: 0.5px solid var(--rule);
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-family: var(--ff-display); font-weight: 600; font-size: 31px; letter-spacing: 0; padding: 14px 0; border-bottom: 0.5px solid var(--rule); color: var(--black); }
.mobile-menu a:last-child { border-bottom: none; }

/* ─── HERO (listing page, full gradient/photo banner) ─── */
.hero {
  margin-top: 52px;
  min-height: 60svh;
  position: relative;
  background: var(--black);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-bg { position: absolute; inset: 0; background: linear-gradient(160deg, #2a2a2a 0%, #111 60%); }
img.hero-bg { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 45%);
}

.hero-content { position: relative; z-index: 2; padding: 32px 20px 24px; }

.page-eyebrow { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 12px; }
.page-title { font-family: var(--ff-display); font-size: clamp(48px, 12vw, 84px); line-height: 0.95; color: #fff; letter-spacing: 0.02em; margin-bottom: 16px; }
.page-sub { font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.65; max-width: 340px; }

.hero-bottom { position: relative; z-index: 2; padding: 16px 20px; border-top: 0.5px solid rgba(255,255,255,0.08); }
.hero-scroll-label { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.25); }

/* ─── POST HERO (single article page) ─── */
.back-link { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 16px; display: inline-block; }
.post-date { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 12px; display: block; }
.post-title { font-family: var(--ff-display); font-weight: 600; font-size: clamp(32px, 8vw, 56px); line-height: 1.05; color: #fff; }
.post-author { font-size: 12px; letter-spacing: 0.04em; color: rgba(255,255,255,0.55); margin-top: 14px; display: block; }

/* ─── SECTION WRAPPER (listing page) ─── */
.section { padding: 48px 20px; border-bottom: 0.5px solid var(--rule); }
.section-label { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--black); margin-bottom: 20px; }

/* ─── POST FEED (listing cards) ─── */
.post-feed { display: flex; flex-direction: column; gap: 0; }

.post-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 0.5px solid var(--rule);
  transition: opacity 0.2s;
}
.post-card:first-child { padding-top: 0; }
.post-card:last-child { border-bottom: none; padding-bottom: 0; }
.post-card:hover { opacity: 0.6; }

.post-thumb { aspect-ratio: 4/3; background: #EFE9DA; position: relative; overflow: hidden; }
.post-thumb-placeholder { position: absolute; inset: 0; }
.post-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.post-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.post-type { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--black); border: 0.5px solid var(--black); padding: 2px 7px; }

.post-feed .post-title { font-size: 20px; font-weight: 500; line-height: 1.4; color: var(--black); }

.post-excerpt {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.6;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── ARTICLE BODY (single post — content typed in Publii's editor) ─── */
.article-body {
  padding: 40px 20px 64px;
  max-width: 640px;
  margin: 0 auto;
}

.article-body p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 20px;
}

.article-body em { font-style: italic; }
.article-body strong { font-weight: 500; }

.article-body h2, .article-body h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  margin: 32px 0 16px;
}

/* Images dropped into the post body by the writer render full-width,
   matching the article-figure treatment from the hand-coded site. */
.article-body img,
.article-body figure {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 28px 0;
}

.article-body figure img { margin: 0; }

/* Two (or more) photos side by side — wrap images in
   <div class="photo-row">...</div> via the editor's HTML view.
   Publii wraps each inserted image in its own <figure class="post__image">,
   so THAT figure — not the <img> — is the actual flex child. The flex
   sizing has to go on the direct child (via >* so it works whatever
   Publii wraps it in), then the img just fills that box. */
.article-body .photo-row {
  display: flex;
  gap: 12px;
  margin: 28px 0;
}

.article-body .photo-row > * {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  margin: 0;
}

.article-body .photo-row img {
  width: 100%;
  height: auto;
  margin: 0;
  display: block;
}

@media (max-width: 640px) {
  .article-body .photo-row {
    flex-direction: column;
  }
}

.article-body figcaption {
  font-size: 11px;
  color: var(--mid);
  margin-top: 8px;
}

/* ─── FOOTER ──────────────────────────────── */
footer { padding: 28px 20px; display: flex; flex-direction: column; gap: 16px; background: var(--accent); border-top: 0.5px solid var(--accent); }
.footer-wordmark { font-family: var(--ff-display); font-weight: 600; font-size: 16px; letter-spacing: 0.02em; color: var(--black); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; }
.footer-nav a { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(54,19,8,0.6); transition: color 0.2s; }
.footer-nav a:hover { color: var(--black); }
.footer-copy { font-size: 10px; color: rgba(54,19,8,0.6); letter-spacing: 0.06em; }
.footer-copy a { border-bottom: 0.5px solid rgba(54,19,8,0.3); }

/* ─── DESKTOP ─────────────────────────────── */
@media (min-width: 768px) {
  nav { padding: 0 40px; }
  .nav-links { display: flex; }
  .nav-hamburger { display: none; }

  .hero-content { padding: 48px 40px 32px; }
  .hero-bottom { padding: 20px 40px; }

  .section { padding: 64px 40px; }
  .post-card { grid-template-columns: 160px 1fr; }
  .section-label { font-size: 18px; }
  .page-sub { font-size: 16px; }

  .article-body { padding: 56px 40px 80px; }
  .article-body p { font-size: 17px; }

  footer { flex-direction: row; justify-content: space-between; align-items: center; padding: 28px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
