/* Vendelsö Djurklinik — shared styles
   Used by every page. Page-specific styles stay in each HTML file's <style>. */

:root {
  --forest: #0d1c0f;
  --forest-mid: #1c3520;
  --green: #3f6040;
  --green-soft: #c8eec0;
  --cream: #faf7f2;
  --cream-warm: #f2ebe0;
  --tan: #ece1d2;
  --text: #181d17;
  --text-muted: #5a6258;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  /* Belt-and-braces: kill horizontal scroll on iOS Safari, where overflow-x
     on body alone sometimes leaks. */
  overflow-x: hidden;
}
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  width: 100%;
}
/* Locks scroll under the mobile menu overlay.
   overflow:hidden on html+body handles the desktop case. iOS Safari
   leaks past it, so a touchmove handler in src/common.jsx blocks the
   gesture too. We avoid `position: fixed` here — it works for the lock
   but causes a visible reflow flash when the class is toggled. */
html.nav-open, body.nav-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Nav ───────────────────────────────────────────────
   Two backdrop modes share the same markup:
   .nav                — transparent over a dark hero (light text)
   .nav.scrolled       — dark backdrop (landing while still in hero)
   .nav.light.scrolled — light backdrop (inner pages on scroll, landing past hero)
*/
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 2.5rem;
  transition: all .35s ease;
}
.nav.scrolled {
  background: rgba(13,28,15,.92);
  backdrop-filter: blur(20px);
  padding: 1rem 2.5rem;
}
.nav.light.scrolled {
  background: rgba(250,247,242,.95);
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}

.nav-brand {
  display: flex; align-items: center; gap: .65rem;
  font-size: .92rem; font-weight: 600; letter-spacing: -.01em;
  color: white; transition: color .3s;
}
.nav-brand img {
  width: 2.2rem; height: 1.9rem; object-fit: contain;
  filter: brightness(0) invert(1); transition: filter .3s;
}
.nav.light.scrolled .nav-brand { color: var(--text); }
.nav.light.scrolled .nav-brand img { filter: none; }

.nav-links { display: flex; align-items: center; gap: .15rem; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,.72); font-size: .88rem; font-weight: 500;
  padding: .48rem .82rem; border-radius: 100px;
  transition: all .2s; white-space: nowrap;
}
.nav-links a:hover { background: rgba(255,255,255,.1); color: white; }
.nav-links a.active { color: var(--green-soft); font-weight: 600; }

.nav.light.scrolled .nav-links a { color: var(--text-muted); }
.nav.light.scrolled .nav-links a:hover { background: rgba(63,96,64,.1); color: var(--text); }
.nav.light.scrolled .nav-links a.active { color: var(--green); }

