/* =========================================================
   GutCareHub — editorial wellness palette
   ========================================================= */

:root {
  /* Warm apothecary palette */
  --cream:        #F4EEE2;
  --cream-deep:   #EAE2D0;
  --parchment:    #E8DCC0;
  --ink:          #1B2520;
  --ink-soft:     #3A4540;
  --forest:       #2F5A3F;
  --forest-deep:  #1F3D2B;
  --sage:         #7A9080;
  --clay:         #B85C3C;
  --clay-soft:    #D78B6E;
  --rule:         rgba(27, 37, 32, 0.14);
  --rule-soft:    rgba(27, 37, 32, 0.07);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body:    "Manrope", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  --measure: 68ch;
  --radius:  4px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Subtle grain overlay for paper-like warmth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: 0.5;
}

main, header, footer, nav { position: relative; z-index: 2; }

/* =========================================================
   Typography
   ========================================================= */

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--forest-deep);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.5em;
  font-variation-settings: "SOFT" 50, "opsz" 48;
}

h1 { font-size: clamp(2.5rem, 5.5vw, 4.5rem); font-weight: 400; }
h2 { font-size: clamp(1.9rem, 3.3vw, 2.7rem); font-weight: 450; }
h3 { font-size: clamp(1.25rem, 1.7vw, 1.5rem); font-weight: 500; }
h4 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; font-family: var(--body); color: var(--clay); }

p { margin: 0 0 1.1em; max-width: var(--measure); }
p.lead { font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); }

a {
  color: var(--forest);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s, border-color 0.2s;
}
a:hover { color: var(--clay); border-color: var(--clay); }

ul, ol { padding-left: 1.2em; max-width: var(--measure); }
li { margin-bottom: 0.4em; }

strong { font-weight: 600; color: var(--forest-deep); }
em { font-style: italic; }

hr { border: 0; height: 1px; background: var(--rule); margin: 3rem 0; }

/* Eyebrow label */
.eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 1.2rem;
  display: inline-block;
}

/* =========================================================
   Layout
   ========================================================= */

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 4.5rem 0; }
@media (max-width: 600px) { section { padding: 3rem 0; } }

/* =========================================================
   Header / Nav
   ========================================================= */

.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(244, 238, 226, 0.92);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--forest-deep);
  letter-spacing: -0.01em;
  border: 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.brand .dot {
  width: 8px; height: 8px;
  background: var(--clay);
  border-radius: 50%;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.95rem;
  color: var(--ink-soft);
  border: 0;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--clay); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.3s;
}

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 6px 12px rgba(0,0,0,0.04);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
  }
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  padding: 6rem 0 5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: end;
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 3rem 0; }
}

.hero h1 {
  font-style: italic;
  font-weight: 350;
}
.hero h1 em {
  font-style: normal;
  color: var(--clay);
  font-weight: 450;
}

.hero-meta {
  border-left: 1px solid var(--rule);
  padding-left: 2rem;
}
.hero-meta p { font-size: 0.95rem; color: var(--ink-soft); }

@media (max-width: 880px) {
  .hero-meta { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
}

/* =========================================================
   Disclaimer banner
   ========================================================= */

.disclaimer-banner {
  background: var(--forest-deep);
  color: var(--cream);
  padding: 0.7rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.disclaimer-banner strong { color: var(--clay-soft); font-weight: 600; }

/* =========================================================
   Issue cards
   ========================================================= */

.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin-top: 2.5rem;
}

.issue-card {
  background: transparent;
  padding: 2rem 1.8rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: block;
  text-decoration: none;
  color: var(--ink);
  border-top: 0; border-left: 0;
  transition: background 0.25s, color 0.25s;
  position: relative;
}
.issue-card:hover {
  background: var(--forest-deep);
  color: var(--cream);
}
.issue-card:hover .issue-num,
.issue-card:hover .issue-title,
.issue-card:hover .issue-desc { color: var(--cream); }
.issue-card:hover .issue-arrow { color: var(--clay-soft); transform: translateX(4px); }

.issue-num {
  font-family: var(--display);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--clay);
  margin-bottom: 1rem;
  display: block;
}

.issue-title {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--forest-deep);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 0.6rem;
  display: block;
}

.issue-desc {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.issue-arrow {
  position: absolute;
  bottom: 1.5rem; right: 1.5rem;
  font-size: 1.1rem;
  color: var(--clay);
  transition: transform 0.25s, color 0.25s;
}

/* =========================================================
   Two-column comparison
   ========================================================= */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 2rem;
  border: 1px solid var(--rule);
}
.compare-col {
  padding: 2.2rem;
  background: var(--cream-deep);
}
.compare-col + .compare-col {
  border-left: 1px solid var(--rule);
  background: var(--parchment);
}
.compare-col h3 { color: var(--forest-deep); margin-bottom: 1rem; }

@media (max-width: 720px) {
  .compare-grid { grid-template-columns: 1fr; }
  .compare-col + .compare-col { border-left: 0; border-top: 1px solid var(--rule); }
}

