/* ============================================
   Godofreda Blog, Main Stylesheet
   Palette and type follow the Godofreda site:
   cream paper, ink text, one coral, Mona Sans.
   ============================================ */

@font-face {
  font-family: 'Mona Sans';
  src: url('../fonts/MonaSans.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Variables --- */
:root {
  --color-primary:      #EA684B;  /* coral: fills, rules, buttons */
  --color-primary-dark: #D4543A;  /* coral hover */
  --color-primary-text: #B8462F;  /* coral as text on paper (5.0:1) */
  --color-primary-hi:   #FF8F72;  /* coral on dark surfaces */
  --color-on-primary:   #1A1917;  /* ink on coral, as on the site */
  --color-ink:          #1A1917;
  --color-night:        #0D0D0D;
  --color-dark-bg:      #1A1917;
  --color-dark-mid:     #141414;
  --color-dark-border:  #2A2724;
  --color-cream:        #F5F2EB;
  --color-light-bg:     #F2EEE5;
  --color-white:        #FAF8F3;  /* paper: the page surface, never pure white */
  --color-text:         #1A1917;
  --color-text-muted:   #57524B;
  --color-border:       #DED6C7;
  --color-sand:         #C4B8A5;
  --color-tag-bg:       #FBE9E3;
  --color-tag-text:     #B8462F;

  --font-display: 'Mona Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Mona Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  /* The site is square-cornered paper; only buttons and pills are round. */
  --radius-sm:  2px;
  --radius-md:  3px;
  --radius-lg:  3px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(26,25,23,0.08);
  --shadow-md:  0 4px 16px rgba(26,25,23,0.10);
  --shadow-lg:  0 28px 64px -36px rgba(26,25,23,0.48);

  --transition: 0.22s ease;
  --container:  1200px;
  --gap:        2rem;
}

:root {
  --max-w: 1160px;
  --ease: 0.2s ease;
  --radius-card: 10px;
}

/* --- Reset (full width, so WordPress and plugins can never box the layout) --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

html,
body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden;
}

body,
body.home,
body.blog,
body.custom-background {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-white) !important;
  background-color: var(--color-white) !important;
  background-image: none !important;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0 !important;
  padding: 0 !important;
}

#page, .site, #content, #primary, #main, main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  background: transparent !important;
}

/* Room for the fixed header. Must come after the reset above, which zeroes padding. */
#page { padding-top: 64px !important; }

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}
::selection { background: var(--color-primary); color: var(--color-on-primary); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.sr-only:focus {
  position: fixed;
  top: 8px; left: 8px;
  width: auto; height: auto;
  margin: 0;
  padding: 10px 16px;
  clip: auto;
  background: var(--color-ink);
  color: var(--color-white);
  z-index: 1000;
}

/* Headings: serif. The download section keeps Mona Sans. */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
}

/* ============================================
   HEADER (matches the masthead on godofreda.com)
   ============================================ */
.site-header {
  width: 100%;
  background: var(--color-white);
  border-bottom: 1px solid var(--rule);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header-wrap {
  max-width: var(--grid-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-logo { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.site-logo a { display: flex; align-items: center; }
.site-logo img { height: 50px; width: auto; }

.blog-badge {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  line-height: 1.3;
}

/* Nav sits on the right, next to the download button, as on the main site */
.header-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.header-nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.header-nav li a {
  position: relative;
  font-size: var(--t-small);
  color: var(--ink-70);
  padding-block: 4px;
  transition: color 160ms var(--ease-quick);
  white-space: nowrap;
}
.header-nav li a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms var(--ease-quick);
}
.header-nav li a:hover,
.header-nav li a:focus-visible { color: var(--color-ink); }
.header-nav li a:hover::after,
.header-nav li a:focus-visible::after { transform: scaleX(1); }
.header-nav .current-menu-item > a { color: var(--color-ink); }

.mcta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-inline: 20px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--t-small);
  white-space: nowrap;
  transition: background 160ms var(--ease-quick), transform 160ms var(--ease-quick);
}
.mcta:hover { background: var(--color-primary-hi); }
.mcta:active { transform: translateY(1px); }
.nav-cta { display: none; }

/* Mobile toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-ink);
  padding: 0.5rem;
  margin-right: -0.5rem;
  line-height: 0;
}

/* ============================================
   FEATURED POST
   ============================================ */
.featured-section { width: 100%; padding: 3.5rem 2rem 0; }
.featured-inner { max-width: var(--max-w); margin: 0 auto; }

.featured-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary-text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.featured-label::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--color-primary);
  opacity: 0.6;
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  min-height: 440px;
}

