/* ═══════════════════════════════════════════════════════════════
   Carmen Whimsy — Blog Stylesheet
   Fonts: Dancing Script (logo) · Playfair Display (headings) · Inter (body)
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
  /* Colours — mirrors the React site's light theme */
  --bg:          #f5f0eb;   /* hsl(30 30% 96%) */
  --surface:     #faf8f5;   /* hsl(30 25% 97%) */
  --border:      #d6cfe0;   /* hsl(280 15% 85%) */
  --text:        #2e2a40;   /* hsl(260 20% 20%) */
  --muted:       #6e6880;   /* hsl(260 10% 45%) */
  --primary:     #c8703a;   /* hsl(25 65% 50%) — warm peach */
  --primary-hov: #b5622f;
  --gold:        #c89420;   /* hsl(40 75% 45%) — star gold */
  --accent-bg:   #ece8f5;   /* hsl(280 25% 93%) — lavender mist */
  --card-bg:     #faf8f5;
  --shadow:      0 2px 12px rgba(46, 42, 64, .06);
  --shadow-lg:   0 8px 32px rgba(46, 42, 64, .13);

  /* Spacing / Shape */
  --radius:      1rem;
  --radius-sm:   .5rem;
  --max-w:       1200px;

  /* Typography */
  --font-head:   'Playfair Display', Georgia, serif;
  --font-body:   'Inter', system-ui, sans-serif;
  --font-script: 'Dancing Script', cursive;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img  { max-width: 100%; height: auto; display: block; }
a    { color: inherit; text-decoration: none; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .875rem;
  padding-bottom: .875rem;
}

/* Logo */
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  flex-shrink: 0;
}
.logo-main {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--primary);
}
.logo-sub {
  font-family: var(--font-script);
  font-size: 1.1rem;
  color: rgba(200, 112, 58, .65);
  margin-top: -.15em;
}

/* Nav */
.site-nav {
  display: none;
  gap: 2rem;
}
.site-nav a {
  font-size: .875rem;
  color: rgba(46, 42, 64, .65);
  transition: color .2s;
}
.site-nav a:hover,
.site-nav a.active { color: var(--primary); }

@media (min-width: 768px) { .site-nav { display: flex; } }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: .75rem; }

.btn-theme {
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  border-radius: 9999px;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color .2s;
  font-size: 1rem;
}
.btn-theme:hover { color: var(--primary); }

.btn-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
}
.btn-menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
@media (min-width: 768px) { .btn-menu { display: none; } }

.header-social {
  display: none;
  align-items: center;
  gap: .35rem;
}
@media (min-width: 768px) { .header-social { display: flex; } }
.header-social-link {
  display: flex;
  align-items: center;
  color: var(--muted);
  padding: .25rem;
  border-radius: 9999px;
  transition: color .2s;
}
.header-social-link:hover { color: var(--primary); }

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem;
  gap: .25rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: .9375rem;
  padding: .6rem 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: color .2s;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { color: var(--primary); }

/* CTA button */
.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: .5rem 1.25rem;
  border-radius: 9999px;
  font-size: .8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity .2s;
  flex-shrink: 0;
}
.btn-primary:hover { opacity: .88; }

/* ══════════════════════════════════════════════════════════════
   BLOG LISTING — HERO BANNER
   ══════════════════════════════════════════════════════════════ */
.blog-hero {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}
.eyebrow {
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: .5rem;
}
.blog-hero-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.blog-hero-sub {
  color: var(--muted);
  font-size: .9375rem;
  max-width: 36rem;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════════
   FEATURED SECTION
   ══════════════════════════════════════════════════════════════ */
.featured-section { padding-bottom: 2.5rem; }

.featured-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .featured-grid { grid-template-columns: 3fr 2fr; }
}

.featured-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  color: #fff;
  transition: transform .3s ease, box-shadow .3s ease;
}
.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.featured-large { min-height: 400px; }

.featured-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--accent-bg);
  background-image: linear-gradient(135deg, #ece8f5 0%, #f5e8d8 100%);
  transition: transform .4s ease;
}
.featured-card:hover .featured-bg { transform: scale(1.03); }

.featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20, 16, 36, .85) 0%,
    rgba(20, 16, 36, .25) 55%,
    transparent 100%
  );
}
.featured-content {
  position: relative;
  z-index: 1;
  padding: 1.75rem;
}
.featured-tag {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .2em .65em;
  border-radius: 9999px;
  margin-bottom: .75rem;
}
.featured-title {
  font-family: var(--font-head);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: .5rem;
}
.featured-excerpt {
  font-size: .875rem;
  opacity: .85;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .75rem;
}
.featured-meta {
  font-size: .75rem;
  opacity: .7;
}

