/* =========================================================================
   GadaFundAm — "Adire Modern" design system
   Hand-written CSS3, no framework, no build step (cPanel-friendly).
   Rooted in adire indigo textile + celebratory Nigerian creative energy.
   ========================================================================= */

/* ---------- Design tokens ------------------------------------------------ */
:root {
    /* Brand */
    --ink:        #14261C;   /* adire forest — brand base            */
    --ink-2:      #1C3A2B;   /* raised forest surface                */
    --ink-3:      #2A4A38;   /* borders on dark                      */
    --paper:      #F7F2E7;   /* warm cream — light base              */
    --paper-2:    #EFE7D5;   /* sunk cream surface                   */
    --gold:       #EEB01E;   /* marigold — primary CTA / signature   */
    --gold-deep:  #D69808;
    --grove:      #2F7048;   /* palm green — growth / progress       */
    --grove-deep: #234E34;
    --rose:       #E5427B;   /* Ankara magenta — community pop       */

    /* Neutrals (warm) */
    --slate:      #55625A;
    --slate-2:    #8A948B;
    --line:       #E6DDCA;   /* hairline on paper                    */
    --white:      #FFFFFF;

    /* Semantic */
    --text:       var(--ink);
    --muted:      var(--slate);
    --bg:         var(--paper);
    --surface:    var(--white);
    --border:     var(--line);
    --success:    var(--grove);
    --danger:     #D64545;
    --warning:    #E0870D;
    --info:       #2F6FED;

    /* Type */
    --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body:    "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono:    "Space Mono", ui-monospace, "SFMono-Regular", monospace;

    /* Type scale (fluid) */
    --step--1: clamp(0.80rem, 0.77rem + 0.15vw, 0.88rem);
    --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.10rem);
    --step-1:  clamp(1.25rem, 1.16rem + 0.45vw, 1.55rem);
    --step-2:  clamp(1.56rem, 1.40rem + 0.80vw, 2.20rem);
    --step-3:  clamp(1.95rem, 1.66rem + 1.45vw, 3.10rem);
    --step-4:  clamp(2.44rem, 1.95rem + 2.45vw, 4.40rem);

    /* Space */
    --sp-1: 0.25rem; --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
    --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 3rem;    --sp-8: 4.5rem;

    /* Radii + shadow */
    --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;
    --shadow-1: 0 1px 2px rgba(18,34,26,.06), 0 2px 8px rgba(18,34,26,.05);
    --shadow-2: 0 8px 30px rgba(18,34,26,.10);
    --shadow-gold: 0 6px 22px rgba(238,176,30,.35);

    --container: 1160px;
    --header-h: 72px;
}

/* ---------- Reset / base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p  { margin: 0 0 1em; }
a  { color: var(--grove-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout helpers ---------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-5); }
.section { padding-block: var(--sp-8); }
.stack > * + * { margin-top: var(--sp-4); }
.grid { display: grid; gap: var(--sp-5); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
/* Main content + sidebar layout that collapses to one column on small screens. */
.grid-split { grid-template-columns: 1.4fr 1fr; align-items: start; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid-split { grid-template-columns: 1fr; } }

/* Campaign detail: main content + funding sidebar. Stacks on smaller screens. */
.campaign-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--sp-6); align-items: start; }
@media (max-width: 860px) {
    .campaign-layout { grid-template-columns: 1fr; }
    .campaign-layout aside { position: static !important; }
}

