/* ==========================================================================
   DockerCP - Brand, Typography & Hero overrides
   Loaded LAST on public pages so it is the authoritative layer. It supersedes
   the older, patched-over .brand / .site-header .brand rules in app.css
   without deleting them, and tightens type weights so Inter renders cleanly
   instead of the over-heavy 800/900 weights the design had drifted into.
   ========================================================================== */

/* ------------------------------------------------------------------ Base type */
body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------- Header brand */
.site-header .brand {
    width: auto !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    background-image: none !important;
    text-indent: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

.site-header .brand .brand-logo {
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 auto !important;
    border-radius: 9px !important;
}

.site-header .brand .brand-name,
.site-header .brand span {
    display: inline-block !important;
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: var(--ec-black) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* ------------------------------------------------------------- Footer brand */
.site-footer .footer-brand,
.site-footer .brand.footer-brand,
.site-footer .brand {
    width: auto !important;
    height: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    background-image: none !important;
    text-indent: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    margin-bottom: 18px !important;
    text-decoration: none !important;
}

.site-footer .footer-brand .brand-logo {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 auto !important;
    border-radius: 8px !important;
}

/* Higher-specificity selectors below intentionally beat app.css's
   `.site-footer .brand.footer-brand span { display:none }` (0,3,1), which
   previously hid the footer wordmark entirely. */
.site-footer .brand.footer-brand .brand-name,
.site-footer a.brand.footer-brand .brand-name,
.site-footer .brand.footer-brand span,
.site-footer a.footer-brand span {
    display: inline-block !important;
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.015em !important;
    color: #ffffff !important;
    line-height: 1 !important;
    text-indent: 0 !important;
    white-space: nowrap !important;
}

/* ===================================================================
   Unified link & control typography  (header nav · footer · buttons)
   -------------------------------------------------------------------
   Header nav and footer links previously diverged on TWO axes the old
   flat-700 patch never addressed:
     1. Contrast — header links used --ec-muted (#64748B) on white, a
        washed-out slate that made even an 800 weight read thin, while
        footer links sat at full-strength white on near-black.
     2. Optical weight — light text on a dark field irradiates and looks
        heavier than the same weight rendered dark-on-light.
   Matching the numeric weight alone therefore still left the footer
   looking bolder. This system gives both surfaces the SAME metrics
   (15px / 600 / -0.006em / 1.5) and closes the contrast gap by darkening
   the header link colour to a true slate, then eases the footer a touch
   in opacity to take the edge off the dark-field bolding. 600 (Inter
   Semibold, a discretely-loaded weight) is the shared anchor: premium,
   never heavy, never thin. The two now read as one family, separated
   only by the colour each background calls for. */

/* Shared metrics across both nav surfaces */
.main-nav > a,
.site-footer a {
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.006em !important;
    line-height: 1.5 !important;
    transition: color 0.18s ease;
}

/* Header nav — slate on light, ink on hover. Contrast is lifted off the
   washed-out --ec-muted so the lighter 600 weight reads solid, not faint. */
.main-nav > a {
    color: #3A4252 !important;
}
.main-nav > a:hover,
.main-nav > a:focus-visible {
    color: #0F1729 !important;
}

/* Footer nav — white on dark, eased slightly in opacity so the dark-field
   optical bolding matches the header's apparent weight. */
.site-footer a {
    color: rgba(255, 255, 255, 0.72) !important;
}
.site-footer a:hover,
.site-footer a:focus-visible {
    color: #FFFFFF !important;
}

/* Buttons — same Semibold anchor as the nav so calls-to-action belong to
   the same family instead of the old maximal 900. */
.btn,
a.btn,
button.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-lg,
.btn-sm,
.btn-small {
    font-weight: 600 !important;
    letter-spacing: -0.005em !important;
}

/* Public in-content hyperlinks — brand blue, scoped to prose content
   (blog / docs / legal / FAQ / changelog) and never the nav, footer, or
   buttons. Underline appears on hover so links stay discoverable without
   shouting in running text. */
.post-content a:not(.btn):not(.tag),
.legal-content a:not(.btn),
.faq-list .faq-answer a,
.ec-changelog-content a:not(.btn),
.ec-rich-steps a:not(.btn) {
    color: #1F6FF5 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}
.post-content a:not(.btn):not(.tag):hover,
.legal-content a:not(.btn):hover,
.faq-list .faq-answer a:hover,
.ec-changelog-content a:not(.btn):hover,
.ec-rich-steps a:not(.btn):hover {
    text-decoration: underline !important;
}

.hero h1,
.page-hero h1 {
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.0 !important;
}

.hero p,
.page-hero p {
    font-weight: 400;
}

.badge {
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    margin-bottom: 10px !important;
}

/* Section headings: keep strong but not maximal */
.template-top h3,
.template-title h3,
.template-card h3 {
    font-weight: 700 !important;
    letter-spacing: -0.015em;
}

/* --------------------------------------------------------------- Hero, mobile */
@media (max-width: 640px) {
    .hero h1,
    .page-hero h1 {
        font-size: clamp(38px, 10.5vw, 60px) !important;
        line-height: 1.05 !important;
        letter-spacing: -0.025em !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }

    .hero p,
    .page-hero p {
        line-height: 1.6;
    }

    /* Mobile dropdown links: keep the unified 600 weight and slate colour
       from the shared rule above, but restore the larger tap-target size
       (the desktop 15px would otherwise win via !important) and give each
       row comfortable height for touch. */
    .main-nav > a {
        font-size: 17px !important;
        line-height: 1.35 !important;
        color: #3A4252 !important;
    }
    .main-nav > a:hover,
    .main-nav > a:focus-visible {
        color: #0F1729 !important;
    }

    .site-header .brand .brand-logo { width: 28px !important; height: 28px !important; }
    .site-header .brand .brand-name,
    .site-header .brand span { font-size: 0.98rem !important; }
}

@media (max-width: 380px) {
    .site-header .brand .brand-name,
    .site-header .brand span { font-size: 0.9rem !important; letter-spacing: -0.03em !important; }
}

/* ==========================================================================
   Hero dashboard preview  (.dcp-hero-preview)
   Self-contained, light-theme product mock. Pure HTML/CSS so it stays crisp
   and responsive. Namespaced to avoid the older, undefined .preview-shell.
   ========================================================================== */
.dcp-hero-preview {
    --dcp-line: #E6ECF3;
    --dcp-ink: #0B1220;
    --dcp-muted: #6B7686;
    --dcp-blue: #1F6FF5;
    position: relative;
    width: 100%;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--dcp-line);
    box-shadow: 0 30px 60px -28px rgba(15, 36, 84, 0.32), 0 8px 22px -16px rgba(15, 36, 84, 0.25);
    overflow: hidden;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* window chrome */
.dcp-hp-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 16px;
    background: #F7F9FC;
    border-bottom: 1px solid var(--dcp-line);
}
.dcp-hp-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #D5DCE6;
}
.dcp-hp-dot:nth-child(1) { background: #F2655F; }
.dcp-hp-dot:nth-child(2) { background: #F6B53C; }
.dcp-hp-dot:nth-child(3) { background: #43C76C; }

.dcp-hp-body {
    display: grid;
    grid-template-columns: 150px 1fr;
    min-height: 358px;
}

/* sidebar */
.dcp-hp-side {
    border-right: 1px solid var(--dcp-line);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #FCFDFE;
}
.dcp-hp-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px 14px;
}
.dcp-hp-brand img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}
.dcp-hp-brand strong {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dcp-ink);
}
.dcp-hp-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dcp-hp-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--dcp-muted);
    text-decoration: none;
}
.dcp-hp-nav a i { width: 14px; font-size: 12px; text-align: center; }
.dcp-hp-nav a.is-active {
    background: #E9F1FE;
    color: var(--dcp-blue);
    font-weight: 600;
}
.dcp-hp-server {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--dcp-line);
    border-radius: 11px;
    background: #fff;
}
.dcp-hp-server span.d {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #43C76C;
    box-shadow: 0 0 0 3px #E4F8EB;
    flex: 0 0 auto;
}
.dcp-hp-server strong { display: block; font-size: 11.5px; color: var(--dcp-ink); font-weight: 600; }
.dcp-hp-server small { font-size: 10px; color: var(--dcp-muted); }