.featured-image { overflow: hidden; background: var(--color-light-bg); position: relative; }
.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.featured-card:hover .featured-image img { transform: scale(1.03); }

.featured-no-image {
  width: 100%;
  height: 100%;
  min-height: 440px;
  background: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-no-image img { width: 96px; height: 96px; opacity: 0.9; border-radius: 22%; }

.featured-body {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  min-width: 0;
}

.featured-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary-text);
}
.featured-title {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  line-height: 1.2;
  color: var(--color-ink);
  overflow-wrap: anywhere;
}
.featured-title a:hover { color: var(--color-primary-text); transition: color var(--ease); }
.featured-excerpt { font-size: 0.95rem; color: var(--color-text-muted); line-height: 1.75; }

.featured-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding-top: 0.5rem;
}
.featured-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.featured-avatar-placeholder {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  flex-shrink: 0;
}
.featured-author { font-size: 0.85rem; font-weight: 600; color: var(--color-ink); }
.featured-dot    { color: var(--color-sand); font-size: 0.8rem; }
.featured-date, .featured-read { font-size: 0.82rem; color: var(--color-text-muted); }

.featured-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary-text);
  margin-top: 0.25rem;
  transition: gap var(--ease);
}
.featured-link:hover { gap: 0.7rem; }

/* Divider */
.section-divider {
  width: 100%;
  max-width: calc(var(--max-w) + 4rem);
  margin: 3rem auto 0;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.section-divider-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.section-divider-line { flex: 1; height: 1px; background: var(--color-border); }

/* ============================================
   POST GRID
   ============================================ */
.posts-section { width: 100%; padding: 2.5rem 2rem 4rem; }
.posts-grid-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(26,25,23,0.08);
  border-color: var(--color-sand);
}

.post-card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-light-bg);
  position: relative;
  display: block;
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-img img { transform: scale(1.04); }

.no-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-light-bg) 0%, var(--color-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.no-img svg { width: 40px; height: 40px; fill: var(--color-sand); }

.post-card-body {
  padding: 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.card-cat {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary-text);
  width: fit-content;
}
.card-title {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.35;
  color: var(--color-ink);
  overflow-wrap: anywhere;
}
.card-title a:hover { color: var(--color-primary-text); }
.card-excerpt { font-size: 0.88rem; color: var(--color-text-muted); line-height: 1.65; flex: 1; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.9rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}
.card-author { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.card-author-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.card-author-placeholder {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700;
  flex-shrink: 0;
}
.card-author-name { font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-date { font-size: 0.75rem; color: var(--color-text-muted); white-space: nowrap; }

/* ============================================
   PAGINATION
   ============================================ */
.pagination-wrap {
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}
.pagination-wrap .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding-inline: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  transition: all var(--ease);
}
.pagination-wrap a.page-numbers:hover { border-color: var(--color-primary); color: var(--color-primary-text); }
.pagination-wrap .page-numbers.current {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}

/* ============================================
   SINGLE POST
   ============================================ */
.post-hero { width: 100%; padding: 4rem 2rem 0; }
.post-hero-wrap { max-width: 760px; margin: 0 auto; }

.post-hero-cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary-text);
  margin-bottom: 1rem;
  display: inline-block;
}
.post-hero-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.12;
  color: var(--color-ink);
  margin-bottom: 1.5rem;
  overflow-wrap: anywhere;
}
.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.post-hero-author { display: flex; align-items: center; gap: 0.6rem; }
.post-hero-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.post-hero-avatar-placeholder {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  flex-shrink: 0;
}
.post-hero-author-name { font-size: 0.88rem; font-weight: 600; color: var(--color-ink); }
.meta-sep { width: 1px; height: 16px; background: var(--color-border); }
.meta-item { font-size: 0.82rem; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 4px; }
a.meta-item:hover { color: var(--color-primary-text); }

