/* AI TEMPLATE STYLE GUIDE
 * Keep selectors, layout, breakpoints and interaction states intact.
 * Concrete color values live only in custom-property definitions.
 * Update the documented BRAND tokens from Color Preferences; keep defaults if absent.
 * Reconcile hover/focus/text contrast and form aliases together when changing a palette.
 * currentColor is inherited semantic color, not a separate palette literal.
 */
/* Galleries reuse the theme variables defined at the top of styles.css. */

/* Responsive component styling for [hidden]; preserve visibility/disabled behavior controlled by HTML or JavaScript. Preserve selectors and specificity. */

[hidden] {
  display: none !important;
}

/* Responsive component styling for .home-gallery. Preserve selectors and specificity. */

.home-gallery {
  padding: 64px 0 52px;
  background: var(--color-soft);
}

/* Responsive component styling for .gallery-heading. Preserve selectors and specificity. */

.gallery-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 30px;
}

/* Responsive component styling for .gallery-heading h2. Preserve selectors and specificity. */

.gallery-heading h2 {
  font-size: 42px;
  line-height: 1.15;
  margin-top: 10px;
}

/* Responsive component styling for .gallery-heading p:last-child. Preserve selectors and specificity. */

.gallery-heading p:last-child {
  font-size: 19px;
  line-height: 1.5;
  margin-top: 13px;
}

/* Responsive component styling for .gallery-view-link. Preserve selectors and specificity. */

.gallery-view-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--color-blue);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

/* Responsive component styling for .gallery-view-link:hover; pointer hover feedback paired with the base component. Preserve selectors and specificity. */

.gallery-view-link:hover {
  color: var(--color-blue-hover);
  text-decoration: underline;
}

/* Responsive component styling for .gallery-view-link .icon. Preserve selectors and specificity. */

.gallery-view-link .icon {
  width: 18px;
  height: 18px;
}

/* Native scrolling keeps touch and trackpad navigation smooth without a library. */

/* Responsive component styling for .gallery-track. Preserve selectors and specificity. */

.gallery-track {
  /* --gallery-gap: gallery gap. Scope: .gallery-track. BRAND: coordinate with the client Color Preferences; retain the default when absent. */
  --gallery-gap: 24px;
  /* --gallery-columns: gallery columns. Scope: .gallery-track. BRAND: coordinate with the client Color Preferences; retain the default when absent. */
  --gallery-columns: 3;
  display: flex;
  gap: var(--gallery-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius-card);
}

/* Responsive component styling for .gallery-track::-webkit-scrollbar. Preserve selectors and specificity. */

.gallery-track::-webkit-scrollbar {
  display: none;
}

/* Responsive component styling for .gallery-card. Preserve selectors and specificity. */

.gallery-card {
  min-width: 0;
  margin: 0;
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* Responsive component styling for .gallery-track .gallery-card. Preserve selectors and specificity. */

.gallery-track .gallery-card {
  flex: 0 0 calc((100% - (var(--gallery-columns) - 1) * var(--gallery-gap)) / var(--gallery-columns));
  scroll-snap-align: start;
}

/* Responsive component styling for .gallery-photo-button. Preserve selectors and specificity. */

.gallery-photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--color-card);
  color: var(--color-ink);
  text-align: left;
}

/* Responsive component styling for .gallery-photo-frame. Preserve selectors and specificity. */

.gallery-photo-frame {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-line);
}

/* Responsive component styling for .gallery-photo-frame img. Preserve selectors and specificity. */

.gallery-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition), opacity var(--transition);
}

/* Breakpoint/conditional rules: retain thresholds and component behavior. */

@media (hover:hover) and (pointer:fine) {
  /* Responsive component styling for .gallery-photo-button:hover .gallery-photo-frame img; pointer hover feedback paired with the base component. Preserve selectors and specificity. */

  .gallery-photo-button:hover .gallery-photo-frame img {
    transform: scale(1.035);
  }
}

/* Responsive component styling for .gallery-photo-button:focus-visible; visible keyboard focus state. Preserve selectors and specificity. */

.gallery-photo-button:focus-visible {
  outline-offset: -4px;
  outline-width: 4px;
}

/* Responsive component styling for .gallery-caption. Preserve selectors and specificity. */

.gallery-caption {
  display: block;
  padding: 17px 20px;
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Responsive component styling for .gallery-controls. Preserve selectors and specificity. */

.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin-top: 26px;
}

/* Responsive component styling for .gallery-arrow. Preserve selectors and specificity. */

.gallery-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  color: var(--color-blue);
  background: var(--color-white);
  transition: background-color var(--transition), color var(--transition);
}

/* Responsive component styling for .gallery-arrow:hover:not(:disabled); pointer hover feedback paired with the base component; preserve visibility/disabled behavior controlled by HTML or JavaScript. Preserve selectors and specificity. */

.gallery-arrow:hover:not(:disabled) {
  background: var(--color-blue);
  color: var(--color-white);
}

