/**
 * HMMüller Tech — Editorial design system
 *
 * Ported from the Claude Design "Home Editorial" / "Section" components.
 * Fonts: Bricolage Grotesque (display), Newsreader (serif body), Space Mono
 * (labels), Inter (classic single-article body). Colours come from the palette
 * tokens below; switch palettes with [data-palette="…"] on <html>.
 */

/* ── Palette tokens ──────────────────────────────────────────── */
:root {
    /* Default = Mono Ink (light). */
    --paper: #ffffff;
    --ink: #111111;
    --accent: #df3b22;
    --muted: #6b6b6b;
    --deck: #1f1f1f;
    --deck2: #444444;
    --rule: #111111;
    --rule-soft: #dcdcdc;
    --img-bg: #ededed;
    --cap: #8a8a8a;
}

[data-palette="Mono Ink"] {
    --paper: #ffffff; --ink: #111111; --accent: #df3b22; --muted: #6b6b6b;
    --deck: #1f1f1f; --deck2: #444444; --rule: #111111; --rule-soft: #dcdcdc;
    --img-bg: #ededed; --cap: #8a8a8a;
}
[data-palette="Newsprint Vermillion"] {
    --paper: #f5f1e8; --ink: #1a1814; --accent: #df3b22; --muted: #6f6a5e;
    --deck: #38332a; --deck2: #524c40; --rule: #1a1814; --rule-soft: #d8d2c4;
    --img-bg: #e6e0d3; --cap: #8a8475;
}
[data-palette="Cobalt Press"] {
    --paper: #eef0f3; --ink: #15171c; --accent: #2348d6; --muted: #5f6470;
    --deck: #2a2d34; --deck2: #4a4f59; --rule: #15171c; --rule-soft: #d6d9df;
    --img-bg: #dde1e8; --cap: #878c97;
}
[data-palette="Forest Ledger"] {
    --paper: #f2f1e9; --ink: #17201a; --accent: #1f7a4d; --muted: #5f675c;
    --deck: #27332a; --deck2: #45514a; --rule: #17201a; --rule-soft: #d2d6c9;
    --img-bg: #dde2d4; --cap: #828a7c;
}
[data-palette="Midnight Gold"] {
    --paper: #14161d; --ink: #f3ede0; --accent: #e0b24c; --muted: #9a9486;
    --deck: #d6d0c2; --deck2: #b1ab9d; --rule: #f3ede0; --rule-soft: #2b2e38;
    --img-bg: #222632; --cap: #7c7768;
}
[data-palette="Oxblood Bone"] {
    --paper: #f3eee6; --ink: #2a1416; --accent: #8c2b2f; --muted: #6f5f5a;
    --deck: #3a2426; --deck2: #574240; --rule: #2a1416; --rule-soft: #ddd2c8;
    --img-bg: #e7dccf; --cap: #8a7b74;
}

/* ── Base ────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.hmt-editorial {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.hmt-editorial a { color: inherit; text-decoration: none; }
.hmt-editorial img { max-width: 100%; }
.hmt-editorial button { font-family: inherit; }
.hmt-editorial input { font-family: inherit; }

::selection { background: var(--accent); color: var(--paper); }

.ed-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 36px;
}

.ed-main { display: block; }

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
}

/* Rules / dividers */
.ed-line { height: 1px; background: var(--rule-soft); }
.ed-line--ink { height: 1px; background: var(--rule); }
.ed-rule-2 { height: 2px; background: var(--rule); }
.ed-rule-3 { height: 3px; background: var(--rule); }

/* Shared text atoms */
.ed-kicker {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.ed-kicker--lg { font-size: 12px; letter-spacing: 0.12em; }
.ed-meta {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cap);
}
.ed-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
}
.ed-label--accent { color: var(--accent); }
.ed-deck {
    font-family: 'Newsreader', Georgia, serif;
    color: var(--deck);
    line-height: 1.45;
}

/* Figures (aspect-ratio image boxes) */
.ed-figure {
    overflow: hidden;
    background: var(--img-bg);
    border: 1px solid var(--rule);
}
.ed-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-figure--4x3 { aspect-ratio: 4 / 3; }
.ed-figure--5x4 { aspect-ratio: 5 / 4; }
.ed-figure--3x2 { aspect-ratio: 3 / 2; }

