/* Destiny Patch Notes Explorer — app-specific styles, built on top of
   styles-brand.css's shared tokens (--bg, --surface, --raised, --line,
   --text, --muted, --accent, --gold, --display, --body, --mono) — the same
   file RaidGuide, fireteam-compare and the stats site use, so all four
   subdomains share one visual identity. */

:root {
    --text-dim: #6d7a81;
    --card-hover: var(--raised);
    --mark-bg: var(--gold);
    --mark-fg: var(--bg);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Several panels below set an explicit display, which would otherwise beat the
   user-agent rule for [hidden] and leave them permanently visible. */
[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
}

body {
    font-size: 15px;
    line-height: 1.55;
}

body.is-locked {
    overflow: hidden;
}

code {
    font-family: var(--mono);
    font-size: 0.86em;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--gold);
}

mark {
    background: var(--mark-bg);
    color: var(--mark-fg);
    border-radius: 2px;
    padding: 0 2px;
    font-weight: 500;
}

/* ---------------------------------------------------------------- top bar */

.patchnotes-hero {
    grid-template-columns: 1fr;
    padding: 46px 0 30px;
}

.patchnotes-hero .intro {
    max-width: 640px;
}

.topbar {
    position: sticky;
    top: 83px;
    z-index: 30;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 28px;
    padding: 12px 40px;
}

.brand-sub {
    display: block;
    white-space: nowrap;
    font: 11px var(--mono);
    letter-spacing: 0.4px;
    color: var(--muted);
}

.searchwrap {
    flex: 1;
    min-width: 240px;
    display: flex;
    gap: 8px;
    align-items: center;
}

#searchInput {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s;
}

#searchInput::placeholder {
    color: var(--text-dim);
}

#searchInput:focus {
    border-color: var(--accent);
}

#searchInput:disabled {
    opacity: 0.5;
}

.ghost-btn {
    font: inherit;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ghost-btn:hover {
    background: var(--raised);
    color: var(--text);
    border-color: var(--accent);
}

.ghost-btn.wide {
    width: 100%;
}

/* ------------------------------------------------------------ syntax help */

.syntax-help {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 16px 24px;
}

.syntax-help dl {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 6px 20px;
}

.syntax-help dt {
    grid-column: 1;
}

.syntax-help dd {
    color: var(--muted);
    font-size: 13px;
    margin-left: 10px;
}

.syntax-help dl > dt {
    display: inline-block;
}

.syntax-help dl > dd {
    display: inline-block;
}

/* ----------------------------------------------------------------- layout */

.layout {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 24px;
    padding: 20px 24px 60px;
    max-width: 1500px;
    margin: 0 auto;
}

/* ---------------------------------------------------------------- filters */

.filters {
    position: sticky;
    top: 147px;
    align-self: start;
    max-height: calc(100vh - 171px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding-right: 4px;
}

.filter-group h2 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    margin-bottom: 9px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    font: inherit;
    font-size: 13px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.chip:hover {
    background: var(--raised);
    color: var(--text);
}

.chip.is-on {
    background: rgba(233, 196, 106, 0.14);
    border-color: var(--gold);
    color: var(--gold);
}

.chip .count {
    color: var(--text-dim);
    font-size: 11px;
    margin-left: 3px;
}

.chip.is-on .count {
    color: var(--gold);
    opacity: 0.75;
}

.switch {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13.5px;
    color: var(--muted);
    cursor: pointer;
}

.switch input {
    margin-top: 3px;
    accent-color: var(--gold);
}

.hint {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-dim);
    margin-top: 7px;
}

.year-range {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.year-range select,
.sortwrap select {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 4px 6px;
    margin-left: 4px;
}

.spark {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 36px;
    margin-top: 12px;
}

.spark i {
    flex: 1;
    min-height: 0;
    background: var(--accent);
    opacity: 0.65;
    border-radius: 1px 1px 0 0;
}

/* ---------------------------------------------------------------- results */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 3px;
}

.tab {
    font: inherit;
    font-size: 13.5px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 3px;
    padding: 6px 15px;
    cursor: pointer;
    transition: all 0.15s;
}

.tab:hover {
    color: var(--text);
}

.tab.is-active {
    background: var(--gold);
    color: var(--bg);
    font-weight: 600;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* The primary filter of a patch-notes site. It starts off, so it has to be visible
   enough that a first-time visitor knows the option exists. */
.toggle-btn {
    font: inherit;
    font-size: 12.5px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 13px 5px 27px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: all 0.15s;
}

/* Checkbox-ish dot so the two states read as on/off rather than as a button. */
.toggle-btn::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 50%;
    width: 11px;
    height: 11px;
    margin-top: -5.5px;
    border: 1px solid var(--text-dim);
    border-radius: 3px;
    background: transparent;
}

.toggle-btn:hover {
    color: var(--text);
    border-color: var(--gold);
}

.toggle-btn.is-on {
    background: rgba(233, 196, 106, 0.14);
    border-color: var(--gold);
    color: var(--gold);
}

.toggle-btn.is-on::before {
    background: var(--gold);
    border-color: var(--gold);
}

.toggle-btn.is-on::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 3px;
    height: 6px;
    margin-top: -4px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.sortwrap {
    font-size: 12.5px;
    color: var(--text-dim);
}

.result-summary {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
}

.result-summary .dim,
.dim {
    color: var(--text-dim);
}

/* ---------------------------------------------------------- active filters */

/* The app starts filtered. This strip is the only thing that says so, so it is
   deliberately not subtle. */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: rgba(233, 196, 106, 0.05);
    border: 1px solid rgba(233, 196, 106, 0.22);
    border-left: 3px solid var(--gold);
    border-radius: 4px;
}