/* ══════════════════════════════════════════════════════════════
   FILTER BAR
   ══════════════════════════════════════════════════════════════ */
.filter-section {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 2.5rem;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.tag-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.tag-tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: .35rem .875rem;
  font-size: .8125rem;
  font-family: var(--font-body);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  line-height: 1;
}
.tag-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.tag-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tab-count {
  font-size: .7em;
  opacity: .7;
  margin-left: .2em;
}

/* Search */
.search-wrap { position: relative; flex-shrink: 0; }
.search-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: .4rem 1rem .4rem 2.25rem;
  font-size: .875rem;
  font-family: var(--font-body);
  color: var(--text);
  width: 220px;
  outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--primary); }
.search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   POSTS GRID
   ══════════════════════════════════════════════════════════════ */
.posts-section { padding-bottom: 4rem; }
.posts-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.no-results {
  text-align: center;
  color: var(--muted);
  padding: 4rem 0;
  font-family: var(--font-script);
  font-size: 1.25rem;
}

/* ── Post Card ── */
.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card-image-link { display: block; }
.card-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--accent-bg);
  background-image: linear-gradient(135deg, #ece8f5 0%, #f5e8d8 100%);
}
.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
  gap: .5rem;
}
.card-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.card-tag {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
}
.card-date { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.card-title {
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: .5rem;
}
.card-title a { transition: color .2s; }
.card-title a:hover { color: var(--primary); }
.card-excerpt {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: .875rem;
}
.card-link {
  font-size: .8125rem;
  color: var(--primary);
  font-weight: 500;
}
.card-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   POST PAGE — HERO
   ══════════════════════════════════════════════════════════════ */
.post-hero {
  position: relative;
  min-height: 440px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  background-color: var(--accent-bg);
}
.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20, 16, 36, .88) 0%,
    rgba(20, 16, 36, .3) 55%,
    rgba(20, 16, 36, .1) 100%
  );
}
.post-hero-content {
  position: relative;
  z-index: 1;
  padding-bottom: 2.75rem;
  color: #fff;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .875rem;
}
.tag {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .22em .7em;
  border-radius: 9999px;
}
.post-title {
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: .875rem;
}
.post-meta {
  font-size: .875rem;
  opacity: .75;
}
.dot { margin: 0 .4em; }

/* ══════════════════════════════════════════════════════════════
   POST PAGE — BODY
   ══════════════════════════════════════════════════════════════ */
.post-main {
  max-width: 740px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4.5rem;
}

/* Prose */
.post-content {
  font-size: 1.0625rem;
  line-height: 1.82;
  color: var(--text);
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.3;
  margin: 2.25rem 0 .75rem;
}
.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.625rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.0625rem; }

.post-content p { margin-bottom: 1.5rem; }

.post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-content a:hover { color: var(--primary-hov); }

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}
.post-content li { margin-bottom: .4rem; }

/* Blockquote */
.post-content blockquote {
  border-left: 3px solid var(--primary);
  padding: .875rem 1.375rem;
  margin: 2rem 0;
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 1.1rem;
  line-height: 1.65;
}
.post-content blockquote p { margin-bottom: 0; }

/* Code */
.post-content code {
  background: var(--accent-bg);
  padding: .15em .4em;
  border-radius: .25rem;
  font-size: .88em;
  font-family: 'Fira Code', 'Courier New', monospace;
}
.post-content pre {
  background: var(--text);
  color: var(--bg);
  padding: 1.375rem 1.5rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: .9em;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Images */
.post-content img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  margin: 1.75rem auto;
}