/* ── Masthead ────────────────────────────────────────────────── */
.ed-mast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 12px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.ed-mast__tools { display: flex; align-items: center; gap: 16px; }
.ed-mast__btn {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--rule);
    padding: 5px 11px;
    cursor: pointer;
}
.ed-mast__search {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* ── Search panel ────────────────────────────────────────────── */
.ed-search { display: none; padding: 20px 0 16px; border-bottom: 1px solid var(--rule-soft); }
.ed-search.is-open { display: block; }
.ed-search__row {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 12px;
}
.ed-search__input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: clamp(22px, 4vw, 34px);
    letter-spacing: -0.02em;
    color: var(--ink);
}
.ed-search__input::placeholder { color: var(--cap); }
.ed-search__close {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--rule-soft);
    padding: 7px 11px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Wordmark ────────────────────────────────────────────────── */
.ed-brand { text-align: center; padding: 26px 0 20px; }
.ed-brand__link {
    font-weight: 800;
    font-size: clamp(28px, 8vw, 52px);
    letter-spacing: -0.02em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}
.ed-brand__sq {
    width: 11px;
    height: 11px;
    background: var(--accent);
    display: inline-block;
    margin-left: 2px;
    align-self: flex-end;
    margin-bottom: 9px;
}

/* ── Section nav ─────────────────────────────────────────────── */
.ed-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 13px 0;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}
.ed-nav__link { padding: 4px 16px; color: var(--ink); transition: color 0.15s ease; }
.ed-nav__link:hover { color: var(--accent); }
.ed-nav__link.is-active { color: var(--accent); }

/* ── Homepage: lead ──────────────────────────────────────────── */
.ed-lead {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 48px;
    padding: 40px 0 44px;
}
.ed-lead__title {
    font-weight: 800;
    font-size: clamp(38px, 6.4vw, 62px);
    line-height: 0.97;
    letter-spacing: -0.025em;
    margin: 0 0 22px;
}
.ed-lead .ed-kicker { margin-bottom: 18px; display: block; }
.ed-lead__deck {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 22px;
    line-height: 1.42;
    color: var(--deck);
    margin: 0 0 24px;
    max-width: 30ch;
}
.ed-byline {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.ed-lead__caption {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--cap);
    margin-top: 9px;
}

/* ── Homepage: secondary columns ─────────────────────────────── */
.ed-sec {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 30px 0 40px;
}
.ed-sec__col { padding-left: 28px; border-left: 1px solid var(--rule-soft); }
.ed-sec__col:first-child { padding-left: 0; padding-right: 28px; border-left: none; }
.ed-sec__title {
    font-weight: 700;
    font-size: 25px;
    line-height: 1.07;
    letter-spacing: -0.015em;
    margin: 12px 0;
}
.ed-sec__deck {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--deck2);
    margin: 0;
}

/* ── Homepage: river + sidebar ───────────────────────────────── */
.ed-body {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 0;
    padding-top: 8px;
}
.ed-river { padding-right: 48px; }
.ed-river__head { padding: 18px 0 14px; }
.ed-river__row {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-top: 1px solid var(--rule-soft);
    align-items: flex-start;
}
.ed-river__body { flex: 1; min-width: 0; }
.ed-river__title {
    font-weight: 700;
    font-size: 26px;
    line-height: 1.08;
    letter-spacing: -0.018em;
    margin: 10px 0;
}
.ed-river__deck {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--deck2);
    margin: 0 0 12px;
}
.ed-river__img {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--img-bg);
    border: 1px solid var(--rule);
}
.ed-river__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ed-aside { border-left: 1px solid var(--rule); padding-left: 40px; }
.ed-aside__head { padding: 18px 0 6px; }
.ed-aside__head--gap { padding: 28px 0 10px; }
.ed-mostread__row {
    display: flex;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--rule-soft);
    align-items: baseline;
}
.ed-mostread__num {
    font-weight: 800;
    font-size: 30px;
    line-height: 1;
    color: var(--accent);
    flex-shrink: 0;
    width: 36px;
}
.ed-mostread__title {
    font-weight: 700;
    font-size: 17px;
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}

