/* ═══════════════════════════════════════════════════════════════════════════
   Ruff Tech Engine — public site (desert dusk editorial theme)
   Deep navy night sky, ember horizon, bluebonnet blue accents.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #05070d;
  --bg-2:      #070b14;
  --card:      #0a0f1c;
  --card-2:    #0d1322;
  --border:    #17203a;
  --border-2:  #1f2b4d;
  --text:      #e9ecf5;
  --text-soft: #c3c9d9;
  --muted:     #8a93ab;
  --accent:    #5b8bf5;
  --accent-2:  #8db0ff;
  --glow-warm: #d96f32;   /* horizon ember */
  --glow-cool: #5b50b4;   /* secondary sky glow */
  --sky-mid:   #241329;   /* bottom-of-sky tint */
  --serif:     'Cormorant Garamond', Georgia, serif;
  --sans:      'Figtree', -apple-system, sans-serif;
  --script:    'Ephesis', cursive;
  --maxw:      1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
/* Transparent images (logos etc.) get the configurable backdrop instead of
   vanishing into the dark theme. Opaque images cover it completely. */
.work-thumb img, .post-card .thumb img, .article-cover img,
.gallery figure img, .article-body img {
  background-color: var(--img-fill, transparent);
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

h1,h2,h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-script { font-family: var(--script); font-size: 1.9rem; color: var(--text); }
.brand-sub {
  font-size: .55rem; letter-spacing: .38em; text-transform: uppercase;
  color: var(--muted); margin-top: 2px; padding-left: 4px;
}
.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 6px 2px; position: relative;
  transition: color .25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent-2); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent);
}
.nav-burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-burger span {
  display: block; width: 22px; height: 2px; background: var(--text);
  margin: 5px 0; transition: transform .3s, opacity .3s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Flashes ─────────────────────────────────────────────────────────────── */
.flashes { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 200; }
.flash {
  background: var(--card-2); border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent);
  padding: 12px 22px; border-radius: 8px; margin-bottom: 8px;
  font-size: .9rem; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  transition: opacity .6s, transform .6s;
}
.flash-error { border-left-color: #e05c5c; }
.flash.bye { opacity: 0; transform: translateY(-10px); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 92vh;
  display: flex; align-items: center;
  padding: 120px 0 80px;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(115% 60% at 50% 108%,
      color-mix(in srgb, var(--glow-warm) 50%, transparent) 0%,
      color-mix(in srgb, var(--glow-warm) 28%, transparent) 26%,
      color-mix(in srgb, var(--sky-mid) 45%, transparent) 48%, transparent 72%),
    radial-gradient(70% 42% at 28% 100%, color-mix(in srgb, var(--glow-warm) 26%, transparent) 0%, transparent 60%),
    radial-gradient(60% 50% at 78% 96%, color-mix(in srgb, var(--glow-cool) 18%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 42%,
      color-mix(in srgb, var(--sky-mid) 45%, var(--bg)) 72%, var(--sky-mid) 100%);
}
.hero-bg.has-image { background-size: cover; background-position: center; }
.hero-bg.has-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 78%, transparent) 0%,
    color-mix(in srgb, var(--bg) 35%, transparent) 55%,
    color-mix(in srgb, var(--bg) 82%, transparent) 100%);
}
.hero-stars { position: absolute; inset: 0; z-index: -1; opacity: .8; }
.hero-stars circle { fill: var(--accent-2); }
.hero-content { max-width: 560px; }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 500; letter-spacing: .01em;
  margin-bottom: 26px;
}
.hero h1 .accent { color: var(--accent-2); font-style: italic; }
.hero p { color: var(--text-soft); font-size: 1.05rem; max-width: 420px; margin-bottom: 38px; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 30px; border-radius: 4px;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 500; transition: all .3s; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: var(--bg); transform: translateY(-2px); box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-ghost { border-color: color-mix(in srgb, var(--text) 35%, transparent); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); transform: translateY(-2px); }
.hero-scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--muted); animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,8px);} }

/* ── Sections ────────────────────────────────────────────────────────────── */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-head { text-align: center; margin-bottom: 54px; }
.sec-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  display: inline-flex; align-items: center; gap: 18px;
}
.sec-head h2::before, .sec-head h2::after {
  content: ''; width: 44px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.sec-head h2::after { background: linear-gradient(90deg, var(--accent), transparent); }
.sec-head p { color: var(--muted); margin-top: 12px; font-size: .95rem; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .08s; }
.reveal:nth-child(3) { transition-delay: .16s; }
.reveal:nth-child(4) { transition-delay: .24s; }

/* ── Work cards ──────────────────────────────────────────────────────────── */
.work-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.work-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; transition: transform .35s, border-color .35s, box-shadow .35s;
}
.work-card:hover {
  transform: translateY(-6px); border-color: var(--border-2);
  box-shadow: 0 18px 48px rgba(0,0,0,.55);
}
.work-thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--card-2); position: relative; }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.work-card:hover .work-thumb img { transform: scale(1.06); }
.work-thumb .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--script); font-size: 2.4rem; color: var(--border-2);
  background: radial-gradient(80% 80% at 50% 110%, color-mix(in srgb, var(--glow-warm) 14%, transparent), transparent 70%), var(--card-2);
}
.work-body { padding: 16px 18px 18px; }
.work-body h3 { font-family: var(--sans); font-weight: 500; font-size: .98rem; letter-spacing: .01em; }
.work-cat {
  display: inline-block; margin-top: 8px;
  font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-2);
}

