/*
 * WMOverland integration layer for Discussion Forge.
 *
 * Discussion Forge remains a standalone application. This file owns only the
 * presentation boundary between the generic app and the WMOverland site shell.
 */

.trail-talk-page {
    background: #121311;
}

.discussion-forge-shell {
    position: relative;
    z-index: 1;
    padding: clamp(2.5rem, 5vw, 4.5rem) max(1rem, calc((100vw - var(--wide)) / 2)) 4rem;
    background:
        radial-gradient(circle at 12% 18%, rgb(119 91 52 / 6%) 0 .12rem, transparent .16rem),
        radial-gradient(circle at 78% 42%, rgb(119 91 52 / 5%) 0 .1rem, transparent .14rem),
        var(--stone-50);
}

.discussion-forge-shell::after {
    content: none;
}

.discussion-forge-intro,
.discussion-forge {
    width: min(1100px, 100%);
    margin-inline: auto;
}

.discussion-forge-intro {
    margin-bottom: 1.5rem;
}

.discussion-forge-intro__eyebrow {
    margin: 0 0 .45rem;
    color: var(--signal);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.discussion-forge-intro h1 {
    margin-bottom: .8rem;
    color: #25241f;
    font-size: clamp(2.8rem, 6vw, 5rem);
}

.discussion-forge-intro__copy {
    max-width: 48rem;
    margin: 0;
    color: #4b4a43;
    font-size: 1.02rem;
    line-height: 1.6;
}

/*
 * Neutralize Discussion Forge's document-level rules inside the WMOverland
 * shell without changing the upstream stylesheet or the deck/card geometry.
 */
.discussion-forge {
    --paper: #f3efe5;
    --ink: #22251f;
    --panel: #fffdf8;
    --border: #b7b09f;
    --accent: #365f43;

    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.discussion-forge h1,
.discussion-forge h2,
.discussion-forge h3 {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: normal;
}

.discussion-forge h2 {
    font-size: 1.5rem;
    line-height: 1.2;
}

.discussion-forge h3 {
    font-size: 1.17em;
}

.discussion-forge .controls {
    box-shadow: 0 .65rem 1.5rem rgb(67 50 31 / 12%);
}

.discussion-forge button:focus-visible,
.discussion-forge input:focus-visible,
.discussion-forge select:focus-visible,
.discussion-forge summary:focus-visible,
.discussion-forge .preview-card:focus-visible {
    outline-color: var(--accent);
}

/*
 * The upstream stylesheet contains document-level .site-header and main rules.
 * These selectors restore WMOverland ownership of the shared shell because this
 * integration stylesheet is loaded after Discussion Forge's stylesheet.
 */
.trail-talk-page > .site-header {
    width: auto;
    margin-inline: 0;
    padding: 0;
}

.trail-talk-page > .discussion-forge-shell {
    width: auto;
    margin-inline: 0;
}

/*
 * Preserve Discussion Forge's dedicated print renderer and exact physical card
 * geometry while removing every WMOverland screen-only element from the job.
 */
@media print {
    .trail-talk-page {background: white !important;
    .trail-talk-page > .site-header,
    .trail-talk-page > .site-footer,
    .discussion-forge-intro,
    .discussion-forge .controls,
    .discussion-forge .noscript-message,
    .discussion-forge .preview-output {
        display: none !important;
    }

    .discussion-forge-shell,
    .discussion-forge {
        width: auto;
        margin: 0;
        padding: 0;
        background: white;
    }

    main#main-content::before,
    main#main-content::after {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        content: none !important;
        background: none !important;
    }

    .discussion-forge .print-output {
        display: block !important;
    }
}
