/* Konisto.de Relaunch, Version 3
   Fonts: Merriweather 300/400/700 and Lato 300/400/700 (Google Fonts, linked in each page head).
   Breakpoints: desktop from 1000px, tablet 720 to 999px, phone up to 719px. */

/* ------------------------------------------------------------------ Tokens */
:root {
  --red: #ff0020;          /* logo block, step numbers, » markers. Never under small white text */
  --red-strong: #d6001b;   /* buttons: white text reaches 5.4:1 */
  --red-hover: #b30016;
  --surface: #ffffff;
  --paper: #f7f5f1;        /* page ground, sidebar */
  --sand: #e3e0d0;         /* top bar */
  --sand-200: #e5e0d0;     /* header bars, rules, author band */
  --sand-hover: #d3cdb6;
  --ink: #222222;
  --black: #000000;
  --muted: #545454;
  --link: #0d6aff;         /* on surface only */
  --edge: #8a8577;         /* input and ad-slot outlines, 3:1 on surface */
  --legal: #b8b3a5;        /* small print on black */

  --serif: Merriweather, Georgia, serif;
  --sans: Lato, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1128px;
  --gut: 24px;
  --sheet-pad: 32px;
  --sheet-rise: 130px;     /* how far the white sheet climbs into the hero photo */

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ------------------------------------------------------------------ Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--paper); }
img { display: block; max-width: 100%; }
a { color: var(--link); }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--sand-200); color: var(--black); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.footer a:focus-visible, .ticker a:focus-visible, .ticker button:focus-visible { outline-color: var(--surface); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Underline that draws in on hover; put .ul on the text, .hov on the link or row */
.ul { background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size 200ms var(--ease-out); }
.go { display: inline-block; transition: transform 200ms var(--ease-out); }

/* ------------------------------------------------------------------ Top bar */
.topbar { background: var(--sand); }
.topbar__in { display: flex; align-items: stretch; }
.logo { flex: none; margin-right: 6px; }
.logo img { height: 48px; width: auto; }
.nav { display: flex; flex-wrap: wrap; }
.nav a { display: flex; align-items: center; min-height: 48px; padding: 0 11px; font-size: 14px; line-height: 1.2; color: var(--black); text-decoration: none; transition: background-color 150ms ease; }
.menu-btn { display: none; }

/* ------------------------------------------------------------------ Hero with search */
.hero { position: relative; height: 460px; overflow: hidden; background: var(--sand-200); }
.hero--article { height: 300px; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: drift 14s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.hero--article .hero__img { object-position: 50% 88%; }
.hero .wrap { position: relative; padding-top: 48px; }
.search { display: flex; max-width: 600px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); animation: drop 560ms var(--ease-out) 140ms both; }
.search input { flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 18px; font: 400 18px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--surface); border-radius: 0; transition: border-color 150ms ease; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus { border-color: var(--ink); }
.search button { flex: none; width: 56px; height: 56px; padding: 0; font-size: 24px; line-height: 1; color: var(--surface); background: var(--red-strong); border: 0; border-radius: 0; cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--ease-out); }

/* ------------------------------------------------------------------ Page: sheet and sidebar */
.page { display: flex; align-items: stretch; padding-bottom: 64px; }
.sheet { position: relative; flex: 1 1 0; min-width: 0; margin-top: calc(var(--sheet-rise) * -1); padding: 28px var(--sheet-pad) 48px; background: var(--surface); display: flex; flex-direction: column; gap: 28px; }
.side { flex: none; width: 348px; padding: 24px; display: flex; flex-direction: column; gap: 28px; }
.h-page { font: 300 30px/1.4 var(--serif); color: var(--ink); }
.h-section { padding-bottom: 6px; border-bottom: 1px solid var(--sand-200); font: 300 27px/1.4 var(--serif); color: var(--ink); }

/* ------------------------------------------------------------------ Photos */
.thumb { flex: none; overflow: hidden; border: 1px solid var(--black); background: var(--sand-200); aspect-ratio: 1 / 1; }
.thumb img, .cat__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 240ms var(--ease-out); }
.thumb--l { width: 160px; }
.thumb--m { width: 100px; }
.thumb--s { width: 60px; }

/* ------------------------------------------------------------------ Article teaser */
.teaser { display: flex; align-items: flex-start; gap: 20px; padding: 20px 0; border-top: 2px solid var(--sand-200); color: var(--ink); text-decoration: none; }
.teaser:first-child { padding-top: 0; border-top: 0; }
.teaser__body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.teaser__title { font: 300 24px/1.4 var(--serif); color: var(--black); }
.teaser__text { font-size: 17px; line-height: 1.6; }
.more { color: var(--link); white-space: nowrap; }

