/* ==========================================================================
   HS Digi alle 30-vuotiaille — campaign landing page
   Skeleton: design tokens -> viewport scaffold -> sections.
   Token values inlined from the SNDP design system (HS brand, light mode)
   so the page is standalone-safe on kampanjat.hs.fi.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* colour — semantic */
  --nof-semantic-color-foreground-primary: #191919;
  --nof-semantic-color-foreground-secondary: #555558;
  --nof-semantic-color-foreground-tertiary: #88888b;
  --nof-semantic-color-foreground-negative: #ffffff;
  --nof-semantic-color-background-content-default: #ffffff;
  --nof-semantic-color-background-content-highlight: #efeff2;
  --nof-semantic-color-background-content-tint: #f0ebe8;
  --nof-semantic-color-brand-primary: #000000;
  --nof-semantic-color-brand-secondary: #436b95;
  --nof-semantic-color-sales-default: #3860ff;

  /* colour — core HS */
  --nof-core-color-hs-yellow: #fffd43;
  --nof-core-color-hs-gray-70: #e9eaed;

  /* typography */
  /* Names + weights per the live SNDP design-tokens docs (nof-ds.sanoma-sndp.fi),
     semantic.typography.content/ui tokens for the Helsingin Sanomat brand. */
  --font-display: 'Sanomat News Headline', Georgia, Baskerville, serif; /* content.headline, weight 700-900 */
  --font-content: 'Sanomat News', Georgia, Baskerville, serif;          /* content.body 400 / ui.title 800 */
  --font-body: 'Helsingin News', Helvetica, Arial, sans-serif;          /* ui.cta/ui.label, weight 500 */
  --font-subtitle: 'Helsingin News', Helvetica, Arial, sans-serif;      /* ui.subtitle, weight 600 */

  /* spacing — 4pt base */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-s: 12px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --radius-card: 8px;   /* /tilaa/ product card: #combo .hss-col-third */
  --radius-pill: 30px;  /* /tilaa/ .button */
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 16px;
  --radius-full: 9999px;

  /* --------------------------------------------------------------------
     2. VIEWPORT SCAFFOLD
     Breakpoints live here as the single source of truth. Note that
     @container / @media cannot read custom properties, so the literal
     values are repeated in the query conditions below — change both.
     -------------------------------------------------------------------- */
  --bp-sm: 640px;   /* small phone -> large phone   */
  --bp-md: 768px;   /* phone -> tablet              */
  --bp-lg: 1024px;  /* tablet -> small desktop      */
  --bp-xl: 1280px;  /* desktop                      */

  --page-max: 100%;        /* full-bleed page width              */
  --content-max: 920px;    /* reading measure for text sections  */
  --gutter: var(--space-l);
  --section-space: var(--space-2xl);
}

/* --------------------------------------------------------------------------
   3. RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-content);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--nof-semantic-color-foreground-primary);
  background: var(--nof-core-color-hs-gray-70);
  text-wrap: pretty;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0; }

a { color: var(--nof-semantic-color-brand-secondary); text-decoration: underline; }
a:hover { color: color-mix(in srgb, var(--nof-semantic-color-brand-secondary) 88%, #000); }

/* --------------------------------------------------------------------------
   4. PAGE SHELL
   Every section is a container, so the layout responds to the width it is
   actually given — not the browser window. That makes the review switcher
   below behave exactly like a real device width.
   -------------------------------------------------------------------------- */
.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  /* No background here: it would sit above the fixed hero-bg in the stacking
     order (see .hero-bg) and hide it. Each section supplies its own bg instead. */
}

.page > * {
  container-type: inline-size;
  container-name: section;
}

/* Review switcher: html[data-viewport="375"] etc. Set by the inline script
   from ?viewport= in the URL. Remove with the script before publishing. */
html[data-viewport] .page { box-shadow: 0 0 0 1px var(--nof-core-color-hs-gray-70); }
html[data-viewport="375"]  .page { max-width: 375px; }
html[data-viewport="414"]  .page { max-width: 414px; }
html[data-viewport="768"]  .page { max-width: 768px; }
html[data-viewport="1024"] .page { max-width: 1024px; }
html[data-viewport="1440"] .page { max-width: 1440px; }

/* --------------------------------------------------------------------------
   5. SHARED
   -------------------------------------------------------------------------- */
.section-title {
  margin: 0 0 var(--space-l);
  font-family: var(--font-content);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.lede {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-align: left;
}

.lede--inverse { color: var(--nof-semantic-color-foreground-negative); }


.body { font-size: 1.0625rem; color: var(--nof-semantic-color-foreground-secondary); }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-xl);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.btn:focus-visible { outline: 2px solid var(--nof-semantic-color-brand-secondary); outline-offset: 2px; }