/* HR */
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Back / next navigation */
.post-back {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.back-link, .next-link {
  font-size: .9375rem;
  color: var(--primary);
  font-weight: 500;
  transition: text-decoration .15s;
}
.next-link { text-align: right; }
.back-link:hover, .next-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   NEWSLETTER STRIP
   ══════════════════════════════════════════════════════════════ */
.newsletter-strip {
  padding: 4rem 0;
}
.newsletter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 768px) {
  .newsletter-card {
    grid-template-columns: 1fr 1fr;
    padding: 2.5rem 3rem;
  }
}
.newsletter-eyebrow {
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
}
.newsletter-heading {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: .5rem;
  line-height: 1.3;
}
.nl-gold { color: var(--gold); }
.newsletter-sub {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.65;
}
.nl-row {
  display: flex;
  gap: .625rem;
  position: relative;
  flex-wrap: wrap;
}
.newsletter-form input[name="EMAIL"] {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: .75rem 1.25rem;
  font-size: .875rem;
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.newsletter-form input[name="EMAIL"]:focus {
  border-color: var(--primary);
}
.newsletter-form button[type="submit"] {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: .75rem 1.5rem;
  font-size: .875rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.newsletter-form button[type="submit"]:hover  { background: var(--primary-hov); }
.newsletter-form button[type="submit"]:disabled { opacity: .6; cursor: default; }
.nl-disclaimer {
  font-size: .75rem;
  color: var(--muted);
  opacity: .65;
  margin-top: .75rem;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 2rem;
}
@media (min-width: 600px) {
  .footer-inner { grid-template-columns: repeat(3, 1fr); }
}
.footer-tagline {
  font-size: .875rem;
  color: var(--muted);
  margin-top: .5rem;
}
.footer-label {
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .875rem;
}
.footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem .75rem;
}
.footer-nav a {
  font-size: .875rem;
  color: rgba(46, 42, 64, .6);
  transition: color .2s;
}
.footer-nav a:hover { color: var(--primary); }
.footer-note {
  font-size: .875rem;
  color: var(--muted);
}
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
  margin-bottom: .75rem;
}
.footer-social a {
  color: rgba(46, 42, 64, .55);
  display: flex;
  transition: color .2s;
}
.footer-social a:hover { color: var(--primary); }
[data-theme="dark"] .footer-social a { color: var(--muted); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid var(--border);
}
.footer-bottom p {
  font-size: .75rem;
  color: rgba(46, 42, 64, .35);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
  .search-input { width: 100%; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
  .search-wrap { width: 100%; }
  .btn-primary { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   DARK THEME
   ══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg:          #131120;
  --surface:     #1b1928;
  --border:      #312c3d;
  --text:        #f0e8dc;
  --muted:       #80788c;
  --primary:     #d07843;
  --primary-hov: #bb6535;
  --gold:        #d4a832;
  --accent-bg:   #2c2537;
  --card-bg:     rgba(27, 25, 40, 0.96);
  --shadow:      0 2px 12px rgba(0,0,0,.4);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.55);
}

[data-theme="dark"] body {
  background: var(--bg);
}

/* ── Header ──────────────────────────────────────────────────── */
[data-theme="dark"] .site-header {
  background: rgba(26, 23, 36, .92);
  border-bottom-color: var(--border);
}
[data-theme="dark"] .site-nav a {
  color: rgba(240, 232, 220, .65);
}
[data-theme="dark"] .mobile-nav {
  background: var(--surface);
  border-top-color: var(--border);
}
[data-theme="dark"] .mobile-nav a {
  color: var(--text);
  border-bottom-color: var(--border);
}
[data-theme="dark"] .btn-menu span {
  background: var(--text);
}

/* ── Filter bar ──────────────────────────────────────────────── */
[data-theme="dark"] .filter-section {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .tag-tab {
  border-color: var(--border);
  color: var(--muted);
}
[data-theme="dark"] .search-input {
  background: rgba(42, 36, 64, .5);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .search-input::placeholder { color: var(--muted); }

/* ── Post cards ──────────────────────────────────────────────── */
[data-theme="dark"] .post-card {
  background: var(--card-bg);
  border-color: var(--border);
}
[data-theme="dark"] .card-image {
  background-image: linear-gradient(135deg, #2c2537 0%, #332a3e 100%);
}

/* ── Newsletter ──────────────────────────────────────────────── */
[data-theme="dark"] .newsletter-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .newsletter-form input[name="EMAIL"] {
  background: rgba(42, 36, 64, .5);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .newsletter-form input[name="EMAIL"]::placeholder { color: var(--muted); }

/* ── Footer ──────────────────────────────────────────────────── */
[data-theme="dark"] .site-footer {
  background: var(--surface);
  border-top-color: var(--border);
}
[data-theme="dark"] .footer-nav a     { color: var(--muted); }
[data-theme="dark"] .footer-bottom    { border-top-color: var(--border); }
[data-theme="dark"] .footer-bottom p  { color: rgba(240, 232, 220, .35); }

/* ── Post body (single post page) ────────────────────────────── */
[data-theme="dark"] .post-content blockquote { background: var(--accent-bg); }
[data-theme="dark"] .post-content code       { background: var(--accent-bg); }
[data-theme="dark"] .post-back               { border-top-color: var(--border); }
[data-theme="dark"] .post-content hr         { border-top-color: var(--border); }