/* ------------------------------------------------------------------ Category blocks */
.cats { padding-top: 28px; border-top: 2px solid var(--sand-200); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 30px; }
.cat { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cat__img { display: block; overflow: hidden; aspect-ratio: 400 / 125; background: var(--sand-200); }
.cat__title { padding-bottom: 4px; border-bottom: 1px solid var(--sand-200); font: 300 27px/1.4 var(--serif); }
.cat__title a { color: var(--black); text-decoration: none; }
.cat__list li { display: flex; gap: 8px; transition: transform 200ms var(--ease-out); }
.cat__list li::before { content: "»"; color: var(--red); }
.cat__list a { padding: 3px 0; color: var(--black); text-decoration: none; }

/* ------------------------------------------------------------------ Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 22px; font: 700 15px var(--sans); color: var(--surface); background: var(--red-strong); border: 0; border-radius: 4px; text-decoration: none; cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.btn--l { min-height: 48px; padding: 0 24px; font-size: 16px; }
.btn--center { align-self: center; }
.btn:active, .search button:active, .check-btn:active, .ticker__btn:active { transform: scale(0.97); }
.check-btn { min-height: 44px; padding: 0 18px; font: 700 15px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--ink); border-radius: 4px; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out); }
.check-btn[aria-pressed="true"] { color: var(--surface); background: var(--ink); }

/* ------------------------------------------------------------------ Ad slots: every slot is labelled and keeps a fixed height */
.ad { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ad__label { font-size: 13px; line-height: 1.2; color: var(--muted); }
.ad__slot { width: 100%; padding: 0 16px; display: flex; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--edge); background: var(--surface); font-size: 14px; line-height: 1.4; color: var(--muted); }
.ad__slot--rect { max-width: 300px; height: 250px; }
.ad__slot--incontent { max-width: 336px; height: 280px; }
.ad__slot--half { max-width: 300px; height: 600px; }
.ad--sticky { position: sticky; top: 16px; }
.only-phone { display: none; }

/* ------------------------------------------------------------------ Sidebar widget */
.widget__title { background: var(--sand-200); font: 700 16px/40px var(--serif); text-align: center; color: var(--ink); }
.widget__row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--surface); font: 400 15px/1.55 var(--serif); color: var(--black); text-decoration: none; transition: transform 200ms var(--ease-out); }

/* ------------------------------------------------------------------ Ticker */
.ticker { display: flex; align-items: stretch; background: var(--black); }
.ticker__btn { flex: none; min-width: 108px; min-height: 56px; padding: 0 16px; font: 700 14px var(--sans); color: var(--surface); background: var(--ink); border: 0; border-radius: 0; cursor: pointer; transition: transform 160ms var(--ease-out); }
.ticker__view { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.ticker__track { display: flex; width: max-content; animation: tick 60s linear infinite; }
.ticker__run { display: flex; }
.ticker__run a { display: flex; align-items: center; gap: 28px; min-height: 56px; padding-left: 28px; font: 300 18px/1.3 var(--serif); color: var(--surface); text-decoration: none; white-space: nowrap; }
.ticker__run a::after { content: "»"; color: var(--red); }
.ticker.is-paused .ticker__track, .ticker:focus-within .ticker__track { animation-play-state: paused; }

/* ------------------------------------------------------------------ Author band */
.authors { background: var(--sand-200); }
.authors__in { display: flex; align-items: flex-start; gap: 32px 64px; padding-top: 56px; padding-bottom: 56px; }
.authors__text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.authors__text p { max-width: 52ch; font-size: 17px; }
.authors__links { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.authors__links a { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 0; border-top: 1px solid var(--edge); font: 300 19px/1.4 var(--serif); color: var(--black); text-decoration: none; transition: transform 200ms var(--ease-out); }
.authors__links a:first-child { border-top: 0; }
.authors__links a::before { content: "»"; color: var(--red); }

/* ------------------------------------------------------------------ Footer */
.footer { background: var(--black); color: var(--surface); }
.footer__in { display: flex; flex-direction: column; gap: 12px; padding-top: 40px; padding-bottom: 28px; }
.footer__menu, .footer__legal { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; }
.footer__name { display: flex; align-items: center; gap: 10px; font: 400 20px/44px var(--serif); }
.footer a { display: flex; align-items: center; min-height: 44px; color: var(--surface); text-decoration: underline; text-underline-offset: 3px; }
.footer__blurb { max-width: 680px; font-weight: 300; }
.footer__legal { margin-top: 12px; padding-top: 8px; border-top: 1px solid #3a3a3a; font-size: 14px; color: var(--legal); }
.footer__legal a { color: var(--legal); }
.footer__legal span { line-height: 44px; }

/* ------------------------------------------------------------------ Article page */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--sand-200); font-size: 15px; line-height: 1.4; color: var(--muted); }
.crumbs a { display: flex; align-items: center; min-height: 32px; color: var(--muted); text-decoration: none; }
.crumbs [aria-current] { color: var(--ink); }
.art-head { display: flex; flex-direction: column; gap: 14px; }
.art-title { font: 300 38px/1.4 var(--serif); color: var(--ink); text-wrap: balance; }
.art-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 15px; line-height: 1.4; color: var(--muted); }
.art-meta a { color: var(--ink); text-underline-offset: 3px; }
.level { display: inline-flex; align-items: center; gap: 8px; }
.level__bars { display: flex; flex-direction: column; gap: 3px; }
.level__bars i { display: block; width: 22px; height: 4px; background: var(--sand-200); }
.level__bars i.on { background: var(--ink); }
.lede { max-width: 64ch; font-size: 20px; line-height: 1.65; text-wrap: pretty; }

