@import url("/site_assets/fonts/fonts.css");

/*
 * Prosemetry shared site styles: colour and type tokens plus the site
 * header. Every page loads this file and prosemetry-header.js.
 * Tokens match the values already used across the report and Workspace.
 */

:root {
    --pm-page-bg: #f9f6ef;
    --pm-panel: #fdfcf7;
    --pm-panel-soft: #f3efe4;
    --pm-ink: #1c2333;
    --pm-muted: #5c6470;
    --pm-border: #e4dfd0;
    --pm-accent: #5a3a29;
    --pm-accent-dark: #3f2a1d;
    --pm-navy: #1f2a3a;
    --pm-gold: #e4c971;
    --pm-rust: #b8451f;
    --pm-serif: "Source Serif 4", "Lora", Georgia, Cambria, "Times New Roman", serif;
    --pm-sans: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --pm-header-height: 64px;
}

/* Form controls use the page's font instead of the browser default. */
button,
input,
select,
textarea {
    font-family: inherit;
}

.pm-site-header,
.pm-site-header * {
    box-sizing: border-box;
}

.pm-site-header {
    position: relative;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid var(--pm-border);
    background: var(--pm-panel);
    color: var(--pm-ink);
    font-family: var(--pm-sans);
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
}

.pm-site-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1440px;
    min-height: var(--pm-header-height);
    margin: 0 auto;
    padding: 0 24px;
}

.pm-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: var(--pm-ink);
    text-decoration: none;
}