/* ---------- Typography accents ------------------------------------------ */
.eyebrow {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    text-transform: uppercase;
    letter-spacing: .22em;
    color: var(--grove-deep);
    margin: 0 0 var(--sp-3);
    font-weight: 700;
}
.lead { font-size: var(--step-1); color: var(--slate); font-weight: 400; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.highlight { color: var(--gold-deep); }

/* Signature: gold marker-underline used sparingly on hero keywords */
.ink-mark {
    background-image: linear-gradient(transparent 62%, rgba(245,179,1,.55) 62%);
    padding-inline: .05em;
}

/* ---------- Buttons ----------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-family: var(--font-body); font-weight: 700; font-size: var(--step-0);
    line-height: 1; padding: .85em 1.4em; border-radius: var(--r-pill);
    border: 2px solid transparent; cursor: pointer; text-decoration: none;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gold); color: var(--ink); box-shadow: var(--shadow-gold); }
.btn-primary:hover { background: var(--gold-deep); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--ink-2); }
.btn-grove { background: var(--grove); color: var(--white); }
.btn-grove:hover { background: var(--grove-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-outline { background: transparent; color: var(--grove-deep); border-color: var(--border); }
.btn-outline:hover { border-color: var(--grove); }
.btn-sm { padding: .55em 1em; font-size: var(--step--1); }
.btn-lg { padding: 1em 1.8em; font-size: var(--step-1); }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Badges / pills ---------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: .4em;
    font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    padding: .35em .7em; border-radius: var(--r-pill);
    background: var(--paper-2); color: var(--slate);
}
.badge-gold  { background: rgba(245,179,1,.18);  color: var(--gold-deep); }
.badge-grove { background: rgba(14,159,110,.15); color: var(--grove-deep); }
.badge-rose  { background: rgba(229,66,123,.14); color: var(--rose); }
.badge-ink   { background: var(--ink); color: var(--paper); }
.badge-verified { background: rgba(14,159,110,.15); color: var(--grove-deep); }

/* ---------- Cards ------------------------------------------------------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow-1);
    overflow: hidden;
}
.card-pad { padding: var(--sp-5); }
.card-hover { transition: transform .15s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }

/* Campaign card */
.campaign-card { display: flex; flex-direction: column; height: 100%; }
.campaign-card .thumb { aspect-ratio: 16/10; background: var(--ink-2); position: relative; }
.campaign-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.campaign-card .thumb .cat-tag { position: absolute; top: var(--sp-3); left: var(--sp-3); }
.campaign-card .body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.campaign-card .title { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; margin: 0; }
.campaign-card .by { font-size: var(--step--1); color: var(--muted); }

/* ---------- Signature progress meter ------------------------------------ */
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .track { height: 10px; background: var(--paper-2); border-radius: var(--r-pill); overflow: hidden; }
.meter .fill {
    height: 100%; border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--gold), var(--gold-deep));
    min-width: 6px; transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.meter .row { display: flex; justify-content: space-between; align-items: baseline; }
.meter .pct { font-family: var(--font-mono); font-weight: 700; font-size: var(--step-1); color: var(--ink); }
.meter .raised { font-family: var(--font-mono); font-weight: 700; }
.meter .goal { font-size: var(--step--1); color: var(--muted); }

/* ---------- Forms ------------------------------------------------------- */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-weight: 600; margin-bottom: var(--sp-2); font-size: var(--step--1); }
.field .hint { font-size: var(--step--1); color: var(--muted); margin-top: var(--sp-2); }
/* Required-field marker (red asterisk) + form legend. */
.req { color: var(--rose, #e11d48); font-weight: 700; margin-left: .15em; }
.form-legend { font-size: var(--step--1); color: var(--muted); margin-bottom: var(--sp-4); }
.input, .select, .textarea {
    width: 100%; font-family: var(--font-body); font-size: var(--step-0);
    padding: .75em .9em; color: var(--text); background: var(--surface);
    border: 1.5px solid var(--border); border-radius: var(--r-md);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--grove);
    box-shadow: 0 0 0 3px rgba(14,159,110,.15);
}
.textarea { min-height: 8rem; resize: vertical; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: var(--step--1); margin-top: var(--sp-2); }

/* Password show/hide toggle (added by JS to any password field) */
.password-field { position: relative; display: block; }
.password-field .input { padding-right: 2.9em; }
.pw-toggle {
    position: absolute; top: 0; right: 0; height: 100%; width: 2.9em;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; cursor: pointer; color: var(--muted);
    border-radius: 0 var(--r-md) var(--r-md) 0;
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--grove); outline-offset: -2px; }
.pw-toggle svg { width: 20px; height: 20px; display: block; }
.pw-toggle .pw-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .pw-eye { display: none; }
.pw-toggle[aria-pressed="true"] .pw-eye-off { display: block; }
.checkbox { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--step--1); }
.checkbox input { margin-top: .2em; width: 1.1em; height: 1.1em; accent-color: var(--grove); }

