/* ============================================================
   CAFÉ FUNDSTÜCK — HEBREW EDITION, RTL LAYER

   Loaded AFTER ../styles.css and ONLY by the two pages in /he/.
   It does exactly two jobs and nothing else:

   1. Hebrew type. The three root faces (Alfa Slab One, Special Elite,
      Newsreader) are Latin-only subsets — a Hebrew page on them falls back
      to Arial and the whole printed-paper world collapses. The three
      replacements keep the same three JOBS the root stylesheet assigns:
        Suez One         → the poster slab. Display: name, headings, prices.
        Miriam Libre     → the typed label. Numbers, tags, captions, forms.
        Frank Ruhl Libre → the reading serif. Sentences.

   2. Mirroring, but only where the layout carries meaning. Decorative pins,
      tape and the coffee ring stay where the German page puts them — paper
      does not care which way you read. What DOES get mirrored: anything a
      reader parses in reading order (ledger columns, receipt values, form
      ticks, arrows, the stamped inventory range that sits in the label's
      empty end).

   Every rule below is scoped to [dir="rtl"]. Nothing here can reach the DE
   or EN pages even if the file is loaded by accident.
   ============================================================ */

/* ---------- 1. Hebrew faces ----------
   Subsets pulled straight from the Google Fonts CSS API and self-hosted, so
   the page makes no third-party request (same rule as the root fonts/).
   Hebrew and Latin ship as separate files with their own unicode-range: a
   Hebrew page still prints Latin digits, prices and "WhatsApp", and loading
   the Latin cut of the SAME family keeps those consistent with the Hebrew
   around them instead of dropping to Arial mid-sentence.

   font-display: optional, not swap — the root stylesheet's deliberate CLS
   decision, kept. Both Hebrew files are preloaded in the page <head>, so the
   real face is ready inside the 100 ms block period. */
@font-face {
  font-family: "SuezOne";
  src: url("fonts/suezone-hebrew.woff2?v=5b48f695") format("woff2");
  font-weight: 100 900;   /* one cut mapped to every request, so the browser
                             never synthesises a fake bold — as in the root */
  font-style: normal;
  font-display: optional;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "SuezOne";
  src: url("fonts/suezone-latin.woff2?v=42584ada") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "MiriamLibre";
  src: url("fonts/miriamlibre-hebrew.woff2?v=54154d13") format("woff2");
  font-weight: 400 700;   /* real variable axis, so 700 is drawn, not faked */
  font-style: normal;
  font-display: optional;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "MiriamLibre";
  src: url("fonts/miriamlibre-latin.woff2?v=0433ab09") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "FrankRuhl";
  src: url("fonts/frankruhl-hebrew.woff2?v=57720a88") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "FrankRuhl";
  src: url("fonts/frankruhl-latin.woff2?v=7e38047d") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The three custom properties the whole stylesheet reads. Re-pointing them
   here is why no other type rule has to be touched: every font-family in
   styles.css goes through var(--display) / var(--type) / var(--body).
   Arial before the generic: it is the one Hebrew-capable face present on
   every Windows, macOS, Android and iOS machine, and David/Times drop to a
   serif that has no Hebrew at all on some of them. */
[dir="rtl"] {
  --display: "SuezOne", Arial, sans-serif;
  --type:    "MiriamLibre", Arial, sans-serif;
  --body:    "FrankRuhl", Arial, serif;
}

/* Hebrew has no uppercase. text-transform: uppercase is a no-op on Hebrew
   letters but still stretches Latin runs inside the same label, so the
   kickers read half-shouted. Letter-spacing is worse: it breaks Hebrew word
   shapes, which have no ascender/descender rhythm to survive it. */
[dir="rtl"] .kicker,
[dir="rtl"] .brand-sub,
[dir="rtl"] .b-name-sub,
[dir="rtl"] .memo-h,
[dir="rtl"] .b-lead-h,
[dir="rtl"] .reg-rom,
[dir="rtl"] .beleg-h,
[dir="rtl"] .beleg-sub,
[dir="rtl"] .confirm-k,
[dir="rtl"] .confirm-h3,
[dir="rtl"] .ledger caption,
[dir="rtl"] .ledger thead th,
[dir="rtl"] .day-w {
  text-transform: none;
  letter-spacing: 0;
}

/* Suez One sets very tight. The root's negative tracking was cut for Alfa
   Slab's Latin and closes Hebrew counters up. */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] .brand-name {
  letter-spacing: 0;
}

