/* ==========================================================================
   DarkWeb Monitor — page layouts
   --------------------------------------------------------------------------
   Everything here is composition: where the blocks from components.css sit on
   a given route. No colour literal appears below — every shade is a token or a
   color-mix() of one, so both themes track without a second rule set.

   Loaded after components.css and before charts.css.
   ========================================================================== */

/* ------------------------------------------------------------- shared ----- */

/*
 * The heading block every listing route opens with: title and lede on the
 * left, the route's own actions pushed to the right, stacking under each other
 * as soon as they no longer fit side by side.
 */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}
.page-head h1 { margin: 0; }
.page-head .lede { margin: .5rem 0 0; }
.page-head__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin: 0;
}
.page-head__meta {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    margin: .6rem 0 0;
}

/* An inline advisory: heavier than a hint, lighter than a flash. */
.notice {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: 0 0 1.2rem;
    padding: .7rem .9rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: .84rem;
    color: var(--text-dim);
}
.notice .icon { flex: none; margin-top: .15rem; }
.notice--warn {
    border-left-color: var(--warn);
    background: color-mix(in srgb, var(--warn) 8%, var(--surface-2));
}
.notice--bad {
    border-left-color: var(--bad);
    background: color-mix(in srgb, var(--bad) 8%, var(--surface-2));
}

/* The illustrative SVG inside an .empty block. */
.empty__art { width: min(220px, 60%); height: auto; margin-bottom: .3rem; }
/* The same block used inside a panel, where it must not look like a page. */
.empty--inline {
    padding: 1.4rem 1rem;
    text-align: left;
    justify-items: start;
    background: none;
}
.empty--inline .empty__art { width: min(160px, 42%); }
.empty--inline .empty__text { max-width: 60ch; }

/* A code block with a copy button parked in its corner. */
.code-block { position: relative; }
.code-block .code { margin: 0; }

/* stat variant for a value that is a phrase rather than a number */
.stat__value--sm { font-size: clamp(1rem, .9rem + .4vw, 1.25rem); line-height: 1.25; }

/* --------------------------------------------------------------- home ----- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.2rem, 3vw, 2.6rem);
    margin-bottom: 2rem;
}
.hero__title {
    margin: .3rem 0 .6rem;
    font-family: var(--font-display);
    line-height: 1.05;
    letter-spacing: .01em;
}
.hero__title::after {
    /* the terminal caret, the one blinking thing base.css allows */
    content: '_';
    color: var(--accent);
    margin-left: .1em;
}
.hero .lede { margin: 0; max-width: 52ch; }
.hero__actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin: 1.1rem 0 0;
}
.hero__stats { align-self: stretch; }
.hero__note {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 0;
    padding: .6rem .85rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: .78rem;
    color: var(--text-faint);
}
.hero__note .icon { flex: none; margin-top: .1rem; }

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

.quick-filters {
    display: flex;
    align-items: baseline;
    gap: .7rem;
    margin-bottom: 1.6rem;
}
.quick-filters__label {
    flex: none;
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.quick-filters__label::after { content: ':'; }

.board__more { display: flex; justify-content: center; margin: 1.6rem 0 0; }

.home-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(1.2rem, 3vw, 2.4rem);
    align-items: start;
}
@media (max-width: 900px) {
    .home-split { grid-template-columns: 1fr; }
}

.rail__note {
    margin: .8rem 0 0;
    font-size: .76rem;
    line-height: 1.6;
    color: var(--text-faint);
}