.pm-brand img {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.pm-brand-name {
    font-family: var(--pm-serif);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.pm-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pm-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 6px;
    border-radius: 8px;
    color: var(--pm-muted);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

a.pm-nav-link:hover,
a.pm-nav-link:focus-visible {
    background: var(--pm-panel-soft);
    color: var(--pm-ink);
    outline: none;
}

.pm-nav-link[aria-current="page"] {
    color: var(--pm-ink);
}

.pm-nav-link[aria-current="page"]::after {
    position: absolute;
    right: 6px;
    bottom: 4px;
    left: 6px;
    height: 3px;
    border-radius: 2px;
    background: var(--pm-gold);
    content: "";
}

.pm-nav-link.is-disabled {
    color: #a3a7ad;
    cursor: default;
}

.pm-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
}

.pm-new-analysis {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--pm-accent);
    color: #fdfcf7;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.pm-new-analysis:hover,
.pm-new-analysis:focus-visible {
    background: var(--pm-accent-dark);
    outline: none;
}

.pm-menu-button {
    display: none;
    align-items: center;
    min-height: 38px;
    margin-left: auto;
    padding: 0 14px;
    border: 1px solid var(--pm-border);
    border-radius: 999px;
    background: var(--pm-panel);
    color: var(--pm-ink);
    font: 600 13.5px var(--pm-sans);
    cursor: pointer;
}

.pm-menu-button:focus-visible {
    outline: 2px solid var(--pm-gold);
    outline-offset: 2px;
}

@media (max-width: 1180px) {
    .pm-site-header-inner {
        flex-wrap: wrap;
        gap: 0 12px;
        padding: 0 16px;
    }

    .pm-menu-button {
        display: inline-flex;
    }

    .pm-nav,
    .pm-actions {
        display: none;
    }

    .pm-site-header.is-open .pm-nav {
        display: flex;
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 6px 0 4px;
        border-top: 1px solid var(--pm-border);
    }

    .pm-site-header.is-open .pm-actions {
        display: flex;
        flex: 1 0 100%;
        justify-content: space-between;
        padding: 8px 0 14px;
    }

    .pm-nav-link {
        min-height: 44px;
        font-size: 15px;
    }

    .pm-nav-link[aria-current="page"]::after {
        top: 12px;
        right: auto;
        bottom: 12px;
        left: 0;
        width: 3px;
        height: auto;
    }
}

/* The same menu layout, applied by prosemetry-header.js when the full
   row does not fit at wider widths. */
.pm-site-header.is-compact-inner {
        flex-wrap: wrap;
        gap: 0 12px;
        padding: 0 16px;
    }

.pm-site-header.is-compact .pm-menu-button {
        display: inline-flex;
    }

.pm-site-header.is-compact .pm-nav,
.pm-site-header.is-compact .pm-actions {
        display: none;
    }

.pm-site-header.is-compact.is-open .pm-nav {
        display: flex;
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 6px 0 4px;
        border-top: 1px solid var(--pm-border);
    }

.pm-site-header.is-compact.is-open .pm-actions {
        display: flex;
        flex: 1 0 100%;
        justify-content: space-between;
        padding: 8px 0 14px;
    }

.pm-site-header.is-compact .pm-nav-link {
        min-height: 44px;
        font-size: 15px;
    }

.pm-site-header.is-compact .pm-nav-link[aria-current="page"]::after {
        top: 12px;
        right: auto;
        bottom: 12px;
        left: 0;
        width: 3px;
        height: auto;
    }

@media print {
    .pm-site-header {
        display: none;
    }
}

/* Subscribe ------------------------------------------------------------- */

.pm-subscribe {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1.5px solid var(--pm-accent);
    border-radius: 999px;
    background: transparent;
    color: var(--pm-accent);
    font: 700 13.5px var(--pm-sans);
    white-space: nowrap;
    cursor: pointer;
}
.pm-subscribe:hover, .pm-subscribe:focus-visible { background: rgba(90, 58, 41, .08); outline: none; }

.pm-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pm-subscribe-row { display: flex; gap: 8px; }
.pm-subscribe-form input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--pm-border);
    border-radius: 999px;
    background: #fff;
    color: var(--pm-ink);
    font: 500 15px var(--pm-sans);
}
.pm-subscribe-form input:focus { outline: 2px solid var(--pm-gold, #d4b35d); outline-offset: 1px; }
.pm-subscribe-submit {
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--pm-accent);
    color: #fdfcf7;
    font: 700 14.5px var(--pm-sans);
    cursor: pointer;
}
.pm-subscribe-submit:hover, .pm-subscribe-submit:focus-visible { background: var(--pm-accent-dark); outline: none; }
.pm-subscribe-submit:disabled { opacity: .6; cursor: default; }
.pm-subscribe-message { min-height: 1.3em; margin: 8px 2px 0; color: var(--pm-muted); font: 500 13.5px/1.4 var(--pm-sans); }
.pm-subscribe-message.is-error { color: #a33a22; }
.pm-subscribe-message.is-success { color: #3f6b46; }

.pm-site-footer {
    margin-top: 56px;
    border-top: 4px solid #b8451f;
    background: #1f2a3a;
    color: #e9e4d8;
    font-family: var(--pm-sans);
}
.pm-site-footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 48px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 24px 24px;
}
.pm-site-footer .pm-brand-name { color: #fdfcf7; }
.pm-footer-about > p { margin: 12px 0 18px; color: #f2cf6b; font: 600 italic 1.15rem var(--pm-serif); }
.pm-footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.pm-footer-links a { color: #e9e4d8; font-size: 14px; font-weight: 600; text-decoration: none; }
.pm-footer-links a:hover, .pm-footer-links a:focus-visible { color: #fff; text-decoration: underline; }
.pm-footer-subscribe h2 { margin: 0 0 6px; color: #fdfcf7; font: 700 1.35rem/1.2 var(--pm-serif); }
.pm-footer-subscribe > p { margin: 0 0 14px; color: rgba(233, 228, 216, .82); font-size: 14.5px; line-height: 1.55; }
.pm-site-footer .pm-subscribe-form input { border-color: transparent; }
.pm-site-footer .pm-subscribe-submit { background: #b8451f; }
.pm-site-footer .pm-subscribe-submit:hover, .pm-site-footer .pm-subscribe-submit:focus-visible { background: #9c3a19; }
.pm-site-footer .pm-subscribe-message { color: rgba(233, 228, 216, .8); }
.pm-site-footer .pm-subscribe-message.is-error { color: #ffb4a0; }
.pm-site-footer .pm-subscribe-message.is-success { color: #b9e0b5; }
.pm-footer-note { max-width: 1180px; margin: 0 auto; padding: 16px 24px 28px; border-top: 1px solid rgba(255, 255, 255, .12); color: rgba(233, 228, 216, .65); font-size: 13px; }

.pm-subscribe-dialog {
    width: min(460px, calc(100% - 32px));
    padding: 30px 28px 24px;
    border: 0;
    border-top: 5px solid #b8451f;
    border-radius: 16px;
    background: var(--pm-panel, #fffdf8);
    color: var(--pm-ink);
    font-family: var(--pm-sans);
    box-shadow: 0 24px 60px rgba(20, 24, 33, .28);
}
.pm-subscribe-dialog::backdrop { background: rgba(28, 35, 51, .45); }
.pm-subscribe-dialog h2 { margin: 4px 0 8px; font: 700 1.6rem/1.15 var(--pm-serif); color: var(--pm-ink); }
.pm-subscribe-dialog > p { margin: 0 0 16px; color: var(--pm-muted); font-size: 15px; line-height: 1.55; }
.pm-subscribe-dialog > p.pm-dialog-kicker { margin: 0; color: var(--pm-accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pm-dialog-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--pm-muted); font-size: 22px; cursor: pointer; }
.pm-dialog-close:hover, .pm-dialog-close:focus-visible { background: var(--pm-panel-soft, #f3efe4); outline: none; }

@media (max-width: 760px) {
    .pm-site-footer-inner { grid-template-columns: 1fr; gap: 28px; padding: 32px 16px 20px; }
    .pm-footer-note { padding: 14px 16px 24px; }
}
@media (max-width: 420px) {
    .pm-subscribe-row { flex-direction: column; }
}
@media print { .pm-site-footer, .pm-subscribe, .pm-subscribe-dialog { display: none !important; } }

/* Main page titles ------------------------------------------------------ */
/* One size, weight and line height for every page's main heading
   (the home page hero keeps its own larger display type). */
h1.pm-page-title {
    font-family: var(--pm-serif) !important;
    font-size: clamp(2.2rem, 3.9vw, 3.25rem) !important;
    font-weight: 700 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.02em !important;
    text-transform: none !important;
}

/* Older analyses: one quiet line under the header */
.pm-fresh { background: var(--pm-panel, #fbf8f2); border-bottom: 1px solid var(--pm-border, #e3dccf); }
.pm-fresh-inner { max-width: 1440px; margin: 0 auto; padding: 8px 24px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font: 500 .86rem/1.45 var(--pm-sans, Inter, system-ui, sans-serif); color: var(--pm-muted, #5b6472); }
.pm-fresh-inner p { margin: 0; flex: 1 1 320px; }
.pm-fresh-button { border: 1px solid var(--pm-border, #e3dccf); background: #fff; color: var(--pm-ink, #1f2a3a); border-radius: 999px; padding: 4px 12px; font: 600 .82rem/1.3 inherit; cursor: pointer; }
.pm-fresh-button:hover, .pm-fresh-button:focus-visible { border-color: var(--pm-rust, #b5651d); }
@media (max-width: 600px) { .pm-fresh-inner { padding-inline: 16px; } }

/* Shown when the folder has newer code than the running app. */
.pm-update-banner { padding: 10px 16px; background: #b5462a; color: #fff; font: 700 .92rem/1.4 Inter, system-ui, sans-serif; text-align: center; }