/* Category filter pills */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 44px; }
.pill {
  padding: 8px 20px; border-radius: 100px; border: 1px solid var(--border-2);
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  transition: all .25s;
}
.pill:hover, .pill.active { color: var(--accent-2); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ── Services ────────────────────────────────────────────────────────────── */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.svc {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  text-align: center; padding: 34px 22px; transition: transform .3s, border-color .3s;
}
.svc:hover { transform: translateY(-4px); border-color: var(--border-2); }
.svc-icon {
  width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 12px;
  display: grid; place-items: center; color: var(--accent-2);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.svc h3 { font-family: var(--sans); font-size: .95rem; font-weight: 500; margin-bottom: 8px; }
.svc p { color: var(--muted); font-size: .84rem; }

/* ── About ───────────────────────────────────────────────────────────────── */
.about-grid {
  display: grid; grid-template-columns: 320px 1fr; gap: 64px; align-items: center;
}
.about-photo {
  width: 300px; height: 380px; border-radius: 50% / 42%;
  object-fit: cover; border: 1px solid var(--border-2);
  box-shadow: 0 24px 70px rgba(0,0,0,.35), 0 0 0 10px color-mix(in srgb, var(--accent) 5%, transparent);
}
.about-photo-ph {
  width: 300px; height: 380px; border-radius: 50% / 42%;
  display: grid; place-items: center; font-family: var(--script); font-size: 4rem;
  color: var(--accent); background: var(--card-2); border: 1px solid var(--border-2);
}
.about-text h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 18px; }
.about-text p { color: var(--muted); max-width: 480px; margin-bottom: 30px; }

/* ── CTA band ────────────────────────────────────────────────────────────── */
.cta {
  position: relative; text-align: center; padding: 110px 24px; isolation: isolate;
  border-top: 1px solid var(--border);
}
.cta-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(100% 90% at 50% 115%,
      color-mix(in srgb, var(--glow-warm) 42%, transparent) 0%,
      color-mix(in srgb, var(--glow-warm) 22%, transparent) 40%, transparent 75%),
    linear-gradient(180deg, var(--bg) 0%,
      color-mix(in srgb, var(--sky-mid) 50%, var(--bg)) 60%, var(--sky-mid) 100%);
}
.cta-bg.has-image { background-size: cover; background-position: center; }
.cta-bg.has-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 85%, transparent),
    color-mix(in srgb, var(--bg) 45%, transparent));
  z-index: -1;
}
.cta h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 14px; }
.cta p { color: var(--text-soft); margin-bottom: 34px; }

/* ── Blog ────────────────────────────────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 24px; max-width: 780px; margin: 0 auto; }
.post-card {
  display: grid; grid-template-columns: 240px 1fr; gap: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: transform .3s, border-color .3s, box-shadow .3s;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: 0 16px 44px rgba(0,0,0,.5); }
.post-card .thumb { min-height: 190px; background: var(--card-2); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 24px 28px; }
.post-card h3 { font-family: var(--sans); font-weight: 500; font-size: 1.08rem; margin-bottom: 8px; }
.post-meta {
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.post-meta .cat { color: var(--accent-2); }
.post-card p { color: var(--muted); font-size: .88rem; }
.read-more {
  display: inline-block; margin-top: 14px;
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-2);
}
.read-more::after { content: ' →'; transition: margin .2s; }
.post-card:hover .read-more::after { margin-left: 4px; }

/* ── Article ─────────────────────────────────────────────────────────────── */
.article { max-width: 720px; margin: 0 auto; padding: 140px 24px 80px; }
.back-link {
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  display: inline-block; margin-bottom: 34px; transition: color .25s;
}
.back-link:hover { color: var(--accent-2); }
.article h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); color: var(--accent-2); margin-bottom: 18px; }
.article-cover { border-radius: 12px; border: 1px solid var(--border); margin: 34px 0; overflow: hidden; }
.article-body { color: var(--text-soft); font-size: 1.02rem; }
.article-body p { margin-bottom: 1.3em; }
.article-body h2, .article-body h3 { color: var(--text); margin: 1.6em 0 .6em; }
.article-body img { border-radius: 10px; border: 1px solid var(--border); margin: 1.4em 0; }
.article-body a { color: var(--accent-2); border-bottom: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent); }
.article-body blockquote {
  font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--accent-2);
  text-align: center; border: 1px solid var(--border-2); border-radius: 12px;
  padding: 34px 40px; margin: 2em 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent);
}
.article-body ul, .article-body ol { margin: 0 0 1.3em 1.4em; }
.article-body code {
  background: var(--card-2); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 5px; font-size: .88em;
}
.share-row { display: flex; align-items: center; gap: 14px; margin-top: 44px; color: var(--muted); }
.share-row span { font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; }
.share-row a {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-2); color: var(--muted); transition: all .25s;
}
.share-row a:hover { color: var(--accent-2); border-color: var(--accent); }
.prevnext {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 44px;
  background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.prevnext a { background: var(--card); padding: 22px 26px; transition: background .25s; }
.prevnext a:hover { background: var(--card-2); }
.prevnext .lbl { font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.prevnext .next { text-align: right; }
.prevnext .empty { background: var(--card); opacity: .4; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin: 40px 0; }
.gallery figure { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--card); }
.gallery img, .gallery video { width: 100%; }
.gallery figcaption { padding: 10px 14px; font-size: .8rem; color: var(--muted); }

/* Instagram section (core/templates/public/sections/instagram.html): a square-tile grid of pictures that each open their
   Instagram post, plus a Follow button. Tiles keep their shape on every screen; a phone shows two across. */
.ig-handle { letter-spacing: .06em; font-weight: 500; margin-left: auto; margin-right: auto; }
.ig-follow, .ig-empty { max-width: none; }
.ig-handle .rte-lk, .ig-handle a { color: inherit; }
.ig-grid { display: grid; gap: 10px; margin: 0 0 34px; }
.ig-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ig-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ig-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ig-tile { display: block; position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: var(--card); }
.ig-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, opacity .3s; }
.ig-tile:hover img, .ig-tile:focus-visible img { transform: scale(1.05); opacity: .92; }
.ig-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ig-follow .btn { display: inline-flex; align-items: center; gap: 9px; }
.ig-follow .btn svg { flex-shrink: 0; }
.ig-empty { color: var(--muted); font-size: .9rem; border: 1px dashed var(--border-2); border-radius: 10px; padding: 26px; margin-bottom: 30px; }
@media (max-width: 720px) {
  .ig-cols-3, .ig-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .ig-grid { gap: 8px; }
}

