/* ============================================================
   CHIANTI VINTAGE EXPEDITIONS — Layout
   layout.css: containers, sections, grids, hero
   ============================================================ */

/* ── Container ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--wide {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .container,
  .container--narrow,
  .container--wide {
    padding-inline: var(--space-10);
  }
}

@media (min-width: 1200px) {
  .container { padding-inline: var(--space-8); }
  .container--narrow { padding-inline: var(--space-8); }
}

/* ── Sections ─────────────────────────────────────────────── */
.section {
  padding-block: var(--space-20);
}

.section--sm { padding-block: var(--space-12); }
.section--lg { padding-block: var(--space-32); }

@media (min-width: 768px) {
  .section { padding-block: var(--space-24); }
  .section--sm { padding-block: var(--space-16); }
  .section--lg { padding-block: var(--space-32); }
}

/* ── Section Header ───────────────────────────────────────── */
.section-header {
  margin-bottom: var(--space-12);
}

.section-header--center {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-12);
}

.section-header .label {
  display: block;
  margin-bottom: var(--space-4);
}

.section-header p {
  margin-top: var(--space-6);
  color: var(--color-grey);
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Fallback gradient when no image is loaded */
  background-color: #2a1f18;
  transform: scale(1.04);
  transition: transform 8s ease-out;
}

.hero__bg.is-loaded {
  transform: scale(1);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(28, 23, 20, 0.35) 0%,
    rgba(28, 23, 20, 0.55) 50%,
    rgba(28, 23, 20, 0.75) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-inline: var(--space-6);
  padding-block: var(--space-32);
  width: 100%;
  max-width: 900px;
}

.hero__label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-6);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 400;
  color: var(--color-white);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  font-style: italic;
  font-weight: 300;
  color: rgba(245, 240, 232, 0.85);
  margin-bottom: var(--space-10);
  line-height: 1.4;
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgba(245, 240, 232, 0.6);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--transition-base);
}

.hero__scroll:hover { color: var(--color-gold); }

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: currentColor;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(0.7); }
}

/* Page hero (internal pages — shorter) */
.page-hero {
  position: relative;
  height: clamp(340px, 45vw, 560px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.page-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #2a1f18;
}

.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(28, 23, 20, 0.2) 0%,
    rgba(28, 23, 20, 0.7) 100%
  );
}

.page-hero__content {
  position: relative;
  z-index: 1;
  padding: var(--space-12) var(--space-6);
  width: 100%;
}

@media (min-width: 768px) {
  .page-hero__content { padding: var(--space-16) var(--space-10); }
}

.page-hero__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
}

.page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 400;
  color: var(--color-white);
  line-height: 1.05;
}

/* ── Two Column Layout ────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }

  .two-col--reverse > :first-child { order: 2; }
  .two-col--reverse > :last-child  { order: 1; }

  .two-col--60-40 {
    grid-template-columns: 3fr 2fr;
  }

  .two-col--40-60 {
    grid-template-columns: 2fr 3fr;
  }
}

/* ── Image Block ──────────────────────────────────────────── */
.img-block {
  position: relative;
  overflow: hidden;
}

.img-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-block--portrait {
  aspect-ratio: 3/4;
}

.img-block--landscape {
  aspect-ratio: 16/9;
}

.img-block--square {
  aspect-ratio: 1/1;
}

/* Placeholder for missing images */
.img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 300px;
  background: linear-gradient(135deg, #2a1f18 0%, #3d2e24 50%, #2a1f18 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(201, 160, 82, 0.4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
