/* =========================================
   COMPARE — /compare/
   One research question, base model vs. Implied side by side. Each pane
   has tool checkboxes; the ticked combination picks which cached answer
   is shown. Loaded after styles2.css + blog.css (doc cards, modal, nav
   active state)
   ========================================= */

/* ===================== */
/* PAGE                  */
/* ===================== */

.compare-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 160px 40px 100px;
    width: 100%;
    box-sizing: border-box;
}

.compare-header {
    max-width: 760px;
    margin-bottom: 48px;
}

.compare-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--orange);
    margin: 0 0 20px 0;
}

.compare-title {
    font-family: 'Geist', 'Articulat CF', sans-serif;
    font-size: 50px;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -1.28px;
    color: var(--army);
    margin: 0 0 24px 0;
}

.compare-title .orange-text {
    font-style: italic;
}

.compare-subtitle {
    font-family: 'Geist', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--grey);
    margin: 0;
    max-width: 620px;
}

/* ===================== */
/* QUESTION TABS         */
/* ===================== */

.compare-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px 0;
}

.compare-tab {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--army);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.compare-tab:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.compare-tab[aria-selected="true"] {
    background: var(--army);
    border-color: var(--army);
    color: var(--cream);
}

.compare-tab:focus {
    outline: none;
}

.compare-tab:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

/* ===================== */
/* PROMPT                */
/* ===================== */

.compare-prompt {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 3px solid var(--orange);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 0 0 28px 0;
}

.compare-prompt-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--grey);
    margin: 0 0 8px 0;
}

.compare-prompt-text {
    font-family: 'Geist', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--army);
    margin: 0;
}

.compare-prompt-note {
    font-family: 'Geist', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--grey);
    margin: 10px 0 0 0;
}

/* ===================== */
/* PANES                 */
/* ===================== */

.compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: start;
}

.compare-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* Pane heading */
.compare-pane-head {
    padding: 0 4px;
}

.compare-pane-name {
    font-family: 'Geist', 'Articulat CF', sans-serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: var(--army);
    margin: 0 0 6px 0;
}

.compare-pane-tag {
    font-family: 'Geist', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--grey);
    margin: 0;
}

/* Pane body: tool checkboxes in a rail on the left, the answer on the right */
.compare-pane-body {
    display: grid;
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    min-width: 0;
}

/* Tool checkboxes — tick one on and the answer beside it swaps to the run that had it */
.compare-tools {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 18px 18px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    background: #fff;
    min-width: 0;
}

.compare-tools-label {
    float: left;          /* keeps the legend inside the box, not on its border */
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--orange);
    padding: 0;
    margin: 0 0 6px 0;
}

.compare-tool {
    clear: both;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 8px;
    margin: 0 -8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.compare-tool:hover {
    background: #faf8f4;
}

.compare-tool input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0 0;
    accent-color: var(--orange);
    cursor: pointer;
}

.compare-tool input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

.compare-tool-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.compare-tool-name {
    font-family: 'Geist', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--army);
}

.compare-tool-hint {
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--grey);
    margin-top: 2px;
}

.compare-tool:has(input:checked) .compare-tool-name {
    color: var(--orange);
}

/* The answer for the ticked combination: doc card + sources strip + eval */
.compare-answer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.compare-answer.is-entering {
    opacity: 0;
    transform: translateY(6px);
}

/* Answer card — reuses .doc-card / .doc-content / .doc-modal from blog.css.
   Overrides: the label stacks (tags are long) and the preview is a touch taller. */
.compare-col .doc-card {
    width: 100%;
}

.compare-col .doc-card-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.compare-col .doc-card-tag {
    white-space: normal;
    line-height: 1.4;
}

.compare-col .doc-card-preview {
    height: 360px;
}

/* Redline conventions, if an answer marks them up */
.doc-content ins {
    background: rgba(88, 177, 108, 0.18);
    text-decoration: none;
}

.doc-content del {
    background: rgba(226, 84, 84, 0.16);
}

.doc-content .changed {
    background: rgba(0, 108, 169, 0.12);
}

/* Citation list at the end of a PDF export ("1. Source", "i. quote") */
.doc-content p.li {
    margin: 0 0 0.4em 1.6em;
    text-indent: -1.6em;
    font-size: 0.92em;
}

