/* ==========================================
   DAYTONA GALLERY PAGE
   Uses internal-page hero from internal-pages.css
========================================== */

/* The top hero/header uses:
   .internal-page
   .internal-hero
   .internal-hero__inner
   .internal-kicker

   This file styles the gallery content below the hero.
*/

/* ==========================================
   GALLERY SECTION
========================================== */

.gallery-section {
  padding: clamp(64px, 8vw, 96px) 0;
  background: #f4f5f5;
}

/* ==========================================
   GALLERY FILTERS
========================================== */

.gallery-toolbar {
  position: relative; /* keeps the chips' hidden screen-reader text inside the row */
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

/* Filter chips: pill shape on purpose (they toggle what's shown rather than
   performing an action), otherwise matching the site button system. */
.gallery-filter {
  min-height: 44px;
  border: 2px solid #d9dfe1;
  background: #ffffff;
  color: #1f2426;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.1;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
}

/* Explicit colours for every state: Kadence's global button:hover/:focus
   otherwise paints a dark background with dark text. */
.gallery-filter:hover,
.gallery-filter:focus,
.gallery-filter:active {
  background: #f1f3f3;
  border-color: #1f2426;
  color: #1f2426;
}

.gallery-filter:hover {
  transform: translateY(-2px);
}

.gallery-filter.is-active,
.gallery-filter.is-active:hover,
.gallery-filter.is-active:focus,
.gallery-filter.is-active:active {
  background: #1f2426;
  color: #ffffff;
  border-color: #1f2426;
}

.gallery-filter:focus-visible {
  outline: 2px solid #1f2426;
  outline-offset: 3px;
}

/* ==========================================
   GALLERY GRID
========================================== */

.gallery-grid-custom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

/* ==========================================
   GALLERY CARDS
========================================== */

.gallery-card {
  display: none;
  width: 100%;
  padding: 0;
  border: 1px solid #e3e6e7;
  border-radius: 24px;
  background: #ffffff;
  color: #1f2426;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(31, 36, 38, 0.06);

  /* Prevent browser/theme button styling */
  appearance: none;
  -webkit-appearance: none;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery-card.is-visible {
  display: block;
}

/* Prevent WordPress/Kadence button hover/focus colors */

.gallery-card,
.gallery-card:hover,
.gallery-card:focus,
.gallery-card:active {
  background: #ffffff !important;
  color: #1f2426 !important;
  border: 1px solid #e3e6e7 !important;
  outline: none !important;
  text-decoration: none !important;
}

/* Card hover effect */

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(31, 36, 38, 0.12) !important;
}

/* Keyboard focus */

.gallery-card:focus-visible {
  outline: 2px solid #667174 !important;
  outline-offset: 3px;
}

/* ==========================================
   GALLERY CARD IMAGE
========================================== */

.gallery-card__image {
  display: block;
  background: #e5e8e9;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gallery-card__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-card:hover .gallery-card__image img {
  transform: scale(1.04);
}

/* ==========================================
   GALLERY CARD CONTENT
========================================== */

.gallery-card__body {
  display: block;
  padding: 18px;
}

.gallery-card__body strong,
.gallery-card:hover .gallery-card__body strong {
  display: block;
  margin-bottom: 5px;
  color: #1f2426 !important;
  font-size: 1.05rem;
}

.gallery-card__body .gallery-card__caption,
.gallery-card:hover .gallery-card__body .gallery-card__caption {
  display: block;
  color: #5f6a6d !important;
  font-size: 0.95rem;
}

/* Service category shown as a small tag above the title */
.gallery-card__body .gallery-card__tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef1f2;
  color: #1f2426 !important;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* "View photo" cue so cards read as clickable */
.gallery-card__body .gallery-card__view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #1f2426 !important;
  font-size: 0.9rem;
  font-weight: 850;
}

.gallery-card__body .gallery-card__view::after {
  content: "\2192";
  transition: transform 0.2s ease;
}

.gallery-card:hover .gallery-card__view::after,
.gallery-card:focus-visible .gallery-card__view::after {
  transform: translateX(3px);
}

/* Photo count in each filter chip */
.gallery-filter__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef1f2;
  color: #1f2426;
  font-size: 0.75rem;
}

