/* ============================================================
   EmailWax design tokens. Keep brand color + spacing in one place.
   ============================================================ */
:root {
    --ew-brand: #0d6efd;
    --ew-brand-dark: #0a58ca;
    --ew-accent: #dc3545;
    --ew-ink: #1c2833;
    --ew-ink-soft: #4a5568;
    --ew-muted: #718096;
    --ew-line: #e5e7eb;
    --ew-bg-soft: #f8fafc;
    --ew-bg-hero: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
    --ew-radius: 10px;
    --ew-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
    --ew-shadow-md: 0 4px 12px rgba(15, 23, 42, .06);
    --ew-shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
    --ew-nav-h: 64px;
}

/* Base typography & layout */
html { position: relative; min-height: 100%; font-size: 16px; }
body {
    color: var(--ew-ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1 0 auto; }

/* Anchor links shouldn't tuck under the sticky navbar */
h1, h2, h3, h4, [id] { scroll-margin-top: calc(var(--ew-nav-h) + 12px); }

/* Accessible keyboard skip-link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ew-brand);
    color: #fff;
    padding: 8px 14px;
    z-index: 1080;
    border-radius: 0 0 6px 0;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Universal focus ring - visible without being ugly */
.btn:focus-visible,
.btn:active:focus-visible,
.btn-link.nav-link:focus-visible,
.form-control:focus,
.form-check-input:focus,
.dropdown-item:focus,
.nav-link:focus-visible,
.navbar-brand:focus-visible {
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
    outline: none;
}

/* ============================================================
   Site header / navbar
   ============================================================ */
.site-header {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--ew-line);
    z-index: 1030;
}
.site-header .navbar { min-height: var(--ew-nav-h); padding-top: .5rem; padding-bottom: .5rem; }

.navbar-brand {
    display: inline-flex; align-items: center; gap: .5rem;
    font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em;
    color: var(--ew-ink);
}
.navbar-brand:hover { color: var(--ew-ink); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: var(--ew-brand); color: #fff;
    border-radius: 8px;
    box-shadow: var(--ew-shadow-sm);
}
.brand-accent { color: var(--ew-brand); }

.site-header .nav-link {
    color: var(--ew-ink-soft);
    font-weight: 500;
    padding: .5rem .9rem;
    border-radius: 6px;
    transition: background-color .15s ease, color .15s ease;
}
.site-header .nav-link:hover { color: var(--ew-ink); background: var(--ew-bg-soft); }
.site-header .nav-link.active { color: var(--ew-brand); background: rgba(13, 110, 253, .08); }

.navbar-cta { margin-left: 1rem; }
@media (max-width: 991.98px) {
    .navbar-cta { margin: .75rem 0 0 0; }
    .navbar-cta .btn { width: 100%; }
}

/* Tools mega-dropdown */
.dropdown-menu-tools {
    min-width: 260px;
    padding: .5rem;
    border: 1px solid var(--ew-line);
    border-radius: var(--ew-radius);
    box-shadow: var(--ew-shadow-lg);
}
.dropdown-menu-tools .dropdown-header {
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .06em;
    color: var(--ew-muted);
    padding: .4rem .75rem .25rem;
}
.dropdown-menu-tools .dropdown-item {
    border-radius: 6px;
    padding: .5rem .75rem;
    color: var(--ew-ink);
}
.dropdown-menu-tools .dropdown-item:hover,
.dropdown-menu-tools .dropdown-item:focus { background: var(--ew-bg-soft); color: var(--ew-ink); }
.dropdown-menu-tools .dropdown-item .dropdown-sub {
    display: block; font-size: .8rem; color: var(--ew-muted); font-weight: 400;
}
.dropdown-menu-tools .dropdown-item-muted { color: var(--ew-brand); font-size: .9rem; }

/* ============================================================
   Buttons - softer shadow, subtle hover lift
   ============================================================ */
.btn-primary {
    background: var(--ew-brand); border-color: var(--ew-brand);
    box-shadow: var(--ew-shadow-sm);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--ew-brand-dark); border-color: var(--ew-brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--ew-shadow-md);
}
.btn { transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease, border-color .15s ease; }
.btn-outline-primary { color: var(--ew-brand); border-color: var(--ew-brand); }
.btn-outline-primary:hover { background: var(--ew-brand); border-color: var(--ew-brand); }

/* ============================================================
   Cards - flatter, hoverable for grid links
   ============================================================ */
.card {
    border: 1px solid var(--ew-line);
    border-radius: var(--ew-radius);
    box-shadow: var(--ew-shadow-sm);
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
a.card:hover {
    box-shadow: var(--ew-shadow-md);
    border-color: rgba(13, 110, 253, .35);
    transform: translateY(-2px);
}
.card-body { padding: 1.25rem; }

/* ============================================================
   Hero (homepage) - soft gradient, centered, breathing room
   ============================================================ */
.hero {
    background: var(--ew-bg-hero);
    border-bottom: 1px solid var(--ew-line);
    padding: 4.5rem 0 3.5rem;
}
.hero h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
}
.hero .lead {
    font-size: 1.15rem;
    max-width: 580px;
    margin: 1rem auto 1.5rem;
}
.hero-form {
    max-width: 640px; margin: 0 auto;
}

/* ============================================================
   Tool layout - sidebar + content
   Centered to match the navbar/footer .container (max ~1320px),
   otherwise the shell bleeds edge-to-edge and looks broken on
   wide monitors.
   ============================================================ */
