/* Blog-Erweiterung für „Abnahme“. Baut auf site.css auf. */

body.area-blog { --pen: var(--ink); }

/* Kopf: Hauptnavigation des Blogs */
.mainnav a[data-area="blog"] { --c: var(--ink); }
.mainnav a[data-area="projekte"] { --c: var(--ink); }

/* ---------- Kopf der Startseite ---------- */
.masthead { padding-block: clamp(2.5rem, 2rem + 4vw, 5.5rem) clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1.5px solid var(--ink); }
.masthead .kicker { color: var(--ink-2); }
.masthead h1 { font-size: var(--fs-5xl); font-stretch: 150%; font-weight: 900; letter-spacing: -0.035em; line-height: 0.88; margin-top: 0.5rem; }
.masthead h1 .marked { --pen: var(--red); }
.masthead .lede { margin-top: 1.5rem; max-width: 46ch; }
@media (width < 40rem) { .masthead h1 { font-size: 13vw; font-stretch: 110%; } }

/* ---------- Aufmacher ---------- */
.lead-post { display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); margin-top: clamp(2rem, 4vw, 3rem); position: relative;
  @media (width >= 60rem) { grid-template-columns: 1.35fr 1fr; align-items: end; }
  & .film img { aspect-ratio: 16 / 9; object-fit: cover; }
  & h2 { font-size: var(--fs-2xl); font-stretch: 115%; line-height: 1.05; margin-top: 0.6rem; hyphens: manual; }
  & h2 a { text-decoration: none; &::after { content: ""; position: absolute; inset: 0; } }
  &:has(h2 a:hover, h2 a:focus-visible) h2 { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.12em; }
  & p.ex { margin-top: 1rem; color: var(--ink-2); }
  & .meta { margin-top: 1rem; } }

/* Metazeile */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; font-family: var(--f-head); font-size: var(--fs-s); color: var(--ink-2); }
.meta .chips { display: inline-flex; }

/* ---------- Kontaktbogen der Beiträge ---------- */
.blog-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); margin-top: clamp(2.5rem, 5vw, 4rem);
  @media (width >= 64rem) { grid-template-columns: 1fr 19rem; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-bottom: 1.5px solid var(--ink); padding-bottom: 0.6rem;
  & h2 { font-size: var(--fs-xl); font-stretch: 120%; }
  & a { font-family: var(--f-head); font-weight: 700; font-size: var(--fs-s); } }

.frames { list-style: none; padding: 0; margin: 0; }
.frame { container: frame / inline-size; position: relative; border-bottom: 1px solid var(--rule);
  & .frame-in { display: grid; gap: 0.75rem 1.5rem; padding-block: 1.4rem; }
  & .no { font-family: var(--f-head); font-stretch: 60%; font-weight: 700; font-size: var(--fs-s); color: var(--ink-2); padding-top: 0.2rem; }
    & .thumb .film { padding: 3px 3px 0; }
  & .thumb img { aspect-ratio: 16 / 9; object-fit: cover; }
  & .thumb figcaption { padding: 0.2rem 0.2rem 0.3rem; }
  & .txt { display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
  & h3 { font-size: clamp(1.25rem, 1rem + 1.6cqi, 1.75rem); font-stretch: 112%; font-weight: 780; line-height: 1.1; }
  & h3 a { text-decoration: none; &::after { content: ""; position: absolute; inset: 0; } }
  & p.ex { color: var(--ink-2); font-size: var(--fs-s); max-width: 60ch; }
  &:has(h3 a:hover, h3 a:focus-visible) { & h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.14em; }
    & .film { outline: 2px solid var(--ink); outline-offset: 2px; } }
  & .chips { position: relative; z-index: 1; } }
@container frame (inline-size > 34rem) {
  .frame .frame-in { grid-template-columns: 15rem 1fr; }
}

/* Seitenleiste */
.side { display: grid; gap: 2.5rem; align-content: start; }
.side h2 { font-size: var(--fs-l); font-stretch: 115%; border-bottom: 1.5px solid var(--ink); padding-bottom: 0.5rem; }
.mini-proofs { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.75rem; }
.mini-proof { --pen: var(--c); position: relative; display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.75rem; align-items: center;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; padding: 0.6rem; box-shadow: 0 2px 0 var(--rule);
  &[data-p="warum"] { --c: var(--red); } &[data-p="ncc"] { --c: var(--blue); } &[data-p="halle77drive"] { --c: var(--green); }
  &[data-p="jenseits-des-systems"] { --c: var(--rust); } &[data-p="alarm-im-darm"] { --c: var(--pink); }
  & .film { padding: 2px; } & img { aspect-ratio: 1; object-fit: cover; }
  & .plate { aspect-ratio: 1; padding: 0.35rem; font-size: 0.6rem; } & .plate b { font-size: 0.8rem; }
  & a { font-family: var(--f-head); font-weight: 800; font-stretch: 115%; text-decoration: none; line-height: 1.1; display: block;
    &::after { content: ""; position: absolute; inset: 0; } }
  & span.s { font-family: var(--f-head); font-size: var(--fs-xs); color: var(--ink-2); }
  &:has(a:hover, a:focus-visible) { border-color: var(--c); box-shadow: 0 2px 0 var(--c); } }
