/*
Theme Name: CaribFlyer
Theme URI: https://caribflyer.com
Description: Editorial wellness theme — A Editorial + P3 Navy chrome + T1 Figtree
Author: CaribFlyer
Version: 1.0.0
Text Domain: caribflyer
*/

/* ── Design tokens ── */
:root {
  --bg: #FFFFFF;
  --bg-alt: #F8F9FA;
  --navy: #0F1E36;
  --navy-light: #162B4D;
  --navy-hover: #1A3358;
  --text: #111827;
  --text-mid: #4B5563;
  --text-light: #6B7280;
  --text-inv: #F3F4F6;
  --mustard: #D4A017;
  --mustard-light: #F0C942;
  --mustard-dark: #B8860B;
  --border: #E5E7EB;
  --border-dark: #D1D5DB;
  --radius: 4px;
  --max-w: 640px;
  --max-w-wide: 900px;
  --font-display: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
  --lh: 1.7;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --bg-alt: #1F2937;
    --navy: #0A1628;
    --navy-light: #0F1E36;
    --navy-hover: #162B4D;
    --text: #F3F4F6;
    --text-mid: #D1D5DB;
    --text-light: #9CA3AF;
    --text-inv: #111827;
    --mustard: #F0C942;
    --mustard-light: #F7DC6F;
    --mustard-dark: #D4A017;
    --border: #374151;
    --border-dark: #4B5563;
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--mustard-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--mustard); }
a:focus-visible { outline: 2px solid var(--mustard); outline-offset: 2px; border-radius: var(--radius); }

button, [role="button"] {
  cursor: pointer;
  min-height: 48px;
  min-width: 48px;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--mustard);
  color: var(--navy);
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  z-index: 1000;
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--space-sm); }

/* ── Header — Archetype A minimal top bar ── */
.site-header {
  background: var(--navy);
  padding: var(--space-md) var(--space-lg);
}
.site-header-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFF;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--mustard-light); }
.site-logo span { color: var(--mustard); }

.site-nav { display: flex; gap: var(--space-lg); align-items: center; }
.site-nav a {
  color: var(--text-inv);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.site-nav a:hover { opacity: 1; color: var(--mustard-light); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #FFF;
  font-size: 1.5rem;
  min-height: 48px;
  min-width: 48px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
    z-index: 999;
  }
  .site-nav.open { display: flex; }
  .site-header { position: relative; }
}

/* ── Hero (navy section, editorial) ── */
.hero {
  background: var(--navy);
  padding: var(--space-2xl) var(--space-lg) var(--space-xl);
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  color: #FFF;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}
.hero .answer-capsule {
  color: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 600px;
}
.hero .dateline {
  color: var(--mustard);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Narrow column (Archetype A core) ── */
.narrow-col {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}
.wide-col {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* ── Content styling ── */
.entry-content h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  margin: var(--space-xl) 0 var(--space-md);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.entry-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: var(--space-lg) 0 var(--space-sm);
  line-height: 1.3;
}
.entry-content p {
  margin-bottom: var(--space-md);
  max-width: 70ch;
}
.entry-content ul, .entry-content ol {
  margin: var(--space-md) 0;
  padding-left: var(--space-lg);
}
.entry-content li { margin-bottom: var(--space-xs); }
.entry-content strong { font-weight: 600; }

/* Drop cap — Archetype A signature */
.entry-content > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 0.85;
  margin: 0.05em 0.1em 0 0;
  color: var(--mustard-dark);
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: var(--space-lg) 0; }
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.entry-content th {
  background: var(--navy);
  color: #FFF;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-display);
}
.entry-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.entry-content tr:nth-child(even) td { background: var(--bg-alt); }

/* ── Info box ── */
.info-box {
  background: var(--bg-alt);
  border-left: 4px solid var(--mustard);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Answer capsule ── */
.answer-capsule {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-mid);
  border-left: 3px solid var(--mustard);
  padding-left: var(--space-md);
  margin-bottom: var(--space-lg);
}

/* ── FAQ ── */
.faq-section { margin: var(--space-xl) 0; }
.faq-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: var(--space-lg);
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  padding: var(--space-md) 0;
  text-align: left;
  cursor: pointer;
  gap: var(--space-md);
}
.faq-q::after { content: '+'; font-size: 1.3rem; flex-shrink: 0; color: var(--mustard); }
.faq-q[aria-expanded="true"]::after { content: '\2212'; }
.faq-a {
  display: none;
  padding: 0 0 var(--space-md);
  color: var(--text-mid);
  line-height: 1.6;
}
.faq-a.open { display: block; }