.tool-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 1320px;
    margin-inline: auto;
}
@media (min-width: 992px) {
    .tool-shell { grid-template-columns: 260px 1fr; }
}
.tool-sidebar {
    background: var(--ew-bg-soft);
    border-right: 1px solid var(--ew-line);
    padding: 1.5rem 1rem;
}
@media (min-width: 992px) {
    .tool-sidebar {
        position: sticky;
        top: var(--ew-nav-h);
        align-self: start;
        max-height: calc(100vh - var(--ew-nav-h));
        overflow-y: auto;
    }
}
.tool-sidebar .nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ew-muted); margin: 1rem .5rem .35rem; }
.tool-sidebar .nav-section:first-child { margin-top: 0; }
.tool-sidebar .tool-link {
    display: block; padding: .45rem .75rem; border-radius: 6px;
    color: var(--ew-ink-soft); text-decoration: none; font-size: .95rem;
}
.tool-sidebar .tool-link:hover { background: #fff; color: var(--ew-ink); }
.tool-sidebar .tool-link.active { background: var(--ew-brand); color: #fff; font-weight: 500; }
.tool-content { padding: 2rem 1.5rem; min-width: 0; }
@media (min-width: 992px) { .tool-content { padding: 2.25rem 2.5rem; } }

/* Domain input form on each tool page */
.domain-form {
    border: 1px solid var(--ew-line);
    border-radius: var(--ew-radius);
    padding: 1.25rem 1.5rem;
    background: #fff;
    box-shadow: var(--ew-shadow-sm);
}
.domain-form .form-label { color: var(--ew-ink); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.domain-examples a { transition: background-color .12s; }
.domain-examples a:hover { background-color: var(--ew-brand) !important; color: #fff !important; border-color: var(--ew-brand) !important; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--ew-line);
    color: var(--ew-ink-soft);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}
.footer-brand {
    display: inline-block;
    font-weight: 700; font-size: 1.15rem; color: var(--ew-ink);
    text-decoration: none; margin-bottom: .5rem;
}
.footer-tagline { color: var(--ew-muted); font-size: .9rem; margin: 0; max-width: 280px; }
.footer-heading {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--ew-muted); margin-bottom: .75rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a { color: var(--ew-ink-soft); text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: var(--ew-brand); }
.footer-bottom {
    margin-top: 2.5rem; padding-top: 1.25rem;
    border-top: 1px solid var(--ew-line);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
    font-size: .85rem; color: var(--ew-muted);
}
.footer-meta a { color: var(--ew-muted); text-decoration: none; margin-left: 1rem; }
.footer-meta a:hover { color: var(--ew-brand); }

/* ============================================================
   Result blocks - softer code, friendlier badges
   ============================================================ */
pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: .85rem;
    line-height: 1.6;
    overflow-x: auto;
}
pre code { background: transparent; color: inherit; padding: 0; }
:not(pre) > code {
    background: #f1f5f9; color: #be185d;
    padding: .15em .4em; border-radius: 4px;
    font-size: .9em;
}
.badge { font-weight: 500; padding: .35em .6em; }

/* Grade pill on the audit page */
.grade-pill {
    display: inline-flex; align-items: center; justify-content: center;
    width: 84px; height: 84px;
    font-size: 3rem; font-weight: 800; line-height: 1;
    border-radius: 50%; color: #fff;
    box-shadow: var(--ew-shadow-md);
}
.grade-A { background: #16a34a; }
.grade-B { background: #65a30d; }
.grade-C { background: #ca8a04; }
.grade-D { background: #ea580c; }
.grade-F { background: #dc2626; }

/* Reading-optimized typography for /learn/* articles */
.learn-article {
    font-size: 1.05rem;
    line-height: 1.7;
}
.learn-article h1 {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}
.learn-article h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
}
.learn-article h3 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1.35rem;
}
.learn-article p,
.learn-article ul,
.learn-article ol,
.learn-article dl,
.learn-article pre,
.learn-article blockquote {
    margin-bottom: 1.25rem;
}
.learn-article code {
    background: #f5f5f5;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    color: #c7254e;
}
.learn-article pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.learn-article pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
}
.learn-article .callout {
    border-left: 4px solid #0d6efd;
    background: #f0f7ff;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}
.learn-article .callout-warning {
    border-left-color: #ffc107;
    background: #fffbea;
}
.learn-article .callout-danger {
    border-left-color: #dc3545;
    background: #fff5f5;
}
.learn-article .related-tools {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 2.5rem 0;
}

/* Print-friendly layout. Hides chrome (nav, sidebar, footer, controls)
   and reformats audit cards as a single-column report. IT admins routinely
   print audit summaries for stakeholders - make those look professional. */
@media print {
    header, footer, .navbar, aside, .breadcrumb, .d-print-none,
    [data-domain-chips], [data-recent-domains], [data-copy-target],
    [data-copy-markdown] {
        display: none !important;
    }
    body { font-size: 11pt; color: #000; background: #fff; }
    .container { max-width: none; }
    a { color: #000; text-decoration: none; }
    a[href]:after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; break-inside: avoid; }
    .card-header { background: #f3f3f3 !important; }
    .badge { border: 1px solid #999 !important; background: #fff !important; color: #000 !important; }
    .display-3 { font-size: 3rem !important; background: #fff !important; color: #000 !important; border: 2px solid #000; }
    h1, h2, h3 { page-break-after: avoid; }
    .row > section, .row > article { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
    .row > aside { display: none !important; }
}