/* Jaume Olmos · olmillos.cat — Revista editorial mediterrània per a l'educació pública */

:root {
  --paper: #FAF6EE;
  --paper-alt: #EFE8D9;
  --card: #FFFFFF;
  --line: #DFD5C3;
  --ink: #16221D;
  --ink-soft: #4F5B55;
  --pine: #0B3B2B;
  --green: #135D43;
  --green-deep: #0A3727;
  --green-soft: #E3F0EA;
  --terra: #B84A2E;
  --terra-soft: #F9EAE5;
  --gold: #C98A2B;
  --navy: #1C344D;
  --shadow: 0 14px 36px rgba(11, 59, 43, 0.07);
  --shadow-lg: 0 24px 54px rgba(11, 59, 43, 0.13);
  --radius: 20px;
  --radius-sm: 14px;
  --reading-scale: 1;
  --font-display: 'Fraunces', Georgia, serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111614;
    --paper-alt: #18201C;
    --card: #1C2520;
    --line: #2C3932;
    --ink: #EDE7DC;
    --ink-soft: #A7B1AB;
    --pine: #09291E;
    --green: #6FD3A8;
    --green-deep: #96E4C2;
    --green-soft: rgba(111, 211, 168, 0.13);
    --terra: #E88567;
    --terra-soft: rgba(232, 133, 103, 0.14);
    --gold: #E8B05A;
    --navy: #172738;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.52);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Textura subtil de paper artesanal */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.24;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  body::before { opacity: 0.08; mix-blend-mode: screen; }
}

main, header, footer { position: relative; z-index: 2; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--pine); color: #FAF6EE; padding: 10px 16px; border-radius: 999px; z-index: 999;
}
.skip-link:focus { left: 16px; }

#read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--terra), var(--gold));
  z-index: 250; transition: width 0.08s linear;
}

.wrap { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.wrap-narrow { width: min(720px, calc(100% - 32px)); margin: 0 auto; }

/* Reveal motion */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none !important; }
}

/* ============ TOPBAR & HEADER ============ */
.top-ribbon {
  background: var(--pine); color: rgba(250, 246, 238, 0.86);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.top-ribbon-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 32px;
}
.top-ribbon-links { display: flex; align-items: center; gap: 14px; }
.top-ribbon-links a { text-decoration: none; color: #FAF6EE; opacity: 0.85; }
.top-ribbon-links a:hover { opacity: 1; color: #E8B05A; }
@media (max-width: 780px) { .top-ribbon { display: none; } }

.site-header {
  position: sticky; top: 0; z-index: 120;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; min-height: 68px; padding-block: 8px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; min-width: 0;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--pine); color: #FAF6EE;
  display: grid; place-items: center; position: relative;
  font-family: var(--font-display); font-weight: 700; font-style: italic; font-size: 1.15rem;
  box-shadow: inset 0 0 0 1px rgba(250,246,238,0.20), 0 4px 12px rgba(11,59,43,0.18);
}
.brand-mark::after {
  content: ''; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--terra);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  font-family: var(--font-display); font-size: 1.18rem; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap;
}
.brand-text span {
  font-size: 0.72rem; color: var(--ink-soft); font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
}

.main-nav { display: flex; align-items: center; gap: 3px; }
.main-nav a {
  text-decoration: none; font-size: 0.88rem; font-weight: 600;
  color: var(--ink-soft); padding: 8px 13px; border-radius: 999px;
  transition: background-color 0.18s, color 0.18s;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--green-deep); background: var(--green-soft);
}
.main-nav a.ialab-link {
  border: 1px solid var(--line); margin-left: 6px;
  font-size: 0.8rem; color: var(--ink);
}
.main-nav a.ialab-link:hover {
  border-color: var(--terra); color: var(--terra); background: var(--terra-soft);
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  min-width: 40px; min-height: 40px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; font-size: 0.82rem; font-weight: 600;
  text-decoration: none;
  transition: border-color 0.18s, transform 0.15s;
}
.icon-btn:hover { border-color: var(--green); color: var(--green-deep); }
.menu-toggle { display: none; }