.btn--dark { background: var(--nof-semantic-color-brand-primary); color: var(--nof-semantic-color-foreground-negative); }
.btn--dark:hover { background: #2b2b2b; color: var(--nof-semantic-color-foreground-negative); }

.btn--light { background: var(--nof-core-color-hs-yellow); color: var(--nof-semantic-color-brand-primary); }
.btn--light:hover { background: color-mix(in srgb, var(--nof-core-color-hs-yellow) 88%, #000); color: var(--nof-semantic-color-brand-primary); }

/* --------------------------------------------------------------------------
   6. HEADER
   -------------------------------------------------------------------------- */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  padding: var(--space-l) var(--gutter);
}

/* The PDF's wordmark specimen uses the bundled Sanomat News Headline face. */
.site-header__logo,
.site-header__logo:hover {
  display: block;
  width: min(332px, 70vw);
  margin-inline: auto;
  text-decoration: none;
}

.site-header__logo img { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   7. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  /* Always exactly one fold. The spacer/content split below absorbs any extra
     space a very tall title would otherwise need, so this never has to grow. */
  height: 100vh;
}

/* Fixed to the viewport, not .hero: it never scrolls, later sections just paint over it.
   Negative z-index is required — position:fixed with z-index:auto still stacks above
   normal in-flow content regardless of DOM order. */
.hero-bg { position: fixed; inset: 0; z-index: -1; }

/* Transparent to layout: .hero-bg__img still sizes itself against .hero-bg, not <picture>. */
.hero-bg picture { display: contents; }

.hero-bg__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 40%;
}

.hero__inner {
  /* Fixed to exactly one fold, split into a spacer (top half) and content
     (bottom half) so the title always starts at vertical center by default —
     the spacer shrinks first if a very tall title needs more room, so the
     fold never overflows into #teksti-1. */
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 var(--gutter) var(--space-2xl);
}

.hero__spacer { flex: 0 1 50%; }

.hero__content {
  /* Grows to absorb any leftover space below the spacer (basis 50%), but
     never shrinks below its own content — the spacer gives way first. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 0 auto;
  min-height: 0;
}

.hero__title {
  margin: 0;
  width: min(100%, 8.8ch);
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(11vw, 17vw, 12rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  font-variant-numeric: lining-nums;
  color: var(--nof-core-color-hs-yellow);
  text-wrap: pretty;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.24);
}

@media (max-width: 767px) {
  .hero__title {
    width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    font-size: clamp(16vw, 8vh, 21.5vw);
  }
}

@media (min-width: 768px) {
  .hero__inner { padding-bottom: 0; }
  .hero__spacer { flex: 1 1 50%; }
  .hero__content { flex: 0 1 55%; }
  .hero__title-line { display: block; }
  .hero__title-mobile-break { display: none; }
  .hero__title {
    width: 100%;
    font-size: min(clamp(11vw, 13.5vw, 15.5rem), 14.5vh, 10.8vw);
  }
  /* "alle 30-vuotiaille" is the box's own widest line (shrink-to-fit), but the
     browser's wrap decision still breaks it at the hyphen a few px short —
     nowrap keeps it on one line; the tiny overhang falls on the dark artwork. */
  .hero__title-line { white-space: nowrap; }
}

.hero__cta {
  /* Fills the remaining space in the fold below the title, centered per fix request. */
  align-self: center;
  margin-top: 2em;
  font-family: var(--font-subtitle);
}

/* --------------------------------------------------------------------------
   8. TEXT BLOCKS
   -------------------------------------------------------------------------- */
.text-block {
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  background: #f7f7f5;
  border-top: 1px solid #e1e1dc;
  border-bottom: 1px solid #e1e1dc;
}

.text-block__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  /* Wider than --content-max on purpose: on laptop widths this reads almost
     full-bleed, ~40px from the edge combined with .text-block's own gutter
     padding — no extra padding added, just a wider cap. */
  max-width: min(calc(100% - 32px), 1600px);
  margin-inline: auto;
}

.text-block--onimage {
  background-color: var(--nof-semantic-color-brand-primary);
  background-image: url("../images/pattern.png");
  background-size: cover;
  background-position: center;
}

.text-block--onimage .text-block__inner {
  padding: var(--space-xl);
  background: rgba(0, 0, 0, 0.72);
  border-radius: var(--radius-l);
}

/* --------------------------------------------------------------------------
   9. OFFER / PRODUCT CARD
   -------------------------------------------------------------------------- */
