/* ============================================================
   Protect Free Speech — modern-minimal design system
   Layers on top of Bootstrap 5.3. Restyles components without
   changing markup IDs/classes the JS depends on.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Newsreader:ital,opt@0,400;0,500;1,400&display=swap');

:root {
    --ink: #14181f;
    --ink-soft: #3b4351;
    --muted: #6b7280;
    --line: #e8eaed;
    --line-strong: #d8dbe0;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #fbfcfd;

    --accent: #1f5eff;
    --accent-hover: #1546d6;
    --accent-soft: #eef3ff;
    --accent-ring: rgba(31, 94, 255, 0.18);

    --warn-bg: #fff8ed;
    --warn-line: #f3ddb5;
    --warn-ink: #92600a;

    --radius-lg: 18px;
    --radius: 12px;
    --radius-sm: 9px;

    --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.06);
    --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.05), 0 2px 4px rgba(17, 24, 39, 0.04);
    --shadow-lg: 0 18px 48px rgba(17, 24, 39, 0.10);

    --ff-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ff-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
    font-family: var(--ff-sans);
    background-color: var(--bg);
    color: var(--ink-soft);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em;
    line-height: 1.65;
}

::selection {
    background: var(--accent-ring);
    color: var(--ink);
}

main.container { max-width: 800px; }

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

.text-dark { color: var(--ink-soft) !important; }
.text-muted { color: var(--muted) !important; }

/* ---------- Navbar ---------- */
.navbar {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
    padding-top: .85rem;
    padding-bottom: .85rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar .container { max-width: 800px; }
.navbar-brand {
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: -0.03em;
    color: var(--ink) !important;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}
.navbar-brand .brand-dot {
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    display: inline-block;
}

/* ---------- Archived status banner ---------- */
.status-banner {
    background: #1b2330;
    color: #e8edf5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.status-banner .container {
    max-width: 800px;
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding-top: .8rem;
    padding-bottom: .8rem;
}
.status-banner .sb-icon {
    flex: 0 0 auto;
    color: #ffcf6b;
    font-size: 1rem;
    margin-top: .15rem;
}
.status-banner p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.55;
    color: #cdd6e3;
}
.status-banner strong { color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 2.4rem 0 .5rem; }
.hero h1 {
    font-size: clamp(2rem, 5vw, 2.9rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.035em;
    margin-bottom: 1.1rem;
}
.hero .lede { font-size: 1.06rem; color: var(--ink-soft); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid #dbe5ff;
    padding: .34rem .7rem;
    border-radius: 999px;
    margin-bottom: 1.1rem;
}
.eyebrow.archived {
    color: var(--muted);
    background: #f1f3f5;
    border-color: var(--line-strong);
}
.eyebrow .pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--accent-ring); }
    70% { box-shadow: 0 0 0 7px rgba(31, 94, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 94, 255, 0); }
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: var(--surface-2) !important;
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.35rem;
}
.card-header h5 {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted) !important;
    margin: 0;
}
.card-body { padding: 1.5rem; }
.card-body.bg-white, .card-body.bg-light { background: var(--surface) !important; }

/* Accent card = the primary action */
#emailGenerator .card-header,
.card.accent .card-header { background: var(--accent-soft) !important; border-bottom-color: #dde6ff; }
.card.accent .card-header h5 { color: var(--accent) !important; }

/* ---------- Buttons ---------- */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: .62rem 1.15rem;
    letter-spacing: -0.01em;
    transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
    border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
}
.btn-primary:disabled { background: var(--accent); border-color: var(--accent); opacity: .6; }