/* The change rail: one line per event, dense enough to scan in a glance. */
.changes {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.changes__row {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .8rem;
    border-bottom: 1px solid var(--border);
    box-shadow: inset 3px 0 0 var(--state, transparent);
    font-size: .82rem;
}
.changes__row:last-child { border-bottom: 0; }
.changes__row:hover { background: var(--surface-2); }
.changes__name {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.changes__name:hover { color: var(--accent); }
.changes__cat {
    margin-left: auto;
    font-size: .72rem;
    color: var(--text-faint);
    white-space: nowrap;
}
.changes__age {
    flex: none;
    font-family: var(--font-mono);
    font-size: .68rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
    .changes__cat { display: none; }
}

/* The state ledger: label, bar, count, one-line explanation. */
.ledger {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .7rem;
}
.ledger__row {
    display: grid;
    grid-template-columns: minmax(6.5rem, auto) minmax(3rem, 1fr) auto;
    align-items: center;
    gap: .4rem .7rem;
}
.ledger__label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: .82rem;
}
.ledger__label:hover { color: var(--accent); }
.ledger__count {
    font-family: var(--font-mono);
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    text-align: right;
}
.ledger__note {
    grid-column: 1 / -1;
    margin-top: -.2rem;
    font-size: .7rem;
    color: var(--text-faint);
}

/* -------------------------------------------------------------- sites ----- */

.filters { margin: 0; }
.filters .filter-bar { margin-bottom: 1.4rem; }

/* ---------------------------------------------------------- categories ---- */

.cat-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .4rem 1.1rem;
    margin-bottom: 1.6rem;
    padding: clamp(1rem, 2.5vw, 1.6rem);
    border: 1px solid color-mix(in srgb, var(--cat, var(--accent)) 30%, var(--border));
    border-left: 4px solid var(--cat, var(--accent));
    border-radius: var(--radius);
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--cat, var(--accent)) 12%, transparent), transparent 60%),
        var(--surface);
}
.cat-head__icon { font-size: clamp(2rem, 5vw, 3rem); line-height: 1; }
.cat-head__text h1 { margin: 0; }
.cat-head__text .lede { margin: .35rem 0 0; max-width: 62ch; }
.cat-head__counts {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin: .6rem 0 0;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--text-dim);
}
.cat-head__counts strong { color: var(--text); font-weight: 700; }
.cat-head__meter { grid-column: 2; }
@media (max-width: 620px) {
    .cat-head { grid-template-columns: 1fr; }
    .cat-head__meter { grid-column: 1; }
}

.state-filters {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}
.state-filters__sort {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-left: auto;
}

.cat-siblings, .cat-empty { margin-top: 2.4rem; }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
}
.cat-card { border-color: color-mix(in srgb, var(--cat, var(--accent)) 26%, var(--border)); }
.cat-card:hover { border-color: color-mix(in srgb, var(--cat, var(--accent)) 60%, var(--border)); }
.cat-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: 0 0 .5rem;
}
.cat-card__icon { font-size: 1.7rem; line-height: 1; }
.cat-card__count {
    font-family: var(--font-display);
    font-size: 1.6rem;
    line-height: 1;
    color: color-mix(in srgb, var(--cat, var(--accent)) 78%, var(--text));
    font-variant-numeric: tabular-nums;
}
.cat-card__name { margin: 0; font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.cat-card__desc {
    margin: .35rem 0 0;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--text-dim);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}
.cat-card__foot { display: grid; grid-template-columns: 1fr auto; gap: .3rem .6rem; }
.cat-card__foot .meter { grid-column: 1 / -1; }
.cat-card__stat {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: var(--font-mono);
    font-size: .68rem;
}
.cat-card__stat:last-child { justify-self: end; }

/* --------------------------------------------------------- site detail ---- */

.page-head--site { align-items: flex-start; }
.page-head--site h1 { line-height: 1.15; overflow-wrap: anywhere; }

.detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
    gap: clamp(1rem, 2.4vw, 1.8rem);
    align-items: start;
}
.detail__main, .detail__aside { display: grid; gap: clamp(1rem, 2.2vw, 1.5rem); align-content: start; }
@media (max-width: 980px) {
    .detail { grid-template-columns: 1fr; }
}

.shot { display: block; }
.shot img { display: block; width: 100%; height: auto; }
/* The detail capture is the subject of the page, not a thumbnail, so it does
   not carry the listing's desaturation or the bottom scrim. */