/* Responsive component styling for .gallery-arrow:disabled; preserve visibility/disabled behavior controlled by HTML or JavaScript. Preserve selectors and specificity. */

.gallery-arrow:disabled {
  opacity: .35;
  cursor: default;
}

/* Responsive component styling for .gallery-arrow .icon. Preserve selectors and specificity. */

.gallery-arrow .icon {
  width: 19px;
  height: 19px;
}

/* Responsive component styling for .gallery-prev .icon. Preserve selectors and specificity. */

.gallery-prev .icon {
  transform: rotate(180deg);
}

/* Responsive component styling for .gallery-position. Preserve selectors and specificity. */

.gallery-position {
  min-width: 95px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* The standalone page shares the site's header/footer, not fixed Home heights. */

/* Responsive component styling for .gallery-intro. Preserve selectors and specificity. */

.gallery-intro {
  padding: 30px 0 48px;
  background: linear-gradient(var(--color-soft), var(--color-white));
}

/* Responsive component styling for .breadcrumbs. Preserve selectors and specificity. */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: var(--color-copy);
  margin-bottom: 30px;
}

/* Responsive component styling for .breadcrumbs a. Preserve selectors and specificity. */

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-blue);
}

/* Responsive component styling for .breadcrumbs a:hover; pointer hover feedback paired with the base component. Preserve selectors and specificity. */

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* Responsive component styling for .gallery-intro h1. Preserve selectors and specificity. */

.gallery-intro h1 {
  font-size: 58px;
  line-height: 1.15;
  margin-top: 12px;
  padding-bottom: 8px;
}

/* Responsive component styling for .gallery-intro > .container > p:last-child. Preserve selectors and specificity. */

.gallery-intro > .container > p:last-child {
  font-size: 21px;
  line-height: 1.55;
  margin-top: 10px;
}

/* Responsive component styling for .gallery-collection. Preserve selectors and specificity. */

.gallery-collection {
  padding-bottom: 58px;
}

/* Responsive component styling for .gallery-grid. Preserve selectors and specificity. */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

/* Responsive component styling for .gallery-more. Preserve selectors and specificity. */

.gallery-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-top: 32px;
}

/* Responsive component styling for .gallery-total. Preserve selectors and specificity. */

.gallery-total {
  font-size: 16px;
}

/* Responsive component styling for .gallery-load-more. Preserve selectors and specificity. */

.gallery-load-more {
  min-height: 56px;
  font-size: 18px;
  padding: 14px 29px;
}

/* Responsive component styling for .gallery-page .final-cta. Preserve selectors and specificity. */

.gallery-page .final-cta {
  margin-top: 0;
}

/* A separate native dialog keeps photo navigation independent of service dialogs. */

/* Responsive component styling for #gallery-lightbox. Preserve selectors and specificity. */

#gallery-lightbox {
  width: min(1200px, calc(100% - 40px));
  max-width: 1200px;
  max-height: calc(100dvh - 32px);
  padding: 20px;
  overflow: auto;
}

/* Responsive component styling for #gallery-lightbox::backdrop. Preserve selectors and specificity. */

#gallery-lightbox::backdrop {
  background: var(--color-overlay);
}

/* Responsive component styling for .gallery-lightbox-top. Preserve selectors and specificity. */

.gallery-lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

/* Responsive component styling for .gallery-lightbox-counter. Preserve selectors and specificity. */

.gallery-lightbox-counter {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* Responsive component styling for .gallery-lightbox-close. Preserve selectors and specificity. */

.gallery-lightbox-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--color-soft);
  color: var(--color-ink);
}

/* Responsive component styling for .gallery-lightbox-close:hover; pointer hover feedback paired with the base component. Preserve selectors and specificity. */

.gallery-lightbox-close:hover {
  background: var(--color-line);
}

/* Responsive component styling for .gallery-lightbox-frame. Preserve selectors and specificity. */

.gallery-lightbox-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(63dvh, 760px);
  min-height: 120px;
  background: var(--color-soft);
  border-radius: 8px;
}

/* Responsive component styling for .gallery-lightbox-frame img. Preserve selectors and specificity. */

.gallery-lightbox-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Responsive component styling for .gallery-lightbox-bottom. Preserve selectors and specificity. */

.gallery-lightbox-bottom {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}

/* Responsive component styling for .gallery-lightbox-caption. Preserve selectors and specificity. */

.gallery-lightbox-caption {
  grid-column: 2;
  text-align: center;
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  max-height: 100px;
  overflow-y: auto;
}

/* Breakpoint/conditional rules: retain thresholds and component behavior. */

