/*
  Base layer — font loading, reset, and default typography.
  Depends on tokens.css being loaded first.
*/

/* ---- Fonts (subset woff2, sources in assets/fonts/) ----
   Orbitron Custom: jglobe.hu's custom Orbitron (assets/fonts/Orbitron_custom.ttf)
   + Ő/Ű added (it shipped without the capitals). Single weight on purpose,
   no font-weight descriptor: heavier weights are synthesised, as on jglobe.hu. */
@font-face {
  font-family: "Orbitron Custom";
  src: url("../fonts/orbitron-custom.woff2?v=2026112707") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-regular.woff2?v=2026112707") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-italic.woff2?v=2026112707") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-medium.woff2?v=2026112707") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-semibold.woff2?v=2026112707") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-bold.woff2?v=2026112707") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  min-height: 100svh;
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-ink);
  background: var(--color-white);
  overflow-x: hidden;
}

/* Page-transition loading bar: a brief top-of-viewport bar for internal
   navigation, styled after YouTube/GitHub/Medium's loading bar. The
   element itself is created by main.js (not present in markup), so no
   HTML file needs changing across the site's 25 pages. main.js adds
   .is-leaving right before navigating away (a quick partial fill via
   transition) and .is-finishing right after a page loads (a full sweep
   + fade via the keyframe below). */
.page-transition-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-red-600);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: var(--z-overlay);
  pointer-events: none;
}

.page-transition-bar.is-leaving {
  transform: scaleX(0.65);
  transition: transform 150ms var(--ease-out);
}

@keyframes page-transition-bar-finish {
  0% {
    transform: scaleX(0.4);
    opacity: 1;
  }
  60% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

.page-transition-bar.is-finishing {
  animation: page-transition-bar-finish 320ms var(--ease-out);
}

/* Not on mobile (user, 2026-11-18); main.js also skips the 160ms
   navigation delay there. */
@media (max-width: 768px) {
  .page-transition-bar {
    display: none;
  }
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
  color: var(--color-navy-900);
  /* Orbitron is wide: at 42px one long Hungarian word ("Szerelvénygyártás")
     is wider than a phone. Hyphenate like jglobe.hu ("Magyar-országon");
     break-word is the last resort if no hyphenation point fits. */
  hyphens: auto;
  overflow-wrap: break-word;
}

/* Card / column titles: Montserrat 700, like jglobe.hu's card headings. */
h3,
h4 {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
}

/* Mobile headings break only at the one soft hyphen main.js puts at each
   long word's middle syllable (user, 2026-11-18: "alkatré-szek" and
   "biztonsá-gi" were not the middle). The class is set by main.js, so
   without JS headings keep `hyphens: auto` above. Subpage hero titles
   are excluded (user): they keep `auto`. overflow-wrap stays the
   last resort. */
@media (max-width: 768px) {
  .js-midhyphen :is(h1, h2, h3, h4):not(.page-hero__title) {
    hyphens: manual;
    -webkit-hyphens: manual;
  }
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
}
h2 {
  font-size: var(--fs-h2);
}
/* jglobe.hu: h2 line-height is 1.2 below 768px, 1.3 above. */
@media (max-width: 767px) {
  h2 { line-height: 1.2; }
}
h3 {
  font-size: var(--fs-h3);
}
h4 {
  font-size: var(--fs-h4);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

/* ---- Focus ---- */
:focus-visible {
  outline: 2px solid var(--color-red-600);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto; margin-right: auto;
  padding-left: var(--content-padding); padding-right: var(--content-padding);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-overlay);
  background: var(--color-navy-900);
  color: var(--color-white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  transition: top var(--duration-base) var(--ease-out);
}

.skip-link:focus-visible {
  top: var(--space-4);
}

/* Visually hides content while keeping it in the accessibility tree and
   the DOM order scripts rely on (e.g. extra lightbox-carousel pages that
   have no visible trigger of their own). Not for interactive elements a
   sighted mouse user should be able to reach. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The HTML `hidden` attribute must win over component `display` rules
   (e.g. `.product-intro__row { display: flex }`), which otherwise override
   the browser default. Used to hide content that stays in the markup. */
[hidden] {
  display: none !important;
}

/* Brand names inside hyphenated headings break only at their own hyphen
   or space, never mid-word ("Brunn-bauer", "INDUST-RIES"; 2026-11-18). */
.u-nohyphen {
  hyphens: manual;
  -webkit-hyphens: manual;
}

