@import url("fonts/fonts.css?v=3");

:root {
  --red: #e31b13;
  --red-deep: #b5130d;
  --red-soft: #fdeceb;
  --ink: #221e1d;
  --mute: #6e6663;
  --field: #f6f3f2;
  --line: #e4dddb;
  --white: #ffffff;
  --gutter: 16px;
  --headline: "Anton", "Barlow Semi Condensed", Impact, sans-serif;
  --brand: "Unbounded", "Barlow Semi Condensed", system-ui, sans-serif;
  --display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 72px; /* a rögzített fejléc ne takarja el, amire az oldal ugrik */
}

body {
  margin: 0;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Fejléc */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 56px;
  padding: 0 var(--gutter);
  background: var(--white);
  transition: box-shadow 0.2s;
}

/* Görgetés után: árnyék, és a hívás gomb pirosra vált */
.topbar.is-stuck {
  box-shadow: 0 6px 16px -10px rgba(60, 8, 4, 0.45);
}

.topbar.is-stuck .call {
  background: var(--red);
  color: var(--white);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--brand);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
}

.brand svg {
  flex: none;
  width: 30px;
  height: 30px;
}

/* Üzemeltető: NÉT Holding logó a Mérőhely Most mellett (telefonon csak görgetés után) */
.operator-mark {
  display: none;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1.5px solid var(--line);
}

.operator-mark img {
  display: block;
  width: auto;
  height: 40px;
}

.operator-mark-text {
  display: none;
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  color: var(--ink);
}

.call {
  margin-left: auto;
}

.call {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px 0 12px;
  border: 1.5px solid var(--red);
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  color: var(--red);
  text-decoration: none;
  white-space: nowrap;
}

.call svg {
  width: 18px;
  height: 18px;
}

/* Váltakozó felirat: a szám és a „Hívjon most” felváltva gördül be (mint a villanyóra számlálója) */
.call .roll {
  display: none;
  height: 22px;
  overflow: hidden;
  line-height: 22px;
  text-align: center;
}

.call .roll-track,
.call .roll-track span {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .call .roll-track {
    animation: call-roll 6s cubic-bezier(0.5, 0, 0.2, 1) infinite;
  }

  /* a telefonikon a felirat váltásakor csörren meg */
  .call svg {
    transform-origin: 50% 50%;
    animation: call-ring 6s ease-in-out infinite;
  }
}

@keyframes call-roll {
  0%,
  44% {
    transform: translateY(0);
  }
  50%,
  88% {
    transform: translateY(-22px);
  }
  94%,
  100% {
    transform: translateY(-44px);
  }
}

@keyframes call-ring {
  0%,
  43%,
  51%,
  87%,
  95%,
  100% {
    transform: rotate(0);
  }
  44%,
  88% {
    transform: rotate(-16deg);
  }
  45.5%,
  89.5% {
    transform: rotate(14deg);
  }
  47%,
  91% {
    transform: rotate(-12deg);
  }
  48.5%,
  92.5% {
    transform: rotate(8deg);
  }
}

.call:hover {
  background: var(--red);
  color: var(--white);
}

/* Nagyon keskeny telefonon (pl. 320 px) a hívás gomb csak ikon, hogy a széles logófelirat kiférjen */
@media (max-width: 349px) {
  .call {
    justify-content: center;
    width: 40px;
    padding: 0;
  }

  .call .call-label {
    display: none;
  }

  .topbar.is-stuck .call {
    width: auto;
    padding: 0 14px 0 12px;
  }
}

/* Telefonon görgetés után a logó felirata helyet ad, és a gombban a teljes szám látszik */
@media (max-width: 599px) {
  .topbar.is-stuck .brand-text {
    display: none;
  }

  .topbar.is-stuck .operator-mark {
    display: flex;
    padding-left: 10px;
  }

  .topbar.is-stuck .call {
    font-size: 17px;
  }

  .topbar.is-stuck .call .call-label {
    display: none;
  }

  .topbar.is-stuck .call .roll {
    display: block;
  }

  /* görgetés előtt (a „Hívás” feliratnál) az ikon nyugton marad; ragadáskor a csörgés a felirattal együtt indul */
  .topbar:not(.is-stuck) .call svg {
    animation: none;
  }
}

/* Lábléc */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 18px var(--gutter) 22px;
  font-size: 14px;
  color: var(--mute);
}

.footer span {
  flex-basis: 100%;
}

.footer a {
  color: var(--mute);
  text-underline-offset: 3px;
}

.footer a:hover {
  color: var(--ink);
}

@media (min-width: 600px) {
  .footer span {
    flex-basis: auto;
  }

  .operator-mark {
    display: flex;
    margin-left: 4px;
  }

  .call .call-label {
    display: none;
  }

  .call .roll {
    display: block;
  }
}

@media (min-width: 960px) {
  :root {
    --gutter: 32px;
  }

  .topbar {
    height: 68px;
  }

  .brand {
    font-size: 20px;
  }

  .brand svg {
    width: 34px;
    height: 34px;
  }

  .operator-mark img {
    height: 46px;
  }
}

@media (min-width: 720px) {
  .operator-mark-text {
    display: block;
  }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 599px) {
  .topbar.is-stuck .operator-mark {
    animation: mark-in 0.25s ease-out;
  }
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