/* Header social icons (site header section, "Show Facebook and Instagram icons next to the menu"). */
.nav-links .nav-socials { display: inline-flex; align-items: center; gap: 10px; }
.nav-links .nav-socials a { width: 30px; height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-2); color: var(--muted); transition: color .25s, border-color .25s; }
.nav-links .nav-socials a:hover { color: var(--accent-2); border-color: var(--accent); }
.nav-links .nav-socials a.active::after { display: none; }
@media (max-width: 860px) { .nav-links .nav-socials { justify-content: center; padding: 8px 0; } .nav-links .nav-socials a { width: 34px; height: 34px; padding: 0; } }

/* ── Video player ────────────────────────────────────────────────────────── */
.player {
  position: relative; width: 100%; aspect-ratio: var(--ratio, 16/9);
  background: #000; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border-2);
  box-shadow: 0 22px 60px rgba(0,0,0,.5);
}
.player-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
/* Embedded player (YouTube, Vimeo, a CDN's own player) — swapped in on click */
.player-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 1; }
.player-overlay {
  position: absolute; inset: 0; cursor: pointer; z-index: 2;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(5,7,13,.15), rgba(5,7,13,.55));
  transition: opacity .35s;
}
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.player-play {
  width: 82px; height: 82px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; padding-left: 5px;
  background: color-mix(in srgb, var(--accent) 72%, transparent);
  border: 1.5px solid rgba(255,255,255,.5);
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  transition: transform .3s, background .3s, box-shadow .3s;
  animation: playpulse 2.6s ease-out infinite;
}
.player-overlay:hover .player-play {
  transform: scale(1.08); background: var(--accent);
}
@keyframes playpulse {
  0% { box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70% { box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 0 22px transparent; }
  100% { box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 0 0 transparent; }
}
.player.playing .player-overlay { opacity: 0; pointer-events: none; }
.player-fs {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: rgba(5,7,13,.55); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s, background .2s;
}
.player:hover .player-fs, .player.playing .player-fs { opacity: 1; }
.player-fs:hover { background: var(--accent); }
.player:fullscreen { border-radius: 0; border: 0; }
.player:fullscreen .player-video { object-fit: contain; }
/* Providers draw their own fullscreen control inside the iframe */
.player[data-embed].playing .player-fs { display: none; }

/* Video badge on cards */
.vid-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 78%, transparent); color: #fff;
  border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(3px);
}

/* ── Client reviews ──────────────────────────────────────────────────────── */
.stars { display: inline-flex; gap: 3px; color: var(--glow-warm); line-height: 0; }
.stars svg.off { color: var(--border-2); }

.review-summary {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 20px; color: var(--muted); font-size: .9rem; flex-wrap: wrap;
}
.review-summary strong { color: var(--text); font-size: 1.05rem; }

.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 22px; }
.review-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 30px 30px 26px;
  transition: transform .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.review-card:hover {
  transform: translateY(-4px); border-color: var(--border-2);
  box-shadow: 0 16px 44px rgba(0,0,0,.45);
}
/* Oversized opening quote, tucked behind the text */
.review-card::before {
  content: '\201C'; position: absolute; top: 4px; right: 22px;
  font-family: var(--serif); font-size: 5.5rem; line-height: 1;
  color: var(--accent); opacity: .15; pointer-events: none;
}
.review-quote {
  font-family: var(--serif); font-style: italic; font-size: 1.14rem; line-height: 1.55;
  color: var(--text-soft); margin: 16px 0 0; flex: 1;
}
.review-who {
  display: flex; align-items: center; gap: 13px;
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border);
}
.review-avatar, .review-avatar-ph {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--border-2);
}
.review-avatar { object-fit: cover; background-color: var(--img-fill, var(--card-2)); }
.review-avatar-ph {
  display: grid; place-items: center;
  background: var(--card-2); color: var(--accent-2);
  font-family: var(--serif); font-size: 1.3rem;
}
.review-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.review-name { font-family: var(--sans); font-weight: 500; font-size: .95rem; }
.review-role { color: var(--muted); font-size: .78rem; }
.review-work { color: var(--accent-2); font-size: .76rem; transition: opacity .2s; }
.review-work:hover { opacity: .75; }
.review-date { margin-left: auto; color: var(--muted); font-size: .72rem; white-space: nowrap; align-self: flex-start; }

