/*
 * Kortalan Forma — type tokens
 * ===========================================================================
 *
 * Every type size and line height the home page uses, in one place. Enqueued
 * before style.css (see kf_assets() in functions.php), which reads these and
 * sets no size of its own.
 *
 * Why here and not in style.css: the home page's sections were drawn at
 * different times against different mockups, and the only way to keep them
 * one system is to have one list to argue about. Change a value here and
 * every place that role appears follows.
 *
 * How it is organised
 * -------------------
 * Tokens are named after the ROLE the type plays, not after the element or
 * the size. Every token has a value at every width, so the rules in style.css
 * never need a media query for type — the breakpoint work happens below.
 *
 * `1rem = 10px` (html { font-size: 62.5% }), so 1.4rem reads as 14px.
 *
 * Fluid values: `clamp(floor, vw, ceiling)` reaches the ceiling at the 1440
 * design grid and falls back to the floor at the 967px breakpoint, where the
 * fixed design figures do not fit. The floor is always the size the theme
 * used before, so nothing shrinks compared with the old layout.
 *
 * Not yet tokenised: the work page, the contact and thank-you pages, the
 * drawer and the Forminator overrides still carry their own sizes in
 * style.css. They are on their own pages and no home page section shares
 * their scale; fold them in here when one of them next gets touched.
 */

:root {
  /* --- The shared scale ------------------------------------------------
     These five are the site's voice. `.t-mono`, `.t-label`, `.t-lead`,
     `.t-heading` and `.t-display` are the classes that print them. */
  --fs-mono: 1.2rem;              --lh-mono: 1.2rem;
  --fs-label: 1.2rem;             --lh-label: 1.2rem;
  --fs-lead: 1.6rem;              --lh-lead: 1.8rem;
  --fs-heading: 2.2rem;           --lh-heading: 2.2rem;
  --fs-display: 2.2rem;           --lh-display: 2.2rem;

  /* Body copy, and the oversized statement 404.php still uses. */
  --fs-body: 1.6rem;
  /* `normal` on narrow screens is what the block inherited before there was
     a token for it; the design only fixes the line at desktop. */
  --fs-about-body: var(--fs-body);  --lh-about-body: normal;
  --fs-statement: clamp(3.4rem, 7.6vw, 12rem);

  /* --- Status bar ------------------------------------------------------
     Five roles on one line; they are sized separately because the brand has
     to win and the numbers have to stay out of the way. */
  --fs-brand: 1.2rem;             --lh-brand: 1.2rem;
  --fs-readout: 1.2rem;           /* clock, city, scroll percentage */
  --fs-nav: 1.2rem;
  --fs-nav-num: 1.2rem;
  --fs-cta: 1.2rem;
  --lh-topbar: 1.2rem;            /* anything in the bar without its own */

  /* The band that opens under the bar from "Munkáink" and "Tevékenységünk": the
     name is the large type, the sentence under it a caption. */
  --fs-navmenu-name: 2.8rem;      --lh-navmenu-name: 1;
  --fs-navmenu-blurb: 1.3rem;

  /* --- Captions ---------------------------------------------------------
     The caption is the sales line, so it sits a step above its index. These
     two are the home page's small-text sizes: everything else in the page
     body is pulled onto them, at the bottom of this file. */
  --fs-caption: 1.2rem;             --lh-caption: 1.2rem;
  --fs-caption-index: 1.2rem;       --lh-caption-index: 1.2rem;

  /* --- Detail strip ----------------------------------------------------- */
  --fs-strip-head: var(--fs-mono);
  --fs-strip-label: var(--fs-mono);
  --fs-strip-caption: var(--fs-label);  --lh-strip-caption: 1.35;

  /* --- The downloadable guide -------------------------------------------
     Two shapes: the narrow panel on a work page and the wide band on the
     home page. The narrow one stays a panel; the wide one is the page's one
     conversion moment, so it outranks the section headings instead of
     matching them — it used to borrow --fs-heading, which is exactly what
     made it read as one more gallery label. */
  --fs-offer-title: 1.8rem;             --lh-offer-title: 1.25;
  --fs-offer-text: 1.4rem;              --lh-offer-text: 1.9rem;
  --fs-offer-title-wide: clamp(2.2rem, 2.4vw, 3.4rem);  --lh-offer-title-wide: 1.12;
  --fs-offer-text-wide: 1.6rem;         --lh-offer-text-wide: 2.1rem;
  --fs-offer-point: 1.4rem;             --lh-offer-point: 1.4;

  /* --- The embedded form -----------------------------------------------
     Forminator's own markup, restyled. It renders in the offer band on the
     home page and on the contact page, so its type belongs to the scale. */
  --fs-form-label: 1rem;
  --fs-form-input: 1.7rem;
  --fs-form-note: 1.1rem;
  --fs-form-submit: 1.1rem;
  --fs-form-response: 1.3rem;

  /* --- Footer ----------------------------------------------------------- */
  --fs-footer-mail: 2.6rem;       --lh-footer-mail: 1.15;

  /* --- Landing page ----------------------------------------------------
     The kitchen page (page-egyedi-konyhabutor-budapest.php) is read, not
     browsed: headings are sentences, not labels, so they sit well below the
     shared --fs-heading, which is sized for one or two words. */
  --fs-land-h1: clamp(3.4rem, 9vw, 4.4rem);       --lh-land-h1: 1.04;
  --fs-land-h2: 2.8rem;                           --lh-land-h2: 1.1;
  --fs-land-h3: 1.9rem;                           --lh-land-h3: 1.25;
  --fs-land-body: 1.6rem;                         --lh-land-body: 1.55;

  /* --- Home page intro (under the wordmark) ----------------------------
     A sentence and two buttons, so it is sized like the landing page's
     headings, not like a label. The buttons are deliberately large: size,
     not only colour, is what makes them the thing to press. */
  --fs-hero-lead: clamp(2.2rem, 5.6vw, 2.6rem);   --lh-hero-lead: 1.12;
  --fs-hero-btn: 1.8rem;
  --fs-hero-btn-main: 2rem;

  /* The proof band: one large figure, the rest set as short headings. */
  --fs-proof-num: clamp(7rem, 20vw, 9rem);
  --fs-proof-big: clamp(2.2rem, 6vw, 3rem);
  --fs-proof-note: 1.3rem;
}