.post-feat-image { max-width: 860px; margin: 2.5rem auto; padding: 0 2rem; }
.post-feat-image img {
  width: 100%;
  border-radius: var(--radius-card);
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.post-content-wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }
.post-hero + .post-content-wrap { padding-top: 2.5rem; }

.entry-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #2E2B27;
  overflow-wrap: break-word;
}
.entry-content > * + * { margin-top: 1.4rem; }

.entry-content h2 { font-size: 1.7rem; color: var(--color-ink); line-height: 1.25; margin-top: 2.5rem; }
.entry-content h3 { font-size: 1.3rem; color: var(--color-ink); margin-top: 2rem; }
.entry-content h4 { font-size: 1.1rem; color: var(--color-ink); margin-top: 1.6rem; }

.entry-content a { color: var(--color-primary-text); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--color-ink); }

.entry-content ul { margin-left: 1.5rem; list-style: disc; }
.entry-content ol { margin-left: 1.5rem; list-style: decimal; }
.entry-content li { margin-bottom: 0.4rem; }

.entry-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--color-ink);
  background: var(--color-light-bg);
  border-radius: 0 6px 6px 0;
}
.entry-content blockquote p { margin: 0; }

.entry-content code {
  background: var(--color-light-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: var(--font-mono);
}
.entry-content pre {
  background: var(--color-ink);
  color: var(--color-cream);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
}
.entry-content pre code { background: none; color: inherit; padding: 0; }

.entry-content img { border-radius: 8px; margin-block: 1.5rem; }
.entry-content figure { max-width: 100%; }
.entry-content figcaption { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.5rem; }

.entry-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.entry-content th, .entry-content td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.entry-content th { background: var(--color-light-bg); font-weight: 700; }
.entry-content iframe, .entry-content video { max-width: 100%; }

.page-links { margin-top: 1.5rem; font-size: 0.9rem; color: var(--color-text-muted); }

/* Tags */
.post-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}
.post-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 4px 12px;
  border-radius: 999px;
  transition: all var(--ease);
}
.post-tag:hover { border-color: var(--color-primary); color: var(--color-primary-text); }

/* Author box */
.author-box {
  margin-top: 3rem;
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--color-light-bg);
}
.author-box-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-box-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
  flex-shrink: 0;
}
.author-written-by {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary-text);
  margin-bottom: 0.3rem;
}
.author-box-name { font-size: 1rem; font-weight: 700; color: var(--color-ink); margin-bottom: 0.5rem; }
.author-box-name a:hover { color: var(--color-primary-text); }
.author-box-bio { font-size: 0.88rem; color: var(--color-text-muted); line-height: 1.65; }

/* ============================================
   COMMENTS
   ============================================ */
.comments-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}
.comments-title { font-size: 1.4rem; color: var(--color-ink); margin-bottom: 2rem; }

.comment-list { display: flex; flex-direction: column; gap: 1.5rem; list-style: none; }
.comment { display: flex; gap: 1rem; }
.comment-ava { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-ava-placeholder {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-light-bg);
  border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.comment-bubble { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-bottom: 0.4rem; }
.comment-name { font-size: 0.88rem; font-weight: 700; color: var(--color-ink); }
.comment-date { font-size: 0.78rem; color: var(--color-text-muted); }
.comment-text { font-size: 0.9rem; line-height: 1.65; color: var(--color-text-muted); overflow-wrap: anywhere; }
.comment-text > * + * { margin-top: 0.75rem; }

.comment-reply-link a,
a.comment-reply-link {
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary-text);
  margin-top: 0.5rem;
}
.children {
  margin-top: 1.2rem;
  margin-left: 3rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  list-style: none;
}

