/* BooksGrub Blog. Palette and type from booksgrub.com: ink, gold, parchment;
   Poppins for headings, Inter for text, Noto Sans Tamil for Tamil. */

:root {
  --ink: #0f1629; --ink-soft: #1e2a45; --gold: #e8a020; --gold-light: #f5c05a; --gold-deep: #9a6408;
  --parchment: #f5edd8; --parchment-light: #faf6ee; --cream: #fafaf7; --border: #e5ddd0;
  --rose: #c4747a; --sage: #6b8f6e; --maroon: #8b3a3f; --muted: #6b7280;

  --bg: var(--cream); --surface: #fff; --band: var(--parchment); --soft: var(--parchment-light);
  --text: var(--ink); --text-2: #3b4458; --line: var(--border); --accent-text: var(--gold-deep);
  --shadow: 0 1px 2px rgba(15, 22, 41, .06), 0 14px 30px -16px rgba(15, 22, 41, .32);

  --head: "Poppins", "Noto Sans Tamil", system-ui, sans-serif;
  --ui: "Inter", "Noto Sans Tamil", system-ui, sans-serif;
  --ta: "Noto Sans Tamil", "Inter", system-ui, sans-serif;

  --kolam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23e8a020' stroke-width='1.3'%3E%3Cpath d='M0 22Q22 4 44 22Q22 40 0 22Z'/%3E%3Cpath d='M22 0Q4 22 22 44Q40 22 22 0Z'/%3E%3C/g%3E%3Cg fill='%23e8a020'%3E%3Ccircle cx='22' cy='22' r='2.2'/%3E%3Ccircle cx='0' cy='0' r='1.7'/%3E%3Ccircle cx='44' cy='0' r='1.7'/%3E%3Ccircle cx='0' cy='44' r='1.7'/%3E%3Ccircle cx='44' cy='44' r='1.7'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --surface: #111a2e; --band: #121c33; --soft: #0f182b;
    --text: #f1ebde; --text-2: #c6ccd8; --line: #26324e; --muted: #99a2b4; --accent-text: var(--gold-light);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 16px 34px -16px rgba(0, 0, 0, .75);
  }
  .brand img { background: #fff; border-radius: 8px; padding: 3px 7px; box-sizing: content-box; }
  .nav .shop { background: var(--gold); color: var(--ink); }
  .nav .shop:hover { background: var(--gold-light); color: var(--ink); }
  .footer { border-top: 1px solid var(--line); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; }
[lang="ta"] { font-family: var(--ta); }
[lang="en"] { font-family: var(--ui); }
img { max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--surface); padding: 10px 14px; border-radius: 8px; }

