/* ============================================================
   Palette drawn from the cover of "অশ্রুচুক্তি" (২০২৩):
   textured cream paper, crimson title, folk-art azure and ochre.
   Keeping the site's colours tied to the book means the accents
   read as deliberate rather than decorative.
   ============================================================ */
:root {
  --primary: #c76b2a;
  --primary-dark: #a2551f;
  --crimson: #a4231f;
  --crimson-dark: #7d1a17;
  --azure: #3f9dc4;
  --gold: #d9a441;

  /* Chrome (nav + footer) stays the established brown. */
  --dark: #5c4331;
  /* Headings sit darker than the chrome — the old #6b4f3a washed out on cream. */
  --ink: #32241a;
  --text: #4a3a2c;
  --text-muted: #8a7867;
  --border: #e7dbca;

  --surface: #ffffff;
  --surface-alt: #fbf7f0;
  /* The page ground is warm paper so white cards actually lift off it. */
  --paper: #f8f2e7;
  --paper-deep: #f2e9db;

  --radius: 12px;
  --radius-lg: 18px;
  /* Faint brand wash for call-to-action panels, so they read as intentional rather than empty. */
  --tint: rgba(199, 107, 42, 0.06);
  --tint-border: rgba(199, 107, 42, 0.22);
  --shadow-sm: 0 1px 2px rgba(50, 36, 26, 0.05), 0 2px 8px rgba(50, 36, 26, 0.05);
  --shadow: 0 6px 24px rgba(50, 36, 26, 0.10);
  --shadow-lg: 0 18px 44px rgba(50, 36, 26, 0.20);

  --font: 'Noto Sans Bengali', sans-serif;
  --font-serif: 'Noto Serif Bengali', serif;
  --font-display: 'Noto Serif Bengali', serif;
}

:root[data-theme="dark"] {
  --primary: #d8813f;
  --primary-dark: #c76b2a;
  --crimson: #e2726a;
  --crimson-dark: #cf5c53;
  --azure: #6dbcda;
  --gold: #e0b667;

  --dark: #2b211a;
  --ink: #f4ead9;
  --text: #e8ddcd;
  --text-muted: #ab9782;
  --border: #3b3027;

  --surface: #1d1613;
  --surface-alt: #251d18;
  --paper: #171210;
  --paper-deep: #120e0c;

  --tint: rgba(216, 129, 63, 0.12);
  --tint-border: rgba(216, 129, 63, 0.30);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.3;
}

::selection { background: var(--primary); color: #fff; }

/* Header */
.site-header { background: var(--surface); box-shadow: var(--shadow-sm); position: relative; z-index: 5; }
.site-header__top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 16px; flex-wrap: wrap; }
.header-controls { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); }
.lang-switch a { font-weight: 600; color: var(--text-muted); }
.lang-switch a:hover { color: var(--primary); }
.lang-switch a.active { color: var(--crimson); }
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface-alt); border-radius: 50%;
  width: 36px; height: 36px; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { border-color: var(--primary); transform: rotate(-12deg); }

.logo {
  font-family: var(--font-display);
  font-size: 1.55rem; font-weight: 700; color: var(--ink);
  letter-spacing: -0.01em; line-height: 1.2;
}
.logo span { color: var(--crimson); }