/* ---------- Alerts ------------------------------------------------------ */
.alert { padding: var(--sp-4); border-radius: var(--r-md); border: 1px solid transparent; margin-bottom: var(--sp-4); font-size: var(--step--1); }
.alert-success { background: rgba(14,159,110,.1);  border-color: rgba(14,159,110,.3);  color: var(--grove-deep); }
.alert-danger  { background: rgba(214,69,69,.1);   border-color: rgba(214,69,69,.3);   color: var(--danger); }
.alert-info    { background: rgba(47,111,237,.08); border-color: rgba(47,111,237,.25); color: var(--info); }
.alert ul { margin: var(--sp-2) 0 0; padding-left: 1.2em; }

/* ---------- Public header / footer -------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(251,246,236,.85); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.site-header .bar { display: flex; align-items: center; gap: var(--sp-5); height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .55em; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(245,179,1,.25); }
.brand-logo { height: 34px; width: auto; display: block; }
.site-footer .brand-logo { height: 40px; }
.nav { display: flex; gap: var(--sp-5); align-items: center; margin-left: auto; }
.nav a { color: var(--ink); font-weight: 600; font-size: var(--step--1); }
.nav a:hover { color: var(--grove-deep); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4em; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

@media (max-width: 860px) {
    .nav-toggle { display: block; margin-left: auto; }
    .nav {
        position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column;
        align-items: stretch; gap: 0; background: var(--paper);
        border-bottom: 1px solid var(--border); padding: var(--sp-4);
        margin: 0; box-shadow: 0 14px 24px rgba(20,24,58,.10);
        /* Fully hide when closed — visibility avoids the menu's last item peeking
           out at the top, since the panel sits var(--header-h) below the viewport. */
        transform: translateY(-12px); opacity: 0; visibility: hidden;
        transition: transform .22s ease, opacity .22s ease, visibility .22s;
    }
    .nav.open { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav a { padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--border); }
    .nav .btn { margin-top: var(--sp-3); justify-content: center; }
}

.site-footer { background: var(--ink); color: var(--paper); padding-block: var(--sp-8) var(--sp-6); margin-top: var(--sp-8); }
.site-footer a { color: rgba(251,246,236,.75); font-size: var(--step--1); }
.site-footer a:hover { color: var(--gold); text-decoration: none; }
.site-footer h4 { color: var(--white); font-size: var(--step-0); margin-bottom: var(--sp-4); }
.site-footer .fnav { display: grid; gap: var(--sp-2); }
.site-footer .foot-bottom { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--ink-3); color: var(--slate-2); font-size: var(--step--1); }

/* Footer newsletter sign-up ("Stay in the Loop") */
.footer-subscribe {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); flex-wrap: wrap;
    margin-top: var(--sp-6); padding-top: var(--sp-6); border-top: 1px solid var(--ink-3);
}
.footer-subscribe-copy { flex: 1 1 320px; max-width: 60ch; }
.footer-subscribe-form { display: flex; gap: var(--sp-3); flex: 1 1 300px; max-width: 460px; }
.footer-subscribe-form .input { flex: 1; background: var(--ink-2); border-color: var(--ink-3); color: var(--paper); }
.footer-subscribe-form .input::placeholder { color: rgba(251,246,236,.45); }
.footer-subscribe-form .btn { flex: none; }
.footer-subscribe-msg { margin: var(--sp-3) 0 0; font-size: var(--step--1); font-weight: 600; }
.footer-subscribe-msg.is-ok { color: var(--gold); }
.footer-subscribe-msg.is-err { color: var(--rose); }
@media (max-width: 560px) {
    .footer-subscribe-form { flex-wrap: wrap; }
    .footer-subscribe-form .btn { width: 100%; }
}