.nav-cta {
  background: rgba(200,238,192,.15) !important;
  color: var(--green-soft) !important;
  border: 1px solid rgba(200,238,192,.25) !important;
  font-weight: 600 !important;
}
.nav-cta:hover { background: rgba(200,238,192,.25) !important; }
.nav.light.scrolled .nav-cta {
  background: var(--green) !important;
  color: #eaffe3 !important;
  border-color: transparent !important;
}
.nav.light.scrolled .nav-cta:hover { background: #2c4a2e !important; color: white !important; }

/* ─── Hamburger (mobile only) ─────────────────────────────
   Three horizontal bars that morph into an X when the menu is open.
   Hidden on desktop via the media query below.
*/
.nav-burger {
  display: none;
  width: 2.4rem; height: 2.4rem;
  background: transparent; border: none; padding: 0;
  cursor: pointer; position: relative; z-index: 110;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
}
.nav-burger span {
  display: block; width: 1.4rem; height: 2px;
  background: white; border-radius: 2px;
  transition: transform .3s ease, opacity .25s ease, background .3s;
}
.nav.light.scrolled .nav-burger span { background: var(--text); }
.nav-burger.open span { background: white; }
/* When the overlay is open the burger sits on top of the dark menu
   backdrop, so force the lines white regardless of the nav's scroll/light
   state — otherwise the "X" inherits the dark color from .light.scrolled
   and becomes invisible. */
body.nav-open .nav-burger span { background: white !important; }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Mobile nav layout ──────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 1rem 1.25rem; }
  .nav.scrolled { padding: .8rem 1.25rem; }
  .nav-burger { display: flex; }

  /* Lift the logo above the fullscreen overlay so it stays visible — and
     force light colors when the menu is open so it reads against the
     dark backdrop regardless of the page's scroll state. */
  .nav-brand { position: relative; z-index: 110; }
  body.nav-open .nav-brand { color: white !important; }
  body.nav-open .nav-brand img { filter: brightness(0) invert(1) !important; }

  /* When the menu is open, drop backdrop-filter from the nav. Otherwise
     it creates a containing block that traps the fixed .nav-links overlay
     inside the small nav bar, so the menu appears clipped after scrolling.
     transition:none makes the style changes apply instantly — otherwise
     the 350ms transition on .nav keeps backdrop-filter partially active
     and the containing block lingers, which shows up as a delayed "pop"
     of the menu to full size. */
  body.nav-open .nav,
  body.nav-open .nav.scrolled,
  body.nav-open .nav.light.scrolled {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: none !important;
  }

  /* The links collapse into a full-screen overlay panel that slides in.
     text-align:center centers inline content inside each row. */
  .nav-links {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: var(--forest);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: .6rem;
    padding: 6rem 1.5rem 2.5rem;
    text-align: center;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.23,1,.32,1);
    overflow-y: auto;
    /* Prevents scroll-chaining: when the menu hits its scroll boundary
       the gesture stops here instead of bleeding through to the page. */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open { transform: translateX(0); }

  /* Large, centered menu labels. display:block so text-align:center applies. */
  .nav-links a,
  .nav.light.scrolled .nav-links a {
    display: block;
    color: rgba(255,255,255,.85);
    font-size: 1.6rem;
    font-weight: 500;
    padding: 1rem 1rem;
    text-align: center;
    border-radius: .9rem;
    line-height: 1.3;
  }
  .nav-links a:hover,
  .nav.light.scrolled .nav-links a:hover {
    background: rgba(255,255,255,.08);
    color: white;
  }
  .nav-links a.active,
  .nav.light.scrolled .nav-links a.active { color: var(--green-soft); }

  /* Booking CTA — the <li> wrapping it is pinned to the bottom, and the
     CTA itself is an inline-block pill centered within that row instead
     of a full-width bar. */
  .nav-links li:last-child { margin-top: auto; padding-top: 1.5rem; text-align: center; }
  .nav-cta,
  .nav.light.scrolled .nav-cta {
    display: inline-block !important;
    background: var(--green-soft) !important;
    color: var(--forest) !important;
    border-color: transparent !important;
    text-align: center !important;
    padding: 1.1rem 1.5rem !important;
  }
  .nav-cta:hover,
  .nav.light.scrolled .nav-cta:hover {
    background: #b0e0a6 !important;
    color: var(--forest) !important;
  }

  /* Footer collapses to a single column on mobile. */
  .footer { padding: 3.5rem 1.5rem 2rem; }
  .footer-top { flex-direction: column; gap: 2.2rem; padding-bottom: 2rem; }
  .footer-links { flex-wrap: wrap; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; align-items: flex-start; }
}