/* Comment form */
.comment-form-section { margin-top: 2.5rem; }
.comment-form-title { font-size: 1.2rem; color: var(--color-ink); margin-bottom: 1.5rem; }

.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.cf-field { display: flex; flex-direction: column; gap: 0.35rem; }
.cf-field label { font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); }
.cf-field label .req { color: var(--color-primary-text); }

.cf-field input,
.cf-field textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-ink);
  background: var(--color-white);
  outline: none;
  transition: border-color var(--ease);
}
.cf-field input:focus,
.cf-field textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(234,104,75,0.15); }
.cf-field textarea { resize: vertical; min-height: 120px; }
.cf-full { grid-column: 1 / -1; }

.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.82rem; color: var(--color-text-muted); margin-top: 1rem; }
.comment-form-cookies-consent input { margin-top: 0.3rem; }
.cf-submit { margin-top: 1rem; }

.btn-submit,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--ease), transform var(--ease);
}
.btn-submit:hover,
.btn-primary:hover { background: var(--color-primary-hi); transform: translateY(-1px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--color-sand);
  color: var(--color-ink);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-full);
  transition: all var(--ease);
}
.btn-outline:hover { border-color: var(--color-ink); background: var(--color-ink); color: var(--color-cream); }

/* ============================================
   ARCHIVE / SEARCH HEADER
   ============================================ */
.archive-header { width: 100%; padding: 3rem 2rem 2rem; border-bottom: 1px solid var(--color-border); }
.archive-header-wrap { max-width: var(--max-w); margin: 0 auto; }
.archive-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary-text);
  margin-bottom: 0.5rem;
}
.archive-title { font-size: clamp(1.7rem, 3.5vw, 2.4rem); color: var(--color-ink); overflow-wrap: anywhere; }
.archive-desc { font-size: 0.95rem; color: var(--color-text-muted); margin-top: 0.5rem; max-width: 60ch; }

.search-form-large { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 560px; margin-top: 1.25rem; }
.search-form-large input {
  flex: 1 1 220px;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-ink);
  background: var(--color-white);
  outline: none;
}
.search-form-large input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(234,104,75,0.15); }

/* ============================================
   EMPTY STATE / 404
   ============================================ */
.empty-state { text-align: center; padding: 5rem 2rem; color: var(--color-text-muted); }
.empty-state h2 { color: var(--color-ink); margin-bottom: 0.5rem; font-size: 1.5rem; }

.four-oh-four {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}
.fof-content { position: relative; padding-top: 4rem; }
.fof-num {
  font-family: var(--font-heading);
  font-size: clamp(5rem, 22vw, 9rem);
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.18;
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
  pointer-events: none;
}
.fof-title { font-size: 1.8rem; color: var(--color-ink); margin-bottom: 0.75rem; position: relative; }
.fof-desc { color: var(--color-text-muted); margin-bottom: 2rem; }
.fof-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* Reading progress bar */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: var(--color-primary);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .featured-card { grid-template-columns: 1fr; min-height: auto; }
  .featured-image { aspect-ratio: 16 / 9; }
  .featured-no-image { min-height: 0; height: 100%; aspect-ratio: 16 / 9; }
  .featured-body { padding: 2rem; }
  .posts-grid-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .header-wrap { gap: 0.75rem; }
  .site-logo img { height: 40px; }
  .header-cta { display: none; }
  .mobile-toggle { display: block; margin-left: auto; }
  .header-nav { display: none; margin-left: 0; }

  .header-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--color-white);
    z-index: 199;
    padding: 1.5rem var(--gutter);
    border-top: 1px solid var(--rule);
    overflow-y: auto;
  }
  .admin-bar .header-nav.open { top: 110px; }
  .header-nav.open ul { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .header-nav.open li a {
    display: block;
    font-size: 1.1rem;
    color: var(--color-ink);
    padding: 1rem 0.25rem;
    border-bottom: 1px solid var(--rule);
  }
  .header-nav.open li a::after { display: none; }
  .header-nav.open .nav-cta { display: inline-flex; justify-content: center; margin-top: 1.5rem; height: 48px; }

  .featured-section { padding: 2.5rem 1.25rem 0; }
  .section-divider { padding-inline: 1.25rem; margin-top: 2.25rem; }
  .posts-section { padding: 2rem 1.25rem 3rem; }
  .posts-grid-wrap { grid-template-columns: 1fr; gap: 1.5rem; }
  .pagination-wrap { padding-inline: 1.25rem; }
  .archive-header { padding: 2.25rem 1.25rem 1.5rem; }

  .post-hero { padding: 2.5rem 1.25rem 0; }
  .post-feat-image { padding: 0 1.25rem; margin-block: 1.75rem; }
  .post-feat-image img { aspect-ratio: 16 / 10; }
  .post-content-wrap { padding: 2rem 1.25rem 3rem; }
  .entry-content { font-size: 1rem; }

  .cf-grid { grid-template-columns: 1fr; }
  .author-box { flex-direction: column; align-items: center; text-align: center; padding: 1.5rem; }
  .children { margin-left: 1rem; }
}