/* ── Contact ─────────────────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; align-items: start; }
.contact-info h2 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); margin-bottom: 16px; }
.contact-info p { color: var(--muted); margin-bottom: 26px; max-width: 380px; }
.contact-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.contact-line svg { color: var(--accent-2); flex-shrink: 0; }
.form-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 36px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: 6px; color: var(--text); padding: 12px 14px;
  font-family: var(--sans); font-size: .95rem; transition: border-color .25s, box-shadow .25s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.field textarea { resize: vertical; min-height: 140px; }
.hp { position: absolute; left: -9999px; opacity: 0; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  position: relative; border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  padding: 70px 24px 0; overflow: hidden;
}
.footer-bloom {
  position: absolute; right: 4%; bottom: -10px; width: 130px; height: 170px;
  color: var(--border-2); opacity: .9; pointer-events: none;
}
.footer-grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
}
.footer-col { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.footer-col h4 {
  font-size: .72rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--text); margin-bottom: 8px; font-weight: 500;
}
.footer-col a, .footer-col .muted { color: var(--muted); font-size: .88rem; transition: color .25s; }
.footer-col a:hover { color: var(--accent-2); }
.footer-brand .brand-script { font-size: 2.2rem; }
.footer-tag { color: var(--muted); font-size: .85rem; margin-top: 10px; }
.socials { display: flex; gap: 10px; margin-top: 14px; }
.socials a {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-2); color: var(--muted); transition: all .25s;
}
.socials a:hover { color: var(--accent-2); border-color: var(--accent); transform: translateY(-2px); }
.footer-bottom {
  max-width: var(--maxw); margin: 50px auto 0; padding: 22px 0;
  border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--muted); text-align: center;
}

/* ── Page hero (inner pages) ─────────────────────────────────────────────── */
.page-head { padding: 150px 24px 60px; text-align: center; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); color: var(--accent-2); }
.page-head p { color: var(--muted); margin-top: 12px; }

/* Portal (customer dashboard) — a working dashboard, not a marketing hero:
   less top padding so useful content sits higher than a hero section needs.
   (Any --muted contrast tuning for the portal belongs in a site's own theme
   overlay, not here — this file is shared by every RTE site.) */
.portal-page .page-head { padding: 40px 24px 20px; text-align: left; }
.portal-page .page-head h1 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }

/* Error page */
.errpage { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 140px 24px 60px; }
.errpage .code { font-family: var(--serif); font-size: 6rem; color: var(--accent-2); line-height: 1; }
.errpage p { color: var(--muted); margin: 14px 0 30px; }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 14px; margin-top: 50px; }

/* ── Ministry / group cards (Groups & Events module) ────────────────────── */
.ministry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.ministry-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 180px; padding: 22px 50px 20px 20px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(165deg, color-mix(in srgb, var(--mc) 55%, var(--bg) 45%) 0%, color-mix(in srgb, var(--mc) 22%, var(--bg) 78%) 100%);
  border: 1px solid color-mix(in srgb, var(--mc) 35%, var(--border));
  transition: transform .3s, box-shadow .3s;
}
.ministry-card:hover { transform: translateY(-5px); box-shadow: 0 18px 44px rgba(0,0,0,.45); }
.ministry-icon {
  position: absolute; top: 18px; left: 20px; width: 40px; height: 40px; border-radius: 10px;
  background: color-mix(in srgb, var(--mc) 75%, black 10%); display: grid; place-items: center; color: #fff;
}
.ministry-card h3 { color: #fff; font-size: 1.12rem; margin-bottom: 4px; }
.ministry-card p { color: rgba(255,255,255,.82); font-size: .85rem; max-width: 92%; }
.ministry-arrow {
  position: absolute; right: 16px; bottom: 16px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--mc); color: #fff; display: grid; place-items: center; transition: transform .25s;
}
.ministry-card:hover .ministry-arrow { transform: translateX(4px); }
.mc-red    { --mc: #E11D2E; }
.mc-teal   { --mc: #06B6D4; }
.mc-purple { --mc: #8B5CF6; }
.mc-amber  { --mc: #D97706; }
.mc-slate  { --mc: #64748B; }

/* ── Event cards (date badge) ────────────────────────────────────────────── */
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.event-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; transition: transform .3s, border-color .3s, box-shadow .3s;
}
.event-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--mc) 45%, var(--border)); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.event-thumb { position: relative; aspect-ratio: 16/10; background: var(--card-2); overflow: hidden; }
.event-thumb img { width: 100%; height: 100%; object-fit: contain; }
.event-thumb .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--mc) 38%, var(--card-2)) 0%, var(--card-2) 100%);
  color: color-mix(in srgb, var(--mc) 65%, white 15%);
}
/* Edge-to-edge width but a FIXED pixel height used to crop everything but a
   thin center strip out of a real photo: a 1920px-wide x 360px-tall box is a
   5.3:1 shape, while an actual landscape photo is usually closer to 1.5–2:1
   -- object-fit:cover had to blow the image up until its width matched the
   viewport, which left most of its height outside the box. Capping the width
   to the page's own content width and using a 16:9 aspect-ratio (not a flat
   pixel height) keeps the crop proportional and gentle at any screen size. */
