/* ===== CSS Variables ===== */
:root {
  --brand: #009900;
  --brand-hover: #007a00;
  --brand-light: #00b300;
  --brand-tint: #e6ffe6;
  --brand-dark: #003300;
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --text: #1e293b;
  --text-muted: #475569;
  --card: #ffffff;
  --border: #e2e8f0;
}

/* ===== Alpine cloak ===== */
[x-cloak] { display: none !important; }

/* ===== Content typography ===== */
.max-w-none h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}
.max-w-none h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.max-w-none h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.max-w-none p {
  margin-bottom: 1rem;
  line-height: 1.75;
}
.max-w-none ul, .max-w-none ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
.max-w-none ul { list-style-type: disc; }
.max-w-none ol { list-style-type: decimal; }
.max-w-none li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}
.max-w-none li > ul, .max-w-none li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
@media (min-width: 768px) {
  .max-w-none h2 { font-size: 1.75rem; }
  .max-w-none h3 { font-size: 1.375rem; }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Scroll animations ===== */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.scroll-animate-delay-1 { transition-delay: 0.1s; }
.scroll-animate-delay-2 { transition-delay: 0.2s; }
.scroll-animate-delay-3 { transition-delay: 0.3s; }
.scroll-animate-delay-4 { transition-delay: 0.4s; }
.scroll-animate-delay-5 { transition-delay: 0.5s; }

/* ===== Hero overlay ===== */
.hero-overlay {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 100%);
}

.hero-overlay-dark {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
}

/* ===== Back to top ===== */
.back-to-top {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* ===== Card hover ===== */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

/* ===== Service card icon ===== */
.service-icon {
  transition: transform 0.2s ease, color 0.2s ease;
}

.card-hover:hover .service-icon {
  transform: scale(1.1);
  color: var(--brand);
}

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

/* ===== Focus visible for accessibility ===== */
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Smooth scroll ===== */
html {
  scroll-behavior: smooth;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .scroll-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }

  .card-hover:hover {
    transform: none;
  }
}

/* ===== Dropdown menu ===== */
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== FAQ accordion ===== */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-chevron {
  transition: transform 0.3s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

/* ===== Section separator ===== */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* ===== Breadcrumbs ===== */
.breadcrumb-separator::after {
  content: '/';
  margin: 0 0.5rem;
  color: var(--text-muted);
}

/* ===== Badge ===== */
.badge-brand {
  background-color: var(--brand-tint);
  color: var(--brand);
}

/* ===== Mobile menu transition ===== */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.open {
  max-height: 100vh;
}

/* ===== Modal overlay ===== */
.modal-overlay {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

/* ===== Image lazy load placeholder ===== */
img[loading="lazy"] {
  background-color: var(--bg-alt);
}

/* ===== Prose content styling ===== */
.prose h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1rem;
}

/* ===== Lightbox overlay ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-overlay.active {
  visibility: visible;
  opacity: 1;
}

/* ===== Image wrapper (blocks click-to-close on the image) ===== */
.lightbox-img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 60px 80px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* ===== Image ===== */
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.35s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-img.loaded {
  opacity: 1;
}

/* ===== Close button ===== */
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.08);
}

.lightbox-close:active {
  transform: scale(0.95);
}

/* ===== Navigation arrows ===== */
.lightbox-nav {
  position: fixed;
  top: 50%;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-nav svg {
  display: block;
}

/* ===== Counter ===== */
.lightbox-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 210;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  user-select: none;
  white-space: nowrap;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .lightbox-img-wrapper {
    padding: 56px 16px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-nav svg {
    width: 24px;
    height: 24px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .lightbox-close svg {
    width: 22px;
    height: 22px;
  }

  .lightbox-counter {
    bottom: 16px;
    font-size: 13px;
    padding: 5px 14px;
  }
}

@media (max-width: 480px) {
  .lightbox-img-wrapper {
    padding: 52px 8px;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
  }

  .lightbox-nav svg {
    width: 20px;
    height: 20px;
  }

  .lightbox-prev {
    left: 6px;
  }

  .lightbox-next {
    right: 6px;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay,
  .lightbox-img {
    transition: none;
  }
}

/* ===== Feedback modal checkmark animation ===== */
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}
