/* PStyle — global styles (loaded on every page).
   Luxury minimalism: monochrome base + one accent (var(--accent)), generous
   whitespace, sharp corners, hairline rules, serif display + grotesque body.
   Raw values live only in tokens.css; everything here references var(--…).
   Sections: reset · base type · links · buttons · forms · containers ·
   utilities · top-bar · header + nav · mobile nav · footer · reveal · a11y. */

/* ============================================================ Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: var(--w-reg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure {
  margin: 0;
}

/* ============================================================ Base type */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.4em;
  font-family: var(--font-display);
  font-weight: var(--w-med);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--ink);
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
  font-family: var(--font-body);
  font-weight: var(--w-semi);
  line-height: 1.3;
  letter-spacing: 0;
}

p {
  margin: 0 0 1.2em;
}

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  font-weight: var(--w-semi);
}

small {
  font-size: var(--step--1);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--sp-5) 0;
}

/* Accent word inside a heading — the single deliberate use of colour. */
.ps-accent {
  color: var(--accent);
}

/* Eyebrow / kicker label above headings. */
.ps-eyebrow {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: var(--w-semi);
  text-transform: uppercase;
  letter-spacing: var(--letter-wide);
  color: var(--muted);
}

/* ============================================================ Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
}

/* Prose links inside rich content get a hairline underline. */
.ps-prose a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
}

.ps-prose a:hover,
.ps-prose a:focus-visible {
  text-decoration-color: var(--accent);
}

/* Text link with trailing arrow. */
.ps-textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--step--1);
  font-weight: var(--w-semi);
  text-transform: uppercase;
  letter-spacing: var(--letter-mid);
}

.ps-textlink .ps-icon {
  width: 1.1em;
  height: 1.1em;
  transition: transform var(--dur-fast) var(--ease);
}

.ps-textlink:hover .ps-icon,
.ps-textlink:focus-visible .ps-icon {
  transform: translateX(0.25em);
}

/* ============================================================ Buttons */
.ps-btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 1.9em;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: var(--w-semi);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: var(--letter-mid);
  border-radius: var(--radius);
  transition:
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.ps-btn:hover,
.ps-btn:focus-visible {
  color: var(--btn-fg);
}

.ps-btn--sm {
  padding: 0.7em 1.35em;
}

.ps-btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--white);
  --btn-bd: var(--accent);
}

.ps-btn--primary:hover,
.ps-btn--primary:focus-visible {
  --btn-bg: var(--accent-hover);
  --btn-bd: var(--accent-hover);
  color: var(--white);
}

.ps-btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
}

.ps-btn--ghost:hover,
.ps-btn--ghost:focus-visible {
  --btn-bd: var(--ink);
  color: var(--ink);
}

/* Ghost button on dark backgrounds. .ps-on-dark is the original convention and
   stays valid; .ps-surface--dark (see Surfaces) is the systemic one. Both may
   sit on the same element. */
.ps-on-dark .ps-btn--ghost,
.ps-surface--dark .ps-btn--ghost {
  --btn-fg: var(--white);
  --btn-bd: var(--line-invert);
}

.ps-on-dark .ps-btn--ghost:hover,
.ps-on-dark .ps-btn--ghost:focus-visible,
.ps-surface--dark .ps-btn--ghost:hover,
.ps-surface--dark .ps-btn--ghost:focus-visible {
  --btn-bd: var(--white);
  color: var(--white);
}

/* ============================================================ Forms */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.85em 1em;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

label {
  display: block;
  font-size: var(--step--1);
  font-weight: var(--w-med);
  margin-bottom: 0.4em;
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* Search form. */
.ps-searchform__row {
  display: flex;
  gap: var(--sp-1);
  align-items: stretch;
}

.ps-searchform__input {
  flex: 1 1 auto;
}

.ps-searchform__submit {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ============================================================ Containers */
.ps-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ps-container--wide {
  max-width: var(--container-wide);
}

.ps-container--narrow {
  max-width: var(--container-narrow);
}

.ps-section {
  padding-block: var(--section-y);
}

/* Prose block for rich page content. */
.ps-prose > * + * {
  margin-top: 1.2em;
}

.ps-prose h2 {
  margin-top: 1.4em;
}

.ps-prose img {
  border-radius: var(--radius);
}

/* ============================================================ Utilities */
.ps-icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  color: currentColor;
}

/* Thin accent hairline used above quiet lines (e.g. footer philosophy). */
.ps-accent-rule {
  position: relative;
  padding-top: var(--sp-4);
}

.ps-accent-rule::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--accent);
}

