/*
 * The home page (M1-HOME, design "1 Portal public"): the hero over the photo, the section heads and the cards of the
 * regions, the audience and the wine routes. Colours, sizes and spacing come from tokens.css; sizes are in rem so the
 * text-size controls reach them. The hero's text is white on the strip's green laid over the photo, so its contrast
 * holds whatever the photo is (4.5:1 at every width, UI-10): 80 % of the green is 4.9:1 against a white photo at worst.
 * On desktop the 80 % holds to 72 % of the width, past the right edge of the search form (42rem) from 1024 px up.
 */

/* The home page lays out its own bands: the main landmark is not a column */
.page-bands {
  display: block;
  padding: 0;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--color-background-strip);
  color: var(--color-text-on-strip);
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
}

/* Phones and tablets: the green over the whole photo */
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--color-background-strip) 80%, transparent);
}

/* Desktop: the green behind the text, the photo clear on the right, as the design has it */
@media (min-width: 1024px) {
  .hero-shade {
    background: linear-gradient(
      90deg,
      color-mix(in srgb, var(--color-background-strip) 82%, transparent) 0,
      color-mix(in srgb, var(--color-background-strip) 80%, transparent) 72%,
      color-mix(in srgb, var(--color-background-strip) 10%, transparent) 100%
    );
  }
}

.hero-inner {
  padding-block: var(--spacing-48);
}

@media (min-width: 768px) {
  .hero-inner {
    padding-block: var(--spacing-64);
    min-height: var(--size-36rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.hero-title {
  max-width: var(--size-40rem);
  margin: 0 0 var(--spacing-24);
  color: var(--color-text-on-strip);
  overflow-wrap: anywhere;
}

/* The design's display size, 48/56, from 768 px; phones keep the H1's 32/40 */
@media (min-width: 768px) {
  .hero-title {
    font-size: var(--font-size-48);
    line-height: var(--line-height-56);
    letter-spacing: var(--letter-spacing-display);
  }
}

.hero-line {
  display: block;
}

.hero-lead {
  max-width: var(--size-40rem);
  margin: 0 0 var(--spacing-32);
  font-size: var(--font-size-18);
  line-height: var(--line-height-28);
}

.hero-search {
  max-width: var(--size-42rem);
  margin: 0 0 var(--spacing-24);
}

.hero-search-label {
  display: block;
  margin-bottom: var(--spacing-8);
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
}

.hero-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-8);
}

.hero-search-field {
  position: relative;
  flex: 1 1 var(--size-14rem);
  min-width: 0;
}

/* Design 01 draws the home search 40 px tall with 14/20 text and a .small submit (brief-m4-8); FO-3's 48 px stays for every other field */
.hero-search-field .input {
  min-height: var(--control-height-small);
  padding-block: var(--control-padding-block-small);
  padding-inline-start: var(--spacing-48);
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
}

.hero-search-icon {
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--spacing-16);
  margin-block: auto;
  color: var(--color-icon-base-default);
  pointer-events: none;
}

.hero-search-row .button {
  flex: 0 0 auto;
  min-width: var(--size-8rem);
}

.hero-quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-8) var(--spacing-16);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
}

.hero-quick a {
  display: inline-block;
  padding-block: var(--spacing-8);
  color: var(--color-text-on-strip);
}

.hero-quick a:hover {
  color: var(--color-text-on-strip);
}

/* ---------- The caption of a generated image: 'Imagine ilustrativă' ---------- */

/* ---------- Next event ---------- */

.home-next {
  padding-block: var(--spacing-48);
}

/* ---------- Section heads and cards ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--spacing-16);
  margin-bottom: var(--spacing-32);
}

/* The home's heads are rows that start at the left. components.css's .section-head is the section switch's centred column (R-SWITCHER),
   which the same class name also reaches here: one more class in the selector puts the row back whatever the order of the sheets. */
.container > .section-head {
  flex-direction: row;
  text-align: start;
}

.section-head h2 {
  margin: 0;
}

.section-head .eyebrow {
  margin-bottom: var(--spacing-4);
}

/* LT-4: from 768 px the action is level with the H2, with or without a lead paragraph, as design 01 centres both.
   The text wrapper dissolves into the flex row: the eyebrow takes a row, the H2 and the action share the next one,
   centred on each other, and the lead takes the last. */
@media (min-width: 768px) {
  .section-head {
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--spacing-16);
  }

  .section-head > div {
    display: contents;
  }

  .section-head .eyebrow {
    flex: 0 0 100%;
    order: 1;
  }

  .section-head h2 {
    flex: 1 1 0;
    min-width: 0;
    order: 2;
  }

  .section-head > .button {
    order: 2;
  }

  .section-head .home-routes-lead {
    flex: 0 0 100%;
    order: 3;
  }
}

.home-audience h2 {
  margin: 0 0 var(--spacing-32);
}

.home-routes {
  position: relative;
}

/* The divider above the routes spans the content box, not the container's gutters (LT-3) */
.home-routes::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: var(--gutter);
  border-top: var(--border-width-1) solid var(--color-border);
}

.home-routes-lead {
  margin: var(--spacing-8) 0 0;
}

.home-card-media {
  position: relative;
}

.home-card .card-title {
  font-weight: var(--font-weight-medium);
}

.home-card .card-actions > * {
  pointer-events: none;
}

.card-more {
  color: var(--color-link);
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
  text-decoration: underline;
  text-underline-offset: var(--underline-offset);
}

.home-card:hover .card-more {
  text-decoration-thickness: var(--border-width-2);
}