/* Narrow: the status bar compacts so brand, clock and percentage stay on one
   line once the location has been dropped. Sizes only — the gaps that go with
   them live beside the .topbar rules in style.css. */
@media (max-width: 560px) {
  :root {
    --fs-brand: 1.15rem;
    --fs-readout: 1.15rem;
    --fs-nav: 1.15rem;
    --fs-nav-num: 1.15rem;
    --fs-cta: 1.15rem;
    --lh-brand: 1.15rem;
    --lh-topbar: 1.15rem;
  }
}

@media (max-width: 380px) {
  :root {
    --fs-brand: 1.05rem;
    --fs-readout: 1.05rem;
    --fs-nav: 1.05rem;
    --fs-nav-num: 1.05rem;
    --fs-cta: 1.05rem;
    --lh-brand: 1.05rem;
    --lh-topbar: 1.05rem;
  }
}

/* The home page speaks in one small size.
   Everything in the page body that used to sit at the shared label size — the
   "(Összes munka)" block, the Rólunk links, the statement and trio captions,
   the counters — is pulled onto the caption sizes, so the page has one voice
   for small text instead of two a hair apart. The captions themselves do not
   move: they are what the rest is measured against.
   Scoped to `main` on purpose: the status bar has its own five sizes, and the
   footer and the drawer are chrome shared with every other page, so neither
   should change size when you land on the home page. */
body.home main {
  --fs-label: var(--fs-caption);        --lh-label: var(--lh-caption);
  --fs-mono: var(--fs-caption-index);   --lh-mono: var(--lh-caption-index);
}

/* Desktop: the design grid's own figures. */
@media (min-width: 967px) {
  :root {
    --fs-mono: 1.4rem;            --lh-mono: 1.6rem;
    --fs-label: 1.4rem;           --lh-label: 1.6rem;
    --fs-lead: 5rem;              --lh-lead: 5.7rem;
    --fs-heading: 5.9rem;         --lh-heading: 5.7rem;
    --fs-display: 8.5rem;         --lh-display: 8.5rem;

    --fs-about-body: 2rem;        --lh-about-body: 2.4rem;

    --fs-brand: clamp(1.4rem, 1.39vw, 2rem);      --lh-brand: 1;
    --fs-readout: clamp(1.4rem, 1.11vw, 1.6rem);
    --fs-nav: clamp(1.4rem, 1.25vw, 1.8rem);
    --fs-nav-num: clamp(1.4rem, 1.04vw, 1.5rem);
    --fs-cta: clamp(1.4rem, 1.11vw, 1.6rem);
    --lh-topbar: var(--lh-label);
    --fs-navmenu-name: clamp(3.2rem, 2.9vw, 4.2rem);
    --fs-navmenu-blurb: 1.4rem;

    --fs-caption: clamp(1.4rem, 1.25vw, 1.8rem);        --lh-caption: 1.2;
    --fs-caption-index: clamp(1.4rem, 1.11vw, 1.6rem);  --lh-caption-index: 1.2;

    --fs-strip-head: clamp(1.4rem, 1.11vw, 1.6rem);
    --fs-strip-caption: clamp(1.4rem, 1.11vw, 1.6rem);

    --fs-offer-title: 2.2rem;
    --fs-offer-text-wide: 2.1rem;      --lh-offer-text-wide: 2.8rem;
    --fs-offer-point: 1.8rem;

    --fs-footer-mail: 5.9rem;          --lh-footer-mail: 1.05;

    --fs-land-h1: clamp(5.2rem, 5.4vw, 8rem);
    --fs-land-h2: clamp(3.6rem, 3.6vw, 5.2rem);
    --fs-land-h3: clamp(2rem, 1.5vw, 2.4rem);
    --fs-land-body: clamp(1.7rem, 1.25vw, 1.9rem);

    --fs-hero-lead: clamp(3.2rem, 3.6vw, 5.4rem);
    --fs-hero-btn: 2rem;
    --fs-hero-btn-main: 2.4rem;
    --fs-proof-num: clamp(10rem, 12vw, 18rem);
    --fs-proof-big: clamp(2.8rem, 2.6vw, 4rem);
    --fs-proof-note: 1.4rem;
  }
}
