/* =====================================================
   NICHE RESEARCHERS — MASTER STYLESHEET
   Single shared stylesheet for every page.
   Fluid layout: readable text column + wide breakout
   elements (images, CTA) via .page-wrap grid + .wide.
   ===================================================== */

:root {
  --ink:        #1A1A2E;
  --body-text:  #2C2C3E;
  --bg:         #F7F6F2;
  --bg-alt:     #EFECE5;
  --bg-header:  #1A1A2E;
  --bg-footer:  #12121F;
  --accent:        #FF2400;
  --accent-hover:  #CC1D00;
  --rule:       #D8D5CE;
  --muted:      #6B6B7B;
  --white:      #FFFFFF;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans:  system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  /* Layout: comfortable reading column vs. wide breakout elements */
  --content:  700px;
  --wide:     1120px;
  --gutter:   clamp(20px, 4vw, 56px);

  /* Fluid type scale */
  --fs-h1:    clamp(1.85rem, 1.35rem + 2.2vw, 3rem);
  --fs-h2:    clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  --fs-h3:    clamp(0.95rem, 0.9rem + 0.2vw, 1.0625rem);
  --fs-body:  clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --fs-lead:  clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);
  --fs-small: clamp(0.8125rem, 0.8rem + 0.1vw, 0.875rem);

  --line-body: 1.75;
  --shadow-sm: 0 1px 2px rgba(26,26,46,0.05), 0 4px 14px rgba(26,26,46,0.05);
  --shadow-md: 0 2px 4px rgba(26,26,46,0.06), 0 12px 32px rgba(26,26,46,0.08);
  --radius: 10px;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: clamp(16px, 15px + 0.3vw, 18px);
  -webkit-text-size-adjust: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--body-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--line-body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; display: block; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* =====================================================
   HEADER — dark navy, full-bleed bar with a fluid inner
   ===================================================== */
