/* =========================================================================
   S/V Sabado — Ghost theme
   Tokens lifted directly from the WordPress (kubio) source so the look matches.
   Accent  : #03A9F4  (kubio-color-1: 3,169,244)  -> overridable via Ghost accent
   Accent- : #016E9E  (kubio-color-1-variant-4)
   Ink     : #000000  (kubio-color-6)
   Body    : #333333  (kubio-color-6-variant-4)
   Muted   : #656565  (kubio-color-5-variant-4)  bylines
   Display : Playfair Display (headings + body, per source)
   UI sans : Open Sans (buttons, nav, labels, per source)
   Card    : white, shadow 0 19px 38px rgba(0,0,0,.16)
   ========================================================================= */

:root {
  --accent: var(--ghost-accent-color, #03A9F4);
  --accent-dark: #016E9E;
  --ink: #000000;
  --body-text: #333333;
  --muted: #656565;
  --muted-strong: #323232;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --border: #e7e7e7;
  --card-shadow: 0 19px 38px 0 rgba(0, 0, 0, 0.16);
  --container: 1200px;
  --section-pad: 100px;

  /* Custom fonts fall back to Playfair/Open Sans if the user hasn't picked any
     in Ghost's Design > Typography panel. */
  --font-heading: var(--gh-font-heading, "Playfair Display", Georgia, serif);
  --font-body: var(--gh-font-body, "Playfair Display", Georgia, serif);
  --font-ui: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  color: var(--body-text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .5em;
}
h1 { font-weight: 600; font-size: 3em; }
h2 { font-weight: 600; font-size: 2.4em; }
h3 { font-weight: 600; font-size: 1.8em; }
h4 { font-weight: 600; font-size: 1.4em; }
h5 { font-weight: 600; font-size: 1.125em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: var(--section-pad) 0; }
.section--tight { padding-bottom: 0; }
.section-title { text-align: center; margin-bottom: 48px; }

/* ---------- buttons / pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 56px;
  padding: 15px 30px;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn--pill { font-size: 12px; padding: 12px 24px; box-shadow: 0 0 10px 2px rgba(0,0,0,.5); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: #fff; }

/* ---------- header / nav (transparent over hero, solid on scroll) ---------- */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 14px 0;
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-logo img { max-height: 70px; width: auto; }
.site-logo .site-logo__text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.4em;
  color: var(--ink);
}
.site-nav { display: flex; align-items: center; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-list a {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-list a:hover { color: var(--accent); }

/* Non-home pages get a solid header from the start */
body:not(.home-template) .site-header {
  position: sticky;
  background: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,.18);
}
/* Scrolled state (added by main.js) */
.site-header.is-stuck {
  position: fixed;
  background: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,.18);
  padding: 10px 0;
}

/* mobile menu toggle */
.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px;
  color: var(--ink);
}
.nav-toggle svg { width: 24px; height: 24px; fill: currentColor; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #1a9bd8, #0b6ea0);
  background-size: cover;
  background-position: center 64%;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,.12);
}
.hero__inner { position: relative; z-index: 2; padding: 120px 24px 80px; max-width: 900px; }
.hero h1 {
  color: #fff;
  font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  line-height: 1.12;
  margin: 0 0 .25em;
  text-shadow: 0 2px 24px rgba(0,0,0,.25);
}
.hero__lead {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  margin: 0 0 2rem;
  text-shadow: 0 1px 12px rgba(0,0,0,.35);
}
.hero__actions { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

/* ---------- post grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* ---------- card ---------- */
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 2px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  height: 100%;
}
.card__image { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--bg-soft); }
.card__image img { width: 100%; height: 100%; object-fit: cover; }
.card__lock {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.65); color: #fff;
  font-family: var(--font-ui); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 5px 10px; border-radius: 4px;
}
.card__lock svg { width: 14px; height: 14px; fill: currentColor; }
.card__body { padding: 26px 28px 30px; display: flex; flex-direction: column; flex: 1; }
.card__cats { margin-bottom: 14px; font-family: var(--font-ui); font-size: 14px; }
.card__cats a { color: var(--accent); font-weight: 600; }
.card__cats .sep { color: var(--muted); margin: 0 6px; }
.card__title { font-size: 1.4em; line-height: 1.25; margin: 0 0 12px; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--accent); }
.card__meta { font-family: var(--font-ui); font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.card__meta .pre { color: var(--muted-strong); }
.card__excerpt { color: var(--body-text); margin: 0 0 18px; flex: 1; }
.card__more {
  font-family: var(--font-ui); font-weight: 600; font-size: 14px;
  color: var(--accent); display: inline-flex; align-items: center; gap: 6px;
}
.card__more:hover { color: var(--accent-dark); }
.card__more svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- categories block ---------- */
.cats-block { text-align: center; }
.cats-pills { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin: 32px 0; }
.intro-copy {
  max-width: 820px; margin: 32px auto 0; text-align: center;
  font-size: 1.05em; line-height: 1.7;
}

/* ---------- single post ---------- */
.post-hero { padding: 140px 0 0; }
.post-head { max-width: 820px; margin: 0 auto 32px; text-align: center; }
.post-head .post-cats { font-family: var(--font-ui); font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.post-head h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.post-head .post-meta { font-family: var(--font-ui); font-size: 15px; color: var(--muted); margin-top: 12px; }
.post-feature { max-width: 1000px; margin: 0 auto 48px; }
.post-feature img { width: 100%; border-radius: 4px; }
.post-content p, .post-content li { font-size: 1.12em; line-height: 1.75; }
.post-content h2, .post-content h3 { margin-top: 1.6em; }
.post-content img { border-radius: 4px; margin: 1.5em 0; }
.post-content a { text-decoration: underline; }

/* Ghost members CTA (paywall) inherits accent automatically */
.gh-content { word-break: break-word; }

/* Koenig editor card widths (required) */
.gh-canvas { display: grid; grid-template-columns:
    [full-start] minmax(24px, 1fr)
    [wide-start] minmax(0, 100px)
    [main-start] min(740px, calc(100% - 48px))
    [main-end] minmax(0, 100px)
    [wide-end] minmax(24px, 1fr)
    [full-end]; }
.gh-canvas > * { grid-column: main-start / main-end; }
.kg-width-wide { grid-column: wide-start / wide-end; }
.kg-width-full { grid-column: full-start / full-end; }
.kg-width-full img { width: 100%; }
.post-content > * { margin-top: 0; margin-bottom: 1.5em; }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 18px; margin-top: 64px; }

/* ---------- footer ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--border); padding: 72px 0; text-align: center; }
.site-footer h5 { font-size: 1.4em; margin-bottom: 24px; }
.social-row { display: flex; gap: 22px; justify-content: center; margin-bottom: 28px; }
.social-row a { color: rgba(0,0,0,.55); }
.social-row a:hover { color: var(--accent); }
.social-row svg { width: 30px; height: 30px; fill: currentColor; }
.copyright { font-family: var(--font-ui); font-size: 14px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  :root { --section-pad: 60px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  :root { --section-pad: 40px; }
  .post-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; inset: 0 0 0 auto; width: min(300px, 80vw);
    background: #222b34; transform: translateX(100%);
    transition: transform .3s ease; padding: 80px 28px; z-index: 60;
  }
  body.nav-open .site-nav { transform: translateX(0); }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 55;
  }
  .nav-list { flex-direction: column; align-items: flex-start; gap: 0; width: 100%; }
  .nav-list li { width: 100%; border-bottom: 1px solid rgba(255,255,255,.15); }
  .nav-list a { display: block; padding: 14px 0; color: #fff; }
  .nav-list a:hover { color: var(--accent); }
  .hero { min-height: 80vh; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