.event-banner {
  width: 100%; max-width: var(--maxw); aspect-ratio: 16/9; max-height: 520px;
  overflow: hidden; margin: 62px auto 0; border-radius: 14px; background: var(--card);
}
.event-banner img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (max-width: 720px) { .event-banner { aspect-ratio: 4/3; border-radius: 0; } }
.event-date-badge {
  position: absolute; top: 12px; left: 12px; background: var(--mc); color: #fff;
  border-radius: 8px; padding: 6px 10px; text-align: center; line-height: 1.1; min-width: 44px;
}
.event-date-badge .mon { display: block; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.event-date-badge .day { display: block; font-size: 1.1rem; font-weight: 700; }
.event-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.event-body h3 { font-size: 1.02rem; font-weight: 600; }
.event-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; }
.event-meta svg { flex-shrink: 0; color: var(--mc); }
.event-card .btn { margin-top: 10px; text-align: center; }
.event-card .btn-ghost { color: var(--mc); border-color: color-mix(in srgb, var(--mc) 45%, var(--border)); }
.event-card .btn-ghost:hover { background: var(--mc); color: #fff; border-color: var(--mc); }

/* ── Ministry-color scope: wraps a group's or event's own detail page so its
   headline, primary action and icons pick up the group's color instead of
   the site's default accent. Always paired with a concrete .mc-* class in
   every template that uses it (events/detail.html, groups/detail.html) --
   deliberately no --mc fallback here: this rule used to set one, but since
   it's declared after .mc-red/.mc-teal/etc in the cascade, equal specificity
   meant THIS rule won the tie and silently overrode the ministry color back
   to the general accent on every single ministry page. */
.mc-scope .page-head h1 { color: var(--mc); }
.mc-scope .btn-primary { background: var(--mc); }
.mc-scope .btn-primary:hover { background: color-mix(in srgb, var(--mc) 82%, white 18%); }
.mc-scope .btn-ghost { color: var(--mc); border-color: color-mix(in srgb, var(--mc) 45%, var(--border)); }
.mc-scope .btn-ghost:hover { background: var(--mc); color: #fff; border-color: var(--mc); }
.mc-scope .contact-line svg { color: var(--mc); }

/* ── Status chips (event lifecycle) ──────────────────────────────────────── */
.status-chip {
  display: inline-block; padding: 4px 11px; border-radius: 100px;
  font-size: .64rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 600;
}
.status-open      { background: color-mix(in srgb, #16A34A 20%, transparent); color: #4ADE80; }
.status-pending    { background: color-mix(in srgb, #D97706 20%, transparent); color: #FBBF24; }
.status-closed     { background: color-mix(in srgb, #64748B 28%, transparent); color: #CBD5E1; }
.status-draft      { background: color-mix(in srgb, #64748B 18%, transparent); color: #94A3B8; }
.status-cancelled  { background: color-mix(in srgb, #DC2626 20%, transparent); color: #F87171; }

/* ── Member/leader portal (/my) ──────────────────────────────────────────── */
.portal-item {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--mc);
  border-radius: 10px; padding: 16px 18px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-photo, .about-photo-ph { margin: 0 auto; }
  .about-text p { margin-left: auto; margin-right: auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card .thumb { min-height: 0; aspect-ratio: 16/8; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 720px) {
  .nav-burger { display: block; }
  .nav-links {
    position: fixed; top: 62px; right: 0; left: 0;
    flex-direction: column; align-items: center; gap: 0;
    background: color-mix(in srgb, var(--bg) 97%, transparent);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav-links.open { max-height: 400px; }
  .nav-links a { padding: 15px; width: 100%; text-align: center; }
  .section { padding: 64px 0; }
  .prevnext { grid-template-columns: 1fr; }
}

/* RTE-LAYOUT:BEGIN -- the generic Visual Editor layout rules below are COPIED VERBATIM into rte-layout.css (the sign-in page loads that file
   instead of this one). Edit both together; tests/test_login_page.py fails if they drift. */
/* Per-block "hide on phones" (Visual Editor color/font/appearance fields,
   core/pages.py _style_fields) -- stays visible on tablets and up, just
   leaves it out of the stacked phone layout. Same 720px cutoff this engine
   already uses elsewhere for "phone" vs "tablet and up". */
@media (max-width: 720px) {
  .rte-hide-mobile { display: none !important; }
}

/* Freeform block positioning (Visual Editor, core/pages.py _style_fields'
   *_freeform/*_x/*_y/*_z fields). Only takes effect at tablet/desktop
   widths -- phones always keep the safe stacked flow, same 720px cutoff as
   .rte-hide-mobile above. Gated on the inline --rte-x custom property
   itself (not a bare selector + var() fallback) so a block that never
   opted in is completely unaffected -- same convention as
   .sec[style*="--sec-text"] in theme.css. */
@media (min-width: 721px) {
  .sec [style*="--rte-x"] {
    position: absolute;
    left: var(--rte-x);
    top: var(--rte-y);
    z-index: var(--rte-z, 1);
  }
}

/* Width / height set by dragging a block's resize handles (core/pages.py
   *_w/*_h, emitted as --rte-w/--rte-h by elem_css()). Custom properties,
   applied only from tablet up, so a phone never inherits a desktop-sized
   box. The percentages are of the block's container -- the whole section
   when it's positioned freely. Photo blocks fill the box they're given. */
@media (min-width: 721px) {
  .sec [style*="--rte-w"] { width: var(--rte-w); max-width: none; }
  .sec [style*="--rte-h"] { height: var(--rte-h); }
  .sec [style*="--rte-w"] > img, .sec [style*="--rte-h"] > img, .sec [style*="--rte-w"] > a.rte-lk > img, .sec [style*="--rte-h"] > a.rte-lk > img { max-width: none; }
  .sec [style*="--rte-w"] > img, .sec [style*="--rte-w"] > a.rte-lk > img { width: 100%; }
  .sec [style*="--rte-h"] > img, .sec [style*="--rte-h"] > a.rte-lk > img { height: 100%; object-fit: cover; }
  .sec .hero-figure[style*="--rte-w"] .hero-portrait { width: 100%; }
  .sec .hero-figure[style*="--rte-h"] .hero-portrait { height: 100%; max-height: none; object-fit: contain; }
  .sec .hero-figure[style*="--rte-h"] { min-height: 0; }

  /* A full-bleed backdrop photo that's been moved or sized: it stops being
     pinned to all four edges and becomes a box of its own (its natural
     size until a width/height is set). */
  .sec .hero-photo[style*="--rte-x"], .sec .cta-photo[style*="--rte-x"], .sec .heal-photo[style*="--rte-x"] {
    right: auto; bottom: auto; width: var(--rte-w, 100%); height: var(--rte-h, 100%);
  }
  .sec .heal-photo[style*="--rte-x"] { height: var(--rte-h, 480px); }
}

/* Section-level visual controls (core/pages.py _COMMON pad_top/pad_bottom/
   bg_image/bg_overlay, rendered by section_style()). All gated on the
   inline custom property being present, same convention as --rte-x above,
   so a section that never set them is untouched. Spacing is a multiplier of
   the theme's own --space-sec; the darkening overlay is a ::before layer
   with the section's content lifted above it. */
.sec[style*="--sec-pad-top"] { padding-top: calc(var(--space-sec, 96px) * var(--sec-pad-top)); }
.sec[style*="--sec-pad-bottom"] { padding-bottom: calc(var(--space-sec, 96px) * var(--sec-pad-bottom)); }
.sec[style*="--sec-overlay"] { position: relative; }
.sec[style*="--sec-overlay"]::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: rgba(0, 0, 0, var(--sec-overlay));
}
.sec[style*="--sec-overlay"] > * { position: relative; }

/* Section canvas height (core/pages.py sec_h, vw = percent of screen width). */
.sec[style*="--sec-h"] { min-height: var(--sec-h); }

/* ── Device overrides come last so they beat the desktop rules above at equal specificity. ── */
/* Items added from the visual editor (core/pages.py item_fields,
   public/_items.html). :where() keeps these defaults at zero specificity so
   every positioning/size rule above and below simply wins. Stacked (flow) by
   default -- centered, readable width; the --rte-* rules take free ones out
   of the flow. */
:where(.rte-item) { box-sizing: border-box; margin: 18px auto; max-width: 100%; }
:where(.rte-item-text, .rte-item-image, .rte-item-video) { width: min(92%, 720px); }
:where(.rte-item-text) { font-size: 1.1rem; line-height: 1.55; padding: 4px 6px; }
/* Text added over a dark hero would be dark-on-dark (the hero's own copy is styled light by .hero-copy, not by the section),
   and the section's Text colour setting should reach it like it reaches the template's own text. */
.sec-hero .rte-item-text { color: rgba(255, 255, 255, .92); }
.sec[style*="--sec-text"] .rte-item-text { color: var(--sec-text); }
:where(.rte-item-shape) { display: block; width: min(92%, 320px); min-height: 28px; background: var(--accent-2, #2f6fd6); border-radius: 8px; }
.rte-item-image img { display: block; width: 100%; height: auto; }
.rte-item-image > a, .rte-item-image > a > img { display: block; }
.rte-item-video .player { width: 100%; }
.rte-item-ph { display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 12px; text-align: center; font-size: .9rem; color: #6b7a90; background: rgba(120, 130, 150, .12); border: 2px dashed rgba(120, 130, 150, .45); border-radius: 10px; }
.rte-item-image .rte-item-ph { aspect-ratio: 4 / 3; min-height: 0; }
.rte-item-video .rte-item-ph { aspect-ratio: 16 / 9; min-height: 0; }
.rte-item-button.rte-item { display: block; width: fit-content; }
.sec .rte-item[style*="--rte-x"] { margin: 0; }
/* The hero is a flex row: a stacked item must wrap onto its own line below
   the hero content, not squeeze in beside it. Only when it has items. */
.sec-hero:has(> .rte-item) { flex-wrap: wrap; align-content: flex-start; }
@media (max-width: 720px) {
  .sec .rte-item[style*="--rte-x"]:not([style*="--rte-m-free"]) { margin: 18px auto; }
  .sec .rte-item[style*="--rte-m-free"] { margin: 0; }
}

/* A block made into a link keeps its surroundings' look. */
a.rte-lk { color: inherit; text-decoration: inherit; font: inherit; }
a.rte-lk > img { display: block; }

/* NOTE: the free/width/height device rules double their attribute selector so they beat theme rules of equal
   specificity such as `.btn-row .btn { width: 100% }` on phones. */
/* Per-device layouts (core/pages.py `{prefix}_dev`, emitted by elem_css() as
   --rte-t-* for tablet and --rte-m-* for phone -- only what that device
   overrides). Desktop is the flat --rte-* rules above. TABLET (721-1024px)
   starts as desktop (the ≥721px rules already apply) and each property it
   overrides wins by coming later at equal specificity; every fallback chain
   ends in the desktop value, so a tablet that only moves a block keeps its
   desktop width. PHONE (≤720px) starts as the stacked page, so its
   fallbacks are plain defaults. Sizes are zoom with !important because
   desktop's zoom is inline. */
@media (min-width: 721px) and (max-width: 1024px) {
  .sec [style*="--rte-t-flow"] { position: static; left: auto; top: auto; z-index: auto; width: var(--rte-t-w, auto); height: var(--rte-t-h, auto); }
  .sec [style*="--rte-t-free"][style*="--rte-t-free"] {
    position: absolute; max-width: none;
    left: var(--rte-t-x, var(--rte-x, 0%)); top: var(--rte-t-y, var(--rte-y, 0%));
    z-index: var(--rte-t-z, var(--rte-z, 1));
    width: var(--rte-t-w, var(--rte-w, auto)); height: var(--rte-t-h, var(--rte-h, auto));
  }
  .sec [style*="--rte-t-x"] { left: var(--rte-t-x); }
  .sec [style*="--rte-t-y"] { top: var(--rte-t-y); }
  .sec [style*="--rte-t-z"] { z-index: var(--rte-t-z); }
  .sec [style*="--rte-t-w"][style*="--rte-t-w"] { width: var(--rte-t-w); max-width: none; }
  .sec [style*="--rte-t-h"][style*="--rte-t-h"] { height: var(--rte-t-h); }
  .sec [style*="--rte-t-size"] { zoom: var(--rte-t-size) !important; }
  .sec [style*="--rte-t-rot"] { rotate: var(--rte-t-rot) !important; }
  .sec [style*="--rte-t-off"] { display: none !important; }
  .sec [style*="--rte-t-w"] > img { width: 100%; max-width: none; }
  .sec [style*="--rte-t-h"] > img { height: 100%; max-width: none; object-fit: cover; }
  .sec .hero-figure[style*="--rte-t-w"] .hero-portrait { width: 100%; }
  .sec .hero-figure[style*="--rte-t-h"] .hero-portrait { height: 100%; max-height: none; object-fit: contain; }
  .sec .hero-figure[style*="--rte-t-h"] { min-height: 0; }
  .sec .hero-photo[style*="--rte-t-free"], .sec .cta-photo[style*="--rte-t-free"], .sec .heal-photo[style*="--rte-t-free"] {
    right: auto; bottom: auto; width: var(--rte-t-w, var(--rte-w, 100%)); height: var(--rte-t-h, var(--rte-h, 100%));
  }
  .sec .heal-photo[style*="--rte-t-free"] { height: var(--rte-t-h, var(--rte-h, 480px)); }
  .sec[style*="--sec-t-pad-top"] { padding-top: calc(var(--space-sec, 96px) * var(--sec-t-pad-top)); }
  .sec[style*="--sec-t-pad-bottom"] { padding-bottom: calc(var(--space-sec, 96px) * var(--sec-t-pad-bottom)); }
  .sec[style*="--sec-t-h"] { min-height: var(--sec-t-h); }
}
@media (max-width: 720px) {
  .sec [style*="--rte-m-flow"] { position: static; left: auto; top: auto; z-index: auto; width: var(--rte-m-w, auto); height: var(--rte-m-h, auto); }
  .sec [style*="--rte-m-free"][style*="--rte-m-free"] {
    position: absolute; max-width: none;
    left: var(--rte-m-x, 0%); top: var(--rte-m-y, 0%); z-index: var(--rte-m-z, 1);
    width: var(--rte-m-w, auto); height: var(--rte-m-h, auto);
  }
  .sec [style*="--rte-m-x"] { left: var(--rte-m-x); }
  .sec [style*="--rte-m-y"] { top: var(--rte-m-y); }
  .sec [style*="--rte-m-z"] { z-index: var(--rte-m-z); }
  .sec [style*="--rte-m-w"][style*="--rte-m-w"] { width: var(--rte-m-w); max-width: none; }
  .sec [style*="--rte-m-h"][style*="--rte-m-h"] { height: var(--rte-m-h); }
  .sec [style*="--rte-m-size"] { zoom: var(--rte-m-size) !important; }
  .sec [style*="rotate:"] { rotate: none !important; }   /* the desktop angle is an inline `rotate`: a phone is the stacked page and starts upright */
  .sec [style*="--rte-m-rot"] { rotate: var(--rte-m-rot) !important; }
  .sec [style*="--rte-m-off"] { display: none !important; }
  .sec [style*="--rte-m-w"] > img { width: 100%; max-width: none; }
  .sec [style*="--rte-m-h"] > img { height: 100%; max-width: none; object-fit: cover; }
  .sec .hero-figure[style*="--rte-m-w"] .hero-portrait { width: 100%; }
  .sec .hero-figure[style*="--rte-m-h"] .hero-portrait { height: 100%; max-height: none; object-fit: contain; }
  .sec .hero-figure[style*="--rte-m-h"] { min-height: 0; }
  .sec .hero-photo[style*="--rte-m-free"], .sec .cta-photo[style*="--rte-m-free"], .sec .heal-photo[style*="--rte-m-free"] {
    right: auto; bottom: auto; width: var(--rte-m-w, 100%); height: var(--rte-m-h, 100%);
  }
  .sec .heal-photo[style*="--rte-m-free"] { height: var(--rte-m-h, 480px); }
  .sec[style*="--sec-m-pad-top"] { padding-top: calc(var(--space-sec, 96px) * var(--sec-m-pad-top)); }
  .sec[style*="--sec-m-pad-bottom"] { padding-bottom: calc(var(--space-sec, 96px) * var(--sec-m-pad-bottom)); }
  .sec[style*="--sec-m-h"] { min-height: var(--sec-m-h); }
}

/* Tablet scales a desktop layout instead of copying its pixel sizes: a free-positioned block's text (desktop `zoom`, also
   emitted as --rte-size; unsized text at 100%) shrinks with the narrower screen, unless the tablet has a size of its own (--rte-t-size). */
@media (min-width: 721px) and (max-width: 860px) {
  .sec [style*="--rte-size"][style*="--rte-x"]:not([style*="--rte-t-size"]):not([style*="--rte-t-flow"]) { zoom: calc(var(--rte-size) * .66) !important; }
  .sec [style*="--rte-x"]:not([style*="--rte-size"]):not([style*="--rte-t-size"]):not([style*="--rte-t-flow"]):not(:has(img)):not(.rte-item-shape):not(.rte-item-video):not(.hero-photo):not(.cta-photo):not(.heal-photo) { zoom: .82; }
}
@media (min-width: 861px) and (max-width: 1024px) {
  .sec [style*="--rte-size"][style*="--rte-x"]:not([style*="--rte-t-size"]):not([style*="--rte-t-flow"]) { zoom: calc(var(--rte-size) * .82) !important; }
  .sec [style*="--rte-x"]:not([style*="--rte-size"]):not([style*="--rte-t-size"]):not([style*="--rte-t-flow"]):not(:has(img)):not(.rte-item-shape):not(.rte-item-video):not(.hero-photo):not(.cta-photo):not(.heal-photo) { zoom: .92; }
}
/* A hero whose content is all free-positioned has nothing in the flow to give it height once the theme stops stretching it
   (<=860px): keep the desktop proportions (about 3:4 of the screen width) unless a canvas height was set for the device. */
@media (min-width: 721px) and (max-width: 1024px) {
  .sec-hero:has([style*="--rte-x"]):not([style*="--sec-h"]):not([style*="--sec-t-h"]) { min-height: 76vw; }
}

/* A scroll-reveal wrapper (.reveal) holding a freely positioned element must never carry a transform: a transformed
   ancestor becomes the containing block of absolute descendants, so the element would be placed against the column
   (not the section) until the 0.7s reveal ends and then jump. The fade stays; only the slide-up is dropped. */
.sec .reveal:has([style*="--rte-x"]), .sec .reveal:has([style*="--rte-t-x"]), .sec .reveal:has([style*="--rte-m-x"]),
.sec .reveal:has([style*="--rte-t-free"]), .sec .reveal:has([style*="--rte-m-free"]) {
  transform: none; transition: opacity .7s ease;
}

/* Picture crop (core/pages.py `{prefix}_fit/_fx/_fy/_zoom`, emitted by elem_css as --rte-fit/fx/fy/zoom): how the <img> sits in
   its frame (Fill/Fit, where it is centred, how far it is zoomed in). Backdrop photos (background-image divs) take Fit + focus. */
.sec [style*="--rte-fit"] > img, .sec [style*="--rte-fit"] > a.rte-lk > img { object-fit: var(--rte-fit); }
.sec [style*="--rte-fx"] > img, .sec [style*="--rte-fy"] > img, .sec [style*="--rte-fx"] > a.rte-lk > img, .sec [style*="--rte-fy"] > a.rte-lk > img { object-position: var(--rte-fx, 50%) var(--rte-fy, 50%); }
.sec [style*="--rte-zoom"] { overflow: hidden; }
.sec [style*="--rte-zoom"] > img, .sec [style*="--rte-zoom"] > a.rte-lk > img { transform: scale(var(--rte-zoom)); transform-origin: var(--rte-fx, 50%) var(--rte-fy, 50%); }
.sec .hero-photo[style*="--rte-fit"], .sec .cta-photo[style*="--rte-fit"], .sec .heal-photo[style*="--rte-fit"] { background-size: var(--rte-fit); background-repeat: no-repeat; }
.sec .hero-photo[style*="--rte-fx"], .sec .cta-photo[style*="--rte-fx"], .sec .heal-photo[style*="--rte-fx"],
.sec .hero-photo[style*="--rte-fy"], .sec .cta-photo[style*="--rte-fy"], .sec .heal-photo[style*="--rte-fy"] { background-position: var(--rte-fx, 50%) var(--rte-fy, 50%); }

/* Desktop half of the Desktop / Tablet / Phone visibility switches (tablet and phone: --rte-t-off / --rte-m-off above). */
@media (min-width: 1025px) {
  .sec [style*="--rte-d-off"] { display: none !important; }
}
/* RTE-LAYOUT:END */

/* ── Resource cards: richer layout (only appears when a resource has "more info") ── */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.res-body .res-summary { color: var(--text-soft); font-size: .9rem; line-height: 1.5; margin-bottom: 10px; }
.res-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; }
.res-chips li { font-size: .7rem; letter-spacing: .04em; font-weight: 600; padding: 3px 10px; border-radius: 100px; border: 1px solid var(--border-2); color: var(--text-soft); background: var(--card); }
.res-more { display: inline-block; font-size: .82rem; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
.res-more:hover { text-decoration: underline; }
.feature-copy .res-summary { font-size: 1.05rem; color: var(--text-soft); margin-bottom: 12px; }
.gate-account .gate-form, .gate-account .how-steps-compact { max-width: 340px; }
.gate-note { font-size: .78rem; color: var(--muted); line-height: 1.5; margin: 0; }
.gate-note a { text-decoration: underline; }
.how-steps { list-style: none; margin: 0; padding: 0; }
.how-steps-compact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 4px; }
.how-steps-compact li { display: flex; flex-direction: column; gap: 6px; font-size: .74rem; line-height: 1.3; }
.how-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.how-steps-compact .how-n { width: 24px; height: 24px; font-size: .76rem; }
