/* Fonts are self-hosted (SIL OFL) so visitor data is not sent to Google. */
@font-face { font-family: "League Spartan"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/league-spartan-600.woff2") format("woff2"); }
@font-face { font-family: "League Spartan"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/league-spartan-700.woff2") format("woff2"); }
@font-face { font-family: "League Spartan"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/league-spartan-800.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --plum: #2a1a4a;
  --pink: #ff8fb1;
  --bg: #ffffff;
  --soft: #f5f5f7;
  --surface: #ffffff;
  --text: #111111;
  --muted: #5f5f66;
  --line: #e7e7ea;
  --line-strong: #c9c9cf;
  --brand: var(--pink);
  --accent: var(--pink);
  --on-pink: #111111;
  --link: #c8326a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .12);
  --radius: 14px;
  --max: 1180px;
  --headline: "League Spartan", "Arial Black", system-ui, sans-serif;
  --display: "League Spartan", Arial, system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
/* Dark theme, chosen from the menu (stored in the browser) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e10;
  --soft: #1a1a1d;
  --surface: #0e0e10;
  --text: #f5f5f5;
  --muted: #a3a3ab;
  --line: #2a2a2e;
  --line-strong: #44444a;
  --link: #ff8fb1;
  --shadow: 0 10px 30px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.masthead { background: var(--bg); color: var(--text); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.masthead__bar { position: relative; display: flex; align-items: center; gap: 24px; min-height: 76px; }
/* Logo: inline SVG. Bubble pink, wordmark follows the text colour. */
.logo { flex-shrink: 0; display: block; margin-right: 12px; color: var(--text); line-height: 0; transition: transform .2s; }
.logo svg { display: block; height: 58px; width: auto; }
.logo:hover { transform: rotate(-2deg) scale(1.03); }
.logo--small svg { height: 50px; }
.nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav__list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav__list li { display: flex; align-items: center; }
.nav__list li + li::before { content: "|"; color: var(--line-strong); font: 600 20px/1 var(--display); padding: 0 8px; }
.nav__list a { position: relative; display: block; padding: 10px 4px 7px; text-decoration: none; font: 800 18px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; color: var(--text); }
.nav__list a::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 3px; border-radius: 2px; background: var(--cat, var(--brand)); transform: scaleX(0); transition: transform .2s; }
.nav__list a:hover::after { transform: scaleX(1); opacity: 0.5; }
.nav__list a[aria-current="page"]::after { transform: scaleX(1); opacity: 1; }
/* Menu button (three lines) and its panel */
.menu-btn { margin-left: auto; flex-shrink: 0; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--soft); }
.menu-btn svg { width: 26px; height: 26px; }
.menu { position: absolute; top: calc(100% + 6px); right: 16px; width: 290px; max-width: calc(100vw - 32px); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; z-index: 7; }
.menu__theme { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; padding: 12px; border: 0; border-radius: 10px; background: none; color: inherit; font: 700 16px/1.2 var(--font); cursor: pointer; text-align: left; }
.menu__theme:hover, .menu__links a:hover { background: var(--soft); }
.switch { position: relative; flex-shrink: 0; width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.menu__theme[aria-checked="true"] .switch { background: var(--pink); }
.menu__theme[aria-checked="true"] .switch::after { transform: translateX(18px); }
.menu__links { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); }
.menu__links a { display: block; padding: 11px 12px; border-radius: 10px; text-decoration: none; font: 600 16px/1.2 var(--font); }

main.wrap { background: var(--surface); padding-top: 24px; padding-bottom: 56px; padding-left: 24px; padding-right: 24px; min-height: 60vh; }

/* Shared bits */
.meta { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.placeholder { display: block; width: 100%; height: 100%; background: radial-gradient(circle at 75% 20%, rgba(255,143,177,.35), transparent 50%), var(--soft); }
.pill { display: inline-block; background: var(--pink); color: var(--on-pink); text-decoration: none; text-transform: uppercase; font: 800 16px/1 var(--display); letter-spacing: 0.04em; padding: 8px 13px 5px; border-radius: 999px; }
.pill:hover { background: var(--text); color: var(--bg); }
.pill--sm { font-size: 12px; padding: 5px 9px 3px; }

/* Story cards */
.card { display: flex; flex-direction: column; min-width: 0; }
.card__figure { position: relative; }
.card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); border-radius: 10px; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card__media img { transform: scale(1.03); }
.card__figure .pill { position: absolute; left: 10px; bottom: 10px; }
.card__title { margin: 12px 0 0; font: 800 27px/1.1 var(--headline); letter-spacing: -0.01em; }
.card__title a { text-decoration: none; }
.card__title a:hover { color: var(--link); }
.card__excerpt { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.card--lead { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.card--lead .card__media { aspect-ratio: 16 / 9; }
.card--lead .card__figure .pill { left: 16px; bottom: 16px; font-size: 19px; }
.card--lead .card__title { font-size: clamp(32px, 4.2vw, 52px); line-height: 1.04; }

/* Front page */
.front { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: start; }
.feed { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.feed > .card { padding: 20px 0; border-bottom: 1px solid var(--line); }
.feed > .card:nth-child(3n) { grid-column: 1 / -1; }
.feed > .card:nth-child(3n) .card__media { aspect-ratio: 16 / 8; }
.feed > .card:nth-child(3n) .card__title { font-size: clamp(28px, 3.2vw, 40px); }

.empty { padding: 48px 0; border-bottom: 1px solid var(--line); }
.empty h1 { font: 800 clamp(34px, 4.4vw, 52px)/1.05 var(--headline); letter-spacing: -0.015em; margin: 0 0 12px; }
.empty p { color: var(--muted); font-size: 18px; max-width: 34em; margin: 0; }

/* Sidebar */
.sidebar { display: grid; gap: 28px; position: sticky; top: 100px; }
.tabs { display: flex; gap: 22px; padding: 0 4px; }
.tabs__btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 0 7px; cursor: pointer; color: var(--muted); font: 800 16px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; border-bottom: 4px solid transparent; }
.tabs__btn svg { width: 18px; height: 18px; }
.tabs__btn[aria-selected="true"] { color: var(--text); border-bottom-color: var(--pink); }
.side-list { list-style: none; margin: -12px 0 0; padding: 0; }
.side-item { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.side-item__thumb { display: block; aspect-ratio: 10 / 9; border-radius: 10px; overflow: hidden; }
.side-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-item__title { display: block; margin-top: 8px; text-decoration: none; font: 700 18px/1.18 var(--display); }
.side-item__title:hover { color: var(--link); }

.box { background: var(--soft); border-radius: var(--radius); padding: 22px; }
.box__title { margin: 0 0 10px; font: 800 26px/1.1 var(--headline); }
.ad-slot { min-height: 250px; display: grid; place-items: center; color: var(--muted); font-size: 13px; border: 2px dashed var(--line); background: none; }

/* Lists (category, latest, related) */
.section { margin-top: 40px; }
.section__title { font: 800 30px/1.1 var(--headline); letter-spacing: -0.01em; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 4px solid var(--pink); }
.grid { display: grid; gap: 28px 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--3 .card__title { font-size: 23px; }
.page-head { border-bottom: 4px solid var(--pink); margin-bottom: 24px; }
.page-head h1 { font: 800 clamp(38px, 5.6vw, 60px)/1.05 var(--headline); letter-spacing: -0.015em; margin: 8px 0 14px; }

.to-top { position: fixed; right: 16px; bottom: 16px; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--pink); color: var(--on-pink); box-shadow: 0 4px 14px rgba(0,0,0,.2); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 6; }
.to-top svg { width: 24px; height: 24px; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* Article */
.article { max-width: 760px; margin: 0 auto; }
.article__head h1 { font: 800 clamp(34px, 5vw, 54px)/1.06 var(--headline); letter-spacing: -0.015em; margin: 16px 0 14px; }
.article__lead { font-size: 20px; color: var(--muted); margin: 0; }
.article__media { margin: 24px 0; }
.article__media img { width: 100%; border-radius: 10px; }
.article__media .placeholder { aspect-ratio: 16 / 9; }
.article__media figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.prose { font: 19px/1.7 var(--serif); }
.prose h1, .prose h2, .prose h3 { font-family: var(--headline); font-weight: 800; line-height: 1.15; }
.prose blockquote { margin: 24px 0; padding-left: 18px; border-left: 5px solid var(--pink); font-style: italic; }
.prose a { color: var(--link); }
.prose table { width: 100%; border-collapse: collapse; font: 15px/1.5 var(--font); margin: 16px 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font: 800 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 2px solid var(--text); }
.page { max-width: 760px; margin: 0 auto; }
.article__foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.article__foot a, .copy-link { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }

/* Reading progress (article pages) */
.read-progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* "Lue myös" inside the article body */
.read-also { margin: 32px 0; padding: 16px 0; border-top: 4px solid var(--pink); border-bottom: 1px solid var(--line); display: grid; gap: 14px; font-family: var(--font); }
.read-also__label { font: 800 15px/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; }
.read-also__item { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; text-decoration: none; color: var(--text); }
.prose .read-also__item { color: var(--text); }
.read-also__thumb { display: block; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; }
.read-also__thumb img { width: 100%; height: 100%; object-fit: cover; }
.read-also__title { font: 800 19px/1.15 var(--headline); }
.read-also__item:hover .read-also__title { color: var(--link); }

/* Footer */
.footer { background: var(--bg); color: var(--muted); border-top: 1px solid var(--line); margin-top: 32px; padding: 36px 0 20px; font-size: 14px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer h2 { font: 800 15px/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--link); }
.footer__legal { color: var(--muted); margin-top: 24px; font-size: 13px; }

@media (max-width: 1180px) {
  .masthead__bar { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-top: 12px; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav__list a { font-size: 17px; padding: 13px 4px 10px; }
  .logo svg { height: 48px; }
}
@media (max-width: 960px) {
  .front { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav__list a { font-size: 14px; letter-spacing: 0; padding: 13px 0 10px; }
  .nav__list li + li::before { font-size: 14px; padding: 0 6px; }
  .logo svg { height: 42px; }
  /* All sections may not fit: the menu scrolls sideways, the fade hints there is more */
  .nav { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .nav.is-end { -webkit-mask-image: none; mask-image: none; }
  main.wrap { padding-left: 16px; padding-right: 16px; padding-top: 16px; }
  .feed, .grid--2, .grid--3, .footer__grid { grid-template-columns: 1fr; }
  .card__title, .grid--3 .card__title { font-size: 24px; }
  .card--lead .card__title { font-size: 32px; }
  .card--lead .card__figure .pill { font-size: 15px; left: 10px; bottom: 10px; }
  .side-item { grid-template-columns: 96px 1fr; }
  .side-item__title { font-size: 17px; }
  .prose { font-size: 18px; }
}