/* Page head shared by inner templates. */
.ps-page-head {
  margin-bottom: var(--sp-5);
}

.ps-page-head__title {
  margin: 0;
}

.ps-empty {
  max-width: var(--container-narrow);
}

.ps-empty > * + * {
  margin-top: var(--sp-3);
}

/* Pagination. */
.pagination,
.ps-page-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-6);
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 0.5em 0.75em;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--step--1);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================ Surfaces
   ONE class decides which ground a section sits on, so the page rhythm
   (white → very light grey → anthracite) is assigned in the template and a later
   change is a single class edit. Put the class on the <section> itself:

       <section class="ps-section ps-why ps-surface--muted">

   System rules (see docs/phases/iteration-2026-08-12-overview.md):
   · never two identical LIGHT surfaces adjacent — the safety net at the end of
     this block makes an accidental repeat visible instead of silent;
   · max two dark sections per page besides the footer;
   · --accent stays an accent (buttons, hairlines, single words), never a fill.

   .ps-surface--dark re-scopes the design tokens INSIDE its own scope, so every
   component that already reads var(--ink) / var(--muted) / var(--line) /
   var(--warm-grey) inverts by itself instead of needing per-section overrides.
   --white and --accent are deliberately NOT re-scoped: --white is a foreground
   (button label, headline on dark) and --accent must keep its exact brand value
   as a button fill. Accent as TEXT on dark uses --accent-on-dark (below).
   The older .ps-on-dark convention still works and both classes may sit on the
   same element; every .ps-on-dark rule group lists .ps-surface--dark too.
   Do NOT nest a light surface inside .ps-surface--dark — the re-scoped tokens
   are inherited, so the nested section would render white text on white. */
.ps-surface--white {
  background: var(--surface-1);
}

.ps-surface--muted {
  background: var(--surface-2);
}

.ps-surface--dark {
  --ink: var(--white);
  --muted: var(--muted-invert);
  --line: var(--line-invert);
  --line-strong: var(--line-strong-invert);
  /* .ps-media / .ps-ph placeholders and hairline-boxed panels read as elevated
     rather than as a light hole punched in the dark ground. */
  --warm-grey: var(--surface-elevated-dark);
  background: var(--surface-3);
  color: var(--white);
}

/* --- What token re-scoping cannot do --- */

/* 1. Accent as TEXT. --accent on --anthracite is 1.9:1 and fails AA, so links
   and accent words lighten. Accent as a BACKGROUND (primary button fill, dots,
   the .ps-accent-rule bar) is untouched and keeps the exact brand value.
   .ps-btn is excluded (buttons carry their own --btn-fg) and it is wrapped in
   :where() so the link rule stays at one-class specificity — any component rule
   that already colours its own links on dark keeps winning. */
/* .ps-on-dark is listed here too: the hero, the Innovation Lab and Smart Apron
   are dark regions that carry ONLY the older class (the hero paints its own
   media ground, the other two are page-level dark), and their accent words were
   left at 1.98:1 without this. The generic link rule below is deliberately NOT
   extended to .ps-on-dark — the footer carries that class and its links are
   muted white by design. */
.ps-surface--dark .ps-accent,
.ps-on-dark .ps-accent,
.ps-surface--dark a:not(:where(.ps-btn)) {
  color: var(--accent-on-dark);
}

.ps-surface--dark a:not(:where(.ps-btn)):hover,
.ps-surface--dark a:not(:where(.ps-btn)):focus-visible {
  color: var(--white);
}

.ps-surface--dark .ps-prose a {
  text-decoration-color: var(--line-strong-invert);
}

.ps-surface--dark .ps-prose a:hover,
.ps-surface--dark .ps-prose a:focus-visible {
  text-decoration-color: var(--accent-on-dark);
}

/* The focus ring must be visible on the dark ground too. */
.ps-surface--dark :focus-visible,
.ps-on-dark :focus-visible {
  outline-color: var(--accent-on-dark);
}

/* 2. Cards / media panels that hard-code a white ground (shop + industries)
   flip to the elevated dark tone. The longer selectors match the specificity of
   the component rules they override in shop.css / industries.css. */
