/*
 * page.css
 * Styles for the content builder section — static pages.
 * Loaded only on page template via theme.liquid.
 */

/* ── Page title ───────────────────────────────────────────────── */

.content-builder {
  padding-top: var(--theme-space-xl);
  padding-bottom: var(--theme-space-3xl);
}

.content-builder__page-title {
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-3xl);
  font-weight: var(--theme-weight-bold);
  letter-spacing: var(--theme-tracking-tight);
  color: var(--theme-color-text-primary);
  margin-bottom: var(--theme-space-lg);
}

/* ── Shared block spacing ─────────────────────────────────────── */

.content-block {
  margin-bottom: var(--theme-space-xl);
}

.content-block:last-child {
  margin-bottom: 0;
}

.content-block__heading {
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-2xl);
  font-weight: var(--theme-weight-bold);
  letter-spacing: var(--theme-tracking-tight);
  color: var(--theme-color-text-primary);
  margin-bottom: var(--theme-space-md);
}

.content-block__rte {
  line-height: var(--theme-leading-loose);
  color: var(--theme-color-text-primary);
}

.content-block__caption {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
  color: var(--theme-color-text-secondary);
  margin-top: var(--theme-space-xs);
}

.content-block__btn {
  margin-top: var(--theme-space-md);
}

/* ── Rich text (rte) ──────────────────────────────────────────── */

.content-block__rte h2,
.content-block__rte h3,
.content-block__rte h4 {
  margin-top: var(--theme-space-lg);
  margin-bottom: var(--theme-space-sm);
  font-family: var(--theme-font-heading);
  font-weight: var(--theme-weight-bold);
}

.content-block__rte h2 { font-size: var(--theme-text-xl); }
.content-block__rte h3 { font-size: var(--theme-text-lg); }

.content-block__rte p {
  margin-bottom: var(--theme-space-md);
}

.content-block__rte ul,
.content-block__rte ol {
  list-style: revert;
  padding-left: var(--theme-space-lg);
  margin-bottom: var(--theme-space-md);
}

.content-block__rte a {
  color: var(--theme-color-text-link);
  transition: color var(--theme-duration-fast) var(--theme-ease-out);
}

.content-block__rte a:hover {
  color: var(--theme-color-text-link-hover);
}

/* Rich-text media (info-page bodies: showroom photo, map, gallery). Block-level
   media fills the column; small images no longer float narrow + left-aligned. */
.content-block__rte > img,
.content-block__rte > iframe {
  width: 100%;
  display: block;
  border-radius: var(--theme-radius-lg);
  margin: var(--theme-space-lg) 0;
}

.content-block__rte > iframe {
  border: 0;
  aspect-ratio: 16 / 9;
  height: auto;
}

/* Adjacent-image runs (wrapped into a gallery in the template) → responsive grid
   of equal, cropped tiles rather than a tall stack. */
.content-block__rte-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--theme-space-md);
  margin: var(--theme-space-lg) 0;
}

.content-block__rte-gallery img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--theme-radius-lg);
  margin: 0;
  cursor: zoom-in;
  transition: transform var(--theme-duration-fast) var(--theme-ease-out),
    box-shadow var(--theme-duration-fast) var(--theme-ease-out);
}

.content-block__rte-gallery img:hover {
  transform: scale(1.02);
  box-shadow: var(--theme-shadow-md);
}

/* Soften the migrated <hr> section dividers (vertical margins collapse with the
   media margins, so spacing stays even). */
.content-block__rte hr {
  border: 0;
  border-top: 1px solid var(--theme-color-border);
  margin: var(--theme-space-lg) 0;
}

/* ── Image block ──────────────────────────────────────────────── */

.content-block__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--theme-radius-md);
}

.content-block__img--full {
  border-radius: 0;
}

/* ── Video block ──────────────────────────────────────────────── */

.content-block__video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  border-radius: var(--theme-radius-md);
  overflow: hidden;
  background: var(--theme-color-black);
}

.content-block__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.content-block__video--native {
  object-fit: contain;
}

/* ── Image with text (split) ──────────────────────────────────── */

.content-block__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--theme-space-xl);
  align-items: center;
}

.content-block--split-reverse .content-block__split {
  direction: rtl;
}

.content-block--split-reverse .content-block__split > * {
  direction: ltr;
}

.content-block__split-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--theme-radius-md);
}

/* ── Banner ───────────────────────────────────────────────────── */

.content-block__banner {
  position: relative;
  min-height: 400px;
  display: flex;
  overflow: hidden;
}

.content-block__banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-block__banner-overlay {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, var(--banner-opacity, 0.4));
  padding: var(--theme-space-3xl) 0;
}

.content-block__banner-content {
  max-width: 600px;
}