.search-form { display: flex; }
.search-form input {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 999px 0 0 999px;
  font-family: inherit;
  font-size: 0.88rem;
  width: 210px;
  background: var(--surface-alt);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search-form input:focus { border-color: var(--primary); background: var(--surface); }
.search-form button {
  padding: 9px 20px;
  border: none;
  background: var(--dark);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 0 999px 999px 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-form button:hover { background: var(--primary); }

.site-nav { background: var(--dark); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.07); }
.site-nav ul { display: flex; gap: 2px; flex-wrap: wrap; }
.site-nav a {
  display: block; padding: 13px 17px; color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem; font-weight: 600; position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav a::after {
  content: ''; position: absolute; left: 17px; right: 17px; bottom: 8px; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav a:hover { color: #fff; }
.site-nav a:hover::after { transform: scaleX(1); }

/* Hamburger: hidden on desktop, shown by the mobile media query below. */
.nav-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.4); background: transparent; color: #fff;
  border-radius: 8px; width: 42px; height: 40px; margin: 7px 0;
  font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.nav-toggle:hover { background: var(--primary); border-color: var(--primary); }

section { padding: 46px 0; }

/* Text pages open straight into content, so they need the air that the home
   page gets from its own <section> padding. */
main.container > article:first-child,
main.container > .page-narrow:first-child,
main.container > .section-title:first-child { margin-top: 42px; }

/* Section headings — a short two-tone rule instead of a plain left bar. */
.section-title {
  font-size: clamp(1.35rem, 2.6vw, 1.72rem);
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 26px;
}
.section-title::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 58px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--primary) 100%);
}

/* Featured grid */
.featured-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.featured-main { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/10; background: var(--surface-alt); box-shadow: var(--shadow-sm); }
.featured-main img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.featured-main:hover img { transform: scale(1.04); }
.featured-main__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28, 18, 12, 0.88), rgba(28, 18, 12, 0.15) 55%, transparent 75%);
  display: flex; align-items: flex-end; padding: 24px; color: #fff;
}
.featured-main__overlay h2 { color: #fff; font-size: 1.55rem; margin-top: 8px; }
.featured-side { display: flex; flex-direction: column; gap: 14px; }
.featured-side-item {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 10px;
  box-shadow: var(--shadow-sm);
}
.featured-side-item img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--surface-alt); }
.featured-side-item h3 { font-size: 0.98rem; line-height: 1.45; margin-top: 4px; }

/* Lead post — the newest piece, given room to breathe instead of a lone small card. */
.lead-post {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 26px;
}
.lead-post--no-image { grid-template-columns: 1fr; }
.lead-post__media { background: var(--surface-alt); overflow: hidden; min-height: 260px; }
.lead-post__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.lead-post:hover .lead-post__media img { transform: scale(1.04); }
/* align-items:flex-start keeps the badge and the "read" link at their own width —
   a column flex container would otherwise stretch them across the card. */
.lead-post__body { padding: 34px 36px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.lead-post__title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: 12px 0 10px; }
.lead-post__excerpt { color: var(--text-muted); font-family: var(--font-serif); font-size: 1.02rem; margin-bottom: 16px; }
.lead-post__meta { font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.lead-post__more { color: var(--crimson); font-weight: 700; font-size: 0.9rem; margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; }
.lead-post:hover .lead-post__more { gap: 11px; }
.lead-post__more span { transition: gap 0.2s ease; }

/* Article grid / list */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 24px; }
.article-card {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.article-card__image { aspect-ratio: 16/10; background: var(--surface-alt); overflow: hidden; }
.article-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.article-card:hover .article-card__image img { transform: scale(1.05); }
.article-card__body { padding: 16px 18px 18px; }
.article-card__category { font-size: 0.72rem; font-weight: 700; color: var(--crimson); letter-spacing: 0.04em; }
.article-card__title { font-size: 1.08rem; margin: 7px 0 8px; line-height: 1.45; }
.article-card__meta { font-size: 0.78rem; color: var(--text-muted); }

.category-badge {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--crimson);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

/* Article detail */
.article-header { max-width: 760px; margin: 0 auto 26px; text-align: left; }
.article-header h1 { font-size: clamp(1.8rem, 4.2vw, 2.5rem); margin: 14px 0 10px; }
.article-subtitle { font-family: var(--font-serif); font-size: 1.18rem; color: var(--text-muted); margin-bottom: 16px; font-style: italic; }
.article-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); align-items: center; padding-top: 14px; border-top: 1px solid var(--border); }
.article-meta a { color: var(--primary); font-weight: 600; }
.article-hero-image { max-width: 900px; margin: 0 auto 8px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.article-hero-image img { width: 100%; }
.article-image-caption { max-width: 900px; margin: 0 auto 32px; font-size: 0.82rem; color: var(--text-muted); text-align: center; }

.article-body {
  max-width: 720px; margin: 0 auto;
  font-size: 1.14rem; font-family: var(--font-serif); line-height: 1.95; color: var(--text);
}
/* A slightly larger opening paragraph reads as a lead-in. Deliberately not a
   drop cap: ::first-letter splits Bengali conjuncts and matras badly. */
.article-body > p:first-of-type { font-size: 1.06em; color: var(--ink); }
.article-body p { margin-bottom: 20px; }
.article-body h2, .article-body h3 { margin: 32px 0 12px; }
.article-body a { color: var(--crimson); border-bottom: 1px solid rgba(164, 35, 31, 0.35); }
.article-body a:hover { border-bottom-color: var(--crimson); }
.article-body img { border-radius: var(--radius); margin: 24px 0; box-shadow: var(--shadow-sm); }
.article-body blockquote {
  border-left: 3px solid var(--primary); background: var(--tint);
  padding: 16px 22px; margin: 24px 0; border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--ink);
}
.article-body ul, .article-body ol { margin: 0 0 20px 1.3em; }
.article-body ul li { list-style: disc; margin-bottom: 6px; }
.article-body ol li { list-style: decimal; margin-bottom: 6px; }