/* ── Sources ── */
.sources-block {
  background: var(--bg-alt);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
  font-size: 0.88rem;
}
.sources-block h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.sources-block ol { padding-left: var(--space-lg); }
.sources-block li { margin-bottom: var(--space-xs); color: var(--text-light); }

/* ── CTA card ── */
.cta-card {
  background: var(--navy);
  color: #FFF;
  padding: var(--space-lg);
  border-radius: var(--radius);
  margin: var(--space-xl) 0;
}
.cta-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: #FFF;
}
.cta-card a {
  color: var(--mustard-light);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Author bio card ── */
.author-card {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
  padding: var(--space-lg);
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin: var(--space-xl) 0;
}
.author-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-card-info h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}
.author-card-info p {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* ── Post meta / byline ── */
.post-meta {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.post-meta a { color: var(--text-light); }
.post-meta .sep { color: var(--border-dark); }

/* ── Breadcrumbs ── */
.breadcrumbs {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs a:hover { color: var(--mustard-dark); }
.breadcrumbs .sep { margin: 0 6px; }

/* ── TOC ── */
.toc {
  background: var(--bg-alt);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  margin-bottom: var(--space-xl);
}
.toc h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}
.toc ol {
  list-style: decimal;
  padding-left: var(--space-lg);
}
.toc li {
  margin-bottom: var(--space-xs);
  font-size: 0.92rem;
}
.toc a {
  color: var(--text);
  text-decoration: none;
}
.toc a:hover { color: var(--mustard-dark); text-decoration: underline; }

/* ── Homepage sections ── */
.home-section {
  padding: var(--space-2xl) var(--space-lg);
}
.home-section:nth-child(even) { background: var(--bg-alt); }
.home-section-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
}
.home-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.01em;
}

/* Pillar cards — Archetype A: text links, not image cards */
.pillar-list { list-style: none; padding: 0; }
.pillar-list li {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}
.pillar-list li:last-child { border-bottom: none; }
.pillar-list a {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.pillar-list a:hover { color: var(--mustard-dark); }
.pillar-list .promise {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-mid);
  margin-top: var(--space-xs);
}

/* Latest posts — Archetype A: headline list */
.posts-list { list-style: none; padding: 0; }
.posts-list li {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
}
.posts-list li:last-child { border-bottom: none; }
.posts-list a {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
}
.posts-list a:hover { color: var(--mustard-dark); }
.posts-list .post-date {
  font-size: 0.82rem;
  color: var(--text-light);
  white-space: nowrap;
}

/* Trust row */
.trust-row {
  background: var(--bg-alt);
  padding: var(--space-lg);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ── Footer ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding: var(--space-2xl) var(--space-lg) var(--space-lg);
}
.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFF;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
}
.footer-col a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.88rem;
  display: block;
  margin-bottom: var(--space-sm);
}
.footer-col a:hover { color: var(--mustard-light); }
.footer-bottom {
  max-width: var(--max-w-wide);
  margin: var(--space-xl) auto 0;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ── Archive page ── */
.archive-header {
  background: var(--navy);
  padding: var(--space-xl) var(--space-lg);
}
.archive-header-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
}
.archive-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #FFF;
}
.archive-header .term-desc {
  color: rgba(255,255,255,0.8);
  margin-top: var(--space-sm);
  max-width: 600px;
}