/* masthead */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { display: block; height: 40px; width: auto; }
.brand-tag { font: 600 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); background: var(--gold); padding: 6px 9px 5px; border-radius: 999px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { font-weight: 500; font-size: 15px; line-height: 1; text-decoration: none; color: var(--text-2); padding: 10px 13px; border-radius: 999px; transition: background .2s, color .2s; }
.nav a:hover { color: var(--text); background: var(--soft); }
.nav a[aria-current="page"] { color: var(--text); background: var(--band); box-shadow: inset 0 0 0 1px var(--line); }
.nav .shop { margin-left: 6px; background: var(--ink); color: #fff; font-weight: 600; }
.nav .shop:hover { background: var(--ink-soft); color: #fff; }

/* bands and headings */
.hero { position: relative; overflow: hidden; background: var(--band); border-bottom: 1px solid var(--line); }
.hero-in { position: relative; z-index: 1; padding-top: 54px; padding-bottom: 48px; }
.hero.slim .hero-in { padding-top: 40px; padding-bottom: 36px; }
.eyebrow { display: block; margin: 0 0 12px; font: 600 12px/1 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--accent-text); }
.eyebrow[lang="ta"], [lang="ta"] > .eyebrow { font-family: var(--ta); letter-spacing: .02em; font-size: 13px; }
.hero h1 { margin: 0; max-width: 24ch; font: 700 clamp(32px, 5.4vw, 54px)/1.25 var(--head); color: var(--text); }
.hero-sub { margin: 14px 0 0; max-width: 58ch; font-size: 17px; line-height: 1.65; color: var(--text-2); }
.rule { display: block; width: 64px; height: 4px; margin-top: 22px; border-radius: 4px; background: var(--gold); }
.kolam { position: absolute; top: -20px; right: -30px; bottom: -20px; width: min(560px, 62%); opacity: .6; pointer-events: none;
  background: var(--kolam) 0 0 / 44px 44px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%); mask-image: linear-gradient(90deg, transparent, #000 55%); }
.section-title { display: flex; align-items: center; gap: 14px; margin: 56px 0 22px; font: 700 24px/1.35 var(--head); }
.section-title small { font: 600 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* books, drawn standing on a shelf */
.stack { display: flex; justify-content: center; align-items: flex-end; width: 100%; }
.book { position: relative; display: block; flex: none; width: 128px; aspect-ratio: 2 / 3; border-radius: 3px 8px 8px 3px; overflow: hidden;
  background: var(--ink-soft); box-shadow: 0 1px 1px rgba(15, 22, 41, .12), 0 16px 30px -12px rgba(15, 22, 41, .6);
  transform: perspective(800px) rotateY(-16deg); transform-origin: left center; transition: transform .35s ease; }
.book::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .3), rgba(255, 255, 255, .2) 4%, rgba(0, 0, 0, .08) 8%, transparent 13%); }
.book img { display: block; width: 100%; height: 100%; object-fit: cover; }
.stack .book + .book { margin-left: -34px; }
.stack .book:nth-child(2) { z-index: 2; width: 146px; transform: perspective(800px) rotateY(-8deg) translateY(-10px); }
.stack .book:nth-child(3) { z-index: 1; }
.stack.small .book { width: 92px; }
.stack.small .book:nth-child(2) { width: 104px; }
.stack.small .book + .book { margin-left: -26px; }
.lead:hover .book, .card:hover .book { transform: perspective(800px) rotateY(-4deg); }
.placeholder { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 14px;
  background: var(--ink); color: var(--gold-light); }
.placeholder::before { content: ""; position: absolute; inset: 0; background: var(--kolam) 0 0 / 44px 44px; opacity: .3; }
.placeholder > span { position: relative; padding: 9px 14px 8px; border: 1px solid rgba(245, 192, 90, .55); border-radius: 6px; background: var(--ink);
  font: 600 13px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; }
.placeholder > span[lang="ta"] { font-family: var(--ta); letter-spacing: .02em; font-size: 14px; }

/* stamps: what kind of story */
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-size: 13px; line-height: 1.2; font-weight: 500; color: var(--muted); }
.stamp { display: inline-block; padding: 5px 7px 4px; border: 1.5px solid currentColor; border-radius: 4px; transform: rotate(-2deg);
  font: 700 11px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--k, var(--maroon)); }