.article-tags { max-width: 720px; margin: 28px auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tag-pill {
  font-size: 0.78rem; background: var(--surface); border: 1px solid var(--border);
  padding: 5px 14px; border-radius: 999px; color: var(--text-muted);
}

.reactions { max-width: 720px; margin: 28px auto; display: flex; gap: 12px; }
.reaction-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-family: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.reaction-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

.related-section { max-width: 900px; margin: 48px auto 0; }

/* Comments */
.comments-section { max-width: 720px; margin: 48px auto 0; }
.comment-card { border-bottom: 1px solid var(--border); padding: 18px 0; }
.comment-card__author { font-weight: 700; font-size: 0.94rem; color: var(--ink); }
.comment-card__date { font-size: 0.78rem; color: var(--text-muted); margin-left: 8px; }
.comment-card__body { margin-top: 6px; color: var(--text); }
.comment-form { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.comment-form input, .comment-form textarea {
  padding: 12px 15px; border-radius: 10px; border: 1px solid var(--border);
  font-family: inherit; font-size: 0.92rem; background: var(--surface); color: var(--text);
  outline: none; transition: border-color 0.15s ease;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary); }
.comment-form button {
  align-self: flex-start; padding: 11px 26px; border-radius: 999px; border: none;
  background: var(--primary); color: #fff; font-family: inherit; font-weight: 700; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.comment-form button:hover { background: var(--primary-dark); transform: translateY(-2px); }
.comment-success { background: #ecfdf3; color: #067647; padding: 11px 16px; border-radius: 10px; font-size: 0.88rem; margin-bottom: 12px; }

/* CV request (about page) */
.cv-request { margin-top: 8px; }
.cv-request__done { background: #ecfdf3; color: #067647; padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; max-width: 600px; }
.cv-request__form input, .cv-request__form textarea {
  padding: 12px 15px; border-radius: 10px; border: 1px solid var(--border);
  font-family: inherit; font-size: 0.92rem; background: var(--surface); color: var(--text);
  outline: none;
}
.cv-request__form input:focus, .cv-request__form textarea:focus { border-color: var(--primary); }
.cv-request__form button { border: none; cursor: pointer; }

/* Sidebar layout (category/search) */
.content-layout { display: grid; grid-template-columns: 2.2fr 1fr; gap: 32px; align-items: flex-start; }
.sidebar-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.sidebar-box h3 { font-size: 1.05rem; margin-bottom: 14px; }
.sidebar-box li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.sidebar-box li:last-child { border-bottom: none; }

/* A single measured column so every block on a text page shares one left edge —
   .article-body centres itself, which otherwise fights left-aligned panels. */
.page-narrow { max-width: 780px; margin: 0 auto; }
.page-narrow .article-body { max-width: none; margin: 0; }
.page-narrow > * { max-width: none !important; }

/* Author page */
.author-header { display: flex; gap: 24px; align-items: center; margin-bottom: 32px; }
.author-avatar {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--surface-alt);
  border: 4px solid var(--surface); box-shadow: var(--shadow);
}
.author-header h1 { font-size: 1.5rem; }
.author-header p { color: var(--text-muted); font-size: 0.94rem; margin-top: 4px; }

/* The published book, shown as an object rather than described in text. */
.book-panel {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 30px; box-shadow: var(--shadow-sm);
}
.book-panel__cover img {
  width: 148px; border-radius: 3px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(50, 36, 26, 0.1);
}
.book-panel__title { font-size: 1.2rem; margin-bottom: 4px; }
.book-panel__year { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 14px; }
.book-panel blockquote {
  font-family: var(--font-serif); font-style: italic; color: var(--text);
  border-left: 3px solid var(--primary); padding-left: 16px; font-size: 0.98rem;
}
.book-panel blockquote cite { display: block; margin-top: 10px; font-style: normal; font-size: 0.82rem; color: var(--text-muted); }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 36px; }
.pagination a, .pagination span {
  padding: 9px 15px; border-radius: 8px; border: 1px solid var(--border); font-size: 0.88rem;
  background: var(--surface); transition: border-color 0.15s ease;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--dark); color: #fff; border-color: var(--dark); }

.empty-state {
  text-align: center; padding: 56px 24px; color: var(--text-muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg);
}

/* Footer */
.site-footer { background: var(--dark); color: #f0e6d8; padding: 44px 0; margin-top: 56px; border-top: 3px solid var(--primary); }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; }
.site-footer a { color: #f0e6d8; }
.site-footer .logo { color: #fff; }
.footer-note { font-size: 0.82rem; color: #d3c0aa; }

.social-links { display: flex; gap: 12px; }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); font-size: 0.78rem; font-weight: 700;
  transition: background 0.15s ease, transform 0.15s ease;
}
.social-links a:hover { background: var(--primary); transform: translateY(-3px); }

/* Video embed */
.video-embed { max-width: 760px; margin: 28px auto; }
.video-embed #video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius); }
.video-embed #video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }

/* Social feed — click-to-load facades, so no vendor script runs until asked */
.social-feed__grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.embed-facade { width: 100%; max-width: 500px; }
/* Compact CTA card, not a big empty placeholder: a faint sepia wash and the primary-filled
   icon keep it reading as something to click rather than a blank panel. */
.embed-facade__box {
  width: 100%;
  border: 1px solid var(--tint-border); border-radius: var(--radius); background: var(--tint);
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px;
  padding: 20px 22px; align-items: center;
}
.embed-facade__icon {
  grid-row: span 2; align-self: start;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.embed-facade__title { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.embed-facade__note { font-size: 0.78rem; color: var(--text-muted); }
.embed-facade__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.embed-facade__actions .btn { padding: 8px 16px; font-size: 0.85rem; }
.embed-facade__btn { border: none; cursor: pointer; font-family: inherit; }
/* Once loaded, the box just hosts the embed — drop the CTA framing. */
.embed-facade__box:has(.fb-page), .embed-facade__box:has(.embed-facade__player) {
  padding: 0; border: none; background: none; display: block;
}
.embed-facade__player { width: 100%; position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.embed-facade__player iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Hero */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 380px at 82% 12%, rgba(63, 157, 196, 0.10), transparent 62%),
    radial-gradient(900px 420px at 10% 88%, rgba(199, 107, 42, 0.12), transparent 60%),
    linear-gradient(170deg, var(--surface-alt) 0%, var(--paper-deep) 100%);
  padding: 68px 0 74px;
  overflow: hidden;
}
/* A hairline rule in the book's three colours, instead of a flat brown border. */
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--primary) 42%, var(--gold) 70%, var(--azure) 100%);
  opacity: 0.85;
}
.hero__inner { display: grid; grid-template-columns: 1.45fr 1fr; gap: 48px; align-items: center; }
.hero__text h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.15rem);
  margin-bottom: 10px; letter-spacing: -0.02em;
}
.hero__tagline { font-size: 1.02rem; color: var(--primary-dark); font-weight: 600; margin-bottom: 14px; }
.hero__book { color: var(--text); margin-bottom: 22px; font-size: 0.98rem; }
.hero__book strong { color: var(--crimson); }
.hero__quote {
  position: relative;
  font-family: var(--font-serif); font-style: italic; color: var(--ink);
  border-left: 3px solid var(--primary); padding: 6px 20px 6px 22px;
  margin-bottom: 26px; font-size: 1.02rem; line-height: 1.75;
}
.hero__quote::before {
  content: '\201C';
  position: absolute; top: -0.28em; left: 0.22em;
  font-family: var(--font-display); font-size: 4.2rem; line-height: 1;
  color: var(--crimson); opacity: 0.16; pointer-events: none;
}
.hero__quote cite { display: block; margin-top: 10px; font-style: normal; font-size: 0.82rem; color: var(--text-muted); }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 11px 26px; border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 0.92rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--outline { border: 2px solid var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--surface); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Portrait and book cover sit together — the book slightly behind and tilted,
   so the pair reads as one composition rather than two floating images. */
