/* Aquifa Water — site styles
   Loaded on every page alongside the Tailwind CDN. Keep selectors scoped
   to the custom hooks used in the HTML (ids/classes below) so nothing
   here fights with Tailwind's utility classes. */

:root {
  --brand-navy: #06304d;
  --brand-navy-deep: #042639;
  --brand-cyan: #0e7490;
  --header-h: 81px;
}

html {
  scroll-behavior: smooth;
}

/* =========================================================
   Header — solidifies once the page is scrolled
   ========================================================= */
#site-header {
  transition: background-color .35s ease, box-shadow .35s ease;
}

#site-header.is-scrolled {
  background-color: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px -12px rgba(6, 48, 77, .35);
  border-bottom-color: rgba(6, 48, 77, .08);
}

/* =========================================================
   Mobile menu button — animates into an "X" when open
   ========================================================= */
.mobile-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-navy);
  transition: transform .3s ease, opacity .3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   Mobile navigation — off-canvas panel + backdrop
   ========================================================= */
/* Scoped to mobile widths only, matching Tailwind's own md breakpoint,
   so these rules never compete with md:hidden on desktop. */
@media (max-width: 767px) {
  .mobile-navigation {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(85vw, 340px);
    flex-direction: column;
    gap: .125rem;
    padding-top: calc(var(--header-h) + 8px);
    padding-bottom: 24px;
    background: #ffffff;
    box-shadow: -16px 0 40px -16px rgba(6, 48, 77, .45);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    z-index: 60;
    overflow-y: auto;
    border-top: none;
  }

  /* Tailwind's `hidden` class sets display:none; once JS removes it
     (to start the open/close transition) fall back to flex. */
  .mobile-navigation:not(.hidden) {
    display: flex;
  }

  .mobile-navigation.is-open {
    transform: translateX(0);
  }
}

.mobile-navigation a {
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(6, 48, 77, .08);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 15, 30, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  /* Keep the backdrop below the header stacking context so the panel stays tappable. */
  z-index: 40;
  touch-action: manipulation;
}

.mobile-nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.nav-open {
  overflow: hidden;
}

/* =========================================================
   Scroll reveal — fade/slide up as sections enter view
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Photo strip — auto-scrolls, but is a real scroll container
   so visitors can drag/swipe/scroll it themselves too
   ========================================================= */
.marquee {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  cursor: grab;
  touch-action: pan-x;
}

.marquee::-webkit-scrollbar {
  display: none;
}

.marquee:active {
  cursor: grabbing;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: max-content;
  padding: .25rem;
  user-select: none;
  -webkit-user-select: none;
}

.marquee-track figure {
  flex: none;
  margin: 0;
}

.marquee-track img {
  height: 240px;
  width: auto;
  max-width: none;
  display: block;
  border-radius: .875rem;
  box-shadow: 0 16px 30px -14px rgba(6, 48, 77, .45);
  object-fit: cover;
  cursor: zoom-in;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  user-drag: none;
  transition: transform .25s ease;
}

.marquee-track img:hover,
.marquee-track img:focus-visible {
  transform: translateY(-4px);
}

.marquee-track img:focus-visible {
  outline: 3px solid var(--brand-cyan);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .marquee-track img {
    height: 170px;
  }
}

/* =========================================================
   Lightbox — click any photo-strip image to view it enlarged
   ========================================================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 15, 30, .88);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: min(92vw, 900px);
  max-height: 85vh;
  border-radius: .75rem;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
  transform: scale(.96);
  transition: transform .25s ease;
}

.lightbox-overlay.is-open img {
  transform: scale(1);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 9999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, .24);
}

.lightbox-close {
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  font-size: 1.15rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lightbox-nav {
    width: 38px;
    height: 38px;
  }
}

/* =========================================================
   Contact form feedback
   ========================================================= */
.form-msg.success {
  color: #0f766e;
}

.form-msg.error {
  color: #b91c1c;
}

/* =========================================================
   Back-to-top button (injected by site.js)
   ========================================================= */
#back-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  color: #fff;
  background: linear-gradient(120deg, var(--brand-navy), var(--brand-cyan));
  box-shadow: 0 10px 25px -10px rgba(6, 48, 77, .6);
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease;
  font-size: 1.1rem;
  line-height: 1;
}

#back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#back-to-top:hover {
  filter: brightness(1.08);
}

/* =========================================================
   Toast — brief confirmation (e.g. "email copied")
   ========================================================= */
.site-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 90;
  max-width: min(92vw, 420px);
  padding: .75rem 1.1rem;
  border-radius: .75rem;
  background: rgba(6, 48, 77, .96);
  color: #fff;
  font-size: .875rem;
  text-align: center;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .25s ease, transform .25s ease;
}

.site-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