/* Sources strip — how many documents the run pulled, and (Implied) the chat link */
.compare-sources {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
}

.compare-sources-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--orange);
}

.compare-sources-count {
    font-family: 'Geist', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--dark-grey);
}

.compare-sources-count strong {
    font-family: 'Geist', 'Articulat CF', sans-serif;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.5px;
    line-height: 1;
    color: var(--army);
    margin-right: 2px;
}

.compare-sources-note {
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    line-height: 1.45;
    color: var(--dark-grey);
}

.compare-sources-link {
    align-self: flex-start;
    margin-top: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--army);
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 7px 14px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.compare-sources-link:hover {
    color: var(--orange);
    border-color: var(--orange);
}

/* Eval strip */
.compare-eval {
    background: #fff8f0;
    border: 1px solid #f3dcc0;
    border-radius: 12px;
    padding: 16px 18px;
}

.compare-eval-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--orange);
    margin: 0 0 10px 0;
}

.compare-eval ul {
    font-family: 'Geist', sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: #4a4a4a;
    margin: 0;
    padding-left: 18px;
}

.compare-eval li {
    margin-bottom: 6px;
}

.compare-eval li:last-child {
    margin-bottom: 0;
}

/* Tool calls / tokens footer */
.compare-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 0 4px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--grey);
}

.compare-meta strong {
    font-weight: 600;
    color: var(--army);
}

/* Placeholder answers — obvious until real content lands */
.compare-answer.is-placeholder .doc-card,
.compare-answer.is-placeholder .compare-sources,
.compare-answer.is-placeholder .compare-eval {
    border-style: dashed;
}

.compare-answer.is-placeholder .doc-content,
.compare-answer.is-placeholder .compare-eval ul {
    color: var(--grey);
    font-style: italic;
}

/* Loading / error states */
.compare-status {
    font-family: 'Geist', sans-serif;
    font-size: 15px;
    color: var(--grey);
    padding: 40px 0;
    text-align: center;
}

.compare-status.is-error {
    color: #b3261e;
}

/* Mobile pane picker + swipe hint (hidden on desktop) */
.compare-colnav {
    display: none;
}

.compare-swipe-hint {
    display: none;
}

/* ===================== */
/* RESPONSIVE            */
/* ===================== */

/* Narrower than this the rail + answer don't fit side by side inside a pane */
@media screen and (max-width: 1100px) {
    .compare-pane-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .compare-tools {
        position: static;
        padding: 14px 16px 10px;
    }

    .compare-tool-hint {
        display: none;
    }
}

@media screen and (max-width: 1024px) {
    .compare-page {
        padding: 150px 32px 80px;
    }

    .compare-col .doc-card-preview {
        height: 320px;
    }
}

/* Below 900px two panes would be cramped — switch to a snap carousel */
@media screen and (max-width: 900px) {
    .compare-colnav {
        display: flex;
        gap: 8px;
        margin: 0 0 14px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .compare-colnav button {
        flex: 0 0 auto;
        font-family: 'Inter', sans-serif;
        font-size: 12px;
        font-weight: 500;
        color: var(--army);
        background: transparent;
        border: 1px solid #e0e0e0;
        border-radius: 999px;
        padding: 8px 14px;
        cursor: pointer;
        white-space: nowrap;
    }

    .compare-colnav button.is-active {
        background: var(--orange);
        border-color: var(--orange);
        color: var(--cream);
    }

    .compare-grid {
        display: flex;
        gap: 14px;
        margin: 0 -24px;
        padding: 0 24px 8px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 24px;
        -webkit-overflow-scrolling: touch;
    }

    .compare-col {
        flex: 0 0 88%;
        scroll-snap-align: center;
    }

    .compare-swipe-hint {
        display: block;
        font-family: 'Inter', sans-serif;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--grey);
        text-align: center;
        margin: 12px 0 0 0;
    }
}

@media screen and (max-width: 767px) {
    .compare-page {
        padding: 130px 24px 60px;
    }

    .compare-title {
        font-size: 38px;
        letter-spacing: -0.8px;
    }

    .compare-header {
        margin-bottom: 36px;
    }

    .compare-prompt {
        padding: 16px 18px;
    }

    .compare-prompt-text {
        font-size: 17px;
    }

    .compare-col .doc-card-preview {
        height: 280px;
    }

    .compare-pane-name {
        font-size: 22px;
    }
}