@media (max-width: 980px) {
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 12px 16px 18px; gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 1rem; border-radius: 12px; }
  .main-nav a.ialab-link { margin-left: 0; margin-top: 6px; text-align: center; }
  .menu-toggle { display: inline-flex; }
}

/* ============ BUTTONS & PILLS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 22px; border-radius: 999px;
  font-weight: 700; font-size: 0.92rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.16s, box-shadow 0.18s, background-color 0.18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #FAF6EE; }
.btn-primary:hover { background: var(--green-deep); box-shadow: 0 10px 24px rgba(19, 93, 67, 0.24); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0B1914; } }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--green); color: var(--green-deep); }
.btn-cream { background: #FAF6EE; color: #0B3B2B; border-color: #FAF6EE; }
.btn-cream:hover { background: #EFE8D9; }
.btn-terra { background: var(--terra); color: #FAF6EE; }
.btn-terra:hover { filter: brightness(0.92); }
.btn-sm { min-height: 36px; padding: 6px 15px; font-size: 0.82rem; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.73rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--green-soft); color: var(--green-deep);
  text-decoration: none;
}
.pill-terra { background: var(--terra-soft); color: var(--terra); }
.pill-dark { background: rgba(250, 246, 238, 0.14); color: #E8B05A; border: 1px solid rgba(250, 246, 238, 0.2); }

/* ============ HERO EDITORIAL ============ */
.hero {
  padding: clamp(32px, 5vw, 66px) 0 clamp(32px, 4.5vw, 54px);
  background:
    radial-gradient(ellipse 60% 70% at 92% 12%, var(--green-soft), transparent 60%),
    radial-gradient(ellipse 50% 60% at 6% 92%, var(--terra-soft), transparent 55%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(26px, 4.2vw, 54px);
  align-items: center;
}
.hero-author {
  display: inline-flex; align-items: center; gap: 14px; margin-bottom: 20px;
}
.hero-avatar {
  width: 58px; height: 58px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--green), 0 8px 18px rgba(0,0,0,0.14);
}
.hero-kicker {
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--terra);
}
.hero-role { font-size: 0.86rem; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.25rem, 4.8vw, 3.65rem);
  line-height: 1.04; letter-spacing: -0.03em;
  margin: 0 0 18px; text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--terra); font-weight: 500; }