.ps-surface--dark .ps-media,
.ps-surface--dark .ps-product-mini__media,
.ps-surface--dark .ps-product-card__media,
.ps-surface--dark .ps-shop-grid--more .ps-product-card__media,
.ps-on-dark .ps-media,
.ps-on-dark .ps-product-mini__media,
.ps-on-dark .ps-product-card__media {
  background: var(--surface-elevated-dark);
}

/* 3. Form controls: the base rule paints them var(--white). */
.ps-surface--dark input[type="text"],
.ps-surface--dark input[type="email"],
.ps-surface--dark input[type="search"],
.ps-surface--dark input[type="tel"],
.ps-surface--dark input[type="url"],
.ps-surface--dark textarea,
.ps-surface--dark select {
  background: var(--surface-elevated-dark);
  color: var(--white);
  border-color: var(--line-strong-invert);
}

.ps-surface--dark input:focus,
.ps-surface--dark textarea:focus,
.ps-surface--dark select:focus {
  border-color: var(--accent-on-dark);
}

.ps-surface--dark ::placeholder {
  color: var(--muted-invert);
  opacity: 1;
}

/* Adjacent-same-surface safety net: an accidental W-W or M-M repeat still reads
   as two sections instead of one long band. */
.ps-surface--white + .ps-surface--white,
.ps-surface--muted + .ps-surface--muted {
  border-top: 1px solid var(--line);
}

/* ============================================================ Media + placeholder
   Shared by pstyle_the_thumbnail() (Phases 2–5). .ps-media wraps a real featured
   image; .ps-ph is the on-brand duotone placeholder used when none exists. Hue
   comes from inline --ps-ph-c1/--ps-ph-c2 vars set per post for gentle variety. */
.ps-media {
  margin: 0;
  overflow: hidden;
  background: var(--warm-grey);
}

.ps-media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ps-ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: var(--ps-ph-ratio, 4 / 5);
  background:
    linear-gradient(
      145deg,
      var(--ps-ph-c1, var(--ph-dark-from)) 0%,
      var(--ps-ph-c2, var(--ph-dark-to)) 100%
    );
  color: var(--on-dark-14);
  overflow: hidden;
}

.ps-ph__mark {
  font-family: var(--font-display);
  font-weight: var(--w-med);
  font-size: clamp(3rem, 1.5rem + 8vw, 7rem);
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}

/* Faint diagonal sheen so the flat duotone reads as a surface, not a fill. */
.ps-ph__grain {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 7px
    );
  pointer-events: none;
}

/* ============================================================ Skip link */
.ps-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.75em 1.25em;
  background: var(--ink);
  color: var(--white);
  font-size: var(--step--1);
}

.ps-skip-link:focus {
  left: var(--sp-2);
  top: var(--sp-2);
  color: var(--white);
}

/* ============================================================ Top-bar */
.ps-topbar {
  background: var(--ink);
  color: var(--muted-invert);
  font-size: var(--step--1);
}

.ps-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--topbar-h);
  padding-block: 0.4rem;
}

.ps-topbar__line {
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--muted-invert);
}

/* Language switcher. */
.ps-langswitch {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  flex: 0 0 auto;
  font-weight: var(--w-med);
  letter-spacing: var(--letter-mid);
}

.ps-langswitch__link {
  color: var(--muted-invert);
  text-transform: uppercase;
}

.ps-langswitch__link.is-current {
  color: var(--white);
}

a.ps-langswitch__link:hover,
a.ps-langswitch__link:focus-visible {
  color: var(--white);
}

.ps-langswitch__sep {
  color: var(--line-invert);
}

/* ============================================================ Header */
.ps-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  transition:
    box-shadow var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease);
}

.ps-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-h);
  transition: min-height var(--dur-fast) var(--ease);
}

/* Shrink on scroll (JS toggles .is-scrolled). */
.ps-header.is-scrolled {
  box-shadow: 0 1px 0 var(--line), var(--shadow-soft);
}

.ps-header.is-scrolled .ps-header__inner {
  min-height: 60px;
}

/* Logo lockup. */
.ps-logo {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  color: var(--ink);
}

.ps-logo:hover,
.ps-logo:focus-visible {
  color: var(--ink);
}

.ps-logo__mark {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: var(--w-semi);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.ps-logo__tag {
  margin-top: 0.35em;
  font-size: 0.62rem;
  font-weight: var(--w-med);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.ps-logo--image img {
  max-height: 56px;
  width: auto;
}

/* Primary nav. */
.ps-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 0.4rem + 1.6vw, 2.2rem);
}