.stamp[lang="ta"] { font-family: var(--ta); letter-spacing: 0; font-size: 12px; padding: 5px 7px; }
.k-new_book { --k: var(--accent-text); } .k-award { --k: var(--maroon); } .k-event { --k: #4c6e50; }
.k-review, .k-interview { --k: #3b4a6b; } .k-essay, .k-other, .k-fiction, .k-poetry { --k: #7a5560; }
@media (prefers-color-scheme: dark) {
  .k-award { --k: #e39aa0; } .k-event { --k: #9cc7a0; } .k-review, .k-interview { --k: #a9b8d8; }
  .k-essay, .k-other, .k-fiction, .k-poetry { --k: #d7b0b8; }
}

/* lead story */
.lead { display: grid; gap: 26px; margin: 36px 0 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.lead-media { display: flex; align-items: flex-end; justify-content: center; min-height: 250px; padding: 22px; border-radius: 16px; text-decoration: none;
  background: radial-gradient(120% 90% at 50% 100%, rgba(232, 160, 32, .24), transparent 62%), var(--soft); }
.lead-media .placeholder { aspect-ratio: auto; min-height: 220px; height: 100%; }
.lead h2 { margin: 12px 0; font: 700 clamp(25px, 3.2vw, 36px)/1.3 var(--head); }
.lead[lang="ta"] h2 { font-size: clamp(23px, 2.7vw, 31px); line-height: 1.5; }
.lead h2 a, .card h3 a { text-decoration: none; }
.lead h2 a:hover, .card h3 a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.dek { margin: 0 0 14px; font-size: 18px; line-height: 1.65; color: var(--text-2); }
.meta { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--muted); }
.lead .btn { margin-top: 20px; }
@media (min-width: 860px) {
  .lead { grid-template-columns: minmax(300px, 420px) 1fr; align-items: center; padding: 32px; }
  .lead-media { min-height: 340px; }
}

/* cards */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { display: flex; align-items: flex-end; justify-content: center; height: 200px; padding: 20px 20px 0; background: var(--soft); border-bottom: 1px solid var(--line); }
.card-media .placeholder { aspect-ratio: auto; height: 100%; border-radius: 12px 12px 0 0; }
.card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 20px; }
.card h3 { margin: 0; font: 700 19px/1.4 var(--head); }
.card[lang="ta"] h3 { font-size: 18px; line-height: 1.55; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.excerpt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 4px; font-size: 13px; }

/* section links */
.sections { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 56px 0 0; }
.section-link { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 26px; overflow: hidden; border-radius: 18px; background: var(--ink); color: #fff; text-decoration: none; }
.section-link::before { content: ""; position: absolute; inset: 0; background: var(--kolam) 0 0 / 44px 44px; opacity: .16; }
.section-link > * { position: relative; }
.section-link .eyebrow { margin: 0; color: var(--gold-light); }
.section-link strong { font: 700 22px/1.35 var(--head); }
.section-link > span:last-child { color: #c9cfdb; font-size: 14px; }
.section-link:hover strong { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 5px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 36px 0 0; }
.pager a { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 15px; text-decoration: none; }

/* a post */
.post-head { padding-top: 32px; }
.crumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 22px; font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--muted); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.post h1 { margin: 14px 0; font: 700 clamp(29px, 4.6vw, 46px)/1.22 var(--head); letter-spacing: -.01em; }
.post[lang="ta"] h1 { letter-spacing: 0; line-height: 1.4; font-size: clamp(27px, 4.2vw, 42px); }
.post .dek { font-size: 19px; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 22px 0 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--muted); }
.byline strong { color: var(--text); font-weight: 600; }
.prose { margin-top: 30px; font-size: 18px; line-height: 1.8; }
.post[lang="ta"] .prose { font-size: 17.5px; line-height: 1.95; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin: 42px 0 12px; font: 700 25px/1.35 var(--head); }
.prose h3 { margin: 32px 0 10px; font: 700 20px/1.4 var(--head); }
.post[lang="ta"] .prose h2 { font-size: 23px; line-height: 1.5; }
.post[lang="ta"] .prose h3 { font-size: 19px; line-height: 1.55; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 24px; }
.prose li { margin: 8px 0; padding-left: 4px; }
.prose li::marker { color: var(--gold); }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 26px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--gold); color: var(--text-2); }
.prose a { text-decoration-color: var(--gold); text-underline-offset: 3px; }
.post[lang="en"] .prose > p:first-of-type::first-letter { float: left; margin: 7px 10px 0 0; font: 700 3.3em/.82 var(--head); color: var(--gold); }

/* the shop shelf under a post */
.shelf { position: relative; margin: 44px 0 0; padding: 26px; overflow: hidden; border-radius: 20px; background: var(--band); border: 1px solid var(--line); }
.shelf::before { content: ""; position: absolute; inset: 0 0 auto auto; width: 220px; height: 140px; background: var(--kolam) 0 0 / 44px 44px; opacity: .35;
  -webkit-mask-image: linear-gradient(225deg, #000, transparent 70%); mask-image: linear-gradient(225deg, #000, transparent 70%); }
.shelf > * { position: relative; }
.shelf h2 { margin: 0 0 18px; font: 700 20px/1.4 var(--head); }
.shelf-list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.shelf-item { display: grid; grid-template-columns: 92px 1fr; gap: 20px; align-items: center; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.shelf-item .book { width: 92px; transform: none; }
.shelf-title { display: block; font: 600 17px/1.45 var(--head); text-decoration: none; }
.shelf-title:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.shelf-alt { display: block; font-size: 13px; color: var(--muted); }
.shelf-author { display: block; margin: 4px 0 12px; font-size: 14px; color: var(--text-2); }
.buy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.price { font-weight: 700; font-size: 19px; line-height: 1; }
.price s { margin-left: 6px; font-weight: 400; font-size: 14px; color: var(--muted); }
.oos { display: inline-block; font-weight: 600; font-size: 13px; color: var(--maroon); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 11px 18px; border: 0; border-radius: 10px; background: var(--gold); color: var(--ink);
  font-weight: 600; font-size: 14px; line-height: 1.1; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s; }
.btn:hover { background: var(--gold-light); }
.btn:active { transform: translateY(1px); }
.btn.ghost { margin-top: 14px; background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--gold); }
.btn.ghost:hover { background: var(--surface); }
.shop-cta p { margin: -8px 0 16px; color: var(--text-2); }

/* sources and sharing */
.sources { margin: 36px 0 0; padding: 22px 0 0; border-top: 1px dashed var(--line); font-size: 15px; line-height: 1.6; }
.sources h2 { margin: 0 0 10px; font: 600 12px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); }
[lang="ta"] .sources h2 { font-family: var(--ta); letter-spacing: 0; font-size: 14px; }
.sources ol { margin: 0; padding-left: 20px; }
.sources li { margin: 6px 0; }
.sources a { text-decoration-color: var(--gold); text-underline-offset: 3px; }
.sources b { font-weight: 600; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; }
.share-label { margin-right: 4px; font-weight: 600; font-size: 13px; color: var(--muted); }
.sh { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font: 600 13px/1 var(--ui); text-decoration: none; cursor: pointer; transition: border-color .2s, transform .2s; }
.sh::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gold)); }
.sh:hover { border-color: var(--c, var(--gold)); transform: translateY(-1px); }
.sh.wa { --c: #25d366; background: #25d366; border-color: #25d366; color: #fff; }
.sh.wa::before { background: #fff; }
.sh.tg { --c: #229ed9; } .sh.fb { --c: #1877f2; } .sh.x { --c: currentColor; }
[lang="ta"] .sh.copy { font-family: var(--ta); }
.post .narrow > .share:last-child { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.more { margin-top: 64px; padding: 4px 0 8px; background: var(--soft); border-top: 1px solid var(--line); }
.more .section-title { margin-top: 40px; }

/* about, 404 */
.page { padding-top: 44px; }
.page h1 { margin: 0 0 8px; font: 700 clamp(28px, 4vw, 40px)/1.35 var(--head); }
.about-en { margin: 44px 0 0; font: 700 24px/1.35 var(--head); }
.notfound { padding-top: 80px; padding-bottom: 20px; text-align: center; }
.notfound h1 { margin: 0; font: 700 clamp(28px, 4vw, 40px)/1.4 var(--head); }
.notfound .hero-sub { margin-left: auto; margin-right: auto; }
.notfound-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.notfound-actions .btn.ghost { margin-top: 0; }

/* footer */
.footer { margin-top: 72px; background: var(--ink); color: #c9cfdb; }
.footer .cols { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); padding-top: 46px; padding-bottom: 36px; }
.footer h2 { margin: 0 0 14px; font: 600 12px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-light); }
.footer ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { color: var(--gold-light); }
.logo-pill { display: inline-block; padding: 8px 12px; background: #fff; border-radius: 10px; }
.logo-pill img { display: block; height: 34px; width: auto; }
.foot-note { margin: 12px 0 0; max-width: 38ch; font-size: 14px; line-height: 1.6; }
.fine { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: #8e98ad; }

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .top { min-height: 62px; }
  .brand img { height: 32px; }
  .brand-tag { display: none; }
  .nav a { padding: 9px 10px; font-size: 14px; }
  .nav .shop { margin-left: 2px; }
  .hero-in { padding-top: 40px; padding-bottom: 36px; }
  .kolam { width: 70%; opacity: .45; }
  .lead { padding: 16px; border-radius: 18px; }
  .lead-media { min-height: 220px; padding: 16px; }
  .book { width: 108px; }
  .stack .book:nth-child(2) { width: 122px; }
  .shelf { padding: 18px; }
  .shelf-item { grid-template-columns: 76px 1fr; gap: 14px; padding: 12px; }
  .shelf-item .book { width: 76px; }
  .prose { font-size: 17px; }
  .post[lang="ta"] .prose { font-size: 16.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