.needs { display: flex; flex-direction: column; gap: 10px; }
.needs__box { border: 1px solid var(--sand-200); }
.needs__title { background: var(--sand-200); font: 700 16px/44px var(--sans); text-align: center; color: var(--ink); }
.needs__row { display: flex; align-items: center; justify-content: space-between; gap: 0 16px; min-height: 48px; padding: 0 16px; border-top: 1px solid var(--sand-200); }
.needs__row label { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.needs__row input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.needs__row input:checked + span { text-decoration: line-through; color: var(--muted); }
.needs__row a, .author a { display: flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
.needs__row a { flex: none; white-space: nowrap; }
.note { font-size: 14px; line-height: 1.5; color: var(--muted); }

.progress { position: sticky; top: 0; z-index: 1; padding: 10px 0; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.progress__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
.progress__row h2 { font: 300 27px/1.4 var(--serif); color: var(--ink); }
.progress__count { font-size: 15px; color: var(--muted); }
.progress__track { height: 6px; overflow: hidden; background: var(--sand-200); }
.progress__fill { height: 100%; background: var(--red); transform-origin: left center; transform: scaleX(0); transition: transform 320ms var(--ease-out); }

.step { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.step__head { display: flex; align-items: stretch; font-family: var(--serif); font-weight: 700; }
.step__num { flex: none; width: 44px; font-size: 21px; line-height: 44px; text-align: center; color: var(--surface); background: var(--red); transition: background-color 260ms ease; }
.step.is-done .step__num { background: var(--ink); }
.step__title { padding: 0 24px; font-size: 17px; line-height: 44px; color: var(--ink); background: var(--sand-200); }
.step p { max-width: 66ch; font-size: 18px; line-height: 1.7; text-wrap: pretty; }

.author { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 18px 0; border-top: 2px solid var(--sand-200); border-bottom: 2px solid var(--sand-200); }
.author__name { font: 400 17px/1.5 var(--serif); }
.related { display: flex; flex-direction: column; gap: 4px; }
.related__row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--sand-200); color: var(--ink); text-decoration: none; transition: transform 200ms var(--ease-out); }
.related__row:first-of-type { border-top: 0; }
.related__title { display: block; font: 300 20px/1.4 var(--serif); color: var(--black); }
.related__cat { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ Motion */
@keyframes drift { from { transform: scale(1.1) translate3d(-1.2%, 1%, 0); } to { transform: scale(1.01); } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); } to { transform: none; } }
@keyframes zoomout { from { transform: scale(1.16); } to { transform: none; } }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.enter { animation: rise 480ms var(--ease-out) both; }
.enter--2 { animation-delay: 70ms; }
.enter--3 { animation-delay: 130ms; }
.enter--4 { animation-delay: 200ms; }
.enter--5 { animation-delay: 270ms; }

/* Scroll reveals: movement only, nothing is ever hidden. Browsers without scroll timelines show the page still. */
@supports (animation-timeline: view()) {
  .reveal { animation: up linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  .zoomout { animation: zoomout linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
}
.zoomout { width: 100%; height: 100%; }

@media (hover: hover) and (pointer: fine) {
  .nav a:hover { background: var(--sand-hover); }
  .hov:hover .ul { background-size: 100% 1px; }
  .hov:hover .thumb img, .hov:hover .cat__img img { transform: scale(1.03); }
  .hov:hover .go, .btn:hover .go, .search button:hover .go { transform: translateX(4px); }
  .btn:hover, .search button:hover { background: var(--red-hover); }
  .cat__list li:hover, .widget__row:hover, .related__row:hover, .authors__links a:hover { transform: translateX(5px); }
  .ticker:hover .ticker__track { animation-play-state: paused; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__img, .ticker__track, .reveal, .zoomout { animation: none; }
  .enter, .search { animation: fade 200ms ease both; }
  .go, .ul, .thumb img, .cat__img img, .cat__list li, .widget__row, .related__row, .authors__links a, .btn, .check-btn, .search button, .progress__fill { transition: none; }
  .hov:hover .thumb img, .hov:hover .cat__img img, .hov:hover .go, .cat__list li:hover, .widget__row:hover, .related__row:hover, .authors__links a:hover, .btn:active, .check-btn:active { transform: none; }
}

/* ------------------------------------------------------------------ Tablet: 720 to 999px. The sidebar moves under the sheet as two columns. */
@media (max-width: 999px) {
  .page { flex-direction: column; align-items: stretch; }
  .side { width: auto; padding: 32px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; align-items: start; }
  .ad--sticky { position: static; }
  .authors__in { flex-direction: column; }
  .authors__links, .authors__text { flex: none; width: 100%; }
}

/* ------------------------------------------------------------------ Phone: up to 719px */
@media (max-width: 719px) {
  :root { --gut: 16px; --sheet-pad: 20px; --sheet-rise: 72px; }

  /* Top bar: logo and a Menü button; the six categories open as a list below */
  .topbar__in { flex-wrap: wrap; justify-content: space-between; padding: 0 var(--gut) 0 0; }
  .logo { margin: 0; }
  .js .menu-btn { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px 0 16px; font: 700 15px var(--sans); color: var(--black); background: none; border: 0; cursor: pointer; }
  .menu-btn::after { content: "»"; display: inline-block; transform: rotate(90deg); transition: transform 200ms var(--ease-out); }
  .menu-btn[aria-expanded="true"]::after { transform: rotate(-90deg); }
  .nav { flex: none; width: 100%; flex-direction: column; padding-left: var(--gut); border-top: 1px solid var(--surface); }
  .js .nav { display: none; }
  .js .nav.is-open { display: flex; animation: fade 160ms ease both; }
  .nav a { min-height: 48px; padding: 0; font-size: 16px; border-bottom: 1px solid var(--surface); }
  .nav a:last-child { border-bottom: 0; }

  .hero { height: 250px; }
  .hero--article { height: 180px; }
  .hero .wrap { padding-top: 24px; }
  .search input { height: 52px; font-size: 16px; padding: 0 14px; }
  .search button { width: 52px; height: 52px; }

  .page { padding-bottom: 40px; }
  .sheet { padding-top: 22px; padding-bottom: 32px; gap: 24px; }
  .h-page { font-size: 26px; }
  .h-section, .cat__title, .progress__row h2 { font-size: 23px; }

  .teaser { gap: 14px; padding: 16px 0; }
  .thumb--l { width: 96px; }
  .thumb--m { width: 80px; }
  .teaser__title { font-size: 19px; line-height: 1.35; }
  .teaser__text { font-size: 16px; line-height: 1.5; }

  .cats { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 24px; }
  .cat__list a { padding: 8px 0; }   /* 44px rows for thumbs */
  .btn--center { align-self: stretch; justify-content: center; }

  /* Ads: one 300 × 250 in the content, one after the content. The 300 × 600 is a desktop format. */
  .ad__slot--incontent { max-width: 300px; height: 250px; }
  .only-desktop { display: none; }
  .only-phone { display: inline; }
  .ad.only-desktop { display: none; }

  .side { grid-template-columns: minmax(0, 1fr); padding-top: 24px; gap: 24px; }
  .widget__row { padding: 10px 0; }

  .ticker__btn { min-width: 88px; min-height: 48px; font-size: 13px; }
  .ticker__run a { min-height: 48px; font-size: 16px; gap: 20px; padding-left: 20px; }
  .authors__in { padding-top: 40px; padding-bottom: 40px; gap: 24px; }
  .authors .h-page { font-size: 24px; }
  .authors .btn { align-self: stretch; justify-content: center; }
  .footer__menu, .footer__legal { gap: 0 20px; }

  .crumbs { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .crumbs > * { flex: none; }
  .art-title { font-size: 28px; line-height: 1.35; }
  .art-meta { gap: 6px 16px; }
  .lede { font-size: 18px; line-height: 1.6; }
  .step p { font-size: 17px; line-height: 1.65; }
  .step__head { align-self: stretch; }
  .step__title { flex: 1 1 auto; padding: 0 16px; font-size: 16px; }
  .check-btn { align-self: stretch; }
  .needs__row { padding: 0 12px; }
  .related__title { font-size: 18px; }
}
