@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

/* ==========================================================================
   Editorial Serif — themes/editorial.css
   Warm cream magazine. Ink text, single clay accent, Fraunces + Inter.
   Self-contained: reset + layout + components + responsive.
   ========================================================================== */

/* ---- Reset ---- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.theme-editorial {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #e7dfcc;
  color: #1c1a16;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.theme-editorial img { max-width: 100%; height: auto; display: block; }

/* ---- Typographic rhythm ---- */
.theme-editorial h1,
.theme-editorial h2,
.theme-editorial h3,
.theme-editorial h4 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  color: #1c1a16;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

.theme-editorial h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1.04;
}

.theme-editorial h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 500;
}

.theme-editorial h3 {
  font-size: clamp(1.25rem, 2vw, 1.45rem);
  font-weight: 500;
}

.theme-editorial p { margin: 0 0 1.1em; }
.theme-editorial p:last-child { margin-bottom: 0; }

.theme-editorial ul,
.theme-editorial ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.theme-editorial li { margin-bottom: 0.4em; }
.theme-editorial li::marker { color: #b4472a; }

.theme-editorial strong { font-weight: 600; color: #1c1a16; }

/* ---- Links (generic prose links only; component classes override) ---- */
.theme-editorial a {
  color: #8f3a21;
  text-decoration: none;
  background-image: linear-gradient(#8f3a21, #8f3a21);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease, color 0.2s ease;
}
.theme-editorial a:hover { background-size: 100% 1px; }
.theme-editorial a:visited { color: #7c3019; }

/* Component links must beat `.theme-editorial a` (same specificity, so
   re-assert them here with the theme scope to win on source order). */
.theme-editorial .btn-primary { color: #f6f1e7; background-image: none; }
.theme-editorial .btn-ghost { color: #1c1a16; background-image: none; }
.theme-editorial .btn-ghost:hover { color: #f6f1e7; }
.theme-editorial .nav-link { color: #4a4438; background-image: none; }
.theme-editorial .nav-link[aria-current] { color: #8f3a21; }
.theme-editorial .text-link { color: #8f3a21; background-image: none; }
.theme-editorial .note-list a { color: #1c1a16; background-image: none; }
.theme-editorial .contact-email { color: #5f5747; background-image: none; }
.theme-editorial .site-brand-link { color: #1c1a16; background-image: none; }

/* ---- Focus-visible (global) ---- */
.theme-editorial a:focus-visible,
.theme-editorial button:focus-visible,
.theme-editorial .btn:focus-visible,
.theme-editorial .nav-link:focus-visible,
.theme-editorial .text-link:focus-visible,
.theme-editorial .theme-switch a:focus-visible {
  outline: 2px solid #b4472a;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Layout ---- */
.main-content { display: block; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

.section { margin: 56px 0; }

/* (Theme switcher styling lives in the shared static/css/switcher.css) */

/* ==========================================================================
   Site header
   ========================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 26px;
  margin-bottom: 44px;
  border-bottom: 1px solid #c9bfab;
}

.site-brand { flex: 0 1 auto; min-width: 0; }

.site-brand-link {
  display: flex;
  align-items: center;
  gap: 16px;
  background-image: none;
}
.site-brand-link:hover { background-image: none; }

.logo-mark {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1c1a16;
  color: #f6f1e7;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  border-radius: 2px;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-text .name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #1c1a16;
  line-height: 1.2;
}

.brand-text .contact { font-size: 0.85rem; }

.contact-email {
  color: #6b6353;
  background-image: none;
}
.contact-email:visited { color: #6b6353; }
.contact-email:hover { color: #b4472a; background-image: linear-gradient(#b4472a, #b4472a); background-size: 100% 1px; }

/* ---- Site nav — small uppercase letterspaced text links ---- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.nav-link {
  color: #4a4438;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  background-image: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-link:visited { color: #4a4438; }
.nav-link:hover {
  color: #b4472a;
  background-image: none;
  border-bottom-color: #b4472a;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
  padding: 14px 26px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  background-image: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn:hover { background-image: none; transform: translateY(-1px); }
.btn:visited { color: inherit; }

.btn-primary {
  background-color: #b4472a;
  color: #f6f1e7;
  border-color: #b4472a;
}
.btn-primary:visited { color: #f6f1e7; }
.btn-primary:hover {
  background-color: #1c1a16;
  border-color: #1c1a16;
  color: #f6f1e7;
}

.btn-ghost {
  background-color: transparent;
  color: #1c1a16;
  border-color: #1c1a16;
}
.btn-ghost:visited { color: #1c1a16; }
.btn-ghost:hover {
  background-color: #1c1a16;
  color: #f6f1e7;
  border-color: #1c1a16;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 24px 0 8px;
  margin-bottom: 20px;
}

.hero-copy { max-width: 760px; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #8f3a21;
  margin: 0 0 20px;
}

.hero h1 { margin-bottom: 0.35em; }

.hero .lead {
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  line-height: 1.6;
  color: #45403690;
  color: #454036;
  max-width: 62ch;
  margin-bottom: 1.8em;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

/* ==========================================================================
   Section grid + cards (flat / paper)
   ========================================================================== */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 56px 0;
  padding-top: 48px;
  border-top: 1px solid #c9bfab;
}

.card {
  background-color: #efe7d5;
  border: 1px solid #d8cdb4;
  border-radius: 3px;
  padding: 36px;
  box-shadow: none;
}

.card-spaced { margin-bottom: 28px; padding: 36px; }
.card-spaced:last-child { margin-bottom: 0; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-header h2 { margin-bottom: 0; }

/* ---- Richtext ---- */
.richtext > :first-child { margin-top: 0; }
.richtext > :last-child { margin-bottom: 0; }
.richtext h2 {
  padding-bottom: 0.3em;
  margin-top: 1.6em;
}
.richtext h2:first-child { margin-top: 0; }
.richtext h3 { margin-top: 1.4em; color: #b4472a; }
.richtext ul { padding-left: 1.2em; }

/* ---- Text link ---- */
.text-link {
  color: #b4472a;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background-image: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.text-link:visited { color: #b4472a; }
.text-link:hover { background-image: none; border-bottom-color: #b4472a; color: #93381f; }

/* ==========================================================================
   Note list (latest writing)
   ========================================================================== */
.note-list { list-style: none; margin: 0; padding: 0; }

.note-list li {
  padding: 18px 0;
  border-bottom: 1px solid #e3dac6;
}
.note-list li:first-child { padding-top: 0; }
.note-list li:last-child { border-bottom: none; padding-bottom: 0; }

.note-list a {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #1c1a16;
  background-image: none;
  transition: color 0.2s ease;
}
.note-list a:visited { color: #1c1a16; }
.note-list a:hover { color: #b4472a; background-image: none; }

.note-meta {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #645c4c;
  margin: 4px 0 6px;
}

.note-summary {
  margin: 0;
  color: #454036;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   Bulleted list (blogs list)
   ========================================================================== */
.bulleted { list-style: none; margin: 18px 0 0; padding: 0; }

.bulleted li {
  padding: 20px 0;
  border-bottom: 1px solid #e3dac6;
}
.bulleted li:last-child { border-bottom: none; padding-bottom: 0; }

.bulleted li a {
  background-image: none;
}
.bulleted li a:hover { background-image: none; }

.bulleted li a strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1c1a16;
  transition: color 0.2s ease;
}
.bulleted li a:hover strong { color: #b4472a; }

.bulleted li > span {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #645c4c;
  margin-left: 10px;
}

.bulleted li > div {
  margin-top: 8px;
  color: #454036;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   Blog detail
   ========================================================================== */
.note-body { max-width: 68ch; }
.note-body > :first-child { margin-top: 0; }
.note-body > :last-child { margin-bottom: 0; }

.note-body h2 {
  margin-top: 1.8em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid #c9bfab;
}

.note-body p { font-size: 1.05rem; line-height: 1.75; }

.note-body blockquote {
  margin: 1.5em 0;
  padding: 0.4em 0 0.4em 1.4em;
  border-left: 3px solid #b4472a;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  color: #3a352c;
}

/* ---- Code blocks ---- */
.note-body code,
.note-body pre,
.note-body .codehilite {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', Menlo, monospace;
  font-size: 0.88rem;
}

.note-body code {
  background-color: #e0d7c2;
  color: #93381f;
  padding: 0.12em 0.42em;
  border-radius: 3px;
  border: 1px solid #e0d6c0;
}

.note-body pre,
.note-body .codehilite {
  background-color: #1c1a16;
  color: #f0e9da;
  padding: 20px 22px;
  border-radius: 4px;
  border: 1px solid #c9bfab;
  overflow-x: auto;
  margin: 1.4em 0;
  line-height: 1.55;
}

.note-body pre code,
.note-body .codehilite code,
.note-body .codehilite pre {
  background-color: transparent;
  color: inherit;
  border: none;
  padding: 0;
  border-radius: 0;
}

.note-body .codehilite .c,
.note-body .codehilite .c1,
.note-body .codehilite .cm { color: #9b917c; font-style: italic; }
.note-body .codehilite .k,
.note-body .codehilite .kd,
.note-body .codehilite .kn { color: #e8a08a; }
.note-body .codehilite .s,
.note-body .codehilite .s1,
.note-body .codehilite .s2 { color: #c8cfa0; }
.note-body .codehilite .n { color: #f0e9da; }
.note-body .codehilite .nf,
.note-body .codehilite .nc { color: #dcc38a; }
.note-body .codehilite .o,
.note-body .codehilite .p { color: #c9bfab; }
.note-body .codehilite .mi,
.note-body .codehilite .mf { color: #d89b7a; }

/* ==========================================================================
   Experience
   ========================================================================== */
.theme-editorial .section .card .richtext h3 {
  color: #1c1a16;
  margin-top: 1.6em;
  padding-top: 1.4em;
  border-top: 1px solid #e3dac6;
}
.theme-editorial .section .card .richtext h2 + h3 {
  border-top: none;
  padding-top: 0;
  margin-top: 0.6em;
}

/* ==========================================================================
   404
   ========================================================================== */
.error-404 {
  text-align: center;
  padding: 90px 20px;
  max-width: 620px;
  margin: 0 auto;
}
.error-404 h1 { margin-bottom: 0.4em; }
.error-404 p { color: #454036; font-size: 1.05rem; }
.error-404 .muted { color: #857c6b; font-size: 0.9rem; }
.error-404 a { font-weight: 600; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 72px;
  padding: 32px;
  text-align: center;
  font-size: 0.82rem;
  color: #645c4c;
  border-top: 1px solid #c9bfab;
}
.site-footer #year { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Reveal animation
   ========================================================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.theme-editorial .reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.theme-editorial .section-grid .reveal:nth-child(2) { animation-delay: 0.12s; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .section-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero { padding-top: 12px; }
}

@media (max-width: 640px) {
  body.theme-editorial { font-size: 16px; }

  .container { padding: 0 20px; }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    padding-top: 80px;
  }

  .site-nav { gap: 22px; }

  .card,
  .card-spaced { padding: 26px 22px; }

  .theme-switch {
    top: 12px;
    right: 12px;
    left: 12px;
    justify-content: center;
    gap: 10px;
    padding: 7px 12px;
  }

  .cta-group { flex-direction: column; align-items: stretch; }
  .cta-group .btn { width: 100%; }

  .section-header { flex-direction: column; gap: 6px; }
}

@media (max-width: 380px) {
  .theme-switch { flex-wrap: wrap; }
  .theme-switch-label { flex-basis: 100%; text-align: center; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .theme-editorial .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .theme-editorial *,
  .theme-editorial *::before,
  .theme-editorial *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}


/* ==========================================================================
   Editorial HOME — magazine reading spread (index_editorial.html)
   ========================================================================== */
.theme-editorial .ed-home { padding-top: 8px; }
.theme-editorial .ed-lede { margin: 44px 0 8px; max-width: 980px; }
.theme-editorial .ed-headline {
  font-family: 'Fraunces', Georgia, serif; font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.04;
  letter-spacing: -0.015em; margin: 12px 0 22px; color: #1c1a16;
}
.theme-editorial .ed-standfirst { font-size: 1.2rem; line-height: 1.75; color: #2a251d; max-width: 760px; }
.theme-editorial .ed-dropcap {
  float: left; font-family: 'Fraunces', Georgia, serif; font-weight: 600;
  font-size: 4.6rem; line-height: 0.74; padding: 8px 14px 0 0; color: #8f3a21;
}
.theme-editorial .ed-rule { border: 0; border-top: 1px solid #c9bfab; margin: 44px 0; }
.theme-editorial .ed-spread { display: grid; grid-template-columns: 1.7fr 1fr; gap: 56px; align-items: start; }
.theme-editorial .ed-body h2 {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.5rem;
  margin: 1.6em 0 0.5em; padding-top: 0.7em; border-top: 1px solid #c9bfab; color: #1c1a16;
}
.theme-editorial .ed-body h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.theme-editorial .ed-body p { font-size: 1.02rem; line-height: 1.78; color: #2f2a22; }
.theme-editorial .ed-body ul { padding-left: 1.1em; }
.theme-editorial .ed-body li { margin: 0.4em 0; color: #2f2a22; }
.theme-editorial .ed-index { position: sticky; top: 24px; }
.theme-editorial .ed-index-title {
  font-family: 'Fraunces', serif; font-size: 0.8rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: #645c4c; margin: 0 0 16px; font-weight: 600;
}
.theme-editorial .ed-index-list { list-style: none; margin: 0; padding: 0; }
.theme-editorial .ed-index-item {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 3px;
  align-items: baseline; padding: 16px 0; border-top: 1px solid #c9bfab;
}
.theme-editorial .ed-index-item:first-child { border-top: none; padding-top: 0; }
.theme-editorial .ed-index-num { font-family: 'Fraunces', serif; color: #8f3a21; font-size: 0.95rem; }
.theme-editorial .ed-index-link {
  font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.12rem;
  color: #1c1a16; background-image: none; line-height: 1.25;
}
.theme-editorial .ed-index-link:hover { color: #8f3a21; }
.theme-editorial .ed-index-date { grid-column: 2; font-size: 0.8rem; color: #645c4c; letter-spacing: 0.06em; }
.theme-editorial .ed-index-all { display: inline-block; margin-top: 18px; color: #8f3a21; font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; background-image: none; }
.theme-editorial .ed-pullquote {
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.4; color: #2a251d;
  text-align: center; max-width: 900px; margin: 56px auto; padding: 0 20px;
}
.theme-editorial .ed-outro { display: flex; gap: 28px; flex-wrap: wrap; margin: 44px 0 8px; border-top: 1px solid #c9bfab; padding-top: 24px; }
.theme-editorial .ed-outro a { color: #8f3a21; font-weight: 600; background-image: none; }
@media (max-width: 820px) {
  .theme-editorial .ed-spread { grid-template-columns: 1fr; gap: 36px; }
  .theme-editorial .ed-index { position: static; }
}