.hero__media { display: flex; align-items: flex-end; justify-content: center; }
.hero__photo img {
  width: 230px; height: 230px; border-radius: 50%; object-fit: cover;
  border: 7px solid var(--surface); box-shadow: var(--shadow-lg);
  position: relative; z-index: 2;
}
.hero__book-cover { margin-left: -40px; margin-bottom: 10px; z-index: 1; }
.hero__book-cover img {
  width: 142px; border-radius: 3px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(50, 36, 26, 0.12);
  transform: rotate(4deg);
  transition: transform 0.3s ease;
}
.hero__book-cover:hover img { transform: rotate(0deg) translateY(-6px); }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.gallery-item { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: var(--surface-alt); box-shadow: var(--shadow-sm); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px;
  background: linear-gradient(to top, rgba(28, 18, 12, 0.82), transparent);
  color: #fff; font-size: 0.82rem; font-weight: 600;
}

/* Hover lift on cards */
.article-card, .featured-main, .featured-side-item, .gallery-item, .lead-post {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover, .featured-main:hover, .gallery-item:hover, .featured-side-item:hover, .lead-post:hover {
  transform: translateY(-4px); box-shadow: var(--shadow);
}

/* Scroll-reveal. Only hide content once JS is confirmed running (html.js is set in
   the <head>), so a slow or failed script never leaves the page blank. */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

@media (max-width: 860px) {
  .featured-grid, .content-layout, .lead-post { grid-template-columns: 1fr; }
  .search-form input { width: 130px; }
  .hero { padding: 48px 0 54px; }
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 34px; }
  .hero__quote { text-align: left; }
  .hero__actions { justify-content: center; }
  .hero__photo img { width: 168px; height: 168px; }
  .hero__book-cover img { width: 106px; }
  .hero__book-cover { margin-left: -28px; }
  .lead-post__media { min-height: 200px; max-height: 280px; }
  .lead-post__body { padding: 26px 24px; }
  .book-panel { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 20px; }
  .book-panel blockquote { text-align: left; }
  .author-header { flex-direction: column; text-align: center; gap: 16px; }
}