.content-block__banner-content--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.content-block__banner-content--right {
  margin-left: auto;
  text-align: right;
}

.content-block__banner-heading {
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-4xl);
  font-weight: var(--theme-weight-bold);
  color: var(--theme-color-white);
  letter-spacing: var(--theme-tracking-tight);
  margin-bottom: var(--theme-space-sm);
}

.content-block__banner-sub {
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-lg);
  color: rgba(255, 255, 255, 0.85);
  line-height: var(--theme-leading-base);
  margin-bottom: var(--theme-space-md);
}

/* ── Accordion / FAQ ──────────────────────────────────────────── */

.content-block__accordion-list {
  border-top: var(--theme-border-width) solid var(--theme-color-border);
}

.content-block__accordion-item {
  border-bottom: var(--theme-border-width) solid var(--theme-color-border);
}

.content-block__accordion-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--theme-space-md) 0;
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-md);
  font-weight: var(--theme-weight-semibold);
  color: var(--theme-color-text-primary);
  cursor: pointer;
  list-style: none;
}

.content-block__accordion-trigger::-webkit-details-marker {
  display: none;
}

.content-block__accordion-trigger svg {
  flex-shrink: 0;
  transition: transform var(--theme-duration-base) var(--theme-ease-out);
  color: var(--theme-color-text-muted);
}

[open] > .content-block__accordion-trigger svg {
  transform: rotate(180deg);
}

.content-block__accordion-body {
  padding-bottom: var(--theme-space-md);
  line-height: var(--theme-leading-loose);
  color: var(--theme-color-text-secondary);
}

/* ── Gallery ──────────────────────────────────────────────────── */

.content-block__gallery-grid {
  display: grid;
  gap: var(--theme-space-sm);
}

.content-block__gallery-grid--2 { grid-template-columns: repeat(2, 1fr); }
.content-block__gallery-grid--3 { grid-template-columns: repeat(3, 1fr); }
.content-block__gallery-grid--4 { grid-template-columns: repeat(4, 1fr); }

.content-block__gallery-item {
  overflow: hidden;
  border-radius: var(--theme-radius-md);
}

.content-block__gallery-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  transition: transform var(--theme-duration-slow) var(--theme-ease-out);
}

.content-block__gallery-item:hover .content-block__gallery-img {
  transform: scale(1.03);
}

/* ── Testimonial ──────────────────────────────────────────────── */

.content-block__testimonial {
  text-align: center;
  padding: var(--theme-space-xl) 0;
  margin: 0;
}

.content-block__testimonial-quote {
  font-family: var(--theme-font-body);
  font-size: var(--theme-text-xl);
  font-style: italic;
  line-height: var(--theme-leading-loose);
  color: var(--theme-color-text-primary);
  margin-bottom: var(--theme-space-lg);
}

.content-block__testimonial-quote::before {
  content: '\201C';
  display: block;
  font-size: var(--theme-text-5xl);
  line-height: 1;
  color: var(--theme-color-brand-gold);
  margin-bottom: var(--theme-space-sm);
}

.content-block__testimonial-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--theme-space-sm);
}

.content-block__testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--theme-radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.content-block__testimonial-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-block__testimonial-name {
  display: block;
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-sm);
  font-weight: var(--theme-weight-bold);
  font-style: normal;
  color: var(--theme-color-text-primary);
}

.content-block__testimonial-role {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-xs);
  color: var(--theme-color-text-muted);
}

/* ── Two Column Text ──────────────────────────────────────────── */

.content-block__two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--theme-space-xl);
}

/* ── Icon Row ─────────────────────────────────────────────────── */

.content-block__icon-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--theme-space-lg);
  text-align: center;
}

.content-block__icon-item svg {
  color: var(--theme-color-brand-gold);
  margin-bottom: var(--theme-space-sm);
}

.content-block__icon-label {
  font-family: var(--theme-font-heading);
  font-size: var(--theme-text-sm);
  font-weight: var(--theme-weight-bold);
  color: var(--theme-color-text-primary);
  margin-bottom: var(--theme-space-3xs);
}

.content-block__icon-desc {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-xs);
  color: var(--theme-color-text-secondary);
  line-height: var(--theme-leading-base);
}

/* ── Contact Form ─────────────────────────────────────────────── */

.content-block__contact-form {
  margin-top: var(--theme-space-md);
}

.content-block__form-success {
  display: flex;
  align-items: center;
  gap: var(--theme-space-sm);
  padding: var(--theme-space-md);
  background: var(--theme-color-success-bg);
  color: var(--theme-color-success);
  border-radius: var(--theme-radius-md);
  margin-bottom: var(--theme-space-lg);
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
}

