/* AIDEV-NOTE: SSR-owned styles for gallery detail page — layout, carousel, content, similar wraps */

/* ========================================================================
   Page layout
   ======================================================================== */

/* AIDEV-NOTE: padding-top clears the fixed v4 nav — uses --nav-height set by nav.js */
.gallery-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--nav-height, 64px) + 12px) 24px 60px;
}

.gallery-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  font-size: 0.9rem;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.15s;
}

.gallery-detail__back:hover {
  color: var(--brand-teal);
}

/* --- Breadcrumb navigation --- */
/* AIDEV-NOTE: Semantic breadcrumb — replaces plain back link, mirrors BreadcrumbList JSON-LD */
.gallery-detail__breadcrumb {
  margin-bottom: 12px;
}

.gallery-detail__breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.gallery-detail__breadcrumb li {
  display: flex;
  align-items: center;
}

.gallery-detail__breadcrumb li:not(:last-child)::after {
  content: '›';
  margin: 0 8px;
  color: var(--muted-foreground);
}

.gallery-detail__breadcrumb a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s;
}

.gallery-detail__breadcrumb a:hover {
  color: var(--brand-teal);
}

.gallery-detail__breadcrumb [aria-current="page"] {
  color: var(--foreground);
  font-weight: 500;
}

/* --- Meta pills (location, price, coverage) --- */
/* AIDEV-NOTE: Single-line horizontal scroll — pills never wrap, swipe to see overflow on mobile */
.gallery-detail__meta {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.gallery-detail__pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--muted);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  flex-shrink: 0;
}

.gallery-detail__pill svg {
  flex-shrink: 0;
}

/* --- Two-column layout --- */
.gallery-detail__layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .gallery-detail__layout {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================
   Media / Carousel
   ======================================================================== */

.gallery-detail__media {
  position: relative;
}

/* AIDEV-NOTE: Fixed 4:3 aspect locks layout — slides differ in source aspect, but each fills the same area */
.gallery-detail__carousel {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--muted);
  aspect-ratio: 4 / 3;
}

/* AIDEV-NOTE: Slides absolutely fill the carousel; only .active is visible */
.gallery-detail__slide {
  position: absolute;
  inset: 0;
  display: none;
}

.gallery-detail__slide.active {
  display: block;
}

.gallery-detail__slide-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* --- Thumbnails --- */
.gallery-detail__thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-detail__thumb {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: var(--muted);
  position: relative;
}

.gallery-detail__thumb.active {
  border-color: var(--primary);
}

.gallery-detail__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-detail__thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 14px;
}

/* --- Responsive YouTube video embed --- */
/* AIDEV-NOTE: Fills the slide's 4:3 box; YouTube player letterboxes its 16:9 content internally */
.gallery-detail__video-container {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.gallery-detail__video-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

/* --- Before/After comparison slider --- */
/* AIDEV-NOTE: stacked images; --reveal drives clip-path on the after image and the handle position */
.gallery-detail__comparison {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  --reveal: 50%;
  touch-action: none;
  user-select: none;
}

.gallery-detail__comparison-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.gallery-detail__comparison-img--after {
  clip-path: inset(0 0 0 var(--reveal));
}

.gallery-detail__comparison-label {
  position: absolute;
  top: 8px;
  padding: 2px 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  pointer-events: none;
}

.gallery-detail__comparison-label--before {
  left: 8px;
}

.gallery-detail__comparison-label--after {
  right: 8px;
}

.gallery-detail__comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--reveal);
  transform: translateX(-50%);
  width: 44px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: ew-resize;
  touch-action: none;
}

.gallery-detail__comparison-handle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.gallery-detail__comparison-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.gallery-detail__comparison-handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* AIDEV-NOTE: outward-pointing arrows ◀ ▶ rendered as CSS triangles */
.gallery-detail__comparison-handle-knob::before,
.gallery-detail__comparison-handle-knob::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: translateY(-50%);
}

.gallery-detail__comparison-handle-knob::before {
  left: 7px;
  border-right: 7px solid #1a1a1a;
}

.gallery-detail__comparison-handle-knob::after {
  right: 7px;
  border-left: 7px solid #1a1a1a;
}

/* --- Thumbnail comparison preview (non-interactive) --- */
.gallery-detail__thumb-comparison {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
}

.gallery-detail__thumb-comparison-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-detail__thumb-comparison-img--before {
  clip-path: inset(0 50% 0 0);
}

.gallery-detail__thumb-comparison-img--after {
  clip-path: inset(0 0 0 50%);
}

.gallery-detail__thumb-comparison-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* AIDEV-NOTE: small knob mirrors the main slider handle so thumbs read as "interactive comparison" */
.gallery-detail__thumb-comparison-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  background: #fff
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a1a1a'%3E%3Cpath d='M9 6L5 12 9 18Z M15 6L19 12 15 18Z'/%3E%3C/svg%3E")
    center / 10px 10px no-repeat;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ========================================================================
   Content sidebar
   ======================================================================== */

/* AIDEV-NOTE: gap reduced from 16px — tighter spacing after removing About h2 and Project Details */
.gallery-detail__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-detail__title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.gallery-detail__description {
  font-size: 0.95rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0;
}

/* --- Business spotlight --- */
.gallery-detail__spotlight {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}

.gallery-detail__spotlight-toggle {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--muted);
}

.gallery-detail__spotlight-body {
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.gallery-detail__spotlight-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand-teal);
  font-weight: 600;
}

.gallery-detail__spotlight-areas {
  margin-top: 8px;
  font-size: 0.85rem;
}

/* --- CTA button --- */
.gallery-detail__cta {
  display: block;
  width: 100%;
  padding: 14px 24px;
  margin-top: 10px;
  background: var(--brand-orange);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  transition: background 0.2s;
}

.gallery-detail__cta:hover {
  background: var(--brand-orange-hover);
  color: #fff;
}

/* AIDEV-NOTE: Orange CTA hidden on mobile — sticky bottom-action-bar takes over below 1024px */
@media (max-width: 1023px) {
  .gallery-detail__cta {
    display: none;
  }
}

/* --- Section titles (About, Project Details) --- */
.gallery-detail__section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

/* --- Spotlight heading inside summary --- */
.gallery-detail__spotlight-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  display: inline;
}


/* ========================================================================
   Similar wraps section
   ======================================================================== */

.gallery-detail__similar {
  margin-top: 48px;
}

.gallery-detail__similar-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.gallery-detail__similar-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.gallery-detail__similar-card {
  flex-shrink: 0;
  width: 220px;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
  display: block;
  background: var(--muted);
}

.gallery-detail__similar-card img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

