/* Kedaipal Blog — mirrors the design tokens used on kedaipal.com */

:root {
  /* Brand */
  --navy: #0f1729;          /* primary / "blue" */
  --navy-soft: #1d283a;
  --green: #10b77f;         /* accent */
  --green-deep: #067552;    /* accent emphasis (text on white) */
  --green-light: #36d399;

  /* Surfaces & text */
  --background: #ffffff;
  --foreground: #0f1729;
  --muted: #f1f5f9;
  --muted-foreground: #65758b;
  --border: #e1e7ef;

  /* Shape & type */
  --radius: 0.75rem;
  --radius-lg: calc(var(--radius) * 2.2);
  --font-display: "Red Hat Display", system-ui, sans-serif;
  --font-text: "Red Hat Text", system-ui, sans-serif;
  --font-mono: "Red Hat Mono", ui-monospace, monospace;
  --container: 72rem;
  --reading: 42rem;
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 768px) { .container { padding-inline: 2rem; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--green); color: #fff; }
.btn-accent:hover { background: color-mix(in srgb, var(--green) 90%, #000); }
.btn-primary { background: var(--navy); color: #f8fafc; }
.btn-primary:hover { background: var(--navy-soft); }
.btn-ghost { color: var(--muted-foreground); }
.btn-ghost:hover { background: var(--muted); color: var(--foreground); }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 50%, transparent); outline-offset: 2px; }

/* ---------- Header (floating pill nav, as on kedaipal.com) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0.75rem 0.75rem 0;
}
.nav {
  max-width: 64rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  padding: 0 0.5rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgb(15 23 41 / 0.04);
}
@media (min-width: 768px) {
  .site-header { padding: 1rem 1.25rem 0; }
  .nav { height: 4rem; padding: 0 0.75rem 0 1.5rem; }
}
.nav-logo img { height: 1.75rem; width: auto; }
@media (min-width: 640px) { .nav-logo img { height: 2rem; } }

.nav-links { display: none; gap: 0.25rem; align-items: center; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background-color .2s, color .2s;
}
.nav-links a:hover { background: var(--muted); color: var(--foreground); }
.nav-links a[aria-current="page"] { color: var(--green-deep); background: color-mix(in srgb, var(--green) 10%, transparent); }

/* ---------- Eyebrow / small labels ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--green-deep);
}

/* ---------- Blog hero ---------- */
.hero {
  padding-block: 4rem 2.5rem;
  text-align: center;
}
@media (min-width: 768px) { .hero { padding-block: 6rem 3.5rem; } }
.hero h1 {
  margin-top: 1rem;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
}
.hero h1 .accent { color: var(--green); }
.hero p {
  max-width: 36rem;
  margin: 1.25rem auto 0;
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

/* ---------- Category filter ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.25rem;
}
.chip {
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--foreground); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #f8fafc; }

/* ---------- Cover art (brand mesh placeholder, swap for real images) ---------- */
.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--navy);
  background-image:
    radial-gradient(75% 80% at 70% 20%, rgb(16 183 127 / 0.35), transparent 70%),
    radial-gradient(100% 60% at 0 100%, rgb(16 183 127 / 0.12), transparent 60%);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover--light {
  background-color: var(--muted);
  background-image: radial-gradient(70% 80% at 80% 10%, rgb(16 183 127 / 0.22), transparent 70%);
}
.cover--green {
  background-color: var(--green);
  background-image: radial-gradient(80% 90% at 20% 0, rgb(255 255 255 / 0.22), transparent 70%);
}
.cover-mark {
  position: absolute;
  inset: auto auto 1.25rem 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgb(248 250 252 / 0.92);
}
.cover--light .cover-mark { color: var(--navy); }

/* ---------- Featured post ---------- */
.featured {
  display: grid;
  gap: 1.75rem;
  align-items: center;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 900px) { .featured { grid-template-columns: 1.15fr 1fr; gap: 3rem; } }
.featured h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); margin-top: 0.75rem; }
.featured p { color: var(--muted-foreground); font-size: 1.0625rem; margin: 1rem 0 0; }
.featured a:hover h2 { color: var(--green-deep); }