.btn-secondary {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover, .btn-secondary:focus {
    background: #f3f4f6;
    border-color: var(--line-strong);
    color: var(--ink);
}

/* JS toggles these on copy feedback */
.btn-success { background: #18a558 !important; border-color: #18a558 !important; color: #fff !important; }
.btn-warning { background: #e8a317 !important; border-color: #e8a317 !important; color: #fff !important; }

.btn-outline-danger {
    border-color: #f1c6c6; color: #c0392b; background: var(--surface);
}
.btn-outline-danger:hover { background: #fdecec; color: #a93226; border-color: #f1c6c6; }

.btn-lg { padding: .8rem 1.6rem; font-size: 1.02rem; }

/* ---------- Forms ---------- */
.form-label {
    font-weight: 600;
    color: var(--ink) !important;
    font-size: .92rem;
    margin-bottom: .5rem;
}
.form-control, .form-select {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: .7rem .9rem;
    color: var(--ink);
    background: var(--surface);
    font-size: .96rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: #aab1bd; }
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
    background: var(--surface);
    color: var(--ink);
}
.form-text { color: var(--muted); }

/* ---------- Alerts / callouts ---------- */
.alert { border-radius: var(--radius); border: 1px solid transparent; padding: 1rem 1.2rem; }

.alert-primary {
    background: var(--accent-soft) !important;
    border-color: #d7e2ff !important;
    color: var(--ink) !important;
}
.callout-action {
    background: linear-gradient(135deg, #1f5eff 0%, #1546d6 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .85rem;
    line-height: 1.45;
}
.callout-action .ca-icon {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.16);
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: 1.15rem;
}
.callout-action .ca-tag {
    display: block; font-size: .72rem; letter-spacing: .1em;
    text-transform: uppercase; opacity: .85; margin-bottom: .15rem; font-weight: 700;
}

.alert-warning {
    background: var(--warn-bg) !important;
    border-color: var(--warn-line) !important;
    color: var(--warn-ink) !important;
}

/* ---------- Blockquote ---------- */
blockquote.blockquote {
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem !important;
    box-shadow: var(--shadow-sm);
    font-family: var(--ff-serif) !important;
    color: var(--ink) !important;
}
blockquote.blockquote .blockquote-footer { margin-top: .6rem; color: var(--muted) !important; }

/* ---------- Prose ---------- */
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--ink); }
.muzzle {
    display: block;
    font-family: var(--ff-serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink);
    margin: 1.2rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
}

/* ---------- Steps list ---------- */
.list-group-numbered .list-group-item {
    border: none;
    border-bottom: 1px solid var(--line);
    background: transparent !important;
    color: var(--ink-soft) !important;
    padding: .9rem .2rem .9rem .4rem;
}
.list-group-numbered .list-group-item:last-child { border-bottom: none; }
.list-group-numbered .list-group-item::marker {
    color: var(--accent);
    font-weight: 700;
}

/* ---------- Accordion ---------- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.accordion-item { border: none; border-bottom: 1px solid var(--line); background: var(--surface); }
.accordion-item:last-child { border-bottom: none; }
.accordion-button {
    background: var(--surface) !important;
    color: var(--ink) !important;
    font-weight: 600;
    font-size: 1.02rem;
    padding: 1.15rem 1.35rem;
}
.accordion-button:not(.collapsed) {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    box-shadow: none;
}
.accordion-button:focus { box-shadow: 0 0 0 4px var(--accent-ring); border: none; }
.accordion-button::after { transition: transform .2s ease; }
.accordion-body { color: var(--ink-soft); padding: 1.2rem 1.35rem 1.5rem; line-height: 1.75; }

/* ---------- Tables (admin) ---------- */
.table { color: var(--ink-soft); }
.table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); border-bottom: 1px solid var(--line-strong); font-weight: 700;
}
.table td { border-color: var(--line); vertical-align: middle; }

/* ---------- Footer ---------- */
footer.container { max-width: 800px; border-top: 1px solid var(--line) !important; }
footer p { color: var(--muted); font-size: .9rem; }
footer a { font-weight: 500; }

/* ---------- TinyMCE container polish ---------- */
.tox-tinymce { border-radius: var(--radius) !important; border-color: var(--line-strong) !important; }

/* ---------- Entrance animation ---------- */
.reveal { opacity: 0; transform: translateY(10px); animation: reveal .55s cubic-bezier(.22,.61,.36,1) forwards; }
.reveal:nth-child(1) { animation-delay: .02s; }
.reveal:nth-child(2) { animation-delay: .07s; }
.reveal:nth-child(3) { animation-delay: .12s; }
.reveal:nth-child(4) { animation-delay: .17s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

@media (max-width: 576px) {
    .card-body { padding: 1.2rem; }
    .callout-action { flex-direction: row; }
    .hero { padding-top: 1.6rem; }
}