.gallery-filter.is-active .gallery-filter__count {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Phones: filters become one swipeable row instead of a tall stack */
@media (max-width: 720px) {
  /* Row runs edge to edge of the screen, with chips starting in line with the content. */
  .gallery-toolbar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 8px;
    margin-inline: calc(50% - 50vw);
    margin-bottom: 24px;
    padding: 4px calc(50vw - 50%) 10px;
    scroll-padding-inline: calc(50vw - 50%);
    scrollbar-width: none;
  }

  .gallery-toolbar::-webkit-scrollbar {
    display: none;
  }

  .gallery-toolbar .gallery-filter {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    white-space: nowrap;
  }
}

/* ==========================================
   GALLERY ACTIONS
========================================== */

.gallery-actions {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.gallery-load-more.is-hidden {
  display: none;
}

/* ==========================================
   CTA
========================================== */

.gallery-cta {
  padding: clamp(64px, 8vw, 90px) 0;
  background: #1f2426;
  color: #ffffff;
}

.gallery-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.gallery-cta .gallery-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-cta h2 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.045em;
}

.gallery-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

/* ==========================================
   LIGHTBOX
   Photo viewer opened from gallery cards.
========================================== */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  place-items: center;
  /* side padding leaves room for the arrows beside the photo */
  padding: clamp(20px, 4vw, 56px) clamp(84px, 8vw, 112px);
  background: rgba(10, 12, 13, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gallery-lightbox.is-open {
  display: grid;
  animation: lightboxFadeIn 0.2s ease;
}

/* Photo with its caption card underneath; both always fit on screen. */
.gallery-lightbox__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: min(100%, 1100px);
  animation: lightboxZoomIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-lightbox__frame {
  position: relative;
  line-height: 0;
}

/* The Before or After tag, as on the home page's photos */
.gallery-lightbox__tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(31, 36, 38, 0.86);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-lightbox__content img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 1100px);
  max-height: calc(100vh - 250px);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transition: filter 0.25s ease;
}

/* Thumbnail placeholder while the full-size photo loads */
.gallery-lightbox__content img.is-loading {
  filter: blur(8px);
}

