/* ============================================================
   beri-polish.css
   ============================================================
   Every rule in this file is additive and reversible. Delete
   this one file and the site returns exactly to its previous
   state — functions.php enqueues it only if it exists, so no
   second edit is needed to undo.

   Loaded after beri.css, so equal-specificity rules win on
   order and nothing here needs !important.

   Scope: the incumbent visual world is preserved. No colour,
   type, layout or copy decision is replaced. What is fixed is
   one contrast defect and the layer of browser surfaces the
   stylesheet never claimed — selection, caret, focus ring,
   scrollbar, form accent, numerals.
   ============================================================ */


/* ------------------------------------------------------------
   1. REFERENZ — white text on a lit bathroom (desktop)
   ------------------------------------------------------------
   On desktop the overlay still sits on the photo, and the photo
   is bright: marble, a white tub, a dusk window. The caption is
   #fff and the stat labels #dbe2e6, both chosen for a dark
   ground — .ref-visual::after was that ground, a bottom-up
   scrim, and it was switched off with `content:none` around
   line 1032 of beri.css. Nothing replaced it, so "Grundfläche"
   and "Ansprechpartner" wash out against the tub.

   The scrim comes back rather than the text getting darker:
   the type colours are correct for the design, it is the
   surface under them that went missing. Bottom-weighted and
   transparent at the top so the photograph still reads.

   Desktop only — below 900px the overlay is a separate pill
   under the photo and has its own ink ground.
   ------------------------------------------------------------ */
@media (min-width:901px){
  html :is(#beri,.beri-root) #projekte .ref-visual::after{
    content:"";
    position:absolute;
    inset:auto 0 0 0;
    height:62%;
    background:linear-gradient(
      to top,
      rgba(12,17,23,.86) 0%,
      rgba(12,17,23,.66) 34%,
      rgba(12,17,23,.28) 68%,
      rgba(12,17,23,0) 100%
    );
    border-radius:0 0 var(--radius-img) var(--radius-img);
    pointer-events:none;
    z-index:1;
  }
  /* the overlay has to sit above the scrim it just gained */
  html :is(#beri,.beri-root) #projekte .ref-overlay{
    z-index:2;
  }
}


/* ------------------------------------------------------------
   2. TEXT SELECTION
   ------------------------------------------------------------
   Undefined, so dragging across any BeRi page produced the
   browser's stock blue — the one colour on the site that
   belongs to no one's design system. Tinted from --blue at a
   weight that keeps ink text readable while selected.
   ------------------------------------------------------------ */
