/* Mobile-First Navigation - KCHSLSC
 * Replaces legacy Squarespace mobile menu
 */

/* Hide legacy Squarespace header */
#header.header {
  display: none !important;
}

.site-header {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.site-logo img {
  height: 60px;
  width: auto;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle .bar {
  width: 100%;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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

.main-nav {
  position: fixed;
  inset: 0;
  top: 84px;
  background: #fff;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
}

.main-nav.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 24px 16px;
}

.nav-list li {
  border-bottom: 1px solid #eee;
}

.nav-list a {
  display: block;
  padding: 16px 0;
  font-size: 18px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a:focus {
  color: #0066cc;
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.nav-list a[aria-current="page"] {
  color: #0066cc;
  font-weight: 600;
}

/* Mobile layout fixes */
@media (max-width: 767px) {
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden !important;
  }

  /* Stack columns vertically */
  .sqs-row {
    display: flex !important;
    flex-direction: column !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .sqs-row [class*="sqs-col-"],
  [class*="sqs-col-"] {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
  }

  /* Stack image layouts vertically */
  .design-layout-collage,
  .design-layout-overlap,
  .design-layout-card {
    display: flex !important;
    flex-direction: column !important;
  }

  .design-layout-collage > *,
  .design-layout-overlap > *,
  .design-layout-card > * {
    width: 100% !important;
    position: relative !important;
  }

  .design-layout-collage .image-card-wrapper,
  .design-layout-overlap .image-card-wrapper,
  .design-layout-card .image-card-wrapper {
    width: 100% !important;
    padding: 16px 0 !important;
    margin-left: 0 !important;
  }

  /* Constrain images */
  .image-inset,
  .sqs-image-shape-container-element {
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .content-wrapper {
    max-width: 100% !important;
  }

  .sqs-block-image img,
  .sqs-gallery-design-strip img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Gallery strips - stack vertically */
  .sqs-gallery-design-strip {
    overflow-x: auto !important;
  }

  /* Reduce excessive hero/banner spacing */
  body.homepage .page-section:first-of-type {
    padding-top: 20px !important;
    min-height: auto !important;
  }

  /* Remove header scrim spacing */
  .sections {
    --header-scrim-top-spacing: 20px !important;
  }

  /* Consistent section alignment - avoid double padding */
  .page-section .content-wrapper {
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }

  .page-section .sqs-layout {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Fix remaining content overflow */
  .sqs-block,
  .sqs-block-content {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Fix image margins and overflow */
  .sqs-block-image,
  .image-block-outer-wrapper,
  figure.sqs-block-image-figure {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden !important;
  }

  /* Gallery strips: horizontal scroll carousel */
  .gallery-strips-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x proximity !important;
    gap: 12px !important;
    padding: 0 16px 8px 16px !important;
    height: auto !important;
  }

  .gallery-strips-item {
    position: relative !important;
    flex: 0 0 85vw !important;
    transform: none !important;
    scroll-snap-align: start !important;
  }

  .gallery-strips-item-wrapper {
    height: auto !important;
  }

  .gallery-strips-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }
}

/* Tablet and up */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    transform: none;
    overflow: visible;
    visibility: visible;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    padding: 0;
  }

  .nav-list li {
    border: none;
  }

  .nav-list a {
    padding: 8px 12px;
    font-size: 14px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .site-logo img {
    height: 100px;
  }

  .nav-list {
    gap: 16px;
  }

  .nav-list a {
    font-size: 16px;
  }
}
