/* ==========================================================================
   nevnap.org — modern design system (new visual identity)
   Mobile-first, card-based, light + dark mode. All tokens are CSS variables.
   ========================================================================== */

/* Poppins, self-hosted — the same files the OG image generator already uses. Replaces the
   Google Fonts stylesheet: one less render-blocking third-party request, and no visitor IP
   handed to fonts.googleapis.com. `swap` means text paints immediately in the fallback
   face, so the font download never delays first paint. The 800 weight the design asked for
   is synthesised from Bold; only three files ship.
   (Optional follow-up: converting these TTFs to WOFF2 would cut ~70% of their size.) */
@font-face {
    font-family: 'Poppins';
    src: url('/font/Poppins-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('/font/Poppins-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('/font/Poppins-Bold.ttf') format('truetype');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Brand */
    --brand: #6741d9;          /* violet */
    --brand-600: #5b34c7;
    --brand-700: #4f2bb3;
    --brand-soft: #efeafe;
    --accent: #f06595;         /* festive pink */
    --accent-soft: #ffe3ee;
    --gold: #f59f00;

    /* Neutrals */
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #f2f3f9;
    --border: #e6e8f0;
    --ink: #1f2430;
    --ink-2: #4a5162;
    --ink-3: #8a91a5;

    /* Feedback */
    --ok: #2f9e44;
    --warn: #e8590c;
    --danger: #e03131;

    /* Shape & motion */
    --r-sm: 8px;
    --r: 14px;
    --r-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(24, 27, 40, .06), 0 1px 3px rgba(24, 27, 40, .08);
    --shadow: 0 6px 18px rgba(24, 27, 40, .08);
    --shadow-lg: 0 18px 40px rgba(24, 27, 40, .16);
    --ring: 0 0 0 3px rgba(103, 65, 217, .28);
    --ease: cubic-bezier(.2, .7, .2, 1);

    --maxw: 1160px;
    --gap: clamp(14px, 2.4vw, 26px);
    --font: 'Poppins', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1117;
        --surface: #171a23;
        --surface-2: #1e222e;
        --border: #2a2f3d;
        --ink: #eef0f6;
        --ink-2: #c2c7d6;
        --ink-3: #8b92a7;
        --brand-soft: #241a4d;
        --accent-soft: #3a1f30;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 8px 22px rgba(0, 0, 0, .45);
        --shadow-lg: 0 20px 44px rgba(0, 0, 0, .6);
    }
}
:root[data-theme="dark"] {
    --bg: #0f1117; --surface: #171a23; --surface-2: #1e222e; --border: #2a2f3d;
    --ink: #eef0f6; --ink-2: #c2c7d6; --ink-3: #8b92a7;
    --brand-soft: #241a4d; --accent-soft: #3a1f30;
}
:root[data-theme="light"] {
    --bg: #f6f7fb; --surface: #fff; --surface-2: #f2f3f9; --border: #e6e8f0;
    --ink: #1f2430; --ink-2: #4a5162; --ink-3: #8a91a5;
    --brand-soft: #efeafe; --accent-soft: #ffe3ee;
}

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

/* Layout */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(14px, 3vw, 24px); }
.page { display: grid; grid-template-columns: 1fr; gap: var(--gap); padding-block: var(--gap); }
@media (min-width: 940px) {
    .page.with-sidebar { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}
.stack > * + * { margin-top: var(--gap); }

/* Header / nav */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.brand .dot { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--accent)); display: grid; place-items: center; color: #fff; font-size: 15px; box-shadow: var(--shadow-sm); }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
    color: var(--ink-2); font-weight: 600; font-size: .95rem;
    padding: 8px 12px; border-radius: 10px; transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { background: var(--brand-soft); color: var(--brand-700); }
.nav-toggle, .theme-toggle {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); cursor: pointer; font-size: 18px;
}
.nav-toggle { display: none; }
@media (max-width: 860px) {
    .nav-toggle { display: grid; }
    .nav-links {
        position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 2px;
        background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px;
        transform: translateY(-120%); transition: transform .25s var(--ease); box-shadow: var(--shadow);
    }
    .nav-links.open { transform: translateY(0); }
    .nav-links a { padding: 12px; }
}