@media (max-width: 480px) {
  .featured-body { padding: 1.5rem; }
  .featured-title { font-size: 1.4rem; }
  .post-card-body { padding: 1.15rem; }
  .meta-sep { display: none; }
  .post-hero-meta { gap: 0.5rem 1rem; }
  .fof-actions .btn-primary,
  .fof-actions .btn-outline { width: 100%; justify-content: center; }
  .search-form-large .btn-primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .post-card:hover, .btn-submit:hover, .btn-primary:hover { transform: none; }
}

/* ============================================
   DOWNLOAD CLOSE + FOOTER
   Mirrors the Godofreda site: a cream "close" with the store buttons,
   then a paper-2 footer with black social tiles, four link columns and
   the wordmark as a faint watermark.
   ============================================ */
:root {
  --grid-max: 1400px;
  --gutter: clamp(20px, 5.5vw, 88px);
  --col-gap: clamp(16px, 1.7vw, 24px);
  --rule-strong: #C9BFAC;
  --ink-70: #57524B;
  --ink-50: #6B655D;
  --night-3: #1C1B1A;
  --night-rule: #2A2724;
  --edge-app: inset 0 1px 0 rgba(245,242,235,.06);
  --ease-quick: cubic-bezier(.4,0,.2,1);
  --rule: #DED6C7;
  --t-hero: clamp(2.75rem, 7.1vw, 6.4rem);
  --t-stand: clamp(1.1rem, 1.8vw, 1.45rem);
  --t-body: 1.0625rem;
  --t-small: .9375rem;
  --t-micro: .6875rem;
}

.gf-grid {
  max-width: var(--grid-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

/* ---- the close (download) ---- */
.close {
  border-top: 1px solid var(--rule-strong);
  padding-block: clamp(96px, 13vw, 200px);
  background: var(--color-white);
}
.close-in { grid-column: 1 / 9; }
.close h2 {
  font-family: var(--font-display);
  font-size: var(--t-hero);
  line-height: .9;
  letter-spacing: -.038em;
  font-weight: 640;
  margin-block: 0 1.5rem;
  text-wrap: balance;
}
.close-stand {
  font-size: var(--t-stand);
  line-height: 1.45;
  color: var(--ink-70);
  max-width: 52ch;
  text-wrap: pretty;
}
.close-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.close-rule {
  grid-column: 1 / 9;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: var(--t-body);
  color: var(--ink-70);
}
a.ilink {
  color: var(--color-primary-text);
  font-weight: 520;
  box-shadow: inset 0 -1px 0 rgba(184,70,47,.35);
}
a.ilink:hover { box-shadow: inset 0 -1px 0 var(--color-primary-text); }

.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding-inline: 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--t-body);
  transition: background 160ms var(--ease-quick), transform 160ms var(--ease-quick);
}
.store svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.store-1 { background: var(--color-primary); color: var(--color-ink); }
.store-1:hover { background: var(--color-primary-hi); }
.store-2 { background: var(--color-night); color: var(--color-cream); }
.store-2:hover { background: var(--night-3); }
.store:active { transform: translateY(1px); }