/* main */
.dcp-hp-main { padding: 16px 18px; }
.dcp-hp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}
.dcp-hp-kicker {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--dcp-muted);
    font-weight: 600;
}
.dcp-hp-head h4 {
    margin: 3px 0 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dcp-ink);
}
.dcp-hp-btn {
    font-size: 11.5px;
    font-weight: 600;
    color: #fff;
    background: var(--dcp-blue);
    border-radius: 9px;
    padding: 7px 12px;
    box-shadow: 0 6px 14px -6px rgba(31, 111, 245, 0.6);
}

.dcp-hp-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.dcp-hp-stat {
    border: 1px solid var(--dcp-line);
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
}
.dcp-hp-stat span {
    font-size: 10.5px;
    color: var(--dcp-muted);
    font-weight: 500;
}
.dcp-hp-stat strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--dcp-ink);
    margin: 2px 0 8px;
}
.dcp-hp-track {
    height: 5px;
    border-radius: 999px;
    background: #EEF2F7;
    overflow: hidden;
}
.dcp-hp-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1F6FF5, #4F95FF);
}

.dcp-hp-list {
    border: 1px solid var(--dcp-line);
    border-radius: 12px;
    overflow: hidden;
}
.dcp-hp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--dcp-line);
}
.dcp-hp-row:last-child { border-bottom: 0; }
.dcp-hp-app {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--dcp-ink);
}
.dcp-hp-ico {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
}
.dcp-hp-ico.wp { background: #2271B1; }
.dcp-hp-ico.pg { background: #336791; }
.dcp-hp-ico.rd { background: #D82C20; }
.dcp-hp-ico.nn { background: #6B47C8; }
.dcp-hp-meta { font-size: 10.5px; color: var(--dcp-muted); font-weight: 400; }
.dcp-hp-tags { display: flex; gap: 6px; }
.dcp-hp-tag {
    font-size: 10px;
    font-weight: 600;
    font-style: normal;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.01em;
}
.dcp-hp-tag.ok { color: #1F8A4C; background: #E4F8EB; }
.dcp-hp-tag.ssl { color: #1F6FF5; background: #E9F1FE; }

@media (max-width: 980px) {
    .dcp-hero-preview { max-width: 560px; margin: 0 auto; }
}
@media (max-width: 560px) {
    .dcp-hp-body { grid-template-columns: 1fr; min-height: 0; }
    .dcp-hp-side {
        flex-direction: row;
        align-items: center;
        border-right: 0;
        border-bottom: 1px solid var(--dcp-line);
        gap: 6px;
    }
    .dcp-hp-brand { padding: 0 6px 0 0; }
    .dcp-hp-nav { flex-direction: row; gap: 2px; flex-wrap: wrap; }
    .dcp-hp-nav a span { display: none; }
    .dcp-hp-nav a { padding: 7px; }
    .dcp-hp-server { display: none; }
    .dcp-hp-main { padding: 13px; }
    .dcp-hp-stats { gap: 7px; }
    .dcp-hp-stat { padding: 9px; }
    .dcp-hp-stat strong { font-size: 15px; }
    .dcp-hp-app { min-width: 0; overflow: hidden; }
    .dcp-hp-meta { display: none; }
    .dcp-hp-btn { padding: 6px 10px; white-space: nowrap; }
}