.offer {
  /* Bigger mobile padding + smaller tile shows more of the "4,90" artwork around the card. */
  padding: clamp(231px, 10vw, 129px) var(--gutter);
  background-color: var(--nof-semantic-color-brand-primary);
  background-image: url("../images/4.90-taustakuva.svg");
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-position: top;
}

.offer__inner {
  max-width: 420px;
  margin-inline: auto;
}

.product {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Generous block padding on mobile so the card doesn't feel cramped edge to edge. */
  padding: 48px var(--space-l) 36px;
  background: var(--nof-core-color-hs-yellow);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.product__name {
  margin: 0;
  font-family: var(--font-content);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.product__image { width: 78%; height: auto; }

.product__feature,
.product__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  line-height: 1.2;
}

.product__feature { font-size: 1.0625rem; margin-bottom: 16px; }

.product__price {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.1;
  margin-bottom: 8px;
}

.product__price strong { font-size: 2.25rem; font-weight: 700; }

.product__price-normal {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.2;
  color: var(--nof-semantic-color-foreground-secondary);
  text-decoration: line-through;
  margin-bottom: 24px;
}

.product__cta { align-self: stretch; margin-bottom: 16px; }

.product__note { font-size: 0.875rem; }

.product__note .icon { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   10. FAQ
   -------------------------------------------------------------------------- */
.faq {
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  background: #f7f7f5;
}

.faq__inner { max-width: var(--content-max); margin-inline: auto; }

.faq .section-title {
  text-align: left;
  /* inline-block, not inline: with this custom font's metrics, an inline
     box's background can miss the half-leading strip below the text. */
  display: inline-block;
  padding: 8px;
  background: var(--nof-semantic-color-brand-primary);
  color: var(--nof-core-color-hs-yellow);
}

.faq__list { display: flex; flex-direction: column; }

.faq__item { border-top: 1px solid var(--nof-semantic-color-background-content-highlight); }
.faq__item:last-child { border-bottom: 1px solid var(--nof-semantic-color-background-content-highlight); }

.faq__q {
  padding: var(--space-m) var(--space-xl) var(--space-m) 0;
  font-family: var(--font-content);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq__q::-webkit-details-marker { display: none; }

.faq__q::after {
  content: "";
  position: absolute;
  right: var(--space-xs);
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 160ms ease-out;
}

.faq__item[open] .faq__q::after { transform: translateY(-30%) rotate(225deg); }

.faq__a {
  padding: 0 var(--space-xl) var(--space-m) 0;
  font-family: var(--font-content);
  font-size: 1.75rem;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   11. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  padding: var(--space-xl) var(--gutter);
  background: var(--nof-semantic-color-brand-primary);
  color: var(--nof-semantic-color-foreground-negative);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  align-items: center;
  max-width: var(--page-max);
  margin-inline: auto;
}

.site-footer__logo {
  display: block;
  width: min(180px, 45vw);
}

.site-footer__logo img { width: 100%; height: auto; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-m);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

.site-footer__links a { color: var(--nof-semantic-color-foreground-negative); }
.site-footer__links a:hover { color: var(--nof-core-color-hs-yellow); }

/* --------------------------------------------------------------------------
   12. CONTAINER QUERIES
   Each section reacts to its own width. Values mirror --bp-* above.
   -------------------------------------------------------------------------- */
@container section (min-width: 640px) {
  .lede { font-size: 2rem; }
  .section-title { font-size: 2rem; }
}

@container section (min-width: 768px) {
  .site-footer__inner { flex-direction: row; justify-content: space-between; }
}

/* @media, not @container: .text-block/.faq establish their own container,
   so they can't query their own width (same reason as .offer below). */
@media (min-width: 768px) {
  .text-block { padding-block: var(--space-3xl); }
  .faq { padding-block: var(--space-3xl); }
}
@container section (min-width: 1024px) {
  .hero__inner {
    padding-inline: var(--space-3xl);
    max-width: var(--page-max);
    margin-inline: auto;
  }
  .hero__title { max-width: 12ch; }
  .lede { font-size: 2.25rem; }
  .section-title { font-size: 2.25rem; }
  .offer__inner { max-width: 460px; }
  .product { padding: var(--space-xl) var(--space-l) var(--space-l); }
}

/* @media, not @container: .offer establishes its own container, so it can't
   query its own width — a container query here would never match. */
@media (min-width: 768px) {
  /* Wider than the artwork: tile it at a fixed size so the "4,90" stays
     legible instead of being blown up by cover. */
  .offer {
    padding-block: 96px;
  }
}