/* ---- footer ---- */
.site-footer {
  background: var(--color-light-bg);
  border-top: 1px solid var(--color-border);
  padding-block: 96px 40px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.site-footer > .gf-grid { position: relative; z-index: 1; }

.foot-tiles {
  grid-column: 1 / 6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.tile {
  aspect-ratio: 9 / 16;
  background: var(--color-night);
  border: 1px solid var(--night-rule);
  border-radius: 16px;
  box-shadow: var(--edge-app);
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  color: var(--color-cream);
  transition: border-color 160ms var(--ease-quick), background 160ms var(--ease-quick);
}
.tile-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile svg {
  width: 26px;
  height: 26px;
  fill: var(--color-cream);
  margin-bottom: auto;
  transition: fill 160ms var(--ease-quick);
}
.tile b { font-size: var(--t-small); font-weight: 600; }
.tile em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-sand);
  word-break: break-all;
}
.tile i {
  font-style: normal;
  font-size: 11px;
  color: var(--color-sand);
  line-height: 1.4;
  margin-top: 2px;
  min-height: 2.8em;
}
@media (hover: hover) {
  .tile:hover {
    border-color: color-mix(in srgb, var(--brand) 55%, transparent);
    background: color-mix(in srgb, var(--brand) 12%, var(--color-night));
  }
  .tile:hover svg { fill: var(--brand); }
}

.foot-cols {
  grid-column: 7 / 13;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.foot-cols h4 {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin-bottom: 16px;
  font-weight: 400;
}
.foot-cols li { margin-bottom: 10px; }
.foot-cols a {
  font-size: var(--t-small);
  color: var(--ink-70);
  position: relative;
  white-space: nowrap;
}
.foot-cols a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--color-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms var(--ease-quick);
}
.foot-cols a:hover { color: var(--color-ink); }
.foot-cols a:hover::after { transform: scaleX(1); }

/* The wordmark sits behind the footer, bottom-anchored and bleeding off the
   right edge, masked so it dissolves upward into the paper. */
.foot-mark {
  position: absolute;
  left: var(--gutter);
  right: 0;
  bottom: -2%;
  z-index: 0;
  line-height: 0;
  pointer-events: none;
}
.foot-mark img {
  width: 100%;
  height: auto;
  opacity: .07;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.35) 32%, #000 78%);
  mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.35) 32%, #000 78%);
}
.foot-base {
  grid-column: 1 / 13;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--ink-50);
}

@media (max-width: 1080px) {
  .close-in, .close-rule, .foot-tiles { grid-column: 1 / 13; }
  .foot-cols { grid-column: 1 / 13; margin-top: 48px; grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
}
@media (max-width: 640px) {
  .foot-cols { grid-template-columns: 1fr; }
  .foot-tiles { gap: 8px; }
  .tile { padding: 12px; }
  .tile svg { width: 20px; height: 20px; }
  .close-actions .store { flex: 1; justify-content: center; min-width: 100%; }
  .foot-base { flex-direction: column; gap: 8px; }
}
@media (max-width: 479px) {
  .foot-tiles { grid-template-columns: 1fr; gap: 8px; }
  .tile { aspect-ratio: auto; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 14px; }
  .tile svg { margin-bottom: 0; width: 22px; height: 22px; }
  .tile i { min-height: 0; }
}

/* ============================================
   SHARE ROW
   ============================================ */
.share-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 2rem;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  color: #fff;
  transition: opacity var(--ease);
}
.entry-content .share-btn { color: #fff; text-decoration: none; }
.share-btn:hover { opacity: 0.88; }
.share-facebook { background: #3b5998; }
.share-twitter  { background: var(--color-ink); }
