/* ==========================================================================
   Pizzerie XXX — custom stylesheet
   Tailwind utilities are loaded via <link> to assets/css/_utilities.css
   in index.html. This file adds fonts, CSS variables, and motion styles.
   ========================================================================== */

/* Accessibility: skip link */
.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;z-index:10000}
.skip-link:focus{position:fixed;left:1rem;top:1rem;width:auto;height:auto;padding:.75rem 1rem;background:#fff;color:#000;outline:2px solid #000}

/* ---------------------------------------------------------------------
   1. Font variables
   --------------------------------------------------------------------- */
:root {
  --font-prata: "Prata", "Prata Fallback", Georgia, serif;
  --font-montserrat: "Montserrat", "Montserrat Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-pinyon: "Pinyon Script", "Pinyon Script Fallback", cursive;

  /* Wire next/font variables into Tailwind utility tokens used by the export */
  --font-serif: var(--font-prata);
  --font-geist-sans: var(--font-montserrat);
  --default-font-family: var(--font-montserrat);

  --color-cream: #fdfcf7;
  --color-accent: #e40014;
  --background: #fdfcf7;
  --foreground: #0f172b;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-montserrat);
  background-color: var(--color-cream);
  color: var(--foreground);
}

.font-serif {
  font-family: var(--font-prata);
}

.font-sans {
  font-family: var(--font-montserrat);
}

.font-script {
  font-family: var(--font-pinyon);
  font-weight: 400;
  line-height: 1;
}

/* Flamesoft brand — stejný mark + Flame gradient jako navbar na flamesoft.fun */
.fs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-montserrat);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.035em;
  color: #f8fafc;
  text-decoration: none;
  text-transform: none;
}

.fs-brand__mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.fs-brand b {
  font-weight: 800;
  background: linear-gradient(100deg, #ff7a2b 0%, #ff5a1f 45%, #e8290b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.fs-brand:hover {
  color: #fff;
}

/* Hero CTA: always under checklist (inline-flex list+button used to sit side-by-side when zoomed out) */
#uvod .animate-hero-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#uvod .animate-hero-left > ul {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 36rem;
}

#uvod .hero-cta {
  display: inline-flex !important;
  width: fit-content;
  align-self: center;
}

@media (min-width: 1024px) {
  #uvod .animate-hero-left {
    align-items: flex-start;
  }

  #uvod .animate-hero-left > ul {
    max-width: none;
  }

  #uvod .hero-cta {
    align-self: flex-start;
  }
}

/* Sections are scrolled to under the fixed nav bar. */
section[id] {
  scroll-margin-top: 6.5rem;
}

/* ---------------------------------------------------------------------
   2. Loading veil (replaces the client-side "data === null" empty shell)
   --------------------------------------------------------------------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--color-cream);
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-screen.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------------------------------------------------------------------
   3. Nav + hero entrance (mirrors motion.nav / variants A & D)
   --------------------------------------------------------------------- */
@keyframes nav-in {
  from { transform: translateY(-100px); }
  to { transform: translateY(0); }
}

