/*
  Public detail and legal page styles
  -----------------------------------
  1. Page shell and detail navigation
  2. Gallery and lightbox
  3. Detail content and cards
  4. Sidebar booking, timeline, and CTA
  5. Legal pages
  6. Responsive rules
*/

/* Page shell and detail navigation */

body.detail-page {
  background: var(--ivory);
}

.detail-page #navbar,
.listing-page #navbar {
  background: rgba(255, 248, 237, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(29, 27, 23, 0.08);
}

.detail-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 248, 237, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(29, 27, 23, 0.08);
}

.detail-nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.detail-nav .btn-secondary {
  color: var(--charcoal);
  border-color: rgba(29, 27, 23, 0.16);
}

.detail-nav .btn-secondary:hover {
  background: rgba(29, 27, 23, 0.05);
  border-color: rgba(29, 27, 23, 0.28);
}

.detail-page main {
  padding-bottom: 48px;
}

/* Gallery and lightbox */

.detail-gallery {
  position: relative;
  padding-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 14px;
}

.gallery-main,
.gallery-side img,
.trip-card,
.booking-card,
.detail-panel,
.review-card,
.info-card,
.season-card,
.map-card {
  border: 1px solid rgba(29, 27, 23, 0.08);
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 14px;
}

.gallery-main {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.gallery-main img,
.gallery-side img,
.feature-card img,
.trip-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.gallery-side img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.show-all-btn {
  position: absolute;
  right: 28px;
  bottom: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--charcoal);
  border: 1px solid rgba(29, 27, 23, 0.08);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(12, 11, 9, 0.88);
  backdrop-filter: blur(14px);
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox-panel {
  width: min(1120px, 100%);
  max-height: min(88vh, 820px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  color: var(--white);
}

.gallery-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.gallery-lightbox-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 600;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 248, 237, 0.22);
  background: rgba(255, 248, 237, 0.1);
  color: var(--white);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.gallery-lightbox-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
  background: rgba(232, 184, 90, 0.18);
  border-color: rgba(232, 184, 90, 0.45);
  transform: translateY(-1px);
}

.gallery-lightbox-stage {
  position: relative;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 248, 237, 0.06);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.36);
}

.gallery-lightbox-image {
  width: 100%;
  height: min(64vh, 640px);
  object-fit: contain;
  background: #0e0d0b;
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 28px;
  transform: translateY(-50%);
}

.gallery-lightbox-nav:hover {
  transform: translateY(-50%) translateY(-1px);
}

.gallery-lightbox-prev {
  left: 16px;
}

.gallery-lightbox-next {
  right: 16px;
}

.gallery-lightbox-count {
  position: absolute;
  left: 18px;
  bottom: 16px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(12, 11, 9, 0.62);
  color: rgba(255, 248, 237, 0.88);
  font-size: 12px;
  font-weight: 700;
}

.gallery-lightbox-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.gallery-lightbox-thumb {
  width: 84px;
  height: 62px;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.62;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

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

.gallery-lightbox-thumb.is-active,
.gallery-lightbox-thumb:hover {
  opacity: 1;
  border-color: var(--gold-light);
  transform: translateY(-1px);
}

/* Detail content and cards */

.detail-hero-copy {
  padding: 26px 0 0;
}

.detail-hero-copy h1 {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  margin-bottom: 10px;
}

.detail-subtitle {
  font-size: 17px;
  color: rgba(29, 27, 23, 0.72);
  max-width: 760px;
  margin-bottom: 18px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ivory-dark);
  border: 1px solid rgba(29, 27, 23, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  padding-top: 32px;
}

.detail-panel {
  padding: 24px;
  margin-bottom: 18px;
}

.detail-panel p,
.detail-panel li {
  color: rgba(29, 27, 23, 0.78);
}

.detail-section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 36px);
  margin: 8px 0 14px;
}