.shot.thumb { aspect-ratio: auto; border-bottom: 0; }
.shot.thumb::after { content: none; }
.shot.thumb img { filter: none; object-fit: contain; }
.shot--placeholder {
    display: grid;
    justify-items: center;
    gap: .8rem;
    padding: clamp(1.4rem, 4vw, 2.6rem);
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.shot--placeholder .dwm-graphic { width: min(260px, 60%); height: auto; }
.shot__note {
    margin: 0;
    max-width: 52ch;
    text-align: center;
    font-size: .8rem;
    line-height: 1.6;
    color: var(--text-faint);
}

.detail__pagetitle { margin: 0 0 .6rem; font-size: 1.05rem; }
.detail__onion { display: block; margin: 0 0 .6rem; }
.detail__onion .onion__value { display: block; padding: .5rem .6rem; line-height: 1.6; }
.detail__copy { margin: 0 0 1rem; }

.spark--days { height: 46px; }

/* A decoded *_json value: nested key/value blocks, indented by one rule. */
.json-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .6rem;
}
.json-list > li {
    padding-left: .8rem;
    border-left: 2px solid var(--border);
}
.panel__body > .kv + .kv { margin-top: .8rem; }
.kv dd > .kv, .json-list .kv { margin-top: .2rem; }

.linkout { margin: 0; padding: 0; list-style: none; }
.linkout__row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    padding: .5rem .9rem;
    border-bottom: 1px solid var(--border);
    box-shadow: inset 3px 0 0 var(--state, transparent);
    font-size: .82rem;
}
.linkout__row:last-child { border-bottom: 0; }
.linkout__name { color: var(--text); text-decoration: none; font-weight: 600; }
a.linkout__name:hover { color: var(--accent); }
.linkout__host {
    margin-left: auto;
    max-width: 24ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .7rem;
}

.headers__status { margin: 0; padding: .7rem .9rem .2rem; }
.headers td:first-child { width: 32%; }
@media (max-width: 720px) {
    .headers td:first-child { width: auto; }
}

.related { margin-top: 2.6rem; }

/* ------------------------------------------------------------- search ----- */

.search-head { margin-bottom: 1.6rem; }
.search-head h1 { margin: 0 0 1rem; overflow-wrap: anywhere; }
.search-page__form {
    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: 46rem;
}
.search-page__form .search-box { flex: 1; }
.search-head__summary {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin: .8rem 0 0;
    font-size: .82rem;
    color: var(--text-dim);
}
.search-tips { display: grid; gap: 1.2rem; }
.search-tips .card__title { font-family: var(--font-display); font-size: .95rem; }
.search-tips .section-head { margin-bottom: .4rem; }

/* ------------------------------------------------------------- submit ----- */

.submit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(1rem, 2.4vw, 1.8rem);
    align-items: start;
}
.submit-layout__aside { display: grid; gap: 1rem; align-content: start; }
@media (max-width: 900px) {
    .submit-layout { grid-template-columns: 1fr; }
}
.submit-form { gap: 1.1rem; }

.steps {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: .5rem;
    font-size: .82rem;
    line-height: 1.55;
    color: var(--text-dim);
}
.steps strong { color: var(--text); }
.steps li::marker { font-family: var(--font-mono); color: var(--accent); }

.submissions { margin-top: 2.6rem; }

/* -------------------------------------------------------------- about ----- */

.about h2 { font-family: var(--font-display); letter-spacing: .03em; }
.about ul { display: grid; gap: .4rem; }
.about__sign { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2.4rem; }