.animate-nav-in {
  animation: nav-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-in-left {
  from { opacity: 0; transform: translateX(-70px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes hero-in-right {
  from { opacity: 0; transform: translateX(70px); }
  to { opacity: 1; transform: translateX(0); }
}

.animate-hero-left {
  animation: hero-in-left 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-hero-right {
  animation: hero-in-right 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------------------------------------------------------------------
   4. Mobile menu overlay (AnimatePresence -> CSS transition)
   --------------------------------------------------------------------- */
.mobile-overlay {
  display: flex;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.mobile-overlay.is-open {
  opacity: 1;
  transform: translateX(0);
}

.mobile-overlay .mobile-link {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.mobile-overlay.is-open .mobile-link {
  opacity: 1;
  transform: translateX(0);
}

.mobile-overlay.is-open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-overlay.is-open .mobile-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-overlay.is-open .mobile-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-overlay.is-open .mobile-link:nth-child(4) { transition-delay: 0.4s; }

/* ---------------------------------------------------------------------
   5. Hero pizza slow spin + gradient text shimmer
   --------------------------------------------------------------------- */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin-slow 60s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-shimmer {
  animation: shimmer 6s linear infinite;
}

/* ---------------------------------------------------------------------
   6. Scroll reveal (IntersectionObserver-driven, mimics the F variant:
      opacity 0 -> 1, y 80px -> 0, scale 0.98 -> 1)
   --------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(60px) scale(0.98);
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .animate-nav-in,
  .animate-hero-left,
  .animate-hero-right,
  .animate-spin-slow,
  .animate-shimmer,
  .animate-float,
  .animate-bounce-slow,
  .mobile-overlay,
  .mobile-overlay .mobile-link {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------------------------------------------------------------------
   7. Composable brightness utility (Tailwind's --tw-* filter pipeline)
      used together with `.invert` on the active Why-Us decorative image.
   --------------------------------------------------------------------- */
.brightness-200 {
  --tw-brightness: brightness(200%);
  filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, )
    var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, )
    var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
}

/* ---------------------------------------------------------------------
   8. Misc decorative helpers
   --------------------------------------------------------------------- */
/* Live-tracking floating toast bounce and promo-badge float both reuse
   .animate-bounce-slow / .animate-float from _utilities.css. */

/* Focus visibility (accessibility, does not change layout/colors) */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   9. Mobile responsiveness overrides
   Everything below is scoped inside max-width media queries. Nothing above
   this point has been modified — desktop (> 768px) rendering is untouched.
   These rules only add missing overrides / correct fixed-size utilities
   (Tailwind classes such as w-72, h-56, h-screen, min-h-[90vh] …) that don't
   have a small-viewport counterpart in index.html.
   ========================================================================== */
@media (max-width: 768px) {

  /* --- Prevent horizontal scroll ------------------------------------------ */
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  #app {
    overflow-x: hidden;
  }

  img,
  svg {
    max-width: 100%;
  }

  /* --- Nav / hamburger -----------------------------------------------------
     On narrow phones the pill bar (hamburger + logo + CTA) is tight; give
     it a little breathing room and stop the CTA label from wrapping to two
     lines, which would otherwise make the fixed nav taller than expected. */
  nav[aria-label="Hlavní navigace"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  nav[aria-label="Hlavní navigace"] > div:not(#mobile-menu) {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
    gap: 0.5rem;
  }

  nav[aria-label="Hlavní navigace"] a[href="#order"] {
    padding: 0.6rem 0.95rem;
    font-size: 10px;
    gap: 6px;
    white-space: nowrap;
  }

  nav[aria-label="Hlavní navigace"] a[href="#order"] svg {
    width: 12px;
    height: 12px;
  }

  /* Mobile menu overlay: use dynamic viewport height (mobile browser
     chrome-safe) and allow scrolling so the phone/contact block at the
     bottom is always reachable on short screens instead of being cut off. */
  #mobile-menu {
    padding-top: 6.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 2rem;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #mobile-menu .mobile-link {
    font-size: 2rem;
  }

  /* --- Hero ----------------------------------------------------------------
     Less forced empty space above/below the stacked hero content; the
     min-h-[90vh] utility isn't needed once the hero stacks to one column. */
  #uvod {
    padding-top: 7.5rem;
    padding-bottom: 3rem;
    min-height: auto;
  }

  #uvod .absolute.-top-5 {
    top: -0.5rem;
  }

  /* --- Menu heading row ------------------------------------------------------
     The "Populární v sekci …" title + prev/next controls share one row on
     desktop; on phones give them room by stacking instead of squeezing. */
  .justify-between.items-end.mb-8 {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .justify-between.items-end.mb-8 > div.flex.gap-2 {
    align-self: flex-end;
  }

  /* --- Live tracking feature row --------------------------------------------
     Let the GPS / Notifikace pills wrap instead of being squeezed onto one
     tight row on narrow phones. */
  .flex.gap-4.mb-8 {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }

  /* --- About section ---------------------------------------------------------
     Keep the floating "15+ let tradice" badge fully inside the section on
     narrow phones instead of hugging the image's negative-offset corner. */
  .absolute.-bottom-4.-left-4 {
    left: -0.25rem;
    bottom: -0.25rem;
    padding: 0.75rem 1rem;
  }

  /* --- Footer ----------------------------------------------------------------
     A touch more breathing room between the Menu / Kontakt columns of the
     mobile footer layout. Extra bottom padding so the fixed pill nav never
     covers the copyright / GDPR row. */
  footer .grid.grid-cols-2.gap-8 {
    gap: 1.5rem 1rem;
  }

  footer#kontakt {
    padding-bottom: 6.5rem;
  }

  footer#kontakt > .lg\:hidden {
    padding-bottom: 1.5rem;
  }

  /* --- Typography scale ------------------------------------------------------
     Safety net so long words in headings never force horizontal scroll. */
  h1,
  h2 {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

@media (max-width: 480px) {

  /* --- Nav / hamburger: extra-small phones -------------------------------- */
  nav[aria-label="Hlavní navigace"] a[href="#order"] {
    padding: 0.55rem 0.8rem;
    font-size: 9px;
  }

  nav[aria-label="Hlavní navigace"] span.text-xl {
    font-size: 1.05rem;
  }

  #mobile-menu {
    padding-top: 6rem;
  }

  #mobile-menu .mobile-link {
    font-size: 1.65rem;
  }

  /* --- Category grid images ------------------------------------------------
     w-72 (288px) is wider than the category card's content box on very
     narrow phones and would otherwise be cropped by the card's
     overflow-hidden edge. */
  #category-grid img {
    width: 68%;
    max-width: 190px;
  }

  /* --- Hero promo badge ----------------------------------------------------- */
  #uvod .absolute.-top-5.bg-yellow-400 {
    width: 6.5rem;
    height: 6.5rem;
  }
}