.archive-posts {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}
.archive-post {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
}
.archive-post:last-child { border-bottom: none; }
.archive-post h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}
.archive-post h2 a { color: var(--text); text-decoration: none; }
.archive-post h2 a:hover { color: var(--mustard-dark); }
.archive-post .excerpt {
  font-size: 0.92rem;
  color: var(--text-mid);
  margin-top: var(--space-sm);
}

/* ── Author page ── */
.author-header {
  background: var(--navy);
  padding: var(--space-2xl) var(--space-lg);
}
.author-header-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}
.author-header img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--mustard);
  flex-shrink: 0;
}
.author-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #FFF;
}
.author-header .author-role {
  color: var(--mustard);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: var(--space-xs);
}
.author-header .author-bio-text {
  color: rgba(255,255,255,0.85);
  margin-top: var(--space-sm);
  max-width: 500px;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .author-header-inner { flex-direction: column; text-align: center; }
  .author-header .author-bio-text { max-width: 100%; }
}

/* ── Search ── */
.search-form {
  display: flex;
  gap: var(--space-sm);
  max-width: 500px;
}
.search-form input[type="search"] {
  flex: 1;
  padding: 12px var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
}
.search-form button {
  background: var(--mustard);
  color: var(--navy);
  border: none;
  padding: 12px var(--space-lg);
  font-weight: 600;
  border-radius: var(--radius);
  font-family: var(--font-display);
}

/* ── Related posts ── */
.related-posts { margin: var(--space-xl) 0; }
.related-posts h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: var(--space-md);
}
.related-list { list-style: none; padding: 0; }
.related-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}
.related-list li:last-child { border-bottom: none; }
.related-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.related-list a:hover { color: var(--mustard-dark); }

/* ── Disclosure block ── */
.disclosure-block {
  background: #FEF9E7;
  border: 1px solid var(--mustard);
  padding: var(--space-md);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-mid);
  margin: var(--space-lg) 0;
}
@media (prefers-color-scheme: dark) {
  .disclosure-block { background: #2D2A1E; }
}

/* ── Reading time ── */
.reading-time {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ── Last reviewed ── */
.last-reviewed {
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
}

/* ── 404 ── */
.error-404 {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}
.error-404 h1 {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: var(--mustard);
}
.error-404 p { margin: var(--space-md) auto; max-width: 400px; }

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ── Print ── */
@media print {
  .site-header, .site-footer, .toc, .faq-section, .related-posts, .nav-toggle { display: none; }
  body { font-size: 12pt; color: #000; background: #FFF; }
}

/* ── Homepage table fix ── */
.home-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.home-section th {
  background: var(--navy);
  color: #FFF;
  font-weight: 600;
  text-align: left;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.home-section td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.home-section tr:nth-child(even) td { background: var(--bg-alt); }
.home-section tr:hover td { background: rgba(212,160,23,0.06); }
.home-section .table-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ── CTA card full width ── */
.cta-card {
  max-width: var(--max-w-wide);
}

/* ── Pillar list polish ── */
.pillar-list li {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.pillar-list a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}
.pillar-list a::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--mustard);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Latest posts polish ── */
.posts-list a { flex: 1; }
.posts-list li:hover { background: rgba(212,160,23,0.04); margin: 0 calc(-1 * var(--space-md)); padding-left: var(--space-md); padding-right: var(--space-md); border-radius: var(--radius); }

/* ── Post cover image ── */
.post-cover {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) 0;
}
.post-cover .cover-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* ── Archive thumbnails ── */
.archive-post {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}
.archive-thumb {
  flex-shrink: 0;
  width: 120px;
  display: block;
}
.archive-thumb img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
}
.archive-post-content {
  flex: 1;
  min-width: 0;
}
@media (max-width: 600px) {
  .archive-post { flex-direction: column; gap: var(--space-sm); }
  .archive-thumb { width: 100%; }
  .archive-thumb img { width: 100%; height: auto; aspect-ratio: 16/9; }
}