.content-block__form-error {
  padding: var(--theme-space-md);
  background: var(--theme-color-error-bg);
  color: var(--theme-color-error);
  border-radius: var(--theme-radius-md);
  margin-bottom: var(--theme-space-lg);
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
}

.content-block__form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--theme-space-md);
}

.content-block__form-field {
  margin-bottom: var(--theme-space-md);
}

.content-block__form-field label {
  display: block;
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-sm);
  font-weight: var(--theme-weight-semibold);
  color: var(--theme-color-text-primary);
  margin-bottom: var(--theme-space-3xs);
}

.content-block__form-field input,
.content-block__form-field textarea {
  width: 100%;
  padding: var(--theme-space-xs) var(--theme-input-padding-x);
  border: var(--theme-border-width) solid var(--theme-input-border);
  border-radius: var(--theme-input-radius);
  font-family: var(--theme-font-body);
  font-size: var(--theme-input-font-size);
  color: var(--theme-color-text-primary);
  background: var(--theme-input-bg);
  transition: border-color var(--theme-duration-fast) var(--theme-ease-out);
}

.content-block__form-field input {
  height: var(--theme-input-height);
}

.content-block__form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.content-block__form-field input:focus,
.content-block__form-field textarea:focus {
  outline: none;
  border-color: var(--theme-input-border-focus);
  box-shadow: var(--theme-input-shadow-focus);
}

/* ── Collection Grid ──────────────────────────────────────────── */

.content-block__collection-grid {
  display: grid;
  grid-template-columns: var(--theme-grid-cols-collection);
  gap: var(--theme-grid-gap);
}

.content-block__collection-cta {
  text-align: center;
  margin-top: var(--theme-space-lg);
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  .content-builder {
    padding-top: var(--theme-space-lg);
    padding-bottom: var(--theme-space-2xl);
  }

  .content-builder__page-title {
    font-size: var(--theme-text-2xl);
  }

  .content-block {
    margin-bottom: var(--theme-space-lg);
  }

  .content-block__heading {
    font-size: var(--theme-text-xl);
  }

  /* Stack image+text on mobile */
  .content-block__split {
    grid-template-columns: 1fr;
    gap: var(--theme-space-md);
  }

  .content-block--split-reverse .content-block__split {
    direction: ltr;
  }

  /* Banner */
  .content-block__banner {
    min-height: 280px;
  }

  .content-block__banner-heading {
    font-size: var(--theme-text-2xl);
  }

  .content-block__banner-overlay {
    padding: var(--theme-space-xl) 0;
  }

  /* Gallery */
  .content-block__gallery-grid--3,
  .content-block__gallery-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Testimonial */
  .content-block__testimonial-quote {
    font-size: var(--theme-text-lg);
  }

  /* Two column text — stack */
  .content-block__two-col {
    grid-template-columns: 1fr;
    gap: var(--theme-space-md);
  }

  /* Icon row — 2 col on mobile */
  .content-block__icon-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--theme-space-md);
  }

  /* Contact form — stack name/email */
  .content-block__form-row {
    grid-template-columns: 1fr;
  }
}

/* ── Info-page sidebar (Delivery / Terms / Privacy) ───────────────── */

.info-page {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: var(--theme-space-2xl);
  align-items: start;
}

.info-page__aside {
  position: sticky;
  top: var(--theme-space-xl);
}

.info-page__aside-heading {
  font-family: var(--theme-font-ui);
  font-size: var(--theme-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--theme-color-text-muted);
  margin: 0 0 var(--theme-space-sm);
}

.info-page__aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--theme-space-3xs);
  border-left: 1px solid var(--theme-color-border);
}

.info-page__aside-link {
  display: block;
  padding: var(--theme-space-2xs) var(--theme-space-md);
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--theme-color-text-muted);
  text-decoration: none;
  font-size: var(--theme-text-md);
  line-height: 1.35;
  transition: color var(--theme-duration-fast), border-color var(--theme-duration-fast);
}

.info-page__aside-link:hover {
  color: var(--theme-color-text-primary);
}

.info-page__aside-link--current {
  color: var(--theme-color-text-primary);
  font-weight: var(--theme-weight-semibold);
  border-left-color: var(--theme-color-text-primary);
}

@media (max-width: 767px) {
  .info-page {
    grid-template-columns: 1fr;
    gap: var(--theme-space-lg);
  }

  .info-page__aside {
    position: static;
  }

  .info-page__aside-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--theme-space-2xs) var(--theme-space-md);
    border-left: 0;
  }

  .info-page__aside-link {
    margin-left: 0;
    padding: var(--theme-space-3xs) 0;
    border-left: 0;
  }

  .info-page__aside-link--current {
    border-left: 0;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}
