/* Homepage priority flow and Article-detail navigation/Topic alignment. */

.sbaleno-home-editorial > .sbaleno-home-partner {
  grid-column: 1 / -1;
  min-width: 0;
}

.sbaleno-home-partner > .sbaleno-partner-update-rail {
  width: 100%;
  margin-block: 0;
}

/*
 * Authoritative Homepage Destination density contract.
 * The bounded pool contains at most four truthful cards. Wide layouts use one
 * 4-card row, the intermediate 3-column layout uses one 3-card row, and the
 * compact 2-column layout uses at most two rows. Resize needs no new request.
 */
[data-sbaleno-home-destination-grid] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 781px) and (max-width: 1120px) {
  [data-sbaleno-home-destination-grid] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  [data-sbaleno-home-destination-grid] > [data-sbaleno-home-destination-card]:nth-child(n + 4) {
    display: none;
  }
}

@media (max-width: 780px) {
  [data-sbaleno-home-destination-grid] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sbaleno-article-breadcrumb {
  margin-bottom: -0.4rem;
}

.sbaleno-article-breadcrumb [aria-current="page"] {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sbaleno-article-reading-track > .sbaleno-article-topics.sbaleno-topic-cloud {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.sbaleno-article-topics .sbaleno-topic-cloud__header h2 {
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  line-height: 1.12;
}

/* Approved visual icons for the six Planning choices. */
.sbaleno-home-moment-card__icon,
.sbaleno-planning-card__icon {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Keep optical icon height consistent while allowing wide SVG artwork to use its natural width. */
.sbaleno-home-moment-card__icon {
  width: min(4.5rem, 100%);
  height: 2.05rem;
}

.sbaleno-planning-card__icon {
  width: min(10.5rem, 100%);
}

.sbaleno-home-moment-card__icon svg,
.sbaleno-planning-card__icon svg {
  display: none;
}

[data-moment-slot^="destination_wedding-"] .sbaleno-home-moment-card__icon,
.sbaleno-planning-card[data-event-icon-key="destination_wedding"] .sbaleno-planning-card__icon {
  background-image: url("icons/planning/svatba-v-zahranici.svg");
}

[data-moment-slot^="honeymoon-"] .sbaleno-home-moment-card__icon,
.sbaleno-planning-card[data-event-icon-key="honeymoon"] .sbaleno-planning-card__icon {
  background-image: url("icons/planning/svatebni-cesta.svg");
}

[data-moment-slot^="elopement-"] .sbaleno-home-moment-card__icon,
.sbaleno-planning-card[data-event-icon-key="elopement"] .sbaleno-planning-card__icon {
  background-image: url("icons/planning/elopement.svg");
}

[data-moment-slot^="vow_renewal-"] .sbaleno-home-moment-card__icon,
.sbaleno-planning-card[data-event-icon-key="vow_renewal"] .sbaleno-planning-card__icon {
  background-image: url("icons/planning/obnova-slibu.svg");
}

[data-moment-slot^="anniversary-"] .sbaleno-home-moment-card__icon,
.sbaleno-planning-card[data-event-icon-key="anniversary"] .sbaleno-planning-card__icon {
  background-image: url("icons/planning/vyroci-a-oslavy.svg");
}

[data-moment-slot^="quality_time-"] .sbaleno-home-moment-card__icon,
.sbaleno-planning-card[data-event-icon-key="quality_time"] .sbaleno-planning-card__icon {
  background-image: url("icons/planning/cas-spolu.svg");
}

@media (max-width: 900px) {
  .sbaleno-home-editorial {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sbaleno-home-editorial__left,
  .sbaleno-home-editorial__left > .sbaleno-home-section--articles,
  .sbaleno-home-editorial__left .sbaleno-home-article-grid {
    display: contents;
  }

  .sbaleno-home-editorial__left .sbaleno-home-section__header {
    grid-column: 1 / -1;
    order: 0;
  }

  .sbaleno-home-editorial__left .sbaleno-home-article-card {
    order: 1;
  }

  .sbaleno-home-editorial > .sbaleno-home-partner {
    grid-column: 1 / -1;
    order: 2;
  }

  .sbaleno-home-editorial__left .sbaleno-home-article-card:nth-child(n + 5) {
    order: 3;
  }

  .sbaleno-home-editorial__left .sbaleno-home-section__footer-link {
    grid-column: 1 / -1;
    order: 4;
  }

  .sbaleno-home-editorial__right {
    grid-column: 1 / -1;
    order: 5;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  .sbaleno-home-editorial__left .sbaleno-home-article-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .sbaleno-home-editorial__left .sbaleno-home-article-card .sbaleno-card-image,
  .sbaleno-home-editorial__left .sbaleno-home-article-card > .sbaleno-home-card__fallback {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 720px) {
  .sbaleno-home-editorial {
    grid-template-columns: minmax(0, 1fr);
  }

  .sbaleno-home-editorial__left .sbaleno-home-article-card:nth-child(n + 3) {
    order: 3;
  }

  .sbaleno-article-breadcrumb {
    margin-bottom: -0.2rem;
  }
}