.hero-lead {
  font-family: var(--font-serif); font-size: clamp(1.16rem, 1.9vw, 1.38rem);
  line-height: 1.58; color: var(--ink-soft); margin: 0 0 26px; max-width: 56ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.hero-quote {
  border-left: 3px solid var(--terra); padding: 8px 0 8px 18px;
  font-family: var(--font-serif); font-style: italic; font-size: 1.06rem;
  color: var(--ink-soft); margin: 0;
}

.featured-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.featured-card:hover { transform: translateY(-3px); }
.featured-cover-box { position: relative; overflow: hidden; }
.featured-cover {
  aspect-ratio: 16 / 10; width: 100%; object-fit: cover; display: block;
  background: var(--paper-alt); transition: transform 0.45s ease;
}
.featured-card:hover .featured-cover { transform: scale(1.025); }
.featured-badge-float {
  position: absolute; top: 14px; left: 14px;
  background: rgba(11, 59, 43, 0.90); color: #FAF6EE; backdrop-filter: blur(8px);
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.featured-body { padding: 24px 26px; display: flex; flex-direction: column; gap: 12px; }
.featured-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--ink-soft); font-weight: 600;
}
.featured-card h2 {
  font-family: var(--font-display); font-size: clamp(1.38rem, 2.2vw, 1.8rem);
  line-height: 1.18; margin: 0; font-weight: 600;
}
.featured-card h2 a { text-decoration: none; }
.featured-card h2 a:hover { color: var(--green); }
.featured-card p {
  font-family: var(--font-serif); font-size: 1.06rem; line-height: 1.56;
  color: var(--ink-soft); margin: 0;
}
.featured-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--line);
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* ============ TICKER EDITORIAL ============ */
.editorial-ticker {
  background: var(--pine); color: #FAF6EE;
  border-block: 1px solid rgba(255,255,255,0.10);
  overflow: hidden; white-space: nowrap; padding: 11px 0;
}
.ticker-track {
  display: inline-block; animation: tickerMove 42s linear infinite;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
}
.editorial-ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { margin: 0 18px; opacity: 0.92; }
.ticker-track i { font-style: normal; color: #E8B05A; }
@keyframes tickerMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============ ART COVERS (PER A POSTS SENSE FOTO) ============ */
.post-art-cover {
  aspect-ratio: 16 / 9; width: 100%; padding: 20px 22px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; text-decoration: none;
  color: #FAF6EE;
  background: linear-gradient(135deg, #0B3B2B 0%, #165941 100%);
}
.post-art-cover.theme-accio { background: linear-gradient(135deg, #7A2B18 0%, #B84A2E 100%); }
.post-art-cover.theme-investigacio { background: linear-gradient(135deg, #122436 0%, #1E3E5E 100%); }
.post-art-cover.theme-altres { background: linear-gradient(135deg, #564217 0%, #9E7324 100%); }
.post-art-cover::after {
  content: 'JO';
  position: absolute; right: 14px; bottom: -14px;
  font-family: var(--font-display); font-style: italic; font-weight: 700;
  font-size: 6.2rem; line-height: 1; color: rgba(250, 246, 238, 0.08);
  pointer-events: none;
}
.post-art-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(250, 246, 238, 0.85);
}
.post-art-title {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 1.24rem; line-height: 1.2; color: #FAF6EE;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 92%;
}

/* ============ SECTIONS & MAGAZINE GRID ============ */
.section { padding: clamp(40px, 5.5vw, 72px) 0; }
.section-alt { background: var(--paper-alt); border-block: 1px solid var(--line); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 30px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display); font-size: clamp(1.7rem, 3.1vw, 2.35rem);
  line-height: 1.12; margin: 6px 0 0; font-weight: 600; letter-spacing: -0.025em;
}
.section-kicker {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--terra); margin: 0;
}
.section-sub { color: var(--ink-soft); margin: 8px 0 0; max-width: 60ch; }

.posts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.post-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--green);
}
.post-card-cover {
  aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block;
  background: var(--paper-alt);
}
.post-card-in {
  padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1;
}
.post-card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.78rem; color: var(--ink-soft); font-weight: 600;
}
.post-card h3 {
  font-family: var(--font-display); font-size: 1.26rem; line-height: 1.24;
  margin: 0; font-weight: 600;
}
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { color: var(--green); }
.post-card p {
  font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.56;
  color: var(--ink-soft); margin: 0; flex: 1;
}
.post-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.84rem; font-weight: 700; color: var(--green); padding-top: 10px;
  border-top: 1px solid var(--line);
}
.post-card-foot a { text-decoration: none; }

@media (min-width: 960px) {
  .posts-grid--magazine { grid-template-columns: repeat(3, 1fr); }
  .posts-grid--magazine .post-card:first-child {
    grid-column: span 2; flex-direction: row;
  }
  .posts-grid--magazine .post-card:first-child > a:first-child {
    width: 46%; flex: none; display: flex;
  }
  .posts-grid--magazine .post-card:first-child .post-card-cover,
  .posts-grid--magazine .post-card:first-child .post-art-cover {
    height: 100%; aspect-ratio: auto; min-height: 250px;
  }
  .posts-grid--magazine .post-card:first-child h3 { font-size: 1.58rem; }
}

/* ============ FULL-BLEED MANIFESTO BAND ============ */
.manifesto-band {
  background: var(--pine); color: #FAF6EE;
  padding: clamp(48px, 6vw, 84px) 0;
  border-block: 1px solid rgba(255,255,255,0.10);
  position: relative; overflow: hidden;
}
.manifesto-band::before {
  content: '“'; position: absolute; right: 4%; top: -40px;
  font-family: var(--font-display); font-size: clamp(12rem, 22vw, 20rem);
  line-height: 1; color: rgba(250, 246, 238, 0.05); pointer-events: none;
}
.manifesto-inner {
  display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 36px; align-items: center;
}
@media (max-width: 860px) { .manifesto-inner { grid-template-columns: 1fr; } }
.manifesto-quote {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.65rem, 3.4vw, 2.55rem); line-height: 1.22;
  margin: 14px 0 24px; text-wrap: balance;
}
.manifesto-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.mstat {
  border: 1px solid rgba(250, 246, 238, 0.18); border-radius: 16px;
  padding: 18px; background: rgba(255,255,255,0.04);
}
.mstat strong {
  display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1;
  color: #E8B05A;
}
.mstat span { font-size: 0.82rem; color: rgba(250,246,238,0.82); font-weight: 600; }