.site-header { background: var(--bg-header); }
.site-header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 28px) var(--gutter) 0;
}
.site-brand { display: flex; flex-direction: column; gap: 6px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.site-name { font-family: var(--font-serif); font-size: clamp(22px, 1.6vw + 16px, 32px); font-weight: normal; color: #FFFFFF; letter-spacing: -0.01em; text-decoration: none; }
.site-name:hover { color: var(--accent); }
.site-tagline { font-size: var(--fs-small); color: #B0B8C8; letter-spacing: 0.03em; font-style: italic; }
.site-nav { display: flex; gap: 0; flex-wrap: wrap; }
.nav-link { font-family: var(--font-sans); font-size: 0.9375rem; color: #C8D0DC; text-decoration: none; padding: 14px 20px 14px 0; margin-right: 4px; letter-spacing: 0.02em; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.nav-link:hover { color: #FFFFFF; border-bottom-color: rgba(255,255,255,0.3); }
.nav-link.active { color: #FFFFFF; border-bottom-color: var(--accent); font-weight: 600; }
.nav-link-home { display: none; }

@media (min-width: 760px) {
  .site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-top: clamp(20px, 2vw, 26px); padding-bottom: clamp(20px, 2vw, 26px); }
  .site-brand { flex-direction: row; align-items: baseline; gap: 14px; padding-bottom: 0; border-bottom: none; }
  .site-nav { padding-top: 0; }
  .nav-link { padding: 8px 0 8px 28px; margin-right: 0; }
}

/* =====================================================
   BODY — fluid content grid: text column + wide breakouts
   ===================================================== */
.page-wrap {
  display: grid;
  grid-template-columns: 1fr min(var(--wide), 100% - 2 * var(--gutter)) 1fr;
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
}
.page-wrap > * {
  grid-column: 2;
  justify-self: center;
  width: 100%;
  max-width: var(--content);
}
.page-wrap > .wide { max-width: var(--wide); }

/* Page hero / intro */
.page-intro { padding: clamp(24px, 4vw, 44px) 0 clamp(24px, 3vw, 32px); border-bottom: 2px solid var(--ink); margin-bottom: clamp(32px, 4vw, 48px); }
.page-intro h1 { font-family: var(--font-serif); font-size: var(--fs-h1); color: var(--ink); line-height: 1.2; font-weight: normal; margin-bottom: 18px; }
.page-intro .lead { font-size: var(--fs-lead); color: var(--muted); line-height: 1.7; max-width: 640px; }

/* Headings */
h2 { font-family: var(--font-serif); font-size: var(--fs-h2); color: var(--ink); font-weight: normal; margin: clamp(36px, 5vw, 56px) 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
h3 { font-family: var(--font-sans); font-size: var(--fs-h3); font-weight: 600; color: var(--accent); margin: 28px 0 10px; text-transform: none; letter-spacing: 0.01em; }

/* Body text */
p { color: var(--body-text); margin-bottom: 20px; line-height: var(--line-body); }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
strong { color: var(--ink); font-weight: 600; }
ul, ol { margin: 12px 0 20px 24px; }
ul li, ol li { color: var(--body-text); margin-bottom: 8px; line-height: 1.7; }

/* Info / callout box */
.callout { background: var(--white); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow-sm); padding: 22px 26px; margin: 28px 0; }
.callout p { margin-bottom: 0; color: var(--body-text); font-size: 0.9375rem; }
.callout a { color: var(--accent); }
.callout a:hover { color: var(--accent-hover); }

/* Finding box (case studies) */
.finding { background: var(--white); border: 1px solid var(--rule); border-left: 3px solid var(--ink); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow-sm); padding: 22px 26px; margin: 20px 0; }
.finding p { margin-bottom: 0; font-style: italic; color: var(--body-text); }
.finding a { color: var(--accent); }
.finding a:hover { color: var(--accent-hover); }

/* Source note */
.source-note { font-size: var(--fs-small); color: var(--muted); margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rule); }
.source-note a { color: var(--accent); font-size: var(--fs-small); text-decoration: underline; text-underline-offset: 3px; }
.source-note a:hover { color: var(--accent-hover); }

/* Steps list */
.steps { list-style: none; margin: 20px 0; }
.steps li { display: flex; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.steps li:last-child { border-bottom: none; }
.step-n { font-family: var(--font-serif); font-size: 1.375rem; color: var(--accent); min-width: 30px; line-height: 1.5; }
.step-body { flex: 1; }
.step-body strong { display: block; color: var(--ink); font-size: 0.9375rem; margin-bottom: 4px; }
.step-body span { color: var(--body-text); font-size: 0.9375rem; line-height: 1.65; }
.step-body a { color: var(--accent); }
.step-body a:hover { color: var(--accent-hover); }

/* Sites list */
.sites-list { list-style: none; margin: 20px 0; }
.sites-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.sites-list li:last-child { border-bottom: none; }
.sites-list a { color: var(--accent); font-size: 1rem; text-decoration: none; font-weight: 600; }
.sites-list a:hover { color: var(--accent-hover); text-decoration: underline; }
.sites-empty { color: var(--muted); font-size: 0.9375rem; font-style: italic; padding: 16px 0; }

/* Case study label */
.case-label { display: inline-block; font-size: 0.6875rem; color: var(--accent); letter-spacing: 0.08em; font-weight: 600; border: 1px solid var(--accent); border-radius: 4px; padding: 4px 10px; margin-bottom: 16px; text-transform: uppercase; }

/* CTA box */
.cta-box { background: var(--ink); border-radius: var(--radius); padding: clamp(28px, 4vw, 44px) clamp(24px, 5vw, 56px); margin: 44px 0; text-align: center; box-shadow: var(--shadow-md); }
.cta-box p { color: rgba(255,255,255,0.85); margin-bottom: 20px; font-size: 1rem; }
.cta-btn { display: inline-block; background: var(--accent); color: var(--white); padding: 13px 32px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.02em; transition: background 0.15s, transform 0.15s; }
.cta-btn:hover { background: var(--accent-hover); color: var(--white); transform: translateY(-1px); }

/* Contact box */
.contact-box { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: clamp(24px, 4vw, 36px); margin: 40px 0; }
.contact-box h2 { margin-top: 0; padding-top: 0; border-bottom: none; }
.contact-link { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 600; font-size: 1.0625rem; text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.contact-link:hover { color: var(--accent-hover); border-color: var(--accent-hover); }

/* Accordion (PAA / Common Questions) */
.accordion-item { border-bottom: 1px solid var(--rule); }
.accordion-btn { width: 100%; background: none; border: none; text-align: left; padding: 18px 4px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 600; color: var(--ink); transition: color 0.15s; }
.accordion-btn:hover { color: var(--accent); }
.accordion-btn::after { content: '+'; color: var(--accent); font-size: 1.25rem; font-weight: 400; flex-shrink: 0; }
.accordion-btn[aria-expanded="true"]::after { content: '−'; }
.accordion-body { display: none; padding: 0 4px 18px; color: var(--body-text); font-size: 0.9375rem; line-height: 1.7; }
.accordion-body a { color: var(--accent); }
.accordion-body a:hover { color: var(--accent-hover); }
.accordion-body.open { display: block; }

/* FAQ (no accordion) */
.faq-item { padding: 20px 4px; border-bottom: 1px solid var(--rule); }
.faq-q { font-weight: 600; color: var(--ink); font-size: 0.9375rem; margin-bottom: 8px; }
.faq-a { color: var(--body-text); font-size: 0.9375rem; line-height: 1.7; }
.faq-a a { color: var(--accent); }
.faq-a a:hover { color: var(--accent-hover); }

/* Attribution */
.attribution { border-top: 2px solid var(--ink); padding: 24px 0; margin-top: 48px; }
.attribution strong { font-family: var(--font-serif); font-size: 1rem; color: var(--ink); display: block; margin-bottom: 6px; }
.attribution p { font-size: 0.875rem; color: var(--muted); margin-bottom: 0; }
.attribution a { color: var(--accent); }
.attribution a:hover { color: var(--accent-hover); }

/* Disclosure box */
.disclosure { background: var(--white); border-left: 3px solid var(--ink); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow-sm); padding: 20px 24px; margin: 20px 0; }
.disclosure p { margin-bottom: 0; font-size: 0.9375rem; }

/* Takeaways */
.takeaways { background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: clamp(22px, 3vw, 30px) clamp(22px, 4vw, 32px); margin-bottom: 40px; }
.takeaways-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 14px; text-transform: uppercase; }
.takeaways ul { list-style: none; margin: 0; padding: 0; }
.takeaways ul li { padding: 6px 0 6px 22px; font-size: 0.9375rem; color: var(--body-text); position: relative; line-height: 1.6; }
.takeaways ul li::before { content: '✓'; color: var(--accent); position: absolute; left: 0; font-weight: 600; }

/* TOC */
.toc { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 26px; margin-bottom: 40px; }
.toc-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 12px; text-transform: uppercase; }
.toc ol { padding-left: 18px; margin: 0; }
.toc ol li { margin-bottom: 7px; }
.toc ol li a { color: var(--accent); text-decoration: none; font-size: 0.9375rem; }
.toc ol li a:hover { text-decoration: underline; }

/* Wide breakout images (hero / feature images) */
.page-wrap > img.wide { border-radius: var(--radius); box-shadow: var(--shadow-md); margin-bottom: 40px; }

/* Hero image placeholder */
.hero-img { width: 100%; background: var(--rule); height: 280px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.875rem; margin-bottom: 36px; border-radius: var(--radius); }

/* Preview banner */
.preview-banner { background: #FEF3C7; color: #92400E; padding: 10px 20px; text-align: center; font-size: 12px; font-weight: 600; border-bottom: 1px solid #F59E0B; }

/* =====================================================
   FOOTER — near-black, full-bleed bar with a fluid inner
   ===================================================== */
.site-footer { background: var(--bg-footer); padding: 44px 0 32px; margin-top: 64px; border-top: 3px solid var(--accent); }
.site-footer-inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.footer-name { font-family: var(--font-serif); font-size: 1.125rem; color: #E8EAF0; margin-bottom: 20px; font-weight: normal; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }
.footer-link { color: #9BA3B0; text-decoration: none; font-size: 0.875rem; padding: 4px 20px 4px 0; }
.footer-link:first-child { padding-left: 0; }
.footer-link:hover { color: #FFFFFF; text-decoration: underline; }
.footer-copy { font-size: 0.8125rem; color: #6B7280; margin-bottom: 6px; }
.footer-badge { font-size: 0.75rem; color: #4B5563; }
.footer-badge a { color: #4B5563; text-decoration: none; }
.footer-badge a:hover { color: #9BA3B0; }

@media (min-width: 760px) {
  .site-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 40px; }
  .footer-name { margin-bottom: 0; }
  .footer-nav { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
  .footer-copy { flex-basis: 100%; margin-top: 12px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
  .footer-badge { flex-basis: 100%; }
}

/* =====================================================
   READ ALSO / ARTICLE CARDS
   ===================================================== */
.cards-section { background: var(--bg-alt); padding: clamp(36px, 6vw, 56px) 0; border-top: 1px solid var(--rule); }
.cards-inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.cards-heading { font-family: var(--font-serif); font-size: 1rem; color: var(--muted); font-weight: normal; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 24px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.article-card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: block; box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s; }
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-img { width: 100%; height: 170px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 18px; }
.card-title { font-family: var(--font-serif); font-size: 1rem; font-weight: normal; color: var(--ink); line-height: 1.4; margin-bottom: 10px; }
.card-teaser { font-family: var(--font-sans); font-size: 0.8125rem; color: var(--muted); line-height: 1.65; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 600px) {
  .cta-box { padding: 24px 20px; }
  .takeaways, .toc { padding: 20px 18px; }
  .contact-box { padding: 22px 18px; }
}