.ps-nav__list a {
  display: inline-block;
  padding: 0.4em 0;
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: var(--w-med);
  text-transform: uppercase;
  letter-spacing: var(--letter-mid);
  position: relative;
}

.ps-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--dur-fast) var(--ease);
}

.ps-nav__list a:hover,
.ps-nav__list a:focus-visible,
.ps-nav__list .current-menu-item > a {
  color: var(--accent);
}

.ps-nav__list a:hover::after,
.ps-nav__list a:focus-visible::after,
.ps-nav__list .current-menu-item > a::after {
  width: 100%;
}

.ps-header__cta {
  flex: 0 0 auto;
}

/* Mobile toggle — hidden on desktop. */
.ps-navtoggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.ps-navtoggle .ps-icon {
  width: 22px;
  height: 22px;
}

.ps-navtoggle__close {
  display: none;
}

.ps-navtoggle[aria-expanded="true"] .ps-navtoggle__open {
  display: none;
}

.ps-navtoggle[aria-expanded="true"] .ps-navtoggle__close {
  display: inline-flex;
}

/* ============================================================ Mobile nav */
.ps-mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.ps-mobile-nav[hidden] {
  display: none;
}

.ps-mobile-nav.is-open {
  display: block;
}

.ps-mobile-nav__inner {
  padding: var(--sp-3) var(--gutter) var(--sp-5);
}

.ps-mobile-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ps-mobile-nav__list a {
  display: block;
  padding: 0.9em 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--step-1);
  font-family: var(--font-display);
}

.ps-mobile-nav__list a:hover,
.ps-mobile-nav__list a:focus-visible {
  color: var(--accent);
}

.ps-mobile-nav__cta {
  margin-top: var(--sp-4);
  width: 100%;
}

/* ============================================================ Footer
   The footer is the DEEPEST surface (--surface-4) plus an inverted hairline.
   Reason: dark CTA bands sit directly above it on most templates, and at the
   same --anthracite tone the two merged into one long dark run.
   It deliberately does NOT carry .ps-surface--dark — it paints itself and its
   links are muted white, not accent-on-dark. It carries .ps-on-dark so any
   shared dark-aware component dropped in here still inverts. This rule sits
   after the Surfaces block on purpose, so the deeper tone wins. */
.ps-footer {
  background: var(--surface-4);
  border-top: 1px solid var(--line-invert);
  color: var(--muted-invert);
  padding-block: var(--section-y) var(--sp-5);
  margin-top: auto;
}

.ps-footer a {
  color: var(--muted-invert);
}

.ps-footer a:hover,
.ps-footer a:focus-visible {
  color: var(--white);
}

.ps-footer__brand {
  /* NOTE: the measure lives on the statement below, not here. `ch` on this
     wrapper resolves against the inherited BODY font (Inter 16px ≈ 272px), which
     squeezed the display-size brand line into four two-word lines. */
  max-width: min(52rem, 100%);
  margin-bottom: var(--sp-7);
}

.ps-footer__statement {
  /* 28ch of the DISPLAY font keeps the brand line on two balanced lines in both
     languages (EN 43 chars, BG 54) without hard-coding a <br> into a
     translatable string. */
  max-width: min(28ch, 100%);
  margin: 0 0 var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.1;
  text-wrap: balance;
  color: var(--white);
}

.ps-footer__company {
  margin: 0;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: var(--letter-mid);
  color: var(--muted-invert);
}

.ps-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5) var(--sp-4);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--line-invert);
}

.ps-footer__heading {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: var(--w-semi);
  text-transform: uppercase;
  letter-spacing: var(--letter-wide);
  color: var(--white);
}

.ps-footer__list {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  font-size: var(--step--1);
}

.ps-footer__list--contact a,
.ps-footer__list--social a {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.ps-footer__list .ps-icon {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--muted-invert);
}

.ps-footer__plain {
  color: var(--muted-invert);
}

.ps-footer__philosophy {
  margin: var(--sp-6) 0 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
  color: var(--white);
}

.ps-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-5);
  font-size: var(--step--1);
}

.ps-footer__copyright {
  margin: 0;
}

.ps-footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

/* ============================================================ Reveal motion */
.ps-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  will-change: opacity, transform;
}

.ps-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* No JS = always visible (progressive enhancement). */
.no-js .ps-reveal {
  opacity: 1;
  transform: none;
}