.rubrics { list-style: none; padding: 0; margin: 1rem 0 0; display: grid;
  & li { border-bottom: 1px solid var(--rule); }
  & a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; text-decoration: none; font-family: var(--f-head); font-weight: 650;
    &:hover { text-decoration: underline; } }
  & .n { color: var(--ink-2); font-variant-numeric: tabular-nums; }
  & ul { list-style: none; padding: 0 0 0.4rem 1rem; } & ul a { padding: 0.25rem 0; font-weight: 550; font-size: var(--fs-s); } & ul li { border: 0; } }

/* ---------- Beitragsliste mit Filter ohne JavaScript ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.75rem; border: 0; padding: 0;
  & legend { font-family: var(--f-head); font-size: var(--fs-s); color: var(--ink-2); margin-bottom: 0.5rem; width: 100%; padding: 0; }
  & label { font-family: var(--f-head); font-size: var(--fs-s); font-weight: 650; padding: 0.35rem 0.85rem; border: 1.5px solid var(--rule); border-radius: 999px; cursor: pointer; background: var(--sheet); }
  & input { position: absolute; opacity: 0; pointer-events: none; }
  & label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--table); }
  & label:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; } }
.archive { margin-top: 1.5rem; }
.archive h2.month { font-size: var(--fs-m); font-stretch: 100%; font-weight: 700; color: var(--ink-2); margin-top: 2.25rem; padding-bottom: 0.4rem; border-bottom: 1.5px solid var(--ink); }
.archive .frames:has(> li:only-child) {}
.filterable:has(#f-ki:checked) .frame:not([data-r~="ki"]),
.filterable:has(#f-tut:checked) .frame:not([data-r~="tutorials"]),
.filterable:has(#f-home:checked) .frame:not([data-r~="homelab"]),
.filterable:has(#f-games:checked) .frame:not([data-r~="games"]),
.filterable:has(#f-musik:checked) .frame:not([data-r~="musik"]),
.filterable:has(#f-allg:checked) .frame:not([data-r~="allgemein"]) { display: none; }
.empty-note { display: none; margin-top: 1rem; color: var(--ink-2); }
.filterable:has(#f-games:checked) .empty-note { display: block; }
.filterable:has(#f-games:checked) .archive { display: none; }

/* ---------- Beitrag ---------- */
.post-head { padding-block: clamp(2rem, 2rem + 3vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.post-head h1 { font-size: var(--fs-4xl); font-stretch: 128%; max-width: 20ch; margin-top: 0.75rem; }
.post-head .meta { margin-top: 1.25rem; }
.post-head .lede { margin-top: 1.25rem; }
.post-cover { max-width: 44rem; }
.post-cover img { aspect-ratio: 16 / 9; object-fit: cover; }
.post-layout { display: grid; gap: 2.5rem; padding-block: clamp(2rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem);
  @media (width >= 68rem) { grid-template-columns: 14rem minmax(0, 1fr); gap: 4rem; } }
.toc { font-family: var(--f-head); font-size: var(--fs-s);
  @media (width >= 68rem) { position: sticky; top: 5.5rem; align-self: start; }
  & h2 { font-size: var(--fs-s); font-stretch: 100%; color: var(--ink-2); font-weight: 650; }
  & ol { list-style: none; padding: 0; margin-top: 0.6rem; border-left: 2px solid var(--rule); display: grid; }
  & a { display: block; padding: 0.3rem 0 0.3rem 0.9rem; text-decoration: none; color: var(--ink-2); margin-left: -2px; border-left: 2px solid transparent;
    &:hover { color: var(--ink); border-left-color: var(--ink); } }
  & .facts { margin-top: 1.75rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 0.9rem;
    & dt { color: var(--ink-2); } & dd { margin: 0; font-weight: 650; } } }
.article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; max-width: var(--measure); min-width: 0;
  & h2 { font-size: var(--fs-2xl); font-stretch: 118%; margin-top: 1.5rem; scroll-margin-top: 6rem; }
  & ul { padding-left: 1.2em; display: grid; gap: 0.4rem; }
  & figure.film { margin-block: 0.75rem; width: min(100%, 52rem); }
  & figure.film figcaption span:first-child { color: var(--edge); } }
.translated { display: flex; gap: 0.75rem; align-items: start; background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: 0.9rem 1rem; font-size: var(--fs-s);
  & .marked { --pen: var(--green); flex: none; } }
.post-foot { border-top: 1.5px solid var(--ink); padding-block: 2rem 0; display: grid; gap: 1.5rem;
  @media (width >= 48rem) { grid-template-columns: 1fr 1fr; } }
.pn { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; padding: 1rem 1.1rem; display: grid; gap: 0.35rem;
  & span { font-family: var(--f-head); font-size: var(--fs-xs); color: var(--ink-2); }
  & a { font-family: var(--f-head); font-weight: 750; font-stretch: 108%; text-decoration: none; line-height: 1.2; &::after { content: ""; position: absolute; inset: 0; } }
  &:has(a:hover) { border-color: var(--ink); }
  &.next { text-align: right; } }

/* ---------- Projekte ---------- */
.proj-updates { list-style: none; padding: 0; margin: 0.25rem 0 0; display: grid; gap: 0.35rem; font-size: var(--fs-s);
  & li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; }
  & time { font-family: var(--f-head); color: var(--ink-2); }
  & a { position: relative; z-index: 1; } }