.gallery-lightbox__caption {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 16px 14px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.gallery-lightbox__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gallery-lightbox__caption strong {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.gallery-lightbox__counter {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.gallery-lightbox__meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.gallery-lightbox__cta {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ---------- Controls: close + arrows share one style ----------
   States are spelled out because Kadence's global button:hover/:focus
   would otherwise recolour them. */
.gallery-lightbox__close,
.gallery-lightbox__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

/* Focus (e.g. Close is focused when the viewer opens) keeps the resting colours;
   colours only, so it never overrides the controls' size or padding. */
.gallery-lightbox__close:focus,
.gallery-lightbox__nav:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
  color: #1f2426;
}

.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.gallery-lightbox__close svg,
.gallery-lightbox__nav svg {
  display: block;
  flex: 0 0 auto;
}

/* Close: labelled pill in the top-right corner */
.gallery-lightbox__close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3;
  height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 850;
}

.gallery-lightbox__close:active {
  transform: scale(0.96);
}

/* Arrows: large circles right beside the photo */
.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.gallery-lightbox__nav:active {
  transform: translateY(-50%) scale(0.94);
}

.gallery-lightbox__nav--prev {
  left: -80px;
}

.gallery-lightbox__nav--next {
  right: -80px;
}

.gallery-lightbox__nav.is-hidden {
  display: none;
}

/* Keyboard hint (only shown where there's a mouse/keyboard) */
.gallery-lightbox__hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  line-height: 1.4;
}

.gallery-lightbox__hint kbd {
  display: inline-block;
  min-width: 26px;
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.gallery-lightbox__hint span {
  margin: 0 6px;
}

@media (hover: none), (pointer: coarse) {
  .gallery-lightbox__hint {
    display: none;
  }
}

/* Tablets and phones: arrows sit over the photo edges, darker for contrast */
@media (max-width: 900px) {
  .gallery-lightbox {
    padding: 16px;
  }

  .gallery-lightbox__nav,
  .gallery-lightbox__nav:focus {
    width: 46px;
    height: 46px;
    background: rgba(10, 12, 13, 0.6);
    border-color: rgba(255, 255, 255, 0.35);
  }

  .gallery-lightbox__nav--prev {
    left: 10px;
  }

  .gallery-lightbox__nav--next {
    right: 10px;
  }
}

/* Phones: icon-only close, caption stacks above a full-width quote button */
@media (max-width: 640px) {
  .gallery-lightbox__close {
    top: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
    padding: 0;
  }

  .gallery-lightbox__close-label {
    display: none;
  }

  .gallery-lightbox__content img {
    max-height: calc(100vh - 290px);
  }

  .gallery-lightbox__caption {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .gallery-lightbox__cta {
    width: 100%;
    white-space: normal;
  }
}

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

@keyframes lightboxZoomIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 1000px) {
  .gallery-grid-custom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-cta__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .gallery-filter {
    width: 100%;
  }

  .gallery-grid-custom {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   GALLERY PAGE HERO
   Backup internal hero styling
========================================== */

.gallery-page .internal-hero {
  position: relative;
  padding: clamp(110px, 14vw, 180px) 0 clamp(70px, 8vw, 110px);
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(31, 36, 38, 0.98), rgba(31, 36, 38, 0.84)),
    url("../images/inner-hero.jpg")
      center/cover no-repeat;
  overflow: hidden;
}

.gallery-page .internal-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 850px;
}

.gallery-page .internal-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-page .internal-hero h1 {
  margin: 0 0 20px;
  color: #ffffff;
  font-size: clamp(2.7rem, 6vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.gallery-page .internal-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  line-height: 1.75;
}

/* ==========================================
   HERO MOBILE
========================================== */

@media (max-width: 640px) {
  .gallery-page .internal-hero {
    padding: 86px 0 66px;
  }

  .gallery-page .internal-hero h1 {
    font-size: clamp(2.4rem, 13vw, 3.7rem);
  }
}

/* ==========================================
   SIDEBAR GALLERY CARD
   Standalone card below .service-sidebar-card
   ("Need this service?"), filling the sidebar
   column's remaining height.
========================================== */

.service-sidebar-gallery-card {
  margin-top: 22px;
  padding: clamp(24px, 3vw, 32px);
  background: #ffffff;
  border: 1px solid #e3e6e7;
  border-radius: 24px;
  box-shadow: 0 14px 35px rgba(31, 36, 38, 0.06);
}

.service-sidebar-gallery-card h3 {
  margin: 0 0 16px;
  color: #1f2426;
  letter-spacing: -0.035em;
  font-size: 1.05rem;
}

.service-sidebar-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Compact variant of .gallery-card — same click/data-* contract,
   lighter chrome so it fits a narrow sidebar column. */
.gallery-card--compact {
  border-radius: 14px;
  box-shadow: none;
}

.gallery-card--compact:hover {
  box-shadow: 0 10px 22px rgba(31, 36, 38, 0.14) !important;
}

.gallery-card--compact .gallery-card__image {
  aspect-ratio: 1 / 1;
}

.service-sidebar-gallery-link {
  display: inline-flex;
  margin-top: 16px;
  color: #1f2426;
  font-weight: 850;
  font-size: 0.92rem;
  text-decoration: none;
}

.service-sidebar-gallery-link:hover {
  text-decoration: underline;
}

/* ==========================================
   HELPFUL TIPS PAGE: TOPIC CHIPS
   (same chip style as the gallery filters)
========================================== */

.tips-topics {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

a.gallery-filter {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

a.gallery-filter:visited {
  color: #1f2426;
}

a.gallery-filter.is-active,
a.gallery-filter.is-active:visited {
  color: #ffffff;
}

.tips-empty {
  text-align: center;
}

@media (max-width: 720px) {
  .tips-topics {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 8px;
    margin-inline: calc(50% - 50vw);
    padding: 4px calc(50vw - 50%) 10px;
    scrollbar-width: none;
  }

  .tips-topics::-webkit-scrollbar {
    display: none;
  }

  .tips-topics .gallery-filter {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    white-space: nowrap;
  }
}
