/* ==========================================================================
   Les Jardins de Nicolas - Custom Styles
   Works alongside Tailwind CSS (CDN). Only overrides and custom properties.
   ========================================================================== */

/* --- Custom Properties -------------------------------------------------- */
:root {
  --green-forest: #2D5F2D;
  --white-off: #FAF8F5;
  --brown-earth: #6B4226;
  --green-olive: #7A9E56;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --transition: 0.3s ease;
}

/* --- Base --------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--white-off);
  color: #333;
}

/* Smooth transitions on all interactive elements */
a,
button,
input,
textarea,
select,
.card,
.gallery-item,
.filter-btn,
img {
  transition: all var(--transition);
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--green-olive);
  border-radius: 4px;
}

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--green-olive) var(--white-off);
}

/* --- Fade-in Animation -------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Sticky Header ------------------------------------------------------ */
.header-scrolled {
  box-shadow: var(--shadow-md);
}

/* --- Active Nav Link ---------------------------------------------------- */
.nav-link.active {
  color: var(--green-forest);
  font-weight: 600;
  position: relative;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--green-olive);
  border-radius: 1px;
}

/* --- Hero Section ------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(45, 95, 45, 0.55) 0%,
    rgba(45, 95, 45, 0.35) 50%,
    rgba(45, 95, 45, 0.65) 100%
  );
  z-index: 1;
}

.hero > * {
  position: relative;
  z-index: 2;
}

/* --- Card Hover Effects ------------------------------------------------- */
.card {
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* --- Gallery Filter Buttons --------------------------------------------- */
.filter-btn {
  cursor: pointer;
  border: 1px solid #ddd;
  background: white;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  color: #555;
}

.filter-btn:hover {
  border-color: var(--green-olive);
  color: var(--green-forest);
}

.filter-btn.active {
  background-color: var(--green-olive);
  border-color: var(--green-olive);
  color: white;
  font-weight: 500;
}

/* --- Gallery Items ------------------------------------------------------ */
.gallery-item {
  cursor: pointer;
  overflow: hidden;
  border-radius: 0.5rem;
}

.gallery-item img {
  transition: transform var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item.hidden {
  display: none;
}

/* --- Lightbox ----------------------------------------------------------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

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

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  padding: 0.5rem;
  z-index: 10000;
  transition: opacity var(--transition);
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 1rem;
  z-index: 10000;
  transition: opacity var(--transition);
}

.lightbox-nav:hover {
  opacity: 0.7;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* --- Google Maps Responsive Container ----------------------------------- */
.map-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 0.5rem;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Form Focus Styles -------------------------------------------------- */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--green-olive);
  box-shadow: 0 0 0 3px rgba(122, 158, 86, 0.2);
}

.form-error {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.form-success {
  color: var(--green-forest);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 768px) {
  .hero {
    min-height: 60vh;
  }

  .lightbox-nav {
    font-size: 1.5rem;
    padding: 0.5rem;
  }

  .lightbox-close {
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1.5rem;
  }
}

/* --- Print Styles ------------------------------------------------------- */
@media print {
  header,
  footer,
  .lightbox-overlay,
  .filter-btn,
  .cta-btn,
  .mobile-menu-btn,
  .map-container {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .hero {
    min-height: auto;
    padding: 1rem 0;
  }

  .hero::before {
    display: none;
  }

  .card {
    box-shadow: none;
    break-inside: avoid;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  img {
    max-width: 100% !important;
  }
}