/* ─── Footer ───────────────────────────────────────────── */
.footer { background: var(--forest); padding: 4.5rem 2.5rem 3rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 3rem; padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 2rem;
}
.footer-brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; font-weight: 600;
  color: var(--cream); margin-bottom: .5rem;
}
.footer-tagline {
  font-size: .85rem; color: rgba(250,247,242,.5);
  line-height: 1.65; max-width: 18rem;
}
.footer-links { display: flex; gap: 4rem; }
.f-col h4 {
  font-size: .75rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: rgba(250,247,242,.35);
  margin-bottom: 1rem;
}
.f-col a {
  display: block; color: rgba(250,247,242,.65);
  font-size: .88rem; margin-bottom: .6rem;
  transition: color .2s;
}
.f-col a:hover { color: var(--cream); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; color: rgba(250,247,242,.38);
  flex-wrap: wrap; gap: 1rem;
}
.footer-bottom-left {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.footer-link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: inherit;
  color: rgba(250,247,242,.55);
  transition: color .2s;
}
.footer-link-btn:hover { color: var(--cream); }
.footer-cta {
  display: inline-flex; padding: .8rem 1.6rem;
  background: var(--green-soft); color: var(--forest);
  font-weight: 700; font-size: .9rem; border-radius: 100px;
  transition: all .22s;
}
.footer-cta:hover { transform: translateY(-2px); background: #b0e0a6; }

/* ─── Reveal-on-scroll ───────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .75s ease, transform .75s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }

/* ─── Notice bar ────────────────────────────────────────
   Sits at the very top of the document in normal flow — scrolls away
   with the page rather than sticking to the viewport. The fixed nav
   still lives at top:0 of the viewport, so we shift it down by
   --vdk-notice-h (the bar's visible height, updated on scroll from JS).
   When the bar has fully scrolled out of view, --vdk-notice-h is 0
   and the nav returns to top:0. */
.vdk-notice-bar {
  position: relative;
  background: #faf9bd;
  border-bottom: 1px solid rgba(26,31,25,.08);
  font-family: 'DM Sans', sans-serif;
  animation: noticeIn .35s ease both;
}
.vdk-notice-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: .65rem 2.5rem;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.vdk-notice-icon {
  flex-shrink: 0;
  width: 1.4rem; height: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.vdk-notice-icon svg { width: 1.15rem; height: 1.15rem; }
.vdk-notice-msg {
  flex: 1;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}
.vdk-notice-close {
  flex-shrink: 0;
  width: 1.9rem; height: 1.9rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.vdk-notice-close:hover { background: rgba(26,31,25,.1); }
.vdk-notice-close svg { width: 1rem; height: 1rem; }

/* Shift the nav down to track the notice bar's visible height (set
   from JS on scroll). The nav's default `transition: all` would smooth
   `top` over .35s, which lags noticeably while scrolling — restrict the
   transition to the props that actually animate between states. */
body.has-notice .nav {
  top: var(--vdk-notice-h, 0);
  transition-property: background, padding, backdrop-filter, box-shadow, color;
}

/* Hide the notice bar while the mobile menu overlay is open — the
   overlay covers the viewport and the bar would just peek through
   confusingly behind it. Also pin the nav back to top:0 so the logo
   and hamburger don't stay shifted down as if the bar were still there. */
body.nav-open .vdk-notice-bar { display: none; }
body.nav-open.has-notice .nav { top: 0; }

@keyframes noticeIn {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@media (max-width: 768px) {
  .vdk-notice-inner { padding: .55rem 1rem; gap: .55rem; }
  .vdk-notice-msg { font-size: .82rem; line-height: 1.4; }
}

/* ─── Cookie banner ──────────────────────────────────────
   Fixed strip at the bottom of every page until the visitor
   chooses. The wrapper is pointer-events:none so the banner
   doesn't block clicks above its visible card. */
.cookie-banner {
  position: fixed;
  left: 1.25rem; right: 1.25rem; bottom: 1.25rem;
  z-index: 250;
  display: flex; justify-content: center;
  pointer-events: none;
  animation: cookieIn .45s cubic-bezier(.23,1,.32,1) both;
}
.cookie-banner-inner {
  pointer-events: auto;
  width: 100%; max-width: 760px;
  background: var(--forest);
  border: 1px solid rgba(200,238,192,.1);
  border-radius: 1.5rem;
  padding: 1.5rem 1.7rem;
  box-shadow: 0 18px 50px rgba(13,28,15,.28);
  display: flex; align-items: center; gap: 1.6rem;
}
.cookie-banner-text { flex: 1; min-width: 0; }
.cookie-banner-text h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em;
  color: var(--cream);
  margin-bottom: .4rem;
}
.cookie-banner-text p {
  font-size: .85rem; line-height: 1.65;
  color: rgba(250,247,242,.6);
}
.cookie-banner-actions {
  display: flex; gap: .55rem; flex-shrink: 0;
}
.cookie-btn-primary,
.cookie-btn-secondary {
  font-family: 'DM Sans', sans-serif;
  font-size: .86rem; font-weight: 700;
  padding: .8rem 1.4rem; border-radius: 100px;
  border: 1px solid transparent; cursor: pointer;
  white-space: nowrap;
  transition: all .22s;
}
.cookie-btn-primary {
  background: var(--green-soft); color: var(--forest);
}
.cookie-btn-primary:hover {
  background: #b0e0a6; transform: translateY(-1px);
}
.cookie-btn-secondary {
  background: transparent;
  color: rgba(250,247,242,.78);
  border-color: rgba(200,238,192,.22);
}
.cookie-btn-secondary:hover {
  color: var(--cream);
  border-color: rgba(200,238,192,.5);
}

@keyframes cookieIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .cookie-banner { left: .75rem; right: .75rem; bottom: .75rem; }
  .cookie-banner-inner {
    flex-direction: column; align-items: stretch;
    gap: 1.1rem; padding: 1.4rem;
  }
  .cookie-banner-text h3 { font-size: 1.3rem; }
  .cookie-banner-actions { flex-direction: column-reverse; gap: .55rem; }
  .cookie-btn-primary,
  .cookie-btn-secondary { width: 100%; padding: .85rem 1rem; }
}

/* ─── Shared keyframes ───────────────────────────────────── */
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