/* Cards */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: clamp(16px, 3vw, 26px); box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--gap); }
.card h2:first-child, .card h1:first-child { margin-top: 0; }

/* Hero (today) */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    border-radius: var(--r-lg); padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; opacity: .9; font-weight: 700; margin: 0 0 6px; }
.hero h1 { color: #fff; margin: 0 0 .3em; }
.hero .names { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero .names a { background: rgba(255,255,255,.16); color: #fff; padding: 8px 16px; border-radius: 999px; font-weight: 700; backdrop-filter: blur(4px); }
.hero .names a:hover { background: rgba(255,255,255,.28); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font-family: inherit; font-weight: 700; font-size: .95rem;
    padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
    background: var(--brand); color: #fff; transition: transform .12s var(--ease), box-shadow .15s var(--ease), background .15s;
}
.btn:hover { background: var(--brand-600); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #e04a83; }
.btn.sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* Chips / badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); }
.chip.brand { background: var(--brand-soft); color: var(--brand-700); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: #c2185b; border-color: transparent; }
.badge-freq { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.freq-5 { background: #e6f4ea; color: #2b8a3e; } .freq-4 { background: #e7f5ff; color: #1971c2; }
.freq-3 { background: #fff3bf; color: #a67c00; } .freq-2 { background: #ffe8cc; color: #d9480f; }
.freq-1 { background: #f1f3f5; color: #868e96; }
@media (prefers-color-scheme: dark) {
    .freq-5{background:#123a20;color:#69db7c}.freq-4{background:#0b2f4a;color:#74c0fc}
    .freq-3{background:#3a3212;color:#ffe066}.freq-2{background:#3a220f;color:#ffa94d}.freq-1{background:#23262e;color:#adb5bd}
}

/* Definition rows (name detail) */
.deflist { display: grid; gap: 2px; }
.defrow { display: grid; grid-template-columns: 1fr; gap: 2px 16px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.defrow:last-child { border-bottom: 0; }
.defrow dt { color: var(--ink-3); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.defrow dd { margin: 0; color: var(--ink); }
@media (min-width: 620px) { .defrow { grid-template-columns: 220px 1fr; align-items: baseline; } }

/* Name grid / lists */
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.name-card { display: block; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); transition: transform .12s var(--ease), border-color .15s, box-shadow .15s; }
.name-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.name-card .n { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.name-card .d { color: var(--ink-3); font-size: .82rem; }

/* A–Z index */
.az { display: flex; flex-wrap: wrap; gap: 6px; }
.az a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font-weight: 700; color: var(--ink-2); border: 1px solid var(--border); }
.az a:hover, .az a.active { background: var(--brand); color: #fff; border-color: transparent; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-weight: 700; color: var(--ink-3); font-size: .78rem; padding: 6px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal .cell { position: relative; min-height: 74px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, transform .12s var(--ease); overflow: hidden; }
.cal a.cell:hover { border-color: var(--brand); transform: translateY(-1px); }
.cal .cell.empty { background: transparent; border-color: transparent; }
.cal .cell .num { font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.cal .cell.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal .cell.today .num { color: var(--brand-700); }
.cal .cell.holiday { background: var(--accent-soft); }
.cal .cell .nm { font-size: .74rem; color: var(--ink-2); line-height: 1.25; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cal .cell .hol { font-size: .68rem; color: #c2185b; font-weight: 700; }
.months-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.mini-cal .cell { min-height: 34px; padding: 2px; text-align: center; }
.mini-cal .cell .num { font-size: .8rem; }
.mini-cal .cell .dotmark { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); margin: 1px auto 0; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: .88rem; color: var(--ink-2); }
input[type=text], input[type=search], input[type=password], select, textarea {
    width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 110px; }
.search-bar { display: flex; gap: 8px; }
.search-bar input { flex: 1; }

/* Sidebar */
.sidebar { display: grid; gap: var(--gap); }
.sidebar .card { padding: 18px; }
.widget-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 800; margin: 0 0 12px; }

/* Ads — responsive slots */
.ad { display: flex; justify-content: center; align-items: center; margin: 0 auto; overflow: hidden; }
.ad-label { display: block; text-align: center; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.ad-leaderboard { min-height: 90px; }
.ad-inline { margin: var(--gap) 0; min-height: 60px; }
.ad-sidebar { min-height: 250px; }
.ad-sticky-mobile { display: none; }
@media (max-width: 860px) {
    .ad-sidebar-wrap { display: none; }
    .ad-sticky-mobile {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
        justify-content: center; background: var(--surface); border-top: 1px solid var(--border);
        padding: 4px; box-shadow: 0 -4px 16px rgba(0,0,0,.1); min-height: 54px;
    }
    body { padding-bottom: 60px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: var(--gap); }
.site-footer .container { padding-block: 30px; display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--ink-2); font-weight: 600; }
.site-footer .muted { color: var(--ink-3); font-size: .85rem; margin-left: auto; }

/* Inline SVG icons (templates/element/icon.php), sized to the surrounding text. */
.icon { width: 1.05em; height: 1.05em; flex: 0 0 auto; vertical-align: -.16em; }

/* CMS pages (admin-authored HTML from the items table) — style the elements the
   editor can produce, so a page written in the admin looks like the rest of the site. */
.cms h2 { margin-top: 1.6em; }
.cms h2:first-of-type { margin-top: .8em; }
.cms ul, .cms ol { padding-left: 1.2em; }
.cms li { margin-bottom: .4em; }
.cms code {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
    padding: 1px 6px; font-size: .88em; word-break: break-word;
}
.cms table {
    width: 100%; border-collapse: collapse; margin: 14px 0;
    display: block; overflow-x: auto; /* long tables scroll instead of breaking the page */
}
.cms th, .cms td {
    border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top;
}
.cms th { background: var(--surface-2); font-weight: 700; }

/* Cookie notice — a single bar at the very bottom, revealed by app.js only when the
   consent cookie is absent. */
.cookie-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0,0,0,.12);
}
.cookie-bar[hidden] { display: none; }
.cookie-bar .container {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-block: 12px;
}
.cookie-bar p { margin: 0; flex: 1 1 260px; font-size: .9rem; color: var(--ink-2); }
.cookie-bar .btn { flex: 0 0 auto; }
/* Keep the footer's last row reachable while the bar covers the page bottom. */
body.cookie-bar-open .site-footer { padding-bottom: 64px; }

@media (max-width: 860px) {
    /* Don't stack the notice on top of the sticky mobile ad — two fixed bars eat the
       viewport, and an obscured ad slot is a Google Ad Manager policy problem. The ad
       steps aside for the few seconds the notice is up. */
    body.cookie-bar-open .ad-sticky-mobile { display: none; }
}

/* Flash */
.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: var(--gap); font-weight: 600; }
.flash.success, .message.success { background: #e6f4ea; color: #2b8a3e; }
.flash.error, .message.error { background: #ffe3e3; color: #c92a2a; }

/* Utility */
.muted { color: var(--ink-3); }
.center { text-align: center; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mt-0{margin-top:0}.mb-0{margin-bottom:0}
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-nav a { padding: 8px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; color: var(--ink-2); }
.pill-nav a.active, .pill-nav a:hover { background: var(--brand); color: #fff; border-color: transparent; }
.divider { height: 1px; background: var(--border); border: 0; margin: var(--gap) 0; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-row a, .share-row button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; font-weight: 700; font-size: .88rem; color: #fff; border: 0; cursor: pointer; }
.sh-fb{background:#1877f2}.sh-x{background:#111}.sh-in{background:#0a66c2}.sh-ig{background:linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7)}.sh-copy{background:var(--ink-2)}