/* ============ COMPASS / OTHER SECTIONS ============ */
.compass-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .compass-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .compass-grid { grid-template-columns: 1fr; } }

.compass-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 22px; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.compass-card:hover { transform: translateY(-3px); border-color: var(--terra); box-shadow: var(--shadow); }
.compass-card .num { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.09em; color: var(--terra); text-transform: uppercase; }
.compass-card h3 { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.2; margin: 0; }
.compass-card p { font-size: 0.92rem; color: var(--ink-soft); margin: 0; flex: 1; }
.compass-card .go { font-size: 0.84rem; font-weight: 700; color: var(--green); }

/* ============ APRENENT DE... PREMIUM CARDS ============ */
.aprenent-hero {
  background: linear-gradient(135deg, var(--pine) 0%, #144D39 100%);
  color: #FAF6EE; padding: clamp(38px, 6vw, 72px) 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.aprenent-hero h1 {
  font-family: var(--font-display); font-size: clamp(2.2rem, 4.8vw, 3.5rem);
  line-height: 1.08; margin: 12px 0 12px; letter-spacing: -0.025em;
}
.aprenent-hero p {
  font-family: var(--font-serif); font-size: clamp(1.12rem, 1.8vw, 1.3rem);
  color: rgba(250, 246, 238, 0.88); max-width: 60ch; margin: 0;
}
.prologue-card {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--terra);
  border-radius: var(--radius-sm); padding: clamp(20px, 3vw, 32px);
  margin: -24px auto 34px; box-shadow: var(--shadow);
}
.prologue-card .prose { padding: 0; font-size: 1.08rem; }
.prologue-card .prose p:last-child { margin-bottom: 0; }

.aprenent-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 26px;
}
.aprenent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
@media (max-width: 480px) { .aprenent-grid { grid-template-columns: 1fr; } }

.ref-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.ref-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--green); }
.ref-head { display: flex; align-items: center; gap: 14px; }
.ref-monogram {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 1.15rem;
  color: #FAF6EE; background: var(--green);
}
.ref-card.era-abans .ref-monogram { background: var(--terra); }
.ref-author { font-family: var(--font-display); font-size: 1.38rem; line-height: 1.15; margin: 0; }
.ref-years { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }
.ref-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-quote {
  position: relative; margin: 0; padding: 14px 16px;
  background: var(--paper-alt); border-radius: 12px; border-left: 3px solid var(--gold);
  font-family: var(--font-display); font-style: italic; font-size: 1.06rem; line-height: 1.42;
}
.ref-summary { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.56; color: var(--ink-soft); margin: 0; flex: 1; }
.ref-highlight {
  font-size: 0.82rem; padding: 9px 12px; border-radius: 10px;
  background: var(--paper); border: 1px dashed var(--line); color: var(--ink);
}
.ref-highlight b { color: var(--terra); font-weight: 800; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; display: block; }
.ref-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

/* Home Aprenent spotlight */
.spotlight-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px;
}

/* ============ ARCHIVE & SUBSCRIBE ============ */
.archive-box {
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 28px; align-items: start;
}
@media (max-width: 860px) { .archive-box { grid-template-columns: 1fr; } }

.chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 6px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 0.86rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: border-color 0.16s, background-color 0.16s;
}
.chip:hover, .chip.active { background: var(--green); color: #FAF6EE; border-color: var(--green); }
@media (prefers-color-scheme: dark) { .chip.active { color: #0B1914; } }
.chip span { opacity: 0.75; font-size: 0.78rem; }

.sub-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.sub-card h3 { font-family: var(--font-display); font-size: 1.38rem; margin: 0 0 8px; }
.sub-card p { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 14px; }

.field-row { display: flex; gap: 8px; flex-wrap: wrap; }
.input, textarea.input, select.input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: 0.95rem;
}
.input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
textarea.input { min-height: 140px; resize: vertical; }

/* ============ BLOG INDEX FILTER BAR ============ */
.filter-bar {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px; margin-bottom: 24px; display: grid; gap: 12px;
}
.filter-controls { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; }
@media (max-width: 680px) { .filter-controls { grid-template-columns: 1fr; } }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 32px; flex-wrap: wrap; }

/* ============ ARTICLE READING VIEW ============ */
.article-head {
  padding: clamp(30px, 5vw, 56px) 0 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-alt), var(--paper));
}
.series-banner {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 14px;
  background: var(--pine); color: #FAF6EE; font-size: 0.78rem; font-weight: 700;
  text-decoration: none;
}
.series-banner span { color: #E8B05A; }
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px; font-size: 0.86rem; color: var(--ink-soft); font-weight: 600;
}
.article-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 4.7vw, 3.15rem);
  line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 18px; text-wrap: balance;
}
.read-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding-top: 14px; border-top: 1px solid var(--line);
}
.read-tools-grp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.article-cover-wrap { margin: 28px auto 0; width: min(880px, calc(100% - 32px)); }
.article-cover {
  width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--line); display: block; box-shadow: var(--shadow);
}

/* Long-form prose + dropcap */
.prose {
  font-family: var(--font-serif);
  font-size: calc(clamp(1.16rem, 1.45vw, 1.26rem) * var(--reading-scale));
  line-height: 1.78;
  color: var(--ink);
  padding: 32px 0;
}
.prose > *:first-child { margin-top: 0; }
.prose--article > p:first-of-type::first-letter {
  font-family: var(--font-display);
  float: left; font-size: 3.55em; line-height: 0.84;
  padding: 6px 12px 0 0; font-weight: 700; color: var(--green);
}
.prose p { margin: 0 0 1.38em; }
.prose h2, .prose h3 {
  font-family: var(--font-display); font-weight: 600; line-height: 1.22;
  letter-spacing: -0.015em; margin: 1.9em 0 0.7em;
}
.prose h2 { font-size: 1.55em; }
.prose h3 { font-size: 1.28em; }
.prose a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--terra); }
.prose blockquote {
  margin: 1.8em 0; padding: 16px 22px;
  border-left: 4px solid var(--terra); background: var(--paper-alt);
  border-radius: 0 14px 14px 0; font-style: italic; color: var(--ink);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.45em; }
