/* ============================================
   CUSTOM OVERRIDES — Leids Carpentry LLC
   Fix static site issues from WP conversion
   ============================================ */

/* -------------------------------------------
   Fix 1: Sticky Header
   ------------------------------------------- */
.elementor-location-header,
header[data-elementor-type="header"] {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Override frozen fixed positioning from WP capture */
.elementor-location-header .elementor-section.elementor-sticky,
.elementor-location-header .elementor-section.elementor-sticky--active {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  top: auto !important;
  left: auto !important;
  margin: 0 !important;
}

.elementor-sticky__spacer { display: none !important; }

/* -------------------------------------------
   Fix 3: Navigation System
   ------------------------------------------- */

/* Desktop: hide mobile dropdown and hamburger */
@media (min-width: 1025px) {
  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    display: none !important;
  }
  .elementor-menu-toggle {
    display: none !important;
  }

  /* Desktop dropdown submenus */
  .elementor-nav-menu--main .menu-item-has-children > .sub-menu {
    display: none !important;
    position: absolute !important;
    top: 100%; left: 0;
    background: #fff !important;
    min-width: 220px; width: max-content; max-width: 320px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.14) !important;
    z-index: 10000 !important;
    padding: 8px 0 !important;
    border-radius: 4px;
    list-style: none !important;
  }
  .elementor-nav-menu--main .menu-item-has-children:hover > .sub-menu {
    display: block !important;
  }
  .elementor-nav-menu--main .sub-menu li a {
    padding: 8px 20px !important;
    display: flex !important;
    align-items: center !important;
    white-space: nowrap;
    color: #222 !important;
    text-decoration: none !important;
    font-size: 15px !important;
  }
  /* Sub-arrow: inline after text, pointing right for nested flyout */
  .elementor-nav-menu--main .sub-menu .sub-arrow {
    display: inline-flex !important;
    margin-left: auto !important;
    padding-left: 8px !important;
  }
  .elementor-nav-menu--main .sub-menu .sub-arrow i,
  .elementor-nav-menu--main .sub-menu .sub-arrow svg {
    transform: rotate(-90deg) !important;
  }
  .elementor-nav-menu--main .sub-menu li a:hover {
    background: #f5f5f5 !important;
    color: #1e73be !important;
  }
  /* Nested flyout to the right */
  .elementor-nav-menu--main .sub-menu .menu-item-has-children > .sub-menu {
    position: absolute !important;
    top: 0 !important; left: 100% !important;
    background: #fff !important;
    z-index: 10001 !important;
  }
}

/* Tablet/Mobile: position the dropdown full-width below header */
@media (max-width: 1024px) {
  /* Allow dropdown to escape the narrow column */
  .elementor-location-header .elementor-column,
  .elementor-location-header .elementor-widget-wrap,
  .elementor-location-header .elementor-widget-container,
  .elementor-location-header .elementor-widget-nav-menu {
    overflow: visible !important;
  }

  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    position: fixed !important;
    left: 0 !important; right: 0 !important;
    width: 100vw !important;
    max-height: calc(100vh - 80px) !important;
    height: auto !important;
    z-index: 99998 !important;
    background: #fff !important;
    overflow-y: auto !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
  }

  .elementor-menu-toggle { z-index: 99999 !important; }

  .elementor-nav-menu--stretch .elementor-nav-menu__container.elementor-nav-menu--dropdown {
    position: fixed !important;
    width: 100vw !important;
    left: 0 !important;
  }
}

/* -------------------------------------------
   Fix 4: Gallery Grid & Lightbox
   ------------------------------------------- */

/* Gallery masonry layout — 3 columns with CSS columns */
.e-gallery-masonry {
  height: auto !important;
  margin-bottom: 0 !important;
  display: block !important;
  column-count: 3 !important;
  column-gap: 10px !important;
}

@media (max-width: 1024px) {
  .e-gallery-masonry {
    column-count: 2 !important;
  }
}

@media (max-width: 768px) {
  .e-gallery-masonry {
    column-count: 1 !important;
  }
}

.e-gallery-masonry .e-gallery-item {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  height: auto !important;
  transform: none !important;
  display: inline-block !important;
  break-inside: avoid !important;
  margin-bottom: 10px !important;
}

.e-gallery-masonry .e-gallery-image {
  width: 100% !important;
  padding-bottom: var(--item-height, 75%) !important;
  height: 0 !important;
  background-size: cover !important;
  background-position: center !important;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.e-gallery-masonry .e-gallery-item:hover .e-gallery-image {
  transform: scale(1.02);
}

/* Hide Elementor gallery overlay text */
.elementor-gallery-item__overlay {
  display: none !important;
}

/* -------------------------------------------
   Lightbox CSS
   ------------------------------------------- */
#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

#lightbox-overlay.active {
  display: flex;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
}