/* ---------- Hero (dark adire panel) ------------------------------------- */
.hero { position: relative; background: #14261c; color: var(--paper); overflow: hidden; }

/* Two concentric radial African patterns on the right of the hero: the inner
   ring spins clockwise, the larger outer ring spins counter-clockwise. Both are
   centred on the same point (the zero-size .hero-rings anchor) so they stay
   concentric, and both are forced to white to read on the dark hero. */
.hero-rings {
    position: absolute; right: -8%; top: 50%; z-index: 1; pointer-events: none;
    width: min(116vh, 1000px); aspect-ratio: 1; margin-top: calc(min(116vh, 1000px) / -2);
}
.hero-ring {
    position: absolute; inset: 0; margin: auto; opacity: .16; will-change: transform;
    filter: brightness(0) invert(1);
}
.ring-1 { width: min(80vh, 700px);   height: min(80vh, 700px);   animation: hero-spin 70s linear infinite; }
.ring-2 { width: min(116vh, 1000px); height: min(116vh, 1000px); animation: hero-spin 95s linear infinite reverse; }
@keyframes hero-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (max-width: 760px) { .hero-rings { right: -40%; } .hero-ring { opacity: .10; } }
@media (prefers-reduced-motion: reduce) { .hero-ring { animation: none; } }
.hero .container { position: relative; z-index: 2; padding-block: var(--sp-8); }
.hero h1 { color: var(--paper); max-width: 16ch; }
.hero .lead { color: rgba(251,246,236,.8); max-width: 52ch; }
.hero .rotator { color: var(--gold); }

/* Floating creative-discipline icons drifting behind the hero copy. Decorative,
   non-interactive, and disabled for users who prefer reduced motion. */
.hero-floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.hero-floaters .floaty {
    position: absolute; display: block; color: var(--gold);
    animation: hero-float var(--dur, 15s) ease-in-out infinite;
    animation-delay: var(--delay, 0s); will-change: transform;
}
.hero-floaters .floaty svg { width: 100%; height: 100%; display: block; }
@keyframes hero-float {
    0%   { transform: translateY(6px) rotate(-5deg); }
    50%  { transform: translateY(-22px) rotate(5deg); }
    100% { transform: translateY(6px) rotate(-5deg); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-floaters .floaty { animation: none; }
}

/* ---------- Stats strip ------------------------------------------------- */
.stat { text-align: center; }
.stat .stat-ic { display: flex; justify-content: center; margin-bottom: var(--sp-3); }
.stat .stat-ic svg { width: 42px; height: 42px; }
.stat .num { font-family: var(--font-mono); font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.6rem); font-weight: 700; color: var(--ink); line-height: 1.1; overflow-wrap: anywhere; }
.stat .lbl { font-size: var(--step--1); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* ---------- Auth layout ------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { background: var(--ink); color: var(--paper); padding: var(--sp-8) var(--sp-7); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::before { content: ""; position: absolute; inset: 0; opacity: .12;
    background-image: radial-gradient(circle at 30% 20%, var(--gold) 0 2px, transparent 3px), linear-gradient(45deg, transparent 46%, rgba(251,246,236,.35) 46% 54%, transparent 54%);
    background-size: 44px 44px, 32px 32px; }
.auth-aside > * { position: relative; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: var(--sp-6); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: var(--step-2); }
@media (max-width: 820px) { .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------- Admin layout ------------------------------------------------ */
.admin { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.admin-side { background: var(--ink); color: var(--paper); padding: var(--sp-5) var(--sp-4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { color: var(--paper); margin-bottom: var(--sp-6); }
.admin-side .brand span { color: var(--paper); }
.admin-nav { display: grid; gap: 2px; }
.admin-nav .group-label { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: var(--slate-2); margin: var(--sp-4) var(--sp-2) var(--sp-2); }
.admin-nav a { display: flex; align-items: center; gap: var(--sp-3); padding: .6em .8em; border-radius: var(--r-md); color: rgba(251,246,236,.78); font-size: var(--step--1); font-weight: 600; }
.admin-nav a:hover { background: var(--ink-2); color: var(--paper); text-decoration: none; }
.admin-nav a.active { background: var(--gold); color: var(--ink); }
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { height: var(--header-h); border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; padding-inline: var(--sp-5); gap: var(--sp-4); position: sticky; top: 0; z-index: 20; }
.admin-content { padding: var(--sp-6); flex: 1; }
.page-title { margin-bottom: var(--sp-5); }
.page-title h1 { font-size: var(--step-2); margin: 0; }

/* KPI cards */
.kpi { padding: var(--sp-5); }
.kpi .k-label { font-size: var(--step--1); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi .k-value { font-family: var(--font-mono); font-size: clamp(1.1rem, .85rem + .85vw, 1.8rem); font-weight: 700; margin-top: var(--sp-2); line-height: 1.15; overflow-wrap: anywhere; }
.kpi .k-delta { font-size: var(--step--1); font-weight: 700; }
.k-up { color: var(--grove-deep); } .k-down { color: var(--danger); }

@media (max-width: 900px) {
    .admin { grid-template-columns: 1fr; }
    .admin-side { position: fixed; z-index: 60; width: 256px; transform: translateX(-110%); transition: transform .25s ease; }
    .admin-side.open { transform: translateX(0); }
}

/* ---------- Tables ------------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
table.data th, table.data td { text-align: left; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
table.data th { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; color: var(--muted); background: var(--paper-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--paper); }

/* ---------- WYSIWYG editor ---------------------------------------------- */
.editor { border: 1.5px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: var(--sp-2); background: var(--paper-2); border-bottom: 1px solid var(--border); }
.editor-btn { font-family: var(--font-mono); font-size: .72rem; font-weight: 700; padding: .3em .6em; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); cursor: pointer; }
.editor-btn:hover { background: var(--gold); border-color: var(--gold); }
.editor-area { min-height: 14rem; padding: var(--sp-4); line-height: 1.6; }
.editor-area:focus { outline: none; }
.editor-area h2, .editor-area h3 { font-family: var(--font-display); }

/* ---------- Media grid -------------------------------------------------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-4); }
.media-tile { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.media-tile .preview { aspect-ratio: 1; background: var(--paper-2); display: flex; align-items: center; justify-content: center; }
.media-tile .preview img { width: 100%; height: 100%; object-fit: cover; }
.media-tile .meta { padding: var(--sp-2); font-size: .72rem; }
/* Video tiles use the shared .video-embed facade; keep its play button compact here. */
.media-tile .video-play { width: 48px; height: 34px; border-radius: 10px; font-size: 1rem; }
.folder-tile { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--paper-2); color: var(--ink); font-weight: 600; }

/* ---------- Inline video embed ------------------------------------------ */
.video-embed {
    position: relative; aspect-ratio: 16 / 9; width: 100%;
    background: var(--ink); border-radius: var(--r-lg); overflow: hidden;
}
.video-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-facade {
    position: absolute; inset: 0; width: 100%; height: 100%; padding: 0;
    border: 0; background: none; cursor: pointer; display: block;
}
.video-facade img { width: 100%; height: 100%; object-fit: cover; }
.video-facade .video-play {
    position: absolute; inset: 0; margin: auto;
    width: 68px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(18,34,26,.78); color: var(--paper);
    font-size: 1.35rem; padding-left: 4px;
    transition: background .15s ease, transform .15s ease;
}

/* Register: "I'm here to…" intent choice cards */
.intent-choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-2); }
.intent-card { position: relative; display: block; cursor: pointer; }
.intent-card > input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.intent-card .intent-body {
    display: block; height: 100%; padding: var(--sp-4);
    border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.intent-ic { font-size: 1.4rem; display: block; line-height: 1; }
.intent-title { display: block; font-weight: 700; margin-top: var(--sp-2); color: var(--text); }
.intent-desc { display: block; font-size: var(--step--1); color: var(--muted); margin-top: 2px; }
.intent-card > input:checked + .intent-body {
    border-color: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold);
    background: color-mix(in srgb, var(--gold) 9%, var(--surface));
}
.intent-card > input:focus-visible + .intent-body { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 560px) { .intent-choices { grid-template-columns: 1fr; } }
.video-facade:hover .video-play { background: var(--rose); transform: scale(1.06); }
.video-facade:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

/* ---------- Data viz: pie / doughnut ------------------------------------ */
.chart-pie { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }
.chart-pie svg { flex: 0 0 auto; }
.chart-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; display: grid; gap: var(--sp-2); }
.chart-legend li { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--step--1); }
.chart-legend .dot { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.chart-legend .lbl { flex: 1; }
.chart-legend .val { font-family: var(--font-mono); font-weight: 700; color: var(--muted); }

/* ---------- Data viz: ranked list --------------------------------------- */
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; display: grid; gap: var(--sp-2); }
.ranked li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.ranked li:last-child { border-bottom: 0; }
.ranked .rank {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 700; font-size: .8rem;
    background: var(--paper-2); color: var(--slate);
}
.ranked .rank-1 { background: var(--gold); color: var(--ink); }
.ranked .rank-2 { background: #C8CBD6; color: var(--ink); }
.ranked .rank-3 { background: #E4B98A; color: var(--ink); }
.ranked-name { flex: 1; font-weight: 600; }
.ranked-value { color: var(--grove-deep); font-weight: 700; }

/* ---------- Data viz: timeline ------------------------------------------ */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: var(--sp-4); padding: 0 0 var(--sp-4) var(--sp-5); }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: -4px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(245,179,1,.25); }
.timeline .tl-body { flex: 1; }
.timeline .tl-title { font-weight: 600; }
.timeline .tl-detail { font-size: var(--step--1); }
.timeline .tl-time { font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* ---------- Data viz: iconographic stat --------------------------------- */
.stat-icon { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); }
.stat-icon .si-icon {
    font-size: 1.35rem; width: 44px; height: 44px; border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    background: var(--paper-2);
}
.stat-icon > div { min-width: 0; }
.stat-icon .si-value { font-family: var(--font-mono); font-size: clamp(.95rem, .78rem + .7vw, 1.4rem); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.stat-icon .si-label { font-size: var(--step--1); color: var(--muted); margin-top: 4px; }
.stat-icon-gold  .si-icon { background: rgba(245,179,1,.18); }
.stat-icon-grove .si-icon { background: rgba(14,159,110,.15); }
.stat-icon-rose  .si-icon { background: rgba(229,66,123,.14); }

/* ---------- Data viz: callout / insight --------------------------------- */
.callout { display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); border-left: 4px solid var(--gold); background: rgba(245,179,1,.10); margin-bottom: var(--sp-4); }
.callout-icon { font-size: 1.4rem; flex: 0 0 auto; }
.callout-title { font-family: var(--font-display); font-weight: 700; }
.callout-body { color: var(--slate); font-size: var(--step--1); }
.callout-info    { border-left-color: var(--info);    background: rgba(47,111,237,.08); }
.callout-success { border-left-color: var(--grove);   background: rgba(14,159,110,.10); }
.callout-warning { border-left-color: var(--warning); background: rgba(224,135,13,.10); }

/* ---------- Data viz: star rating --------------------------------------- */
.stars { display: inline-flex; align-items: center; gap: 2px; font-size: 1.3rem; line-height: 1; }
.stars .star { color: var(--line); }
.stars .star.on { color: var(--gold); }
.stars .star.half { position: relative; color: var(--line); }
.stars .star.half::before { content: "★"; position: absolute; left: 0; width: 50%; overflow: hidden; color: var(--gold); }
.stars-num { margin-left: var(--sp-2); font-weight: 700; font-size: 1rem; color: var(--ink); }
.stars-count { font-size: var(--step--1); }

/* ---------- Pagination -------------------------------------------------- */
.pagination-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.pagination-summary { font-size: var(--step--1); color: var(--muted); }
.pagination {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 6px; list-style: none; margin: 0; padding: 0;
}
.pagination li { margin: 0; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 .7em;
    font-family: var(--font-mono); font-size: var(--step--1); font-weight: 700;
    border: 1.5px solid var(--border); border-radius: var(--r-md);
    background: var(--surface); color: var(--ink); text-decoration: none;
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.pagination a:hover { border-color: var(--grove); color: var(--grove-deep); text-decoration: none; transform: translateY(-1px); }
.pagination .page-current span { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.pagination .page-disabled span { opacity: .4; cursor: not-allowed; }
.pagination .page-gap span { border-color: transparent; background: transparent; }
.pagination .page-nav a, .pagination .page-nav span { gap: .4em; }
@media (max-width: 520px) {
    /* Keep prev/next; hide numeric pages on small screens to avoid wrapping. */
    .pagination .page-num { display: none; }
}

/* ---------- Utilities --------------------------------------------------- */
.mt-0{margin-top:0}.mb-0{margin-bottom:0}.mt-4{margin-top:var(--sp-4)}.mt-5{margin-top:var(--sp-5)}.mt-6{margin-top:var(--sp-6)}
.flex{display:flex}.wrap{flex-wrap:wrap}.gap-3{gap:var(--sp-3)}.gap-4{gap:var(--sp-4)}.items-center{align-items:center}.grow{flex:1}
.hide{display:none!important}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--ink); padding: .6em 1em; border-radius: 0 0 var(--r-md) 0; z-index: 100; }
.skip-link:focus { left: 0; }

.mt-7{margin-top:var(--sp-7)}

/* Tools-used checkbox grid (campaign form) + tag display (campaign page) */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--sp-2); margin-top: var(--sp-2); }
.tool-check { display: flex; align-items: center; gap: .5em; padding: .5em .7em; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); cursor: pointer; font-size: var(--step--1); transition: border-color .15s ease, background .15s ease; }
.tool-check:hover { border-color: var(--grove); }
.tool-check:has(input:checked) { border-color: var(--grove); background: color-mix(in srgb, var(--grove) 8%, var(--white)); font-weight: 600; }
.tool-check input { flex: none; }
.tool-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tool-tag { display: inline-flex; align-items: center; padding: .35em .8em; border-radius: var(--r-pill); background: var(--paper-2); border: 1px solid var(--line); font-size: var(--step--1); font-weight: 600; color: var(--ink); }

