/* ══════════════════════════════════════════════════════════════
   RealEstate CRM — Public website
   Theme: "Verdant Estate" — emerald + champagne gold on warm neutrals.
   Light & dark. Accent/primary can be overridden per-site by the admin
   (Appearance) via an inline <style> that redefines these tokens.
   ══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

/* ── Light (default) ── */
:root, :root[data-theme="light"] {
    --pub-primary: #0e7c5a;          /* emerald */
    --pub-primary-2: #0b6349;        /* darker emerald (hover) */
    --pub-accent: #c9a24b;           /* champagne gold */
    --pub-accent-soft: rgba(14, 124, 90, 0.10);
    --pub-gold-soft: rgba(201, 162, 75, 0.14);
    --pub-dark: #0f1a16;             /* footer / deep ground */
    --pub-ink: #16241f;              /* headings */
    --pub-text: #2b3a34;
    --pub-muted: #64756d;
    --pub-bg: #f8f7f3;               /* warm ivory */
    --pub-surface: #ffffff;          /* cards */
    --pub-bg-alt: #f0efe8;
    --pub-border: #e6e3da;
    --pub-radius: 14px;
    --pub-shadow: 0 6px 24px rgba(15, 26, 22, 0.08);
    --pub-shadow-lg: 0 22px 60px rgba(15, 26, 22, 0.16);
    --pub-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pub-font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
    --pub-hero-1: #0e5a44;
    --pub-hero-2: #0e7c5a;
    color-scheme: light;
}

/* ── Dark — explicit choice ── */
:root[data-theme="dark"] {
    --pub-primary: #2dd4a7;
    --pub-primary-2: #24b892;
    --pub-accent: #e0b352;
    --pub-accent-soft: rgba(45, 212, 167, 0.14);
    --pub-gold-soft: rgba(224, 179, 82, 0.16);
    --pub-dark: #0a100d;
    --pub-ink: #eaf2ee;
    --pub-text: #d3ddd7;
    --pub-muted: #93a49b;
    --pub-bg: #0e1512;               /* deep forest-charcoal */
    --pub-surface: #16211c;
    --pub-bg-alt: #131d18;
    --pub-border: rgba(255, 255, 255, 0.09);
    --pub-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --pub-shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.55);
    --pub-hero-1: #0a3a2c;
    --pub-hero-2: #0f5a43;
    color-scheme: dark;
}

/* ── Dark — system default (no explicit choice) ── */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --pub-primary: #2dd4a7;
        --pub-primary-2: #24b892;
        --pub-accent: #e0b352;
        --pub-accent-soft: rgba(45, 212, 167, 0.14);
        --pub-gold-soft: rgba(224, 179, 82, 0.16);
        --pub-dark: #0a100d;
        --pub-ink: #eaf2ee;
        --pub-text: #d3ddd7;
        --pub-muted: #93a49b;
        --pub-bg: #0e1512;
        --pub-surface: #16211c;
        --pub-bg-alt: #131d18;
        --pub-border: rgba(255, 255, 255, 0.09);
        --pub-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
        --pub-shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.55);
        --pub-hero-1: #0a3a2c;
        --pub-hero-2: #0f5a43;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

.pub-body {
    margin: 0;
    font-family: var(--pub-font);
    color: var(--pub-text);
    background: var(--pub-bg);
    line-height: 1.65;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Headings use the display serif for a premium editorial feel. */
.pub-hero h1, .pub-section-head h2, .pub-form-title,
.pub-card-title, .pub-footer-brand, .pub-doc h1, .pub-doc h2 {
    font-family: var(--pub-font-head);
    letter-spacing: -0.01em;
}

.pub-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Header ── */
.pub-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--pub-bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pub-border);
    transition: box-shadow 0.2s ease, background-color 0.3s ease;
}
.pub-header.scrolled { box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08); }