.fb-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.fb-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-right: 2px;
}

.fb-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: 12.5px;
    color: var(--text);
    background: rgba(233, 196, 106, 0.14);
    border: 1px solid rgba(233, 196, 106, 0.45);
    border-radius: 999px;
    padding: 3px 9px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.fb-pill:hover {
    background: rgba(231, 76, 60, 0.18);
    border-color: rgba(231, 76, 60, 0.55);
}

.fb-x {
    font-size: 14px;
    line-height: 1;
    color: var(--text-dim);
}

.fb-pill:hover .fb-x {
    color: #e88b80;
}

.fb-clear {
    font: inherit;
    font-size: 12px;
    color: var(--text-dim);
    background: transparent;
    border: 0;
    padding: 2px 4px;
    margin-left: auto;
    cursor: pointer;
    text-decoration: underline;
}

.fb-clear:hover {
    color: var(--text);
}

.fb-hidden {
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--muted);
    border-top: 1px dashed var(--line);
    padding-top: 8px;
}

.fb-btn {
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--bg);
    background: var(--gold);
    border: 0;
    border-radius: 4px;
    padding: 5px 12px;
    cursor: pointer;
    white-space: nowrap;
}

.fb-btn:hover {
    filter: brightness(1.12);
}

.chip.is-empty {
    opacity: 0.4;
}

.load-state {
    padding: 22px 0;
    color: var(--muted);
    font-size: 13px;
}

.load-state .bar {
    height: 4px;
    background: var(--surface);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 9px;
}

.load-state .bar > div {
    height: 100%;
    width: 0;
    background: var(--gold);
    transition: width 0.2s;
}

.load-state.is-error {
    color: #e74c3c;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty {
    color: var(--muted);
    padding: 34px 0;
    text-align: center;
}

/* change-level hit */

.hit {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid transparent;
    border-radius: 4px;
    padding: 11px 14px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.hit:hover {
    background: var(--card-hover);
    border-left-color: var(--gold);
}

.hit-text {
    font-size: 14.5px;
}

/* Enclosing bullet(s): the change this line belongs to. */
.hit-parent {
    font-size: 12.5px;
    color: var(--text-dim);
    padding-left: 10px;
    border-left: 2px solid var(--line);
    margin-bottom: 5px;
}

/* Nested bullets: usually the actual numbers behind a named weapon or ability. */
.hit-children {
    list-style: none;
    margin: 6px 0 0 2px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hit-children li {
    font-size: 13.5px;
    color: var(--muted);
    padding-left: 12px;
    position: relative;
}

.hit-children li::before {
    content: "\2013";
    position: absolute;
    left: 0;
    color: var(--text-dim);
}

/* Explanatory prose that sits beside the bullets rather than being one of them. */
.hit-children li.is-prose {
    padding-left: 0;
    color: var(--text-dim);
    font-size: 13px;
}

.hit-children li.is-prose::before {
    content: none;
}

.hit-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
    font-size: 11.5px;
    color: var(--text-dim);
}

.hit-title {
    color: var(--accent);
}

.hit-section::before {
    content: "in ";
    color: var(--text-dim);
}

.hit-section {
    color: var(--muted);
}

/* article card */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.card:hover {
    background: var(--card-hover);
    border-color: var(--gold);
}

.card-head h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--text-dim);
}