.detail-section-header p {
  max-width: 760px;
  color: rgba(29, 27, 23, 0.7);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card {
  padding: 14px;
  border-radius: 12px;
  background: var(--ivory-dark);
  border: 1px solid rgba(29, 27, 23, 0.08);
}

.feature-card.small {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.feature-card h3 {
  font-size: 18px;
  margin-top: 10px;
}

.feature-card p {
  font-size: 14px;
  margin-top: 6px;
}

.feature-card img {
  height: 160px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.season-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.season-card,
.info-card {
  padding: 16px;
}

.season-card strong,
.info-card strong {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(29, 27, 23, 0.58);
  margin-bottom: 8px;
}

.season-card span,
.info-card span {
  display: block;
}

.trip-grid,
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.trip-card {
  overflow: hidden;
}

.trip-card img {
  aspect-ratio: 16 / 10;
}

.trip-card-body {
  padding: 16px;
}

.trip-card-body span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(29, 27, 23, 0.58);
}

.trip-card-body h3 {
  margin: 8px 0 6px;
  font-size: 18px;
}

.trip-card-body p {
  font-size: 14px;
  margin-bottom: 10px;
}

.map-card {
  padding: 18px;
}

.map-placeholder {
  height: 190px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(184, 92, 56, 0.1), rgba(216, 161, 95, 0.1)),
    repeating-linear-gradient(
      45deg,
      rgba(36, 91, 138, 0.08) 0 8px,
      transparent 8px 16px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 24px;
  margin-bottom: 14px;
}

.faq-list details {
  border-top: 1px solid rgba(29, 27, 23, 0.08);
  padding: 14px 0;
}

.faq-list details:last-child {
  border-bottom: 1px solid rgba(29, 27, 23, 0.08);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-list p {
  padding-top: 10px;
  color: rgba(29, 27, 23, 0.74);
}

/* Sidebar booking, timeline, and CTA */

.detail-aside .booking-card {
  position: sticky;
  top: 92px;
  padding: 20px;
}

.booking-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.booking-card label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.booking-card input {
  border: 1px solid rgba(29, 27, 23, 0.12);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  background: var(--white);
}

.booking-price {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-serif);
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.timeline-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.timeline-content h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.timeline-content p {
  margin-bottom: 8px;
}

.two-col-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.two-col-list h3 {
  margin-bottom: 10px;
}

.two-col-list ul {
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.detail-cta {
  background: var(--charcoal);
  color: var(--white);
  padding: 48px 0;
  text-align: center;
}

.detail-cta h2 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 52px);
  margin-bottom: 12px;
}

.detail-cta p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 18px;
}

.detail-cta .btn-secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Legal pages */

.legal-page-shell {
  padding: clamp(48px, 8vw, 92px) 0;
}

.legal-page-header {
  max-width: 820px;
  margin: 0 auto 28px;
}

.legal-page-header span {
  display: block;
  color: var(--terracotta);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.legal-page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1;
}

.legal-rich-content {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(29, 27, 23, 0.08);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.legal-rich-content h2,
.legal-rich-content h3,
.legal-rich-content h4 {
  font-family: var(--font-serif);
  margin: 1.2em 0 0.45em;
}

.legal-rich-content h2:first-child,
.legal-rich-content h3:first-child {
  margin-top: 0;
}

.legal-rich-content p,
.legal-rich-content li {
  color: rgba(29, 27, 23, 0.78);
  line-height: 1.75;
}

.legal-rich-content ul,
.legal-rich-content ol {
  padding-left: 22px;
  margin: 12px 0 18px;
}

.legal-rich-content blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--terracotta);
  background: var(--ivory-dark);
}

/* Responsive rules */

@media (max-width: 980px) {
  .detail-gallery,
  .detail-layout,
  .feature-grid.compact,
  .season-grid,
  .info-grid,
  .trip-grid,
  .review-grid,
  .two-col-list {
    grid-template-columns: 1fr;
  }

  .detail-aside .booking-card {
    position: static;
  }
}

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

  .detail-gallery {
    padding-top: 20px;
  }

  .show-all-btn {
    right: 16px;
    bottom: 12px;
  }
}