/* ---------- Post meta ---------- */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 1.625rem;
  padding: 0 0.625rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 10%, transparent);
  color: var(--green-deep);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
}
.author { display: flex; align-items: center; gap: 0.625rem; margin-top: 1.5rem; }
.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
}
.author strong { display: block; font-family: var(--font-display); font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.author span { font-size: 0.8125rem; color: var(--muted-foreground); }

/* ---------- Post grid ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 3.5rem 1.75rem;
}
.section-head h2 { font-size: 1.5rem; }

.grid {
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  padding-bottom: 5rem;
}
.card { display: flex; flex-direction: column; }
.card .cover { transition: transform .3s ease; }
.card:hover .cover { transform: translateY(-3px); }
.card .meta { margin-top: 1.125rem; }
.card h3 { font-size: 1.25rem; margin-top: 0.625rem; transition: color .2s; }
.card:hover h3 { color: var(--green-deep); }
.card p { margin: 0.5rem 0 0; color: var(--muted-foreground); font-size: 0.9375rem; }
.card[hidden] { display: none; }

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted-foreground); padding: 3rem 0; }

/* ---------- CTA band (bg-cta-mesh on the main site) ---------- */
.cta {
  margin-bottom: 5rem;
  padding: 3rem 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  color: #f8fafc;
  background-color: var(--navy);
  background-image:
    radial-gradient(75% 80%, rgb(16 183 127 / 0.22), transparent 70%),
    radial-gradient(100% 50% at 0 100%, rgb(16 183 127 / 0.08), transparent 60%);
}
@media (min-width: 768px) { .cta { padding: 4.5rem 3rem; } }
.cta .eyebrow { color: var(--green-light); }
.cta h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-top: 0.875rem; }
.cta p { max-width: 30rem; margin: 1rem auto 0; color: rgb(248 250 252 / 0.7); }
.subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 28rem;
  margin: 2rem auto 0;
}
.subscribe input {
  flex: 1 1 14rem;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(255 255 255 / 0.06);
  color: #f8fafc;
  font: inherit;
  font-size: 0.9375rem;
}
.subscribe input::placeholder { color: rgb(248 250 252 / 0.5); }
.subscribe input:focus { outline: none; border-color: var(--green); }
.subscribe-note { margin-top: 0.875rem; font-size: 0.8125rem; color: rgb(248 250 252 / 0.55); min-height: 1.2em; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #f8fafc;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}
.footer-inner {
  display: grid;
  gap: 2.5rem;
  padding-block: 3.5rem 2rem;
}
@media (min-width: 768px) { .footer-inner { grid-template-columns: 1fr auto; } }
.footer-inner img { height: 2rem; width: auto; }
.footer-inner p { margin: 1.25rem 0 0; font-size: 0.875rem; color: rgb(248 250 252 / 0.65); }
.footer-cols { display: flex; flex-wrap: wrap; gap: 3rem; }
.footer-cols h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--green);
}
.footer-cols ul { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-cols a { font-size: 0.875rem; color: rgb(248 250 252 / 0.8); transition: color .2s; }
.footer-cols a:hover { color: var(--green-light); }
.footer-bottom {
  border-top: 1px solid rgb(255 255 255 / 0.1);
  padding-top: 1.5rem;
  font-size: 0.8125rem;
  color: rgb(248 250 252 / 0.5);
}

/* ---------- Article page ---------- */
.article-head {
  max-width: var(--reading);
  margin-inline: auto;
  padding-block: 3.5rem 2rem;
}
@media (min-width: 768px) { .article-head { padding-block: 5rem 2.5rem; } }
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}
.back:hover { color: var(--green-deep); }
.article-head h1 {
  font-size: clamp(2.125rem, 5vw, 3.25rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-top: 1rem;
}
.article-head .lede { font-size: 1.1875rem; color: var(--muted-foreground); margin: 1.25rem 0 0; }
.article-cover { max-width: 56rem; margin-inline: auto; }
.article-cover .cover { aspect-ratio: 21 / 9; }
/* Phones: same 16:10 shape as the cards, so the banner isn't a thin strip */
@media (max-width: 767px) {
  /* Full-bleed: cancel the container's side padding and square the corners */
  .article-cover { margin-inline: -1.25rem; }
  .article-cover .cover { aspect-ratio: 16 / 10; border-radius: 0; }
}

.prose {
  max-width: var(--reading);
  margin-inline: auto;
  padding-block: 3rem 4rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #334155;
}
.prose > * + * { margin-top: 1.25em; }
.prose p { margin-bottom: 0; }
.prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; color: var(--foreground); margin-top: 2.25em; }
.prose h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--foreground); margin-top: 1.75em; }
.prose a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--green) 45%, transparent); }
.prose a:hover { text-decoration-color: var(--green); }
.prose strong { color: var(--foreground); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--green); }
.prose blockquote {
  margin-inline: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--green);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--foreground);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.125em 0.375em;
  border-radius: 0.375rem;
  background: var(--muted);
  color: var(--foreground);
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin-block: 2.5em; }
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--green) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--green) 20%, transparent);
  font-size: 0.975rem;
}
.callout strong { color: var(--green-deep); }

.share {
  max-width: var(--reading);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem 4rem;
  border-top: 1px solid var(--border);
}
.share-links { display: flex; gap: 0.5rem; }
.icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  transition: all .2s;
}
.icon-btn:hover { border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green-deep); background: color-mix(in srgb, var(--green) 6%, transparent); }
.icon-btn svg { width: 1.125rem; height: 1.125rem; }

.related { border-top: 1px solid var(--border); background: #f8fafc; }
.related .grid { padding-bottom: 4rem; }

/* ---------- Sanity-driven content ---------- */
.featured > a { display: block; }
.cover-mark { max-width: 10ch; }
.cover img { position: absolute; inset: 0; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.icon-btn { background: none; cursor: pointer; }
.prose figure { margin-inline: 0; }
.prose figure img { width: 100%; height: auto; border-radius: var(--radius); }
.prose figcaption { margin-top: 0.625rem; font-size: 0.875rem; color: var(--muted-foreground); text-align: center; }

/* ---------- Audio player (article body) ---------- */
.prose .audio {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--green) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--green) 20%, transparent);
}
.audio-play {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.audio-play:hover { background: color-mix(in srgb, var(--green) 88%, #000); }
.audio-play:active { transform: scale(0.96); }
.audio-play svg { width: 1.25rem; height: 1.25rem; }
.audio-body { min-width: 0; }
.audio-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
}
.audio-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.audio-seek {
  --p: 0%;
  flex: 1;
  min-width: 0;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--green) var(--p), var(--border) var(--p));
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.audio-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-deep);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent);
}
.audio-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green-deep);
  border: 2px solid #fff;
}
.audio-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.prose .audio figcaption,
.audio-transcript { grid-column: 1 / -1; margin: 0; text-align: left; font-size: 0.875rem; line-height: 1.6; color: var(--muted-foreground); }
.audio-transcript summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--green-deep);
}
.audio-transcript p { margin: 0.5rem 0 0; }
