/* ==========================================================================
   Sharmila Vaidyanathan — The Yellow Turmeric
   One stylesheet for the whole site. Colors and sizes live in :root below.
   ========================================================================== */

:root {
  /* palette: turmeric + curry leaf */
  --turmeric: #f2b705;      /* accents: underlines, dots, focus rings */
  --band: #fae49b;          /* big yellow blocks (home intro, page titles) */
  --turmeric-soft: #fdf3cf;
  --leaf: #1e3a2f;
  --leaf-bright: #2f5a48;
  --paper: #ffffff;
  --text: #232323;
  --muted: #5e6a62;
  --line: #e2e6df;
  --on-turmeric: #1e3a2f;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --page-max: 1920px;
  --gutter: clamp(16px, 4.5vw, 96px);
  --measure: 48rem;          /* story text column (~78 characters) */
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111a16;
    --text: #e6ebe7;
    --muted: #9fb0a5;
    --line: #26342d;
    --leaf: #cfe3d6;
    --leaf-bright: #f2c94c;
    --turmeric-soft: #2a2a17;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* type grows gently with the screen: 16px on phones, ~17px on laptops, 20px on big monitors */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-size: clamp(16px, 0.42vw + 11px, 20px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, iframe, video { max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--serif); color: var(--leaf); line-height: 1.12; margin: 0; text-wrap: balance; }

.bar { width: 100%; max-width: var(--page-max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--leaf); color: #fff; padding: 10px 16px; z-index: 10; }
.skip:focus { left: 16px; top: 16px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 40px; min-height: 76px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.wordmark {
  display: inline-flex; align-items: center; gap: .55em;
  font: 700 clamp(1.35rem, 2.2vw, 1.7rem)/1.1 var(--serif);
  color: var(--leaf); text-decoration: none; letter-spacing: -0.01em;
}
/* TYT logo before the name */
.wordmark-logo { width: 1.9em; height: 1.9em; border-radius: 8px; flex: none; display: block; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 26px; font: 500 .98rem/1.2 var(--sans); }
.nav a { text-decoration: none; color: var(--text); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--turmeric); }
.nav a[aria-current="page"] { border-bottom-color: var(--leaf); color: var(--leaf); }

/* ---------- turmeric band (home intro, section + listing titles) ---------- */
.hero, .band { background: var(--band); color: var(--on-turmeric); }
.hero h1, .band h1 { color: var(--on-turmeric); }
.hero a, .band a { color: var(--on-turmeric); }

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 96px); align-items: center;
  padding-top: clamp(48px, 7vw, 112px); padding-bottom: clamp(48px, 7vw, 112px);
}
.hero-title {
  font-size: clamp(2.1rem, 3.4vw, 3.9rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; max-width: 22ch;
  font-variation-settings: "opsz" 72;
}
.hero-body { margin-top: 1.8rem; max-width: 42rem; font: 400 clamp(1.1rem, 1.35vw, 1.28rem)/1.55 var(--serif); }
.hero-body p { margin: 0 0 .9em; }
.hero-body a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin: 2rem 0 0; }
.hero-art { margin: 0; justify-self: center; max-width: 520px; }
.hero-art img { display: block; width: 100%; border-radius: 50% 50% var(--radius) var(--radius); background: #fff; }
.hero-art figcaption { margin-top: 10px; font-size: .85rem; text-align: center; opacity: .85; }
/* home intro: lead paragraph + topic chips above the illustration */
.hero-lead { font-size: 1.22em; line-height: 1.45; font-weight: 500; }
.hero-side { justify-self: center; width: 100%; max-width: 520px; }
.hero-side .hero-art { max-width: none; }
.chips { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: var(--turmeric-soft); border: 1.5px solid var(--turmeric);
  box-shadow: 0 1px 2px rgba(30, 58, 47, .08);
  font: 600 .92rem/1.2 var(--sans); color: var(--on-turmeric); text-decoration: none;
}
a.chip:hover { background: #1e3a2f; border-color: #1e3a2f; color: #fff; }

.band .bar { padding-top: clamp(40px, 6vw, 88px); padding-bottom: clamp(36px, 5vw, 72px); }
.band-title { font-size: clamp(2rem, 3.4vw, 3.3rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variation-settings: "opsz" 72; }
.band-sub { margin: .7rem 0 0; font: 700 clamp(1.2rem, 1.6vw, 1.5rem)/1.35 var(--sans); max-width: 46rem; }
.band-note { font-weight: 400; font-size: 1.1rem; line-height: 1.5; }   /* plain sentence under a title, e.g. on the 404 page */

.button {
  display: inline-block; background: #1e3a2f; color: #fff !important; text-decoration: none;
  font: 600 1rem/1 var(--sans); padding: 16px 24px; border-radius: 999px;
}
.button:hover { background: #12271f; }
.link-strong { font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: currentColor; }
.link-strong:hover { text-decoration-color: var(--turmeric); }
.hero .link-strong:hover { text-decoration-color: var(--leaf); }

/* ---------- sections ---------- */
.section { padding-top: clamp(48px, 6vw, 96px); padding-bottom: clamp(48px, 6vw, 96px); }
.section + .section { padding-top: 0; }
.section-title {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem); font-weight: 600; letter-spacing: -0.015em;
  padding-bottom: 18px; margin-bottom: clamp(28px, 3.5vw, 48px); border-bottom: 2px solid var(--leaf);
}
.section-more { margin: clamp(32px, 4vw, 56px) 0 0; font-size: 1.05rem; color: var(--leaf); }

/* ---------- story cards ---------- */
.grid {
  display: grid; gap: clamp(36px, 4vw, 56px) clamp(24px, 2.6vw, 40px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
.card { display: flex; flex-direction: column; min-width: 0; }
.card-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--turmeric-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card-noimg {
  display: flex; align-items: flex-end; height: 100%; padding: 18px 20px;
  font: italic 500 1.5rem/1.1 var(--serif); color: var(--leaf);
}
.card-body { padding-top: 18px; }
.card-title { font-size: clamp(1.3rem, 1.6vw, 1.55rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-decoration-color: var(--turmeric); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
.card-cat { color: var(--leaf-bright); font-weight: 600; text-decoration: none; }
.card-cat:hover { text-decoration: underline; }
.card-excerpt { margin: 10px 0 0; font: 400 1.08rem/1.5 var(--serif); color: var(--text); }

.card-lead { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; margin-bottom: clamp(48px, 5vw, 80px); }
.card-lead .card-img { aspect-ratio: 16 / 10; }
.card-lead .card-body { padding-top: 0; }
.card-lead .card-title { font-size: clamp(1.9rem, 3.4vw, 3.1rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
.card-lead .card-excerpt { font-size: clamp(1.1rem, 1.4vw, 1.3rem); margin-top: 16px; }

/* ---------- topics ---------- */
.topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); column-gap: clamp(40px, 5vw, 96px); }
.topics a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 20px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.topic-name { font: 600 1.35rem/1.2 var(--serif); color: var(--leaf); }
.topic-count { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.topics a:hover .topic-name { text-decoration: underline; text-decoration-color: var(--turmeric); text-decoration-thickness: 3px; text-underline-offset: 4px; }

/* ---------- story page ---------- */
/* title block lines up with the text column below it */
.post-head { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-top: clamp(40px, 6vw, 96px); padding-bottom: clamp(28px, 3vw, 44px); }
.post-cats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px; font-weight: 600; font-size: .95rem; }
.post-cats a { color: var(--leaf-bright); text-decoration: none; border-bottom: 2px solid var(--turmeric); }
.post-title { font-size: clamp(2rem, 3.4vw, 3.3rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variation-settings: "opsz" 72; }
.post-meta { margin: 22px 0 0; color: var(--muted); font-size: 1rem; }
.post-meta a { color: var(--text); font-weight: 600; text-decoration: none; }

/* lead image: sits at the left of the text, which wraps beside it and continues below */
.prose .post-hero { float: left; width: 42%; margin: .3em 2rem 1.2rem 0; }
.prose .post-hero img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.prose > .post-hero + * { margin-top: 0; }
/* drop cap: first letter of a story, big and bold, spanning ~3 lines */
.post .prose > p:first-of-type::first-letter {
  float: left; font-size: 2.8em; line-height: .86; font-weight: 700; color: var(--leaf);
  margin: .08em .1em 0 0; font-variation-settings: "opsz" 72;
}
/* wide things (big centered images, videos, tables) start below the lead image instead of squeezing beside it */
.prose .aligncenter, .prose .video, .prose table, .prose figure:not(.post-hero):not(.alignleft):not(.alignright) { clear: both; }

.prose {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  font: 400 clamp(1.15rem, 1.25vw, 1.28rem)/1.7 var(--serif); overflow-wrap: break-word;
}
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose * + p { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.8em; line-height: 1.25; }
.prose h2 { font-size: 1.75em; } .prose h3 { font-size: 1.4em; } .prose h4 { font-size: 1.12em; font-weight: 600; }
.prose a { color: var(--leaf-bright); text-decoration-color: var(--turmeric); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose img { border-radius: 4px; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font: .9rem/1.4 var(--sans); color: var(--muted); margin-top: 8px; text-align: center; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose blockquote { margin: 1.6em 0; padding: 0 0 0 1.1em; border-left: 4px solid var(--turmeric); font-style: italic; }
.prose blockquote.pullquote { font: 500 1.45em/1.35 var(--serif); font-style: normal; color: var(--leaf); }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font: .95rem/1.45 var(--sans); }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px 12px; vertical-align: top; text-align: left; }
.prose .video { position: relative; aspect-ratio: 16 / 9; }
.prose .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose::after { content: ""; display: table; clear: both; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; text-align: center; }
.alignleft { float: left; margin: .35em 1.4em 1em 0; max-width: 48%; }
.alignright { float: right; margin: .35em 0 1em 1.4em; max-width: 48%; }
.text-center { text-align: center; } .text-right { text-align: right; }

.post-foot { margin-top: clamp(40px, 5vw, 64px); font-family: var(--sans); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.prose .tags { padding: 0; }      /* undo the list indent used in story text */
.prose .tags li { margin: 0; }   /* undo the list-item spacing used in story text */
.tags a { display: inline-block; padding: 6px 14px; border: 1px solid var(--turmeric); border-radius: 999px; background: var(--turmeric-soft); font-size: .9rem; text-decoration: none; }
.tags a:hover { border-color: #d39e00; background: #f6d56a; color: #1e3a2f; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: clamp(56px, 6vw, 96px); }
.post-nav a { display: block; padding: 24px 0 0; border-top: 2px solid var(--leaf); text-decoration: none; font: 600 clamp(1.15rem, 1.6vw, 1.45rem)/1.25 var(--serif); color: var(--leaf); }
.post-nav a span { display: block; font: 500 .9rem var(--sans); color: var(--muted); margin-bottom: 8px; }
.post-nav a:hover { color: var(--leaf-bright); }
.pn-next { grid-column: 2; text-align: right; }
.related { padding-top: clamp(56px, 6vw, 96px); }

/* ---------- footer ---------- */
.site-footer { background: #1e3a2f; color: #dfe8e2; margin-top: clamp(48px, 6vw, 96px); }
.site-footer a { color: #fff; text-decoration-color: var(--turmeric); text-underline-offset: 3px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-top: 64px; padding-bottom: 48px; }
.footer-name { font: 700 1.7rem/1.1 var(--serif); color: #fff; margin: 0 0 14px; }
.footer-about p { max-width: 32rem; }
.footer-email { font-weight: 600; font-size: 1.1rem; }
.footer-head { font-weight: 600; color: var(--turmeric); margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: 8px; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 20px; padding-bottom: 28px; font-size: .9rem; color: #b8c7bd; }
.footer-base p { margin: 0; }

/* ---------- responsive ---------- */
/* wider story column on big screens (laptops keep the 48rem column above) */
@media (min-width: 1600px) { :root { --measure: 56rem; } }
@media (min-width: 2200px) {
  :root { --measure: 62rem; }
  .prose { font-size: 1.38rem; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { max-width: 420px; justify-self: start; }
  .chips { justify-content: flex-start; }
  .card-lead { grid-template-columns: 1fr; }
  .card-lead .card-body { padding-top: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .site-header .bar { min-height: 0; }
  .nav { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); gap: 22px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .alignleft, .alignright { float: none; display: block; margin: 1.2em auto; max-width: 100%; }
  .prose .post-hero { float: none; width: auto; margin: 0 0 1.4rem; }
  .post-nav { grid-template-columns: 1fr; }
  .pn-next { grid-column: 1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .post-nav, .related { display: none; }
}