.card-preview {
    list-style: none;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.card-preview li {
    font-size: 13.5px;
    color: var(--muted);
    padding-left: 12px;
    border-left: 2px solid var(--line);
}

.card-excerpt {
    margin-top: 9px;
    font-size: 13.5px;
    color: var(--muted);
}

.card-more {
    margin-top: 9px;
    font-size: 12px;
    color: var(--accent);
}

/* badges */

.badge {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-radius: 4px;
    padding: 2px 6px;
    border: 1px solid transparent;
}

.badge-d1 {
    background: rgba(113, 185, 190, 0.16);
    color: var(--accent);
    border-color: rgba(113, 185, 190, 0.4);
}

.badge-d2 {
    background: rgba(233, 196, 106, 0.14);
    color: var(--gold);
    border-color: rgba(233, 196, 106, 0.38);
}

.badge-marathon {
    background: rgba(231, 76, 60, 0.15);
    color: #e88b80;
    border-color: rgba(231, 76, 60, 0.4);
}

.badge-kind {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--line);
}

.kind-patch,
.kind-hotfix {
    color: #7fd1a6;
    border-color: rgba(46, 204, 113, 0.4);
}

.ver {
    font-size: 11.5px;
    color: var(--muted);
}

/* --------------------------------------------------------------- timeline */

.timeline {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 320px;
    padding: 14px 4px 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.tl-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    gap: 5px;
    cursor: pointer;
}

.tl-col:hover .tl-bar {
    background: var(--gold);
}

.tl-count {
    font-size: 11px;
    color: var(--text-dim);
}

.tl-bar {
    width: 100%;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    transition: background 0.15s;
    min-height: 0;
}

.tl-year {
    font-size: 11px;
    color: var(--muted);
    padding-bottom: 6px;
}

/* ----------------------------------------------------------------- reader */

.reader {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 34px 20px;
}

.reader-scrim {
    position: absolute;
    inset: 0;
    background: rgba(4, 7, 14, 0.78);
    backdrop-filter: blur(2px);
}

.reader-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(920px, 100%);
    max-height: 100%;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.reader-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.reader-head h2 {
    font-size: 19px;
}

.reader-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--text-dim);
}

.reader-meta a {
    color: var(--accent);
    text-decoration: none;
}

.reader-meta a:hover {
    text-decoration: underline;
}

.reader-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--line);
    max-height: 104px;
    overflow-y: auto;
}

.reader-nav a {
    font-size: 11.5px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 10px;
    text-decoration: none;
}

.reader-nav a:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.reader-body {
    overflow-y: auto;
    padding: 20px 24px 40px;
    scroll-behavior: smooth;
}

.reader-body h2,
.reader-body h3,
.reader-body h4 {
    margin: 22px 0 8px;
    color: var(--gold);
}

.reader-body h2 {
    font-size: 17px;
}

.reader-body h3 {
    font-size: 15px;
}

.reader-body h4 {
    font-size: 13.5px;
    color: var(--muted);
}

.reader-body p {
    margin: 9px 0;
    color: var(--muted);
    font-size: 14px;
}

.reader-body ul {
    margin: 6px 0 6px 20px;
}

.reader-body li {
    font-size: 14px;
    margin: 4px 0;
}

.reader-body .is-focus {
    background: rgba(113, 185, 190, 0.16);
    outline: 1px solid rgba(113, 185, 190, 0.45);
    border-radius: 4px;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .filters {
        position: static;
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 18px 26px;
    }

    .filter-group {
        flex: 1 1 210px;
    }
}

@media (max-width: 720px) {
    .topbar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 20px;
    }

    .layout {
        padding: 16px 14px 50px;
    }

    .timeline {
        height: 240px;
    }

    .tl-count {
        display: none;
    }
}