/* ---------- 2. Reading-order mirroring ---------- */

/* the skip link parks off-screen above the same corner the reader starts in */
[dir="rtl"] .skip { left: auto; right: var(--gut); }

/* the inventory range is stamped into the label's EMPTY end — which flips */
[dir="rtl"] .b-name .stampmark { right: auto; left: calc(var(--u) * 2.4); }
[dir="rtl"] .confirm-stamp { right: auto; left: calc(var(--u) * 2); }

/* the coffee ring sits on the ledger's blank margin, not on the numbers */
[dir="rtl"] .ledger-box::after { right: auto; left: calc(var(--u) * 3.4); }

/* the inventory book: four columns read right-to-left, price column last */
[dir="rtl"] .ledger caption { text-align: right; }
[dir="rtl"] .ledger th,
[dir="rtl"] .ledger td {
  text-align: right;
  padding-inline: 0 .8em;
}
[dir="rtl"] .ledger .c-pr {
  text-align: left;
  padding-inline-end: 0;
}
/* "Nr." is printed by the stylesheet, not the markup, so it needs its own
   Hebrew here or every menu card says Nr. in a Hebrew sentence */
[dir="rtl"] .entry-no::before { content: "מס' "; }

/* the red-pen correction arrow points back at the field it belongs to */
[dir="rtl"] .err::before { content: "\21B2\00A0"; }
/* → becomes ← : the arrow means "onward", and onward is leftward here */
[dir="rtl"] .link-arrow::after { content: " \2190"; }

/* the form's field number is stamped in the margin the reader starts at */
[dir="rtl"] .step { margin-right: 0; margin-left: .55em; }
/* a floated legend floats to the side the text starts on */
[dir="rtl"] .fs legend { float: right; }

/* 404 · the hand-ticked box moves to the right of its label */
[dir="rtl"] .zone-b { padding: 14px 38px 14px 6px; }
[dir="rtl"] .zone-b::before { left: auto; right: 2px; }
[dir="rtl"] .zone input:checked + .zone-b::after { left: auto; right: 6px; }

/* the receipt: label on the right, value on the left of each dotted line */
[dir="rtl"] .beleg-l dd,
[dir="rtl"] .confirm-l dd { text-align: left; }

/* the ticked "what happens now" list */
[dir="rtl"] .confirm-next li { padding: .6em 1.5em .6em 0; }
[dir="rtl"] .confirm-next li::before { left: auto; right: .1em; }

/* ---------- 3. Bidi safety ----------
   A price, a time or a phone number is a Latin-digit run inside a Hebrew
   sentence. Unicode's bidi algorithm already gets these right on their own,
   but a run that ENDS in a neutral (the dotted leader, a colon, a dash)
   gets re-ordered against the surrounding paragraph. Isolating the numeric
   cells costs nothing and removes the whole class of bug. */
[dir="rtl"] .entry-price,
[dir="rtl"] .pre-p,
[dir="rtl"] .beleg-items .bi-p,
[dir="rtl"] .beleg-sum b,
[dir="rtl"] .ledger .c-pr,
[dir="rtl"] .ledger .c-nr,
[dir="rtl"] .slot-b,
[dir="rtl"] .day-d,
[dir="rtl"] .st-n,
[dir="rtl"] .tag-nr,
[dir="rtl"] .entry-no {
  unicode-bidi: isolate;
}

/* The phone field is typed left-to-right whatever the page direction:
   03-555-1234 typed into an RTL input lands with the dashes in the wrong
   places on screen, which reads as a typo the visitor cannot fix. */
[dir="rtl"] #f-phone {
  direction: ltr;
  text-align: right;
}