.lb-img-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 88vh;
}

.lb-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  transition: opacity 0.3s;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
}

.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 28px;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.lb-prev:hover, .lb-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-spinner {
  display: none;
  position: absolute;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lb-spin 0.8s linear infinite;
}

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

/* -------------------------------------------
   Fix 7: Smooth Scroll
   ------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* -------------------------------------------
   Gallery Filter Buttons (active state)
   ------------------------------------------- */
/* -------------------------------------------
   Reviews Carousel Arrows — black, no background
   ------------------------------------------- */
.elementor-widget-reviews .elementor-swiper-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: none !important;
  color: #000 !important;
  font-size: 24px !important;
  width: 40px !important;
  height: 40px !important;
  cursor: pointer;
}
.elementor-widget-reviews .elementor-swiper-button i {
  color: #000 !important;
}
.elementor-widget-reviews .elementor-swiper-button:hover {
  opacity: 0.7;
}

/* Ensure swiper slides are visible */
.elementor-widget-reviews .swiper-slide {
  display: block !important;
  flex-shrink: 0;
}

.elementor-gallery-title.elementor-item-active {
  color: #1e73be !important;
  font-weight: 600;
}

/* ============================================
   ADAPT FORM (form-relay)
   Brand: gold #cfa167 on ink #1b2123, pale #e7efe7
   ============================================ */
.adapt-form-wrapper { width: 100%; }
.adapt-form {
  display: block;
  font-family: Poppins, sans-serif;
  --af-gold: #cfa167;
  --af-gold-dark: #b4884f;
  --af-ink: #1b2123;
  --af-line: #d8d5cd;
  --af-pale: #f3f7f3;
}
.adapt-form .form-required-legend {
  font-size: 12.5px; color: #6b6f70; margin: 0 0 18px;
  letter-spacing: .01em;
}
.adapt-form .required { color: var(--af-gold-dark); font-weight: 700; }
.adapt-form fieldset { border: 0; padding: 0; margin: 0 0 4px; }
.adapt-form fieldset > legend {
  font-weight: 600; margin-bottom: 8px; display: block; width: 100%;
  font-size: 14px; color: var(--af-ink);
  text-transform: uppercase; letter-spacing: .08em;
}
.adapt-form .form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.adapt-form .form-row > .form-group { flex: 1 1 calc(50% - 8px); min-width: 210px; }
.adapt-form .form-group { margin-bottom: 16px; }
.adapt-form label {
  display: block; font-weight: 600; margin-bottom: 6px;
  font-size: 13px; color: var(--af-ink);
  text-transform: uppercase; letter-spacing: .08em;
}
.adapt-form .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.adapt-form input[type="text"],
.adapt-form input[type="email"],
.adapt-form input[type="tel"],
.adapt-form textarea {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--af-line); border-radius: 2px;
  font: inherit; font-size: 15px; background: #fff; color: var(--af-ink);
  box-sizing: border-box;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.adapt-form input::placeholder, .adapt-form textarea::placeholder { color: #9aa0a1; }
.adapt-form input:hover, .adapt-form textarea:hover { border-color: #bdb8ac; }
.adapt-form input:focus, .adapt-form textarea:focus {
  outline: 0; border-color: var(--af-gold); background: #fffdf9;
  box-shadow: 0 0 0 3px rgba(207,161,103,.18);
}
.adapt-form textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

/* honeypot: must stay in the layout for bots, invisible to people */
.adapt-form .adapt-hp {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.adapt-form-submit {
  background: var(--af-gold); color: #1b2123; border: 0;
  padding: 15px 40px; font: inherit; font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: .1em;
  border-radius: 2px; cursor: pointer; margin-top: 4px;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 2px 0 rgba(0,0,0,.06);
}
.adapt-form-submit:hover:not(:disabled),
.adapt-form-submit:focus-visible {
  background: var(--af-gold-dark); color: #fff; transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(27,33,35,.45);
}
.adapt-form-submit:active:not(:disabled) { transform: translateY(0); }
.adapt-form-submit:disabled { opacity: .55; cursor: not-allowed; }

.adapt-form-status {
  margin-top: 16px; font-size: 14.5px; min-height: 1.4em; line-height: 1.55;
}
.adapt-form-status.is-success {
  color: #1e5f33; font-weight: 600;
  background: var(--af-pale); border-left: 3px solid #2f8b4c;
  padding: 12px 14px; border-radius: 2px;
}
.adapt-form-status.is-error {
  color: #9c2b21; font-weight: 600;
  background: #fdf3f2; border-left: 3px solid #c0392b;
  padding: 12px 14px; border-radius: 2px;
}
@media (max-width: 600px) {
  .adapt-form .form-row > .form-group { flex: 1 1 100%; }
  .adapt-form-submit { width: 100%; }
}