/* =========================================================
   Issue detail blocks (long-form on issues page)
   ========================================================= */

.issue-block {
  padding: 3rem 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 80px;
}
.issue-block:last-child { border-bottom: 0; }

.issue-block-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.issue-block-num {
  font-family: var(--display);
  font-size: 3.5rem;
  color: var(--clay);
  font-style: italic;
  font-weight: 350;
  line-height: 1;
}
.issue-block-head h2 { margin: 0; }

@media (max-width: 600px) {
  .issue-block-head { gap: 1rem; }
  .issue-block-num { font-size: 2.5rem; }
}

/* Why-it-happens / what-helps callouts */
.callout {
  background: var(--parchment);
  padding: 1.5rem 1.8rem;
  border-left: 3px solid var(--clay);
  margin: 1.8rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout h4 { margin-bottom: 0.6rem; }
.callout p:last-child { margin-bottom: 0; }
.callout.urgent {
  background: #F5DCD3;
  border-color: #B83D1E;
}
.callout.urgent h4 { color: #B83D1E; }

/* =========================================================
   Table of contents
   ========================================================= */

.toc {
  background: var(--cream-deep);
  padding: 2rem 2.2rem;
  margin: 2rem 0 3rem;
  border-radius: var(--radius);
}
.toc h4 { margin-top: 0; }
.toc ol {
  margin: 0;
  padding-left: 1.4em;
  columns: 2;
  column-gap: 2rem;
}
.toc ol li { margin-bottom: 0.4em; }
.toc a { border: 0; color: var(--ink-soft); }
.toc a:hover { color: var(--clay); }
@media (max-width: 600px) { .toc ol { columns: 1; } }

/* =========================================================
   FAQ accordion
   ========================================================= */

.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
}
.faq-q {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--forest-deep);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-right: 0.5rem;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: "+";
  font-family: var(--body);
  font-size: 1.5rem;
  color: var(--clay);
  font-weight: 300;
  transition: transform 0.25s;
  flex-shrink: 0;
}
details[open] .faq-q::after { content: "−"; }
.faq-a { padding-top: 1rem; color: var(--ink-soft); }
.faq-a p:last-child { margin-bottom: 0; }

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  background: var(--forest-deep);
  color: var(--cream);
  border: 0;
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--clay); color: var(--cream); border: 0; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--forest-deep);
  border: 1px solid var(--forest-deep);
}
.btn-ghost:hover { background: var(--forest-deep); color: var(--cream); }

/* =========================================================
   Pull quote
   ========================================================= */

.pullquote {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.35;
  color: var(--forest-deep);
  border-left: 3px solid var(--clay);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2.5rem 0;
  max-width: 60ch;
}
.pullquote cite {
  display: block;
  font-size: 0.85rem;
  font-family: var(--body);
  font-style: normal;
  color: var(--ink-soft);
  margin-top: 0.8rem;
  letter-spacing: 0.05em;
}

/* =========================================================
   Section divider with label
   ========================================================= */

.section-rule {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.section-rule::before { content: ""; flex: 0 0 40px; height: 1px; background: var(--clay); }
.section-rule .eyebrow { margin: 0; }

/* =========================================================
   Footer
   ========================================================= */

footer.site-footer {
  background: var(--forest-deep);
  color: var(--cream);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.site-footer .container { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 3rem; }
@media (max-width: 760px) { .site-footer .container { grid-template-columns: 1fr; gap: 2rem; } }
.site-footer h4 { color: var(--clay-soft); margin-bottom: 1rem; }
.site-footer a { color: var(--cream); border: 0; }
.site-footer a:hover { color: var(--clay-soft); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5em; }
.footer-brand-text {
  font-family: var(--display);
  font-size: 1.4rem;
  font-style: italic;
  margin-bottom: 0.5rem;
}
.footer-bottom {
  border-top: 1px solid rgba(244, 238, 226, 0.12);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  font-size: 0.82rem;
  color: rgba(244, 238, 226, 0.6);
  text-align: center;
}
.footer-bottom p { margin: 0 auto; max-width: 60ch; }

/* =========================================================
   Page header (interior pages)
   ========================================================= */

.page-header {
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}
.page-header h1 {
  font-style: italic;
  font-weight: 350;
  max-width: 16ch;
}
.page-header .lead { margin-top: 1rem; }

/* =========================================================
   Reveal animation
   ========================================================= */

/* Only apply hidden state when JS is active, so the site works without JS */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* =========================================================
   Misc
   ========================================================= */

.tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  background: var(--parchment);
  color: var(--ink-soft);
  border-radius: var(--radius);
  margin-right: 0.4rem;
}

.resource-list {
  list-style: none;
  padding: 0;
}
.resource-list li {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
}
.resource-list li:last-child { border-bottom: 0; }
.resource-list strong { display: block; color: var(--forest-deep); margin-bottom: 0.2rem; }
