/* DriveGas – baza: fonturi, reset, tipografie, accesibilitate.
   Ordinea straturilor este fixată aici (primul fișier încărcat după tokens.css). */
@layer reset, base, components, layout, pages, utilities;

/* ---------- fonturi ale mărcii (resources/fonts, împachetate de tools/fonts.php) ---------- */
@font-face {
  font-family: "Myriad Web Pro";
  src: url("../fonts/myriad-web-pro-regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Myriad Web Pro";
  src: url("../fonts/myriad-web-pro-bold.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Myriad Pro Cond";
  src: url("../fonts/myriad-pro-cond-bold.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- tranziții între pagini (document nou, același site): bara de sus și cea de jos rămân pe loc ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-base); }
.appbar { view-transition-name: appbar; }
.tabbar { view-transition-name: tabbar; }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100vh; min-height: 100dvh; }
  img, svg, video, canvas, picture { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  ul, ol { padding: 0; }
  table { border-collapse: collapse; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    --gutter: 20px;
    --container: 1200px;
    --appbar-h: 64px;
    --tabbar-h: 68px;
    --focus: color-mix(in srgb, var(--secondary) 80%, transparent);
  }
  @media (min-width: 768px) { :root { --gutter: 32px; } }
  @media (min-width: 1024px) { :root { --appbar-h: 76px; } }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--appbar-h) + 16px);
    -webkit-tap-highlight-color: transparent;
    background: var(--bg);
  }
  body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: .004em;
    text-wrap: balance;
  }
  h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
  h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
  h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
  h4 { font-size: var(--fs-title); line-height: var(--lh-title); font-family: var(--font-body); }
  p { text-wrap: pretty; }
  strong, b { font-weight: 700; }
  small { font-size: var(--fs-small); }

  a { color: var(--secondary); text-underline-offset: .2em; text-decoration-thickness: .08em; }
  a:hover { text-decoration-thickness: .14em; }

  :focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px;
  }
  ::selection { background: color-mix(in srgb, var(--primary) 28%, transparent); }

  hr { border: 0; border-top: 1px solid var(--line); margin-block: var(--space-6); }

  /* cifre cu aliniere uniformă în prețuri, ore, distanțe */
  .tnum { font-variant-numeric: tabular-nums; }

  /* logo și emblemă (simboluri SVG din includes/partials/logo-symbols.php): culorile urmează tema, iar contextul le poate înlocui
     (de exemplu --logo-blue: #fff pentru filigranul alb din cardul principal) */
  .lg-b { fill: var(--logo-blue); }
  .lg-g { fill: var(--logo-green); }
  .logo, .emblem { display: block; }
}

@layer utilities {
  .sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .sprite-hidden { position: absolute; width: 0; height: 0; overflow: hidden; }
  .skip-link {
    position: fixed; left: 12px; top: -80px; z-index: 200;
    background: var(--primary); color: var(--on-primary); font-weight: 700;
    padding: 12px 18px; border-radius: var(--radius-pill); text-decoration: none;
    transition: top var(--dur-fast) var(--ease);
  }
  .skip-link:focus { top: 12px; }
  .container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
  .mt-2 { margin-top: var(--space-2); }
  .mt-3 { margin-top: var(--space-3); }
  .mt-4 { margin-top: var(--space-4); }
  .mt-5 { margin-top: var(--space-5); }
  .mt-6 { margin-top: var(--space-6); }
  .text-2 { color: var(--text-2); }
  .text-3 { color: var(--text-3); }
  .center { text-align: center; }
  .nowrap { white-space: nowrap; }
}

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