/* Like-count badge overlaid on the blog thumbnail */
.thumb-likes {
    position: absolute; bottom: var(--sp-3); right: var(--sp-3);
    display: inline-flex; align-items: center; gap: .35em;
    padding: .3em .7em; border-radius: var(--r-pill);
    background: rgba(18,34,26,.72); color: #fff;
    font-size: var(--step--1); font-weight: 700; line-height: 1;
    backdrop-filter: blur(2px);
}

/* -----------------------------------------------------------------
   Like button (campaign cards + detail)
------------------------------------------------------------------ */
.like-btn {
    display: inline-flex; align-items: center; gap: .4em;
    padding: .4em .8em; border: 1.5px solid var(--border); border-radius: var(--r-pill);
    background: var(--white); color: var(--muted);
    font: inherit; font-size: calc(var(--step--1) * 2); font-weight: 600; line-height: 1;
    cursor: pointer; text-decoration: none; transition: all .15s ease;
}
.like-btn:hover { border-color: var(--rose); color: var(--rose); }
.like-btn .like-heart { font-size: 1.05em; line-height: 1; transition: transform .15s ease; }
.like-btn:hover .like-heart { transform: scale(1.15); }
.like-btn.is-liked { border-color: var(--rose); color: var(--rose); background: color-mix(in srgb, var(--rose) 10%, var(--white)); }
.like-btn.is-liked .like-heart { color: var(--rose); }