/* Phone layout: shrink the wordmark so it never clips, and collapse the nav
   into a tap-to-open menu instead of a three-row wrap. */
@media (max-width: 760px) {
  .site-header__top { padding: 14px 0; gap: 10px 12px; }
  .logo { font-size: 1.15rem; }
  .search-form { order: 3; width: 100%; }
  .search-form input { flex: 1 1 auto; width: auto; }
  .header-controls { gap: 10px; }

  .site-nav .container { display: flex; flex-wrap: wrap; align-items: center; padding: 0 20px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav ul { display: none; flex-direction: column; width: 100%; gap: 0; }
  .site-nav.is-open ul { display: flex; }
  .site-nav li { width: 100%; }
  .site-nav a { padding: 14px 4px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .site-nav a::after { display: none; }

  section { padding: 34px 0; }
  .site-footer .container { justify-content: center; text-align: center; }
}

/* Press clippings — work published in newspapers and magazines.
   These leave the site, so they are styled as references rather than as the
   site's own article cards: publication name leads, and the arrow says "out". */
.page-lede { color: var(--text-muted); margin: -14px 0 26px; font-size: 1.02rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head .section-title { margin-bottom: 26px; }
.section-head__more { color: var(--crimson); font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.section-head__more:hover { text-decoration: underline; }

.press-list { display: flex; flex-direction: column; gap: 18px; }
.press-card {
  display: grid; grid-template-columns: 190px 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.press-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--tint-border); }
/* The thumb column disappears entirely when a clipping has no usable image
   (see the onerror handler in press.html), so the grid must cope with one child. */
.press-card__thumb { background: var(--surface-alt); overflow: hidden; }
.press-card__thumb img { width: 100%; height: 100%; object-fit: cover; min-height: 150px; }
.press-card--no-image { grid-template-columns: 1fr; }
.press-card__body { padding: 22px 26px; grid-column: -2 / -1; }
.press-card__publication {
  font-size: 0.76rem; font-weight: 700; color: var(--crimson);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.press-card__title { font-size: 1.2rem; margin: 8px 0 8px; line-height: 1.45; }
.press-card__summary {
  color: var(--text-muted); font-size: 0.94rem; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.press-card__meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-muted); }
.press-card__link { color: var(--crimson); font-weight: 700; }

/* Home-page teaser strip — a small thumbnail up top when the clipping has one,
   otherwise the crimson rule on the body carries it alone. */
.press-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.press-chip {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.press-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.press-chip__thumb { aspect-ratio: 16/9; background: var(--surface-alt); overflow: hidden; }
.press-chip__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.press-chip:hover .press-chip__thumb img { transform: scale(1.06); }
.press-chip__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; border-left: 3px solid var(--crimson); }
.press-chip__publication { font-size: 0.74rem; font-weight: 700; color: var(--crimson); letter-spacing: 0.04em; }
.press-chip__title { font-family: var(--font-display); font-weight: 700; color: var(--ink); line-height: 1.45; }
.press-chip__date { font-size: 0.78rem; color: var(--text-muted); }

@media (max-width: 760px) {
  .press-card { grid-template-columns: 1fr; }
  .press-card__thumb { max-height: 190px; }
  .press-card__body { padding: 18px 20px; grid-column: 1; }
}

/* Kind filter — plain buttons that hide rows client-side, so the server still
   renders every clipping on one indexable page. */
.kind-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.kind-chip {
  font-family: inherit; font-size: 0.84rem; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.kind-chip:hover { border-color: var(--primary); color: var(--primary); }
.kind-chip.is-active { background: var(--crimson); border-color: var(--crimson); color: #fff; }

.press-card__tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.press-card__kind {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--text-muted); background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}

/* Homepage category row — a compact index of what's on the site, sitting
   between the hero and the article sections. */
.category-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 6px; }
.category-row a {
  font-family: inherit; font-size: 0.86rem; font-weight: 600;
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.category-row a:hover { border-color: var(--crimson); color: var(--crimson); transform: translateY(-2px); }

/* A single, clearly-labelled ad/sponsor slot — sized like a classic leaderboard
   banner so it reads as its own thing, never mistaken for site content. */
.ad-banner {
  display: block; position: relative; max-width: 728px; margin: 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-alt); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}
.ad-banner:hover { box-shadow: var(--shadow); }
.ad-banner img { width: 100%; max-height: 140px; object-fit: cover; }
.ad-banner__label {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: rgba(0, 0, 0, 0.55); color: #fff; padding: 3px 9px; border-radius: 999px;
}
