/* =========================================================
   DIMORA BAGNI — Eredità (Heritage) page styles
   ========================================================= */

/* ---- Narrative section -------------------------------- */
.narrative__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.narrative__text p {
  color: var(--color-mid);
  line-height: 1.85;
  margin-bottom: var(--space-sm);
}

.narrative__img-frame {
  position: relative;
}

.narrative__img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

/* Gold offset frame */
.narrative__img-frame::before {
  content: '';
  position: absolute;
  inset: -12px 12px 12px -12px;
  border: 1.5px solid var(--color-oro);
  border-radius: var(--radius-sm);
  z-index: -1;
  opacity: 0.55;
}

@media (max-width: 900px) {
  .narrative__grid {
    grid-template-columns: 1fr;
  }
  .narrative__img { height: 320px; }
  .narrative__img-frame::before { display: none; }
}

/* ---- Philosophy pull quote ---------------------------- */
.philosophy-quote {
  text-align: center;
  padding-block: var(--space-xl);
}

.philosophy-quote blockquote {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-style: italic;
  font-weight: 300;
  color: var(--color-crema);
  max-width: 780px;
  margin-inline: auto;
  line-height: 1.4;
}

.philosophy-quote cite {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-oro);
}

/* ---- Timeline ----------------------------------------- */
.timeline {
  max-width: 720px;
  margin: var(--space-md) auto 0;
  position: relative;
}

/* Vertical center line */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--color-oro) 15%, var(--color-oro) 85%, transparent);
  transform: translateX(-50%);
}

.timeline__item {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: center;
  margin-bottom: var(--space-lg);
}

/* Alternating: odd items — year left, text right */
.timeline__item:nth-child(odd) .timeline__year  { text-align: right; padding-right: var(--space-sm); }
.timeline__item:nth-child(odd) .timeline__text  { text-align: left;  padding-left: var(--space-sm); }
.timeline__item:nth-child(odd) .timeline__text  { grid-column: 3; }
.timeline__item:nth-child(odd) .timeline__year  { grid-column: 1; }

/* Even items — text left, year right */
.timeline__item:nth-child(even) {
  direction: rtl;
}
.timeline__item:nth-child(even) > * {
  direction: ltr;
}
.timeline__item:nth-child(even) .timeline__year { text-align: left;  padding-left: var(--space-sm); }
.timeline__item:nth-child(even) .timeline__text { text-align: right; padding-right: var(--space-sm); }

.timeline__year {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-oro);
  font-weight: 300;
}

.timeline__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-oro);
  border: 3px solid var(--color-crema);
  box-shadow: 0 0 0 1px var(--color-oro);
  margin: auto;
  flex-shrink: 0;
}

.timeline__text {
  font-size: var(--text-sm);
  color: var(--color-mid);
  line-height: 1.65;
}

@media (max-width: 700px) {
  /* Vertical line runs through the centre of the 24px dot column */
  .timeline::before { left: 12px; }

  .timeline__item {
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto auto;
    direction: ltr !important;
    gap: 0;
    margin-bottom: var(--space-md);
  }

  /* !important needed: desktop :nth-child(odd) selectors have higher specificity
     and would otherwise override these mobile column/row placements */
  .timeline__dot {
    grid-row: 1 !important;
    grid-column: 1 !important;
    justify-self: center;
    margin-top: 5px;
  }

  .timeline__year {
    grid-row: 1 !important;
    grid-column: 2 !important;
    text-align: left !important;
    padding: 0 0 0 var(--space-sm) !important;
    font-size: var(--text-lg);
    line-height: 1.3;
  }

  .timeline__text {
    grid-row: 2 !important;
    grid-column: 2 !important;
    text-align: left !important;
    padding: 6px 0 0 var(--space-sm) !important;
  }

  /* Collapsible timeline on mobile */
  .timeline__item { cursor: pointer; }

  .timeline__text {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.35s ease;
    opacity: 0;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .timeline__item.tl-open .timeline__text {
    max-height: 300px;
    opacity: 1;
    padding-bottom: 1rem;
  }

  .timeline__year::after {
    content: ' +';
    font-size: 0.9rem;
    color: var(--color-oro);
    font-family: var(--font-body);
    font-weight: 700;
    display: inline; /* inline-block caused unwanted line breaks */
  }

  .timeline__item.tl-open .timeline__year::after {
    content: ' −';
  }
}

/* ---- Territory strip ---------------------------------- */
.territory-strip {
  background: var(--color-dark);
  padding-block: var(--space-md);
}

.territory-strip__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.territory-strip__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.territory-strip__label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-oro);
}

.territory-strip__value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--color-crema);
  letter-spacing: 0.02em;
}

.territory-strip__sep {
  width: 1px;
  height: 40px;
  background: rgba(250, 247, 242, 0.15);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .territory-strip__sep { display: none; }
  .territory-strip__inner { gap: var(--space-md); }
}

/* ---- Family anecdote ---------------------------------- */
.family-story {
  background: var(--color-light);
  text-align: center;
}

.family-story__inner {
  max-width: 680px;
  margin-inline: auto;
}

.family-story__ornament {
  font-size: 1.2rem;
  color: var(--color-oro);
  letter-spacing: 0.6em;
  margin-bottom: var(--space-sm);
  display: block;
}

.family-story__heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-dark);
  margin-bottom: var(--space-md);
  letter-spacing: 0.04em;
}

.family-story__text {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-style: italic;
  font-weight: 300;
  color: var(--color-mid);
  line-height: 1.75;
  max-width: none;
  margin-bottom: var(--space-md);
}

.family-story__caption {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-oro);
  max-width: none;
}

/* ---- Why us grid -------------------------------------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.why-card {
  text-align: center;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 2px 12px rgba(44, 36, 22, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}
.why-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(44, 36, 22, 0.12);
}

.why-card__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-sm);
  color: var(--color-oro);
}

.why-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.why-card__desc {
  font-size: var(--text-sm);
  color: var(--color-mid);
  line-height: 1.65;
  max-width: none;
}

@media (max-width: 700px) {
  .why-grid { grid-template-columns: 1fr; }
}