.prose li { margin-bottom: 0.45em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em auto; width: 40%; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em;
  background: var(--paper-alt); padding: 2px 6px; border-radius: 6px;
}
.prose figure.prose-fig { margin: 1.8em 0; text-align: center; }
.prose figure.prose-fig img, .prose img {
  border-radius: 14px; border: 1px solid var(--line); max-width: 100%; height: auto;
}
.prose figcaption { font-family: var(--font-sans); font-size: 0.82rem; color: var(--ink-soft); margin-top: 8px; }
.embed-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1.8em 0;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #000;
}
.embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Mobile reading comfort dock */
.mobile-read-dock {
  display: none;
}
@media (max-width: 760px) {
  .mobile-read-dock {
    position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 160;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 8px; border-radius: 999px;
    background: color-mix(in srgb, var(--pine) 94%, transparent);
    color: #FAF6EE; backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.28);
    border: 1px solid rgba(250,246,238,0.18);
  }
  .mobile-read-dock button {
    border: 0; background: transparent; color: #FAF6EE;
    padding: 7px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; cursor: pointer;
    white-space: nowrap;
  }
  .mobile-read-dock button.accent { background: var(--terra); color: #FAF6EE; }
}

/* ============ SHARE BAR & NEXT READ ============ */
.share-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 22px 0 28px; box-shadow: var(--shadow);
}
.share-box-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.share-box-head strong { font-family: var(--font-display); font-size: 1.2rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-size: 0.85rem; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: border-color 0.16s, background-color 0.16s, transform 0.15s;
}
.share-btn:hover { transform: translateY(-1px); border-color: var(--green); background: var(--green-soft); }
.share-btn.primary { background: var(--green); color: #FAF6EE; border-color: var(--green); }
@media (prefers-color-scheme: dark) { .share-btn.primary { color: #0B1914; } }

.author-box {
  display: flex; align-items: center; gap: 16px;
  background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 24px;
}
.author-box img { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--card); }
.author-box h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.18rem; }
.author-box p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
@media (max-width: 540px) { .author-box { flex-direction: column; align-items: flex-start; } }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0 32px; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }
.post-nav a {
  display: flex; flex-direction: column; gap: 4px; padding: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; transition: border-color 0.18s, transform 0.15s;
}
.post-nav a:hover { border-color: var(--green); transform: translateY(-2px); }
.post-nav span { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--terra); }
.post-nav strong { font-family: var(--font-display); font-size: 1.06rem; line-height: 1.25; }

.comments-details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); padding: 16px 20px; margin-top: 24px;
}
.comments-details summary { cursor: pointer; font-weight: 700; font-size: 0.95rem; }
.comment-item { padding: 14px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.comment-meta { font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 4px; }
.comment-body { font-family: var(--font-serif); font-size: 0.98rem; line-height: 1.55; margin: 0; }

/* ============ PAGE HERO, TALKS & CONTACT ============ */
.page-hero {
  padding: clamp(32px, 5vw, 58px) 0 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-alt), var(--paper));
}
.page-hero h1 {
  font-family: var(--font-display); font-size: clamp(2.05rem, 4.4vw, 3.1rem);
  line-height: 1.08; margin: 12px 0 10px; font-weight: 600; letter-spacing: -0.025em;
}
.page-hero p { font-family: var(--font-serif); font-size: 1.2rem; color: var(--ink-soft); margin: 0; max-width: 62ch; }

.cards-two { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.info-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.info-card h3 { font-family: var(--font-display); font-size: 1.26rem; line-height: 1.24; margin: 0; }
.info-card p { font-family: var(--font-serif); color: var(--ink-soft); margin: 0; font-size: 1.03rem; }

.contact-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.form-stack { display: grid; gap: 14px; }
.field-lbl { display: grid; gap: 6px; font-size: 0.86rem; font-weight: 700; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-msg { font-size: 0.92rem; font-weight: 600; min-height: 1.3em; margin: 4px 0 0; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: var(--terra); }

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--line); background: var(--paper-alt);
  padding: 44px 0 32px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; margin-bottom: 28px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-family: var(--font-display); font-size: 1.12rem; margin: 0 0 10px; }
.footer-grid p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; max-width: 48ch; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 0.92rem; }
.footer-links a { text-decoration: none; color: var(--ink-soft); font-weight: 600; }
.footer-links a:hover { color: var(--green); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 0.82rem; color: var(--ink-soft);
}

/* ============ TOAST & PREVIEW BANNER ============ */
#toast-region {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: grid; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--pine); color: #FAF6EE; padding: 11px 20px;
  border-radius: 999px; font-size: 0.88rem; font-weight: 700;
  box-shadow: var(--shadow-lg); pointer-events: auto;
}
.preview-banner {
  background: var(--terra); color: #fff; text-align: center;
  padding: 8px 16px; font-size: 0.84rem; font-weight: 700;
}
.noscript { padding: 32px; text-align: center; font-weight: 700; }
