/* Base + background */
html, body { height: 100%; }
* { box-sizing: border-box; }

body {
  margin: 0;
  background: rgba(220,213,205,0.98);                /* full-screen background */
  color: #111;
  font-family: "Baskerville", "Libre Baskerville", "Times New Roman", serif;
  font-weight: 400;                    /* Baskerville Semibold feel */
  line-height: 1.33;                   /* 33% more vertical spacing */
}

/* Headings per your spec */
h1, h2, h3 { margin: 0; line-height: 1.33; }

h1 { font-size: 2em; letter-spacing: 0.1em; font-weight: 100; }
h2 { font-size: 1em; letter-spacing: 0.1em; font-weight: 100; }
h3, p2 {
  font-size: 0.6em;      /* desktop/base */
  letter-spacing: 0.40em;
  font-weight: 500;      /* override body’s semibold */
}
p { font-size: 1em; }

/* Container: full width on mobile, max 800px on desktop */
.container {
  width: 100%;
  padding: 24px 16px 64px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .container {
    max-width: 800px;
    padding: 48px 16px 96px;
  }
}

/* Page header */
.page-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}
.blurb {
  margin: 0;
  font-size: 1rem;
}

/* Inline image (responsive) */
.inline-image {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 0.5rem;
}

/* Posts list */
.posts {
  display: grid;
  gap: 2rem;
}
.post h2 a {
  color: inherit;
  text-decoration: none;
}
.post h2 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.excerpt {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

/* =========================
   Navigation (top on desktop / hamburger on mobile)
   ========================= */

.site-nav {
  position: sticky;   /* stays visible when scrolling desktop */
  top: 0;
  z-index: 1000;
  background: rgba(220,213,205,0.98);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Hide checkbox */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

/* Top bar */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
}

/* Desktop inline menu */
.menu-row {
  display: flex;
  gap: 1rem 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Links shared */
.menu-row a,
.menu-column a {
  color: inherit;
  text-decoration: none;
  padding: 0.25rem 0;
}

/* Desktop-only hover underline (1px black, animated) */
@media (hover: hover) and (pointer: fine) {
  .menu-row a { position: relative; }
  .menu-row a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px; background: #000;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 180ms ease;
  }
  .menu-row a:hover::after { transform: scaleX(1); }
}

/* Hamburger button (mobile) */
.hamburger {
  display: none;
  position: absolute;
  right: 16px;
  top: 12px;
  width: 28px; height: 22px;
  cursor: pointer;
  z-index: 1002
}
.hamburger span {
  display: block;
  height: 2px; background: #000;
  margin: 5px 0;
  transition: transform 200ms ease, opacity 200ms ease;
}

/* Overlay (mobile) */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(220,213,205,0.98);
  padding: 20vh 16px 10vh;
}
.menu-column {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
}

/* Mobile rules */
@media (max-width: 768px) {
  /* h3 bigger on mobile as requested */
  h3 { font-size: 2em; }

  /* Hide inline menu, show hamburger */
  .menu-row { display: none; }
  .hamburger { display: block; }

  /* Toggle overlay with checkbox */
  .nav-toggle:checked ~ .nav-overlay { display: block; }

  /* Turn hamburger into an "X" when open */
  .nav-toggle:checked ~ .nav-bar .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-bar .hamburger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .nav-bar .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .site-nav {
    border-bottom: none;
  }
}

/* Ensure everything inside .container wraps */
.container {
  overflow-wrap: anywhere;     /* wrap long words/URLs */
  word-break: break-word;      /* safety for older engines */
  hyphens: none;               /* nicer wrapping for hyphenable text */
}

/* Prevent flex/grid children from forcing overflow */
.container * {
  min-width: 0;
}

/* Make every media element inside the blog container responsive */
.container img,
.container svg,
.container picture,
.container video,
.container canvas,
.container iframe {
  display: block;
  max-width: 100%;
  height: auto;
  box-sizing: border-box;            /* include padding/border in width */
}

/* 10px spacing "mat" and 1px gray border around all images */
.container img,
.container svg {
  padding: 16px;                     /* the 10px spacing around the image */
  border: 1px solid rgba(0,0,0,0.1);         /* 1px gray border */
  background: transparent;
  margin: 1rem 0;                    /* space from surrounding text */
}

/* Figure + caption (subtitle) */
.image-figure {
  margin: 1.25rem 0;
}

.image-figure figcaption {
  margin-top: 0.5rem;
  text-align: center;
}

/* h3 subtitle inherits your site-wide h3 styles; keep it centered */
.image-caption {
  /* h3 sizing/letter-spacing already set globally:
     h3 { font-size: 0.4em; letter-spacing: 0.40em; font-weight: 400; }
     On mobile: @media (max-width: 768px) { h3 { font-size: 2em; } }
   */
  margin: 0;
}

/* Code blocks wrap instead of overflowing */
.container pre,
.container code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Wide tables scroll instead of breaking layout */
.container table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}