/* Section tag chips */
.ed-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-tag {
    border: 1px solid var(--rule);
    padding: 5px 11px;
    color: var(--ink);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background 0.15s ease, color 0.15s ease;
}
.ed-tag:hover { background: var(--ink); color: var(--paper); }

/* ── Homepage: reviews ───────────────────────────────────────── */
.ed-reviews { padding: 8px 0 16px; margin-top: 28px; border-top: 3px solid var(--rule); }
.ed-reviews__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 20px 0 26px;
}
.ed-h2 { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; margin: 0; }
.ed-more {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}
.ed-revgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.ed-revcard { display: block; }
.ed-revcard .ed-figure { margin-bottom: 16px; }
.ed-revcard__title {
    font-weight: 700;
    font-size: 22px;
    line-height: 1.12;
    letter-spacing: -0.015em;
    margin: 0 0 8px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.ed-foot { margin-top: 40px; border-top: 3px solid var(--rule); }
.ed-foot__top {
    padding: 36px 0 16px;
    display: grid;
    grid-template-columns: 1.3fr 2fr;
    gap: 48px;
}
.ed-foot__brand { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; line-height: 1; margin-bottom: 14px; text-transform: uppercase; }
.ed-foot__blurb {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--deck2);
    margin: 0;
    max-width: 34ch;
}
.ed-foot__cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 18px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    align-content: start;
}
.ed-foot__cols a { color: var(--deck2); transition: color 0.15s ease; }
.ed-foot__cols a:hover { color: var(--accent); }
.ed-foot__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 0 40px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cap);
}
.ed-foot__bottom a { color: var(--cap); }
.ed-foot__bottom a:hover { color: var(--accent); }
.ed-foot__bottom-links { display: flex; gap: 18px; }

/* ── Section / archive listing ───────────────────────────────── */
.ed-sechead { padding: 50px 0 30px; }
.ed-sechead__kicker { display: block; margin-bottom: 16px; }
.ed-sechead__title {
    font-weight: 800;
    font-size: clamp(52px, 11vw, 104px);
    line-height: 0.92;
    letter-spacing: -0.035em;
    margin: 0 0 20px;
}
.ed-sechead__desc {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 21px;
    line-height: 1.45;
    color: var(--deck);
    margin: 0;
    max-width: 54ch;
}

.ed-seclead {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 44px;
    padding: 36px 0 40px;
    align-items: center;
}
.ed-seclead__title {
    font-weight: 800;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.02;
    letter-spacing: -0.025em;
    margin: 14px 0 16px;
}
.ed-seclead__deck {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 18px;
    line-height: 1.5;
    color: var(--deck2);
    margin: 0 0 16px;
}

.ed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 36px;
    padding: 36px 0 16px;
}

/* Listing card (card-review template part) */
.ed-card { display: block; }
.ed-card .ed-figure { margin-bottom: 15px; }
.ed-card__title {
    font-weight: 700;
    font-size: 22px;
    line-height: 1.12;
    letter-spacing: -0.015em;
    margin: 9px 0;
}
.ed-card__deck {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--deck2);
    margin: 0 0 10px;
}