@media (max-width: 1099px) {
  /* Responsive component styling for .home-gallery. Preserve selectors and specificity. */

  .home-gallery {
    padding: 45px 0 36px;
  }

  /* Responsive component styling for .gallery-track. Preserve selectors and specificity. */

  .gallery-track {
    /* --gallery-columns: gallery columns. Scope: .gallery-track. BRAND: coordinate with the client Color Preferences; retain the default when absent. */
    --gallery-columns: 2;
  }

  /* Responsive component styling for .gallery-heading h2. Preserve selectors and specificity. */

  .gallery-heading h2 {
    font-size: 34px;
  }

  /* Responsive component styling for .gallery-heading p:last-child. Preserve selectors and specificity. */

  .gallery-heading p:last-child {
    font-size: 17px;
  }

  /* Responsive component styling for .gallery-grid. Preserve selectors and specificity. */

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Responsive component styling for .gallery-intro h1. Preserve selectors and specificity. */

  .gallery-intro h1 {
    font-size: 48px;
  }
}

/* Breakpoint/conditional rules: retain thresholds and component behavior. */

@media (max-width: 767px) {
  /* Responsive component styling for .home-gallery. Preserve selectors and specificity. */

  .home-gallery {
    padding: 34px 0 28px;
  }

  /* Responsive component styling for .gallery-heading. Preserve selectors and specificity. */

  .gallery-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 22px;
  }

  /* Responsive component styling for .gallery-heading h2. Preserve selectors and specificity. */

  .gallery-heading h2 {
    font-size: 29px;
  }

  /* Responsive component styling for .gallery-heading p:last-child. Preserve selectors and specificity. */

  .gallery-heading p:last-child {
    font-size: 16px;
    margin-top: 12px;
  }

  /* Responsive component styling for .gallery-view-link. Preserve selectors and specificity. */

  .gallery-view-link {
    font-size: 16px;
  }

  /* Responsive component styling for .gallery-track. Preserve selectors and specificity. */

  .gallery-track {
    /* --gallery-columns: gallery columns. Scope: .gallery-track. BRAND: coordinate with the client Color Preferences; retain the default when absent. */
    --gallery-columns: 1;
    /* --gallery-gap: gallery gap. Scope: .gallery-track. BRAND: coordinate with the client Color Preferences; retain the default when absent. */
    --gallery-gap: 16px;
  }

  /* Responsive component styling for .gallery-controls. Preserve selectors and specificity. */

  .gallery-controls {
    margin-top: 20px;
  }

  /* Responsive component styling for .gallery-caption. Preserve selectors and specificity. */

  .gallery-caption {
    font-size: 16px;
    padding: 14px 17px;
  }

  /* Responsive component styling for .gallery-intro. Preserve selectors and specificity. */

  .gallery-intro {
    padding: 18px 0 30px;
  }

  /* Responsive component styling for .breadcrumbs. Preserve selectors and specificity. */

  .breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
  }

  /* Responsive component styling for .gallery-intro h1. Preserve selectors and specificity. */

  .gallery-intro h1 {
    font-size: 42px;
  }

  /* Responsive component styling for .gallery-intro > .container > p:last-child. Preserve selectors and specificity. */

  .gallery-intro > .container > p:last-child {
    font-size: 17px;
  }

  /* Responsive component styling for .gallery-grid. Preserve selectors and specificity. */

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Responsive component styling for .gallery-collection. Preserve selectors and specificity. */

  .gallery-collection {
    padding-bottom: 32px;
  }

  /* Responsive component styling for #gallery-lightbox. Preserve selectors and specificity. */

  #gallery-lightbox {
    width: calc(100% - 24px);
    padding: 12px;
    border-radius: 12px;
  }

  /* Responsive component styling for .gallery-lightbox-top. Preserve selectors and specificity. */

  .gallery-lightbox-top {
    margin-bottom: 10px;
  }

  /* Responsive component styling for .gallery-lightbox-frame. Preserve selectors and specificity. */

  .gallery-lightbox-frame {
    height: 55dvh;
  }

  /* Responsive component styling for .gallery-lightbox-bottom. Preserve selectors and specificity. */

  .gallery-lightbox-bottom {
    gap: 10px;
    margin-top: 12px;
  }

  /* Responsive component styling for .gallery-lightbox-caption. Preserve selectors and specificity. */

  .gallery-lightbox-caption {
    font-size: 15px;
  }
}

/* Reduced-motion accessibility: retain the user preference handling. */

@media (prefers-reduced-motion: reduce) {
  /* Responsive component styling for .gallery-photo-frame img. Preserve selectors and specificity. */

  .gallery-photo-frame img {
    transition: none;
  }

  /* Responsive component styling for .gallery-photo-button:hover .gallery-photo-frame img; pointer hover feedback paired with the base component. Preserve selectors and specificity. */

  .gallery-photo-button:hover .gallery-photo-frame img {
    transform: none;
  }
}

/* Static controls animate only their color, never their hit area. */

/* Responsive component styling for .gallery-view-link. Preserve selectors and specificity. */

.gallery-view-link {
  transition: color var(--transition),text-decoration-color var(--transition);
}

/* Responsive component styling for .gallery-lightbox-close. Preserve selectors and specificity. */

.gallery-lightbox-close {
  transition: background-color var(--transition),color var(--transition);
}