.pub-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.pub-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--pub-primary);
    text-decoration: none;
}
.pub-brand i { font-size: 1.6rem; color: var(--pub-accent); }
.pub-brand-logo { height: 38px; width: auto; }

.pub-nav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}
.pub-nav > a {
    color: var(--pub-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.15s ease;
}
.pub-nav > a:hover { color: var(--pub-accent); }

.pub-nav-account { display: flex; align-items: center; gap: 0.6rem; }
.pub-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--pub-primary);
    cursor: pointer;
}

/* ── Buttons ── */
.pub-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.pub-btn-primary { background: var(--pub-primary); color: #fff; }
.pub-btn-primary:hover { background: var(--pub-primary-2); transform: translateY(-1px); box-shadow: var(--pub-shadow); color: #fff; }
.pub-btn-gold { background: var(--pub-accent); color: #23180a; }
.pub-btn-gold:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: var(--pub-shadow); color: #23180a; }
.pub-btn-outline { background: transparent; border-color: var(--pub-accent); color: var(--pub-accent); }
.pub-btn-outline:hover { background: var(--pub-accent-soft); color: var(--pub-accent); }
.pub-btn-ghost { background: transparent; color: var(--pub-text); }
.pub-btn-ghost:hover { color: var(--pub-accent); }
.pub-btn-lg { padding: 0.8rem 1.7rem; font-size: 1.02rem; }
.pub-btn-block { width: 100%; justify-content: center; }

/* ── Alerts ── */
.pub-alert { margin: 1rem 0; padding: 0.85rem 1.1rem; border-radius: 8px; font-weight: 500; }
.pub-alert-success { background: #e7f6ec; color: #1a7f43; border: 1px solid #b6e3c6; }
.pub-alert-error { background: #fdeaea; color: #c0332b; border: 1px solid #f3c2c0; }

/* ── Hero ── */
.pub-hero {
    background: linear-gradient(135deg, var(--pub-primary) 0%, var(--pub-primary-2) 60%, var(--pub-accent) 100%);
    color: #fff;
    padding: 5rem 0 5.5rem;
    position: relative;
    overflow: hidden;
}
.pub-hero h1 { font-size: 2.8rem; font-weight: 800; margin: 0 0 1rem; line-height: 1.15; }
.pub-hero p { font-size: 1.15rem; opacity: 0.92; max-width: 620px; margin: 0 0 2rem; }
.pub-hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ── Sections ── */
.pub-section { padding: 4rem 0; }
.pub-section-alt { background: var(--pub-bg-alt); }
.pub-section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.pub-section-head h2 { font-size: 2rem; font-weight: 800; color: var(--pub-primary); margin: 0 0 0.6rem; }
.pub-section-head p { color: var(--pub-muted); margin: 0; }
.pub-eyebrow { color: var(--pub-accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }

/* ── Project cards grid ── */
.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.pub-card {
    background: var(--pub-surface);
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pub-card:hover { transform: translateY(-4px); box-shadow: var(--pub-shadow-lg); }
.pub-card-media {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #dce6f5, #eef3fb);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pub-card-media img { width: 100%; height: 100%; object-fit: cover; }
.pub-card-media .pub-card-placeholder { font-size: 3rem; color: var(--pub-accent); opacity: 0.5; }
.pub-card-badge {
    position: absolute; top: 0.75rem; left: 0.75rem;
    background: rgba(30, 53, 96, 0.9); color: #fff;
    padding: 0.25rem 0.7rem; border-radius: 99px; font-size: 0.72rem; font-weight: 600;
}
.pub-card-body { padding: 1.1rem 1.2rem 1.3rem; flex: 1; display: flex; flex-direction: column; }
.pub-card-title { font-size: 1.15rem; font-weight: 700; color: var(--pub-primary); margin: 0 0 0.3rem; }
.pub-card-loc { color: var(--pub-muted); font-size: 0.88rem; margin: 0 0 0.7rem; }
.pub-card-loc i { color: var(--pub-accent); }
.pub-card-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--pub-muted); margin-bottom: 0.9rem; }
.pub-card-price { font-weight: 700; color: var(--pub-accent); font-size: 1.05rem; }
.pub-card-foot { margin-top: auto; display: flex; gap: 0.5rem; }

/* ── Chips / status ── */
.pub-chip {
    display: inline-block; padding: 0.28em 0.7em; border-radius: 99px;
    font-size: 0.74rem; font-weight: 600; background: var(--pub-accent-soft); color: var(--pub-accent);
}
.pub-chip-green { background: #e7f6ec; color: #1a7f43; }
.pub-chip-amber { background: #fdf0dc; color: #b26a00; }

/* ── Project detail ── */
.pub-detail-hero { position: relative; }
.pub-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 0.6rem; border-radius: var(--pub-radius); overflow: hidden; }
.pub-gallery-main { aspect-ratio: 16/10; background: var(--pub-bg-alt); }
.pub-gallery-main img, .pub-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pub-gallery-side { display: grid; grid-template-rows: 1fr 1fr; gap: 0.6rem; }
.pub-gallery-thumb { background: var(--pub-bg-alt); overflow: hidden; }
.pub-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: start; }
.pub-info-card { background: var(--pub-surface); border: 1px solid var(--pub-border); border-radius: var(--pub-radius); padding: 1.5rem; box-shadow: var(--pub-shadow); }
.pub-info-card.sticky { position: sticky; top: 90px; }
.pub-spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.pub-spec { background: var(--pub-bg-alt); border-radius: 10px; padding: 0.9rem 1rem; }
.pub-spec-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pub-muted); }
.pub-spec-value { font-weight: 700; color: var(--pub-primary); font-size: 1.05rem; }
.pub-amenities { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pub-amenity { display: flex; align-items: center; gap: 0.45rem; background: var(--pub-accent-soft); color: var(--pub-primary); padding: 0.45rem 0.85rem; border-radius: 8px; font-size: 0.88rem; font-weight: 500; }

/* ── Forms ── */
.pub-form-card { max-width: 480px; margin: 3rem auto; background: var(--pub-surface); border: 1px solid var(--pub-border); border-radius: var(--pub-radius); padding: 2.25rem; box-shadow: var(--pub-shadow); }
.pub-form-card.wide { max-width: 720px; }
.pub-form-title { font-size: 1.5rem; font-weight: 800; color: var(--pub-primary); margin: 0 0 0.3rem; text-align: center; }
.pub-form-sub { color: var(--pub-muted); text-align: center; margin: 0 0 1.75rem; font-size: 0.92rem; }
.pub-field { margin-bottom: 1.1rem; }
.pub-field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.35rem; color: var(--pub-primary); }
.pub-field .form-control, .pub-field .form-select {
    width: 100%; padding: 0.6rem 0.85rem; border: 1px solid var(--pub-border);
    border-radius: 8px; font-size: 0.95rem; font-family: inherit;
}
.pub-field .form-control:focus, .pub-field .form-select:focus {
    outline: none; border-color: var(--pub-accent); box-shadow: 0 0 0 3px var(--pub-accent-soft);
}
.pub-consent { display: flex; gap: 0.6rem; align-items: flex-start; background: var(--pub-bg-alt); padding: 0.9rem 1rem; border-radius: 8px; margin-bottom: 1.1rem; font-size: 0.86rem; color: var(--pub-muted); }
.pub-consent input { margin-top: 0.2rem; }
.pub-text-danger { color: #c0332b; font-size: 0.82rem; }
.pub-form-foot { text-align: center; margin-top: 1.25rem; font-size: 0.9rem; color: var(--pub-muted); }
.pub-form-foot a { color: var(--pub-accent); font-weight: 600; text-decoration: none; }

/* ── Filters bar ── */
.pub-filters { display: flex; gap: 0.75rem; flex-wrap: wrap; background: var(--pub-surface); border: 1px solid var(--pub-border); border-radius: var(--pub-radius); padding: 1rem 1.15rem; margin-bottom: 2rem; box-shadow: var(--pub-shadow); }
.pub-filters .form-control, .pub-filters .form-select { padding: 0.5rem 0.75rem; border: 1px solid var(--pub-border); border-radius: 8px; font-family: inherit; }

/* ── Account dashboard ── */
.pub-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.pub-stat { background: var(--pub-surface); border: 1px solid var(--pub-border); border-radius: var(--pub-radius); padding: 1.3rem; box-shadow: var(--pub-shadow); }
.pub-stat-value { font-size: 1.9rem; font-weight: 800; color: var(--pub-primary); }
.pub-stat-label { color: var(--pub-muted); font-size: 0.85rem; }

/* ── Tables (account areas) ── */
.pub-table { width: 100%; border-collapse: collapse; background: var(--pub-surface); border-radius: var(--pub-radius); overflow: hidden; box-shadow: var(--pub-shadow); }
.pub-table th { background: var(--pub-bg-alt); text-align: left; padding: 0.8rem 1rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pub-muted); }
.pub-table td { padding: 0.8rem 1rem; border-top: 1px solid var(--pub-border); font-size: 0.92rem; }

/* ── Legal / content pages ── */
.pub-doc { max-width: 860px; margin: 0 auto; }
.pub-doc h1 { color: var(--pub-primary); font-weight: 800; }
.pub-doc h2 { color: var(--pub-primary); font-weight: 700; font-size: 1.3rem; margin-top: 2rem; }
.pub-doc h3 { color: var(--pub-primary-2); font-weight: 600; font-size: 1.08rem; margin-top: 1.3rem; }
.pub-doc p, .pub-doc li { color: var(--pub-text); }
.pub-doc a { color: var(--pub-accent); }

/* ── Breadcrumb ── */
.pub-breadcrumb { display: flex; gap: 0.5rem; font-size: 0.85rem; color: var(--pub-muted); padding: 1.25rem 0; flex-wrap: wrap; }
.pub-breadcrumb a { color: var(--pub-accent); text-decoration: none; }

/* ── Cookie banner ── */
.cookie-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
    background: var(--pub-dark); color: #fff; box-shadow: 0 -6px 24px rgba(0,0,0,0.25);
}
.cookie-banner-inner {
    max-width: 1180px; margin: 0 auto; padding: 1.1rem 1.25rem;
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between;
}
.cookie-banner-text { flex: 1; min-width: 260px; }
.cookie-banner-text strong { font-size: 1rem; }
.cookie-banner-text p { margin: 0.25rem 0 0; font-size: 0.86rem; opacity: 0.85; }
.cookie-banner-text a { color: #9dc0f5; }
.cookie-banner-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cookie-banner .pub-btn-ghost { color: #cbd5e1; }
.cookie-banner .pub-btn-outline { border-color: #9dc0f5; color: #9dc0f5; }

/* ── Footer ── */
.pub-footer { background: var(--pub-dark); color: #cbd5e1; margin-top: 4rem; }
.pub-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 2rem; padding: 3rem 1.25rem 2rem; }
.pub-footer-brand { font-size: 1.2rem; font-weight: 800; color: #fff; margin-bottom: 0.6rem; }
.pub-footer-about { font-size: 0.88rem; opacity: 0.8; }
.pub-footer h6 { color: #fff; font-size: 0.95rem; margin: 0 0 0.9rem; }
.pub-footer a { display: block; color: #cbd5e1; text-decoration: none; font-size: 0.88rem; margin-bottom: 0.5rem; }
.pub-footer a:hover { color: #fff; }
.pub-footer p { font-size: 0.85rem; margin: 0 0 0.5rem; opacity: 0.85; }
.pub-social { display: flex; gap: 0.7rem; margin-top: 0.9rem; }
.pub-social a { font-size: 1.25rem; display: inline; margin: 0; }
.pub-grievance { margin-top: 0.75rem; opacity: 0.7; }
.pub-footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 1rem 0; }
.pub-footer-bottom .pub-container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.82rem; opacity: 0.75; }

/* ── Responsive ── */
@media (max-width: 980px) {
    .pub-detail-grid { grid-template-columns: 1fr; }
    .pub-gallery { grid-template-columns: 1fr; }
    .pub-info-card.sticky { position: static; }
    .pub-footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile / tablet header: hamburger + full-width dropdown menu under the bar.
   Anchored to the sticky .pub-header so it spans the full width cleanly with a
   proper scrim behind it — no more cramped side panel overlapping the hero. */
@media (max-width: 900px) {
    .pub-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .pub-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0.15rem;
        background: var(--pub-surface);
        border-top: 1px solid var(--pub-border);
        border-bottom: 1px solid var(--pub-border);
        padding: 0.5rem 1.25rem 1rem;
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
        max-height: 0; overflow: hidden;
        opacity: 0; visibility: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.2s ease, padding 0.3s ease;
    }
    .pub-nav.open { max-height: calc(100vh - 68px); overflow-y: auto; opacity: 1; visibility: visible; }
    .pub-nav > a {
        padding: 0.85rem 0.4rem; font-size: 1.02rem;
        border-bottom: 1px solid var(--pub-border);
    }
    .pub-nav > a:last-of-type { border-bottom: none; }
    .pub-nav #pubThemeToggle { align-self: flex-start; margin: 0.35rem 0; }
    .pub-nav-account { flex-direction: column; align-items: stretch; width: 100%; gap: 0.5rem; margin-top: 0.4rem; }
    .pub-nav-account .pub-btn { width: 100%; justify-content: center; padding: 0.7rem 1rem; }
    /* Scrim behind the open menu so tapping outside is obvious + focuses the menu. */
    .pub-nav-scrim {
        position: fixed; inset: 68px 0 0; z-index: 90;
        background: rgba(0, 0, 0, 0.28); opacity: 0; visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    .pub-nav-scrim.show { opacity: 1; visibility: visible; }
}
@media (max-width: 560px) {
    .pub-container { padding: 0 1rem; }
    .pub-header-inner { height: 60px; }
    .pub-nav-scrim { inset: 60px 0 0; }
    .pub-nav.open { max-height: calc(100vh - 60px); }
    .pub-brand { font-size: 1.05rem; }
    .pub-brand-logo { height: 32px; }
    .pub-hero h1 { font-size: 1.9rem; }
    .pub-footer-grid { grid-template-columns: 1fr; }
    .pub-stat-num { font-size: 2.1rem; }
}

/* ══════════════════════════════════════════════════════════════
   Motion — theme toggle, scroll reveal, hero carousel, counters
   ══════════════════════════════════════════════════════════════ */

/* Theme toggle + header icon buttons */
.pub-icon-btn {
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--pub-border); background: transparent;
    color: var(--pub-text); cursor: pointer; font-size: 1.1rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.pub-icon-btn:hover { background: var(--pub-accent-soft); color: var(--pub-primary); transform: translateY(-1px); }

/* Scroll reveal — elements start hidden and animate in when visible */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-left { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal-scale { transform: scale(0.94); }
.reveal.is-visible.reveal-left, .reveal.is-visible.reveal-right, .reveal.is-visible.reveal-scale { transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.40s; }

/* Entrance keyframes */
@keyframes pub-fade-up { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes pub-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pub-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pub-gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Hero: animated gradient + entrance */
.pub-hero {
    background: linear-gradient(120deg, var(--pub-hero-1), var(--pub-hero-2), var(--pub-primary));
    background-size: 200% 200%;
    animation: pub-gradient 16s ease infinite;
}
.pub-hero h1 { animation: pub-fade-up 0.8s cubic-bezier(.2,.7,.2,1) both; }
.pub-hero p { animation: pub-fade-up 0.8s cubic-bezier(.2,.7,.2,1) 0.12s both; }
.pub-hero .pub-hero-actions { animation: pub-fade-up 0.8s cubic-bezier(.2,.7,.2,1) 0.24s both; }
.pub-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(1200px 400px at 80% -10%, rgba(201,162,75,0.20), transparent 60%);
}

/* Hero carousel (banners from the CMS) */
.pub-carousel { position: relative; }
.pub-slide { display: none; }
.pub-slide.active { display: block; animation: pub-fade-in 0.6s ease both; }
.pub-carousel-dots { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.5rem; }
.pub-dot { width: 10px; height: 10px; border-radius: 99px; border: none; cursor: pointer;
    background: rgba(255,255,255,0.4); transition: background 0.2s, width 0.2s; }
.pub-dot.active { background: #fff; width: 26px; }

/* ── Full-hero banner slide (full-bleed background image, optional overlay text) ── */
.pub-slide-hero.active { display: flex; align-items: center; }
.pub-slide-hero {
    position: relative;
    min-height: 60vh;
    border-radius: 20px;
    overflow: hidden;
    background-color: var(--pub-primary);
    background-size: cover;
    background-position: center;
    box-shadow: var(--pub-shadow-lg);
}
.pub-slide-hero-scrim {
    position: absolute; inset: 0;
    /* readable gradient behind the text; lighter on the far side */
    background: linear-gradient(90deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.38) 45%, rgba(0,0,0,0.12) 100%);
}
.pub-slide-hero-scrim.is-clear { background: none; }   /* text hidden → show image untouched */
.pub-slide-hero-content { position: relative; z-index: 2; width: 100%; padding: 2.5rem 0; }
.pub-slide-hero-content.align-center { text-align: center; margin-inline: auto; }
.pub-slide-hero-content.align-center p { margin-inline: auto; }
.pub-slide-hero-content.align-right { text-align: right; }
.pub-slide-hero-content.align-right p { margin-left: auto; }
/* A text-hidden full hero still needs some height to show the image nicely */
.pub-slide-hero:has(> .pub-slide-hero-scrim.is-clear:only-child) { min-height: 56vh; }
@media (max-width: 768px) {
    .pub-slide-hero { min-height: 52vh; }
}

/* Count-up stats band */
.pub-stats-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; }
.pub-stat-big { text-align: center; }
.pub-stat-num { font-family: var(--pub-font-head); font-size: 2.6rem; font-weight: 700; color: var(--pub-primary); line-height: 1; }
.pub-stat-cap { color: var(--pub-muted); font-size: 0.9rem; margin-top: 0.35rem; }

/* Card hover shine */
.pub-card { position: relative; }
.pub-card .pub-card-media img { transition: transform 0.5s cubic-bezier(.2,.7,.2,1); }
.pub-card:hover .pub-card-media img { transform: scale(1.06); }

/* Section entrance for anything tagged .reveal is handled by JS observer */

/* ── Error pages (404 / 500) ── */
.pub-error { text-align: center; max-width: 640px; margin: 2rem auto 3rem; }
.pub-error-code {
    font-family: var(--pub-font-head);
    font-size: clamp(6rem, 22vw, 12rem);
    font-weight: 700; line-height: 0.95; letter-spacing: -0.03em;
    background: linear-gradient(120deg, var(--pub-primary), var(--pub-accent));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    background-size: 200% 200%; animation: pub-gradient 8s ease infinite;
}
.pub-error-heading { font-size: 1.9rem; color: var(--pub-ink); margin: 0.25rem 0 0.6rem; }
.pub-error-msg { color: var(--pub-muted); font-size: 1.05rem; margin: 0 auto 1.8rem; max-width: 460px; }
.pub-error-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.pub-error-hint { margin-top: 1.75rem; color: var(--pub-muted); font-size: 0.9rem; }
.pub-error-hint a { color: var(--pub-primary); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
}