/* Suche-Symbol im Kopf */
.searchlink { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 999px; border: 1.5px solid transparent; color: var(--ink);
  &:hover, &[aria-current] { border-color: var(--ink); } }

/* Hinweis: Beitrag nur auf Deutsch */
.lang-note { background: var(--sheet); border: 1.5px dashed var(--ink-2); border-radius: 4px; padding: 0.8rem 1rem; font-size: var(--fs-s); max-width: var(--measure); }
.only-de { font-family: var(--f-head); font-size: var(--fs-xs); font-weight: 650; color: var(--ink-2); border: 1.5px dashed var(--ink-2); border-radius: 999px; padding: 0.05rem 0.5rem; }

/* Suche */
.search-box { margin-top: 1.5rem; display: flex; gap: 0.5rem; max-width: 40rem;
  & input { flex: 1; font: inherit; font-size: var(--fs-l); padding: 0.6rem 0.9rem; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--sheet); color: var(--ink); min-width: 0; } }
.search-count { margin-top: 1rem; font-family: var(--f-head); font-size: var(--fs-s); color: var(--ink-2); }
mark { background: color-mix(in oklab, var(--edge) 40%, transparent); color: inherit; padding: 0 0.1em; }

/* Seiten (Musik, Hardware …) */
.page-body { padding-block: 0 clamp(3rem, 6vw, 5rem); }
.article .film video { width: 100%; }
.article table { margin-block: 0.5rem; }
.article blockquote { margin: 0; padding-left: 1.1rem; border-left: 3px solid var(--rule); font-style: italic; }
.article img:not(.film img) { border-radius: 2px; }
.article pre { white-space: pre; }
.article table { display: block; overflow-x: auto; }
.article code { overflow-wrap: anywhere; }
.embed-link a { font-family: var(--f-head); font-weight: 700; }
.proof:not([data-p="warum"], [data-p="ncc"], [data-p="halle77drive"], [data-p="jenseits-des-systems"], [data-p="alarm-im-darm"]) { --c: var(--ink); }
.proof .strip picture img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

/* Changelog auf Projektseiten */
.changelog { list-style: none; padding: 0; margin: 1.25rem 0 0; border-top: 1.5px solid var(--ink); max-width: 52rem;
  & li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.25rem 1.25rem; padding: 0.65rem 0; border-bottom: 1px solid var(--rule); }
  & time { font-family: var(--f-head); font-size: var(--fs-s); font-weight: 700; color: var(--ink-2); padding-top: 0.15em; }
  & .cl-more { font-family: var(--f-head); font-weight: 700; font-size: var(--fs-s); white-space: nowrap; &::after { content: " →"; } }
  @media (width < 30rem) { & li { grid-template-columns: 1fr; } } }
.cl-older { margin-top: 1rem; max-width: 52rem;
  & summary { cursor: pointer; font-family: var(--f-head); font-weight: 700; }
  & .changelog { margin-top: 0.75rem; } }

/* Hochkant-Videos (Shorts) als Raster */
.article .shorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem 0.9rem; margin-block: 1rem 1.5rem;
  & figure { margin: 0; }
  & video { width: 100%; aspect-ratio: 9 / 16; border-radius: 2px; }
  & figcaption { font-size: var(--fs-s); margin-top: 0.4rem; line-height: 1.4; } }