/* ── Pagination ──────────────────────────────────────────────── */
.ed-pagination { padding: 36px 0 8px; }
.ed-pagination .nav-links,
.ed-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.ed-pagination .page-numbers {
    display: inline-flex;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
}
.ed-pagination a.page-numbers:hover { background: var(--ink); color: var(--paper); }
.ed-pagination .page-numbers.current { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.ed-pagination .page-numbers.dots { border: none; }

/* ── 404 ─────────────────────────────────────────────────────── */
.ed-404 { text-align: center; padding: 90px 0 110px; }
.ed-404__code { font-weight: 800; font-size: clamp(80px, 20vw, 160px); line-height: 1; letter-spacing: -0.04em; color: var(--accent); }
.ed-404__title { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; margin: 18px 0 10px; }
.ed-404__text { font-family: 'Newsreader', Georgia, serif; font-size: 18px; color: var(--deck2); margin: 0 0 28px; }
.ed-button {
    display: inline-block;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    border: 1px solid var(--rule);
    padding: 12px 22px;
}
.ed-button:hover { background: var(--accent); border-color: var(--accent); }

/* ── Generic page ────────────────────────────────────────────── */
.ed-page { max-width: 760px; margin: 0 auto; padding: 50px 0 64px; }
.ed-page__title { font-weight: 800; font-size: clamp(34px, 6vw, 52px); line-height: 1.02; letter-spacing: -0.025em; margin: 0 0 28px; }

/* ── Single article (classic layout, palette-tokened) ────────── */
.ed-article {
    max-width: 740px;
    margin: 0 auto;
    padding: 48px 0 8px;
    font-family: 'Inter', system-ui, sans-serif;
}
.ed-article__crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--cap);
    margin-bottom: 18px;
}
.ed-article__crumbs a { color: var(--cap); }
.ed-article__crumbs a.is-cat { color: var(--accent); font-weight: 600; }
.ed-article__title {
    font-size: clamp(32px, 5.5vw, 44px);
    font-weight: 800;
    line-height: 1.07;
    letter-spacing: -0.03em;
    margin: 0 0 20px;
    color: var(--ink);
}
.ed-article__lead {
    font-size: 20px;
    line-height: 1.5;
    color: var(--deck2);
    margin: 0 0 26px;
}
.ed-article__byline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0;
    border-top: 1px solid var(--rule-soft);
    border-bottom: 1px solid var(--rule-soft);
}
.ed-article__avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.ed-article__author { font-size: 14px; }
.ed-article__author strong { display: block; font-weight: 600; color: var(--ink); }
.ed-article__author span { color: var(--cap); }
.ed-article__hero {
    margin: 30px 0 8px;
    overflow: hidden;
    background: var(--img-bg);
    border: 1px solid var(--rule-soft);
}
.ed-article__hero img { width: 100%; display: block; height: auto; }
.ed-article__body { margin-top: 36px; }

/* Pills (tags) */
.ed-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 36px 0 8px; }
.ed-pill {
    background: var(--img-bg);
    color: var(--deck2);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
}
.ed-pill:hover { color: var(--accent); }

/* Prev / next */
.ed-postnav {
    max-width: 740px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 0 8px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.ed-postnav a { color: var(--accent); }
.ed-postnav a:hover { color: var(--ink); }

/* Related ("More reading") */
.ed-related { padding: 40px 0 16px; }
.ed-related__head { border-top: 2px solid var(--rule); padding-top: 16px; margin-bottom: 26px; }
.ed-related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ed-relcard {
    border: 1px solid var(--rule-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ed-relcard__media { aspect-ratio: 16 / 9; background: var(--img-bg); overflow: hidden; }
.ed-relcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-relcard__body { padding: 18px 20px 22px; }
.ed-relcard__title {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.28;
    letter-spacing: -0.01em;
    margin: 9px 0 0;
    color: var(--ink);
}

/* Empty / placeholder note */
.ed-note {
    border: 1px dashed var(--rule-soft);
    padding: 22px;
    text-align: center;
    font-family: 'Newsreader', Georgia, serif;
    color: var(--deck2);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .ed-lead { grid-template-columns: 1fr; gap: 30px; }
    .ed-body { grid-template-columns: 1fr; }
    .ed-river { padding-right: 0; }
    .ed-aside { border-left: none; padding-left: 0; border-top: 3px solid var(--rule); margin-top: 28px; }
    .ed-revgrid { grid-template-columns: repeat(2, 1fr); }
    .ed-seclead { grid-template-columns: 1fr; gap: 26px; }
    .ed-grid { grid-template-columns: repeat(2, 1fr); }
    .ed-related__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
    .ed-wrap { padding: 0 18px; }
    .ed-sec { grid-template-columns: 1fr; }
    .ed-sec__col { border-left: none; padding: 22px 0; border-top: 1px solid var(--rule-soft); }
    .ed-sec__col:first-child { padding: 0 0 22px; border-top: none; }
    .ed-revgrid { grid-template-columns: 1fr; }
    .ed-grid { grid-template-columns: 1fr; }
    .ed-related__grid { grid-template-columns: 1fr; }
    .ed-foot__top { grid-template-columns: 1fr; gap: 26px; }
    .ed-river__row { flex-direction: column-reverse; gap: 16px; }
    .ed-river__img { width: 100%; height: 210px; }
    .ed-mast { flex-wrap: wrap; gap: 6px; justify-content: center; }
    .ed-sechead__title { font-size: 48px; }
}