/* ============================================================ Focus + a11y */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  margin: -1px;
  border: 0;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  clip: auto !important;
  clip-path: none;
  width: auto;
  height: auto;
  padding: 0.75em 1em;
  background: var(--ink);
  color: var(--white);
  z-index: 1000;
}

/* Prevent body scroll when the mobile nav is open. */
body.ps-nav-open {
  overflow: hidden;
}

/* ============================================================ Responsive */
/* The desktop masthead is shown only once it actually fits. It used to switch to
   the burger at 980px, but the row (7 nav items + the CTA) needs ~1157px of
   content width in Bulgarian — Cyrillic labels run longer and the CTA reads
   "ЗАПАЗЕТЕ КОНСУЛТАЦИЯ" — so every width from 981px up to ~1180px pushed the
   document wider than the viewport and put a horizontal scrollbar on EVERY page
   in BOTH languages. Measured before the fix (scrollWidth - innerWidth):
   BG 981px +140, BG 1024px +105, BG 1100px +45, BG 1120px +29; EN 981px +78,
   EN 1024px +43. Switching at 1200px, together with the compaction band below,
   leaves the row inside the container with real slack rather than the ~2px it
   had at 1280px in Bulgarian. */
@media (max-width: 1199.98px) {
  .ps-nav,
  .ps-header__cta {
    display: none;
  }

  .ps-navtoggle {
    display: inline-flex;
  }
}

/* Desktop masthead, compact band. Between the switch point and 1440px the row
   still has little slack in Bulgarian, so the three elastic parts tighten a
   step: the header gap, the nav gap and the CTA's own padding/tracking. Above
   1440px the original spacing applies unchanged. */
@media (min-width: 1200px) and (max-width: 1439.98px) {
  .ps-header__inner {
    gap: var(--sp-3);
  }

  .ps-nav__list {
    gap: clamp(0.9rem, 0.2rem + 1.1vw, 1.5rem);
  }

  .ps-header__cta .ps-btn {
    padding-inline: 1em;
    letter-spacing: 0.05em;
  }
}

@media (max-width: 640px) {
  .ps-footer__cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .ps-topbar__line {
    /* Keep positioning line readable but compact on small screens. */
    font-size: 0.72rem;
  }
}

@media (max-width: 560px) {
  /* Hold the brand line to two lines on phones in BOTH languages — Cyrillic runs
     ~25% longer, so at the full display size the BG version broke into four. */
  .ps-footer__statement {
    font-size: clamp(1.5rem, 6.6vw, var(--step-3));
  }
}

@media (max-width: 460px) {
  .ps-footer__cols {
    grid-template-columns: 1fr;
  }
}

/* ============================================================ Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .ps-reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================ Breadcrumbs */
/* Global chrome: small, muted trail rendered above single/page titles by
   pstyle_breadcrumbs(). Kept minimal and token-driven. */
.ps-breadcrumbs {
  margin: 0 0 0.75rem;
  font-size: var(--step--1);
  line-height: 1.4;
}

.ps-breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ps-breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin: 0;
  color: var(--muted);
}

.ps-breadcrumbs__link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ps-breadcrumbs__link:hover,
.ps-breadcrumbs__link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.ps-breadcrumbs__sep {
  color: var(--line-strong);
  user-select: none;
}

.ps-breadcrumbs__current {
  color: var(--ink);
}

/* On dark sections the trail must stay legible (both surface conventions). */
.ps-on-dark .ps-breadcrumbs__item,
.ps-on-dark .ps-breadcrumbs__link,
.ps-surface--dark .ps-breadcrumbs__item,
.ps-surface--dark .ps-breadcrumbs__link {
  color: var(--muted-invert);
}

.ps-on-dark .ps-breadcrumbs__current,
.ps-surface--dark .ps-breadcrumbs__current {
  color: var(--white);
}

.ps-on-dark .ps-breadcrumbs__sep,
.ps-surface--dark .ps-breadcrumbs__sep {
  color: var(--line-invert);
}

/* The breadcrumb link is an <a>; it must not pick up the accent-on-dark link
   colour from the Surfaces block, so restate the hover here. */
.ps-surface--dark .ps-breadcrumbs__link:hover,
.ps-surface--dark .ps-breadcrumbs__link:focus-visible {
  color: var(--accent-on-dark);
  border-bottom-color: var(--accent-on-dark);
}