::selection{
  background:rgba(0,153,204,.22);
  color:var(--ink,#1B232E);
}
::-moz-selection{
  background:rgba(0,153,204,.22);
  color:var(--ink,#1B232E);
}
/* on the dark surfaces the same tint would swallow white text */
:is(#beri,.beri-root) .cta-banner ::selection,
:is(#beri,.beri-root) #projekte .ref-overlay ::selection,
:is(#beri,.beri-root) footer.is-dark ::selection{
  background:rgba(0,153,204,.42);
  color:#fff;
}


/* ------------------------------------------------------------
   3. THE FORM'S OWN SURFACES
   ------------------------------------------------------------
   caret-color and accent-color were never set, so the insertion
   point was black and the Datenschutz checkbox rendered in the
   operating system's blue — on Windows a violet-leaning tone
   that sits next to --blue and reads as a mistake.

   The focus ring is the substantive one. beri.css removes it
   (`input:focus{outline:none}`, twice) and signals focus only
   by recolouring the border, which is the same blue the field
   uses on hover and is invisible to anyone tabbing quickly.
   A real ring returns, on :focus-visible only, so it appears
   for keyboard users without boxing every mouse click.
   ------------------------------------------------------------ */
:is(#beri,.beri-root) input,
:is(#beri,.beri-root) textarea{
  caret-color:var(--blue);
}
:is(#beri,.beri-root) input[type="checkbox"],
:is(#beri,.beri-root) input[type="radio"]{
  accent-color:var(--blue);
}
html :is(#beri,.beri-root) input:focus-visible,
html :is(#beri,.beri-root) textarea:focus-visible,
html :is(#beri,.beri-root) select:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:2px;
  border-color:var(--blue);
}


/* ------------------------------------------------------------
   4. KEYBOARD FOCUS EVERYWHERE ELSE
   ------------------------------------------------------------
   Only two elements in ~6,100 lines had a focus style: the
   hamburger and the back-to-top button. Everything else fell
   back to the user agent's ring, which several of the site's
   own treatments then obscured — a 1px UA outline against a
   photographic hero, or against the blue CTA, is not a
   visible indicator.

   One ring, from the palette, offset so it never crowds the
   glyphs. White on dark surfaces so it survives there too.
   ------------------------------------------------------------ */
:is(#beri,.beri-root) a:focus-visible,
:is(#beri,.beri-root) button:focus-visible,
:is(#beri,.beri-root) summary:focus-visible,
:is(#beri,.beri-root) .wp-block-button__link:focus-visible,
:is(#beri,.beri-root) [tabindex]:focus-visible{
  outline:2px solid var(--blue);
  outline-offset:3px;
  border-radius:4px;
}
:is(#beri,.beri-root) .cta-banner a:focus-visible,
:is(#beri,.beri-root) .cta-banner button:focus-visible,
:is(#beri,.beri-root) .mp-hero a:focus-visible,
:is(#beri,.beri-root) footer a:focus-visible{
  outline-color:#fff;
}
/* the primary CTA is already blue — a blue ring on blue is not a ring */
:is(#beri,.beri-root) .btn-primary:focus-visible,
:is(#beri,.beri-root) .wp-block-button:not(.btn-white) > .wp-block-button__link:focus-visible{
  outline-color:var(--ink);
  outline-offset:3px;
}


/* ------------------------------------------------------------
   5. SCROLLBAR
   ------------------------------------------------------------
   The pages are long and the scrollbar is on screen the whole
   time. Left at the platform default it is the one persistent
   element that never joined the design.
   ------------------------------------------------------------ */
html{
  scrollbar-color:#B9C1C9 var(--grey-bg,#EEEEEE);
  scrollbar-width:thin;
}
::-webkit-scrollbar{
  width:11px;
  height:11px;
}
::-webkit-scrollbar-track{
  background:var(--grey-bg,#EEEEEE);
}
::-webkit-scrollbar-thumb{
  background:#B9C1C9;
  border-radius:99px;
  border:3px solid var(--grey-bg,#EEEEEE);
}
::-webkit-scrollbar-thumb:hover{
  background:#95A0AB;
}


/* ------------------------------------------------------------
   6. NUMERALS
   ------------------------------------------------------------
   Fraunces ships proportional figures, so the stat block set
   "14", "12 m²" and "1" on three different optical left edges,
   and the phone number's digits jittered against each other.
   Lining tabular figures where numbers are read as data — not
   in running prose, where proportional is correct.
   ------------------------------------------------------------ */
:is(#beri,.beri-root) .ref-stats p.sn,
:is(#beri,.beri-root) .hero-badge p.num,
:is(#beri,.beri-root) .mp-step .n,
:is(#beri,.beri-root) .strip-inner p strong,
:is(#beri,.beri-root) .contact-info .rv,
:is(#beri,.beri-root) .info-row p.rv{
  font-variant-numeric:tabular-nums lining-nums;
  font-feature-settings:"tnum" 1,"lnum" 1;
}


/* ------------------------------------------------------------
   7. HEADING WRAP
   ------------------------------------------------------------
   Headings that carry an authored <br> keep their own breaks —
   `balance` only acts on lines the browser chose. This stops
   the one-word last line on the headings that wrap freely,
   most visibly the FAQ and section headers at intermediate
   widths.
   ------------------------------------------------------------ */
:is(#beri,.beri-root) h1,
:is(#beri,.beri-root) h2,
:is(#beri,.beri-root) h3{
  text-wrap:balance;
}
:is(#beri,.beri-root) p.eyebrow,
:is(#beri,.beri-root) .mp-step p{
  text-wrap:pretty;
}