/* -----------------------------------------------------------------
   Public creator profile
------------------------------------------------------------------ */
.profile-banner {
    height: clamp(150px, 26vw, 300px); border-radius: var(--r-lg); overflow: hidden;
    background: linear-gradient(120deg, var(--ink), var(--grove));
    margin-top: var(--sp-5);
}
.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-head {
    display: flex; align-items: flex-end; gap: var(--sp-5);
    margin: calc(-1 * var(--sp-7)) var(--sp-5) 0; position: relative; flex-wrap: wrap;
}
.profile-avatar {
    width: 128px; height: 128px; flex: none; border-radius: 50%; overflow: hidden;
    border: 4px solid var(--paper); background: var(--ink); box-shadow: var(--shadow-2);
    display: grid; place-items: center; color: var(--paper); font-weight: 700; font-size: 2.4rem;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-id { flex: 1 1 240px; padding-bottom: var(--sp-2); }
.profile-actions { padding-bottom: var(--sp-2); }
.profile-stats {
    display: flex; gap: var(--sp-6); flex-wrap: wrap; margin: var(--sp-5) 0 0;
    padding: var(--sp-4) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.profile-stats > div { display: flex; flex-direction: column; }
.profile-stats strong { font-size: var(--step-1); color: var(--ink); }
.profile-stats span { font-size: var(--step--1); }
@media (max-width: 640px) {
    .profile-head { margin-inline: 0; }
    .profile-actions { width: 100%; }
    .profile-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