.state-key { display: grid; gap: .6rem; margin: 1rem 0 1.6rem; }
.state-key__row {
    display: grid;
    grid-template-columns: minmax(7.5rem, auto) minmax(0, 1fr);
    align-items: start;
    gap: .5rem 1rem;
    padding: .65rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: inset 3px 0 0 var(--state, var(--border-strong));
}
.state-key__row dt { margin: 0; }
.state-key__row dd { margin: 0; font-size: .84rem; line-height: 1.6; color: var(--text-dim); }
@media (max-width: 620px) {
    .state-key__row { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------- api docs ----- */

.apidoc { max-width: 78ch; }
.apidoc__section { margin-bottom: 2.6rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.apidoc__section h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: .03em;
    margin: 0 0 .7rem;
}
.apidoc__section h2::before { content: '// '; color: var(--accent); }
.apidoc__section h3 {
    font-family: var(--font-mono);
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 1.4rem 0 .5rem;
}
.apidoc__section p { font-size: .88rem; line-height: 1.7; color: var(--text-dim); }
.apidoc__section ul { display: grid; gap: .55rem; font-size: .88rem; line-height: 1.65; color: var(--text-dim); }
.apidoc__section .code { margin: .6rem 0 1rem; }
.apidoc__section .table-wrap { margin: .6rem 0 1rem; }

/* ------------------------------------------------------------ profile ----- */

.profile-head {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
}
.profile-head h1 { margin: 0; overflow-wrap: anywhere; }
.profile-head__meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin: .5rem 0 0;
    font-size: .82rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 1rem;
    align-items: start;
}

.identities { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.identities__row {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    padding: .5rem .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: .82rem;
}
.identities__name { font-weight: 600; color: var(--text); }
.identities__email { font-size: .72rem; }
.identities__row .dim { margin-left: auto; }

.tokens { margin-top: 2.6rem; }
.token-form { margin-bottom: 1.2rem; }
.token-form .form-row { align-items: end; }
.token-form .form-actions { padding-top: 0; }

.newtoken {
    margin-bottom: 1.2rem;
    padding: .9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--border));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--ok) 8%, var(--surface));
}
.newtoken__lead {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0 0 .6rem;
    font-size: .8rem;
    color: var(--ok-ink);
}
.newtoken .code { overflow-wrap: anywhere; }

/* --------------------------------------------------------------- print --- */

@media print {
    .hero__stats, .quick-filters, .filters, .state-filters, .board__more,
    .page-head__actions, .related, .detail__copy { display: none; }
    .detail, .home-split, .hero, .submit-layout { grid-template-columns: 1fr; }
}

/* --------------------------------------------- harvested address lists ---- */

/*
 * Wallets, mail addresses and key ids. One row each, the value in the data
 * face, a copy button on the end - these are copied far more often than read.
 */
.addrs { margin: 0; padding: 0; list-style: none; }
.addrs__row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .9rem;
    border-bottom: 1px solid var(--border);
}
.addrs__row:last-child { border-bottom: 0; }
.addrs__row:hover { background: var(--surface-2); }
.addrs__kind {
    flex: none;
    min-width: 5.5rem;
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.addrs__value { flex: 1; font-size: .74rem; }
.addrs__row .btn { flex: none; }
@media (max-width: 560px) {
    .addrs__row { flex-wrap: wrap; }
    .addrs__value { flex: 1 1 100%; order: 3; }
}

/* -----------------------------------------------------------------------------
   Sign in / register
   -------------------------------------------------------------------------- */

.auth-page {
    width: min(28rem, 100%);
    margin: clamp(1.5rem, 6vw, 4rem) auto;
}

.auth-card .panel__body { display: grid; gap: 1rem; }

.auth-providers { display: grid; gap: .5rem; }

.btn--provider {
    width: 100%;
    justify-content: flex-start;
    gap: .6rem;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.btn--provider:hover,
.btn--provider:focus-visible { background: var(--surface-hover); border-color: var(--accent); }

/* A rule with the label sitting in a gap punched out of it. Drawn with two
   flex-grown pseudo-elements rather than a background gradient, so it lands on
   the pixel grid at any width and needs no hard-coded background colour behind
   the text. */
.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .25rem 0;
    font-family: var(--font-mono);
    font-size: .74rem;
    color: var(--text-faint);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-form { display: grid; gap: .9rem; }
.btn--block { width: 100%; justify-content: center; }

.auth-foot {
    text-align: center;
    font-family: var(--font-mono);
    font-size: .78rem;
}

.auth-note {
    margin: 1rem .25rem 0;
    font-size: .82rem;
    line-height: 1.6;
    color: var(--text-faint);
    text-align: center;
}

.masthead__signup { margin-left: .35rem; }
@media (max-width: 40rem) { .masthead__signup { display: none; } }
