/* Official LAIF seed system.
   Loaded after style.css so former root/trama experiments cannot reappear. */

/* Editorial ribbons crop the official artwork aggressively. They create the
   small, authored gestures seen in festival publications without becoming a
   second hero image. */
.laif-site-header,
.laif-site-footer,
.laif-archive-intro,
.laif-film-single__body--editorial-only,
.laif-shorts-programme__list {
  position: relative;
}

.laif-site-header {
  z-index: 20;
  margin-bottom: 0;
  overflow: visible;
}

.wp-site-blocks > .wp-block-template-part:first-child + main {
  margin-block-start: 0 !important;
}

.laif-site-footer::before {
  position: absolute;
  z-index: 3;
  display: block;
  background-color: var(--laif-2026-purple);
  background-position: center;
  background-repeat: repeat-x;
  background-blend-mode: normal;
  content: "";
  pointer-events: none;
}

.laif-film-single__body--editorial-only::after,
.laif-shorts-programme__list::before,
.laif-site-header::after {
  display: none;
}

.laif-site-header__inner {
  position: relative;
}

.laif-site-header__inner::after {
  display: none;
}

.laif-site-footer {
  margin-top: clamp(2.5rem, 5vw, 5rem);
  overflow: visible;
}

.laif-site-footer::before {
  top: calc(-1 * clamp(1.1rem, 1.55vw, 1.65rem));
  right: 0;
  left: 0;
  height: clamp(1.1rem, 1.55vw, 1.65rem);
  background-color: var(--laif-2026-purple);
  background-image: url("./laif-seeds/seed-accent-final.webp?v=3");
  background-position: center;
  background-size: auto 100%;
  clip-path: none;
}

.laif-archive-intro {
  margin-top: clamp(3rem, 6vw, 6rem);
  padding-top: clamp(3rem, 6vw, 6rem);
}

.laif-archive-intro::before {
  display: none;
}

.laif-shorts-programme__list {
  padding-top: clamp(2rem, 4vw, 4rem);
}

.laif-archive-hero {
  background: linear-gradient(
    90deg,
    var(--laif-2026-purple) 0 66%,
    var(--laif-2026-red) 66% 100%
  );
}

.laif-archive-hero::before {
  z-index: 0;
  display: block;
  top: 0;
  right: 0;
  bottom: 0;
  left: 66%;
  background-color: transparent;
  background-image:
    url("./laif-seeds/seed-cluster.webp"),
    url("./laif-seeds/seed-3.webp");
  background-position:
    calc(100% + 10rem) calc(100% + 9rem),
    8% -5rem;
  background-repeat: no-repeat;
  background-size:
    clamp(29rem, 44vw, 48rem) auto,
    clamp(4rem, 7vw, 7rem) auto;
  opacity: 0.24;
  -webkit-mask-image: none;
  mask-image: none;
}

/* Final supplied Arkiv artwork: exact colors, softened only by opacity. */
.laif-archive-hero::after {
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: 66%;
  height: 100%;
  background-image: url("./laif-seeds/seed-archive-final.webp?v=3");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  opacity: 0.22;
  pointer-events: none;
  mix-blend-mode: normal;
  transform: none;
}

.laif-archive-kicker {
  padding: 0;
  color: var(--laif-2026-yellow);
  background: transparent;
  transform: none;
}

.laif-edition-ribbon {
  display: none;
}

.laif-archive-ribbon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none !important;
  min-height: clamp(3.2rem, 4vw, 4.25rem);
  margin: 0 calc(-1 * var(--laif-space-page)) !important;
  padding: 0.8rem var(--laif-space-page);
  overflow: hidden;
  color: var(--laif-base-ink);
  background: var(--laif-2026-yellow);
  transform: none;
}

.laif-archive-ribbon p {
  width: auto;
  margin: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: clamp(0.68rem, 0.9vw, 0.84rem);
  font-weight: 900;
  letter-spacing: 0.11em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  transform: none;
}

.laif-archive-intro__title {
  border-top: 0;
}

.laif-archive-hero__mark {
  border-color: rgb(255 255 255 / 40%);
  background: rgb(35 31 32 / 16%);
}

.laif-archive-intro::after {
  right: calc(-1 * var(--laif-space-page));
  bottom: -5rem;
  width: min(34vw, 31rem);
  aspect-ratio: 200 / 177;
  background-color: transparent;
  background-image: url("./laif-seeds/seed-cluster.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.07;
  -webkit-mask-image: none;
  mask-image: none;
  transform: rotate(-9deg);
}

.laif-edition-grid::before {
  background-color: transparent;
  background-image:
    url("./laif-seeds/seed-3.webp"),
    url("./laif-seeds/seed-2.webp");
  background-position: 3rem 4rem, 20rem 23rem;
  background-repeat: repeat;
  background-size: 2.2rem auto, 3.1rem auto;
  opacity: 0.018;
  -webkit-mask-image: none;
  mask-image: none;
}

/* LAIF 2025: its own festival artwork fills only the annual hero. */
body.laif-edition-year-2025 .laif-edition-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none !important;
  min-height: 0;
  aspect-ratio: 1640 / 630;
  margin-block: 0;
  margin-inline: 0 !important;
  overflow: hidden;
  background: var(--laif-edition-primary);
}

body.laif-edition-year-2025 .laif-edition-hero .wp-block-post-featured-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

body.laif-edition-year-2025 .laif-edition-hero .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
}

body.laif-edition-year-2025 .laif-edition-hero__title {
  z-index: 2;
  background: rgb(255 250 241 / 96%);
}

/* Annual page rhythm: the local navigation belongs directly to the hero,
   while the editorial sections keep generous but visible page margins. */
body.single-laif_edition .laif-edition-toc {
  margin-top: 0 !important;
}

body.single-laif_edition .laif-edition-toc__inner,
body.single-laif_edition .laif-edition-body > .wp-block-post-content > .wp-block-group {
  width: min(calc(100% - clamp(3rem, 9vw, 10rem)), 1600px);
  margin-right: auto !important;
  margin-left: auto !important;
}

body.single-laif_edition .laif-edition-body > .wp-block-post-content > .wp-block-group {
  padding-top: clamp(2.75rem, 4vw, 4.5rem);
  padding-bottom: clamp(3.5rem, 5vw, 5.5rem);
}

@media (max-width: 720px) {
  body.laif-edition-year-2025 .laif-edition-hero {
    min-height: 35rem;
    aspect-ratio: auto;
  }

  body.laif-edition-year-2025 .laif-edition-hero__title {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
    margin: 0;
  }

  body.single-laif_edition .laif-edition-toc__inner,
  body.single-laif_edition .laif-edition-body > .wp-block-post-content > .wp-block-group {
    width: calc(100% - 2rem);
  }

  body.single-laif_edition .laif-edition-body > .wp-block-post-content > .wp-block-group {
    padding-top: 2.75rem;
    padding-bottom: 3.75rem;
  }
}

.laif-film-single__hero[data-edition-year="2025"] .laif-film-single__identity::before {
  right: -13%;
  bottom: -22%;
  width: 72%;
  aspect-ratio: 200 / 177;
  background-color: transparent;
  background-image: url("./laif-seeds/seed-cluster.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.11;
  -webkit-mask: none;
  mask: none;
  transform: rotate(-10deg);
}

.laif-film-single__body--editorial-only::before {
  inset: 0;
  width: auto;
  aspect-ratio: auto;
  background-color: transparent;
  background-image:
    url("./laif-seeds/seed-2.webp"),
    url("./laif-seeds/seed-3.webp"),
    url("./laif-seeds/seed-cluster.webp");
  background-position:
    calc(100% + 1rem) 12%,
    4% calc(100% - 2rem),
    calc(100% + 7rem) calc(100% + 8rem);
  background-repeat: no-repeat;
  background-size: 4.5rem auto, 2.7rem auto, min(29vw, 25rem) auto;
  opacity: 0.075;
  -webkit-mask: none;
  mask: none;
}

.laif-shorts-programme__hero::before {
  top: auto;
  right: clamp(-7rem, -5vw, -3rem);
  bottom: clamp(-9rem, -7vw, -5rem);
  display: block;
  width: clamp(22rem, 40vw, 39rem);
  height: auto;
  aspect-ratio: 200 / 177;
  background-color: transparent;
  background-image: url("./laif-seeds/seed-cluster.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.18;
  -webkit-mask-image: none;
  mask-image: none;
  transform: rotate(-8deg);
}

@media (max-width: 700px) {
  .laif-site-header__inner::after {
    display: none;
  }

  .laif-archive-intro {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
  }

  .laif-archive-hero::before {
    right: 0;
    left: 0;
    background-position: calc(100% + 9rem) calc(100% + 7rem), 10% -4rem;
    background-size: 27rem auto, 4rem auto;
    opacity: 0.16;
  }

  .laif-archive-hero::after {
    width: 100%;
    background-image: url("./laif-seeds/seed-archive-final.webp?v=3");
    background-position: center;
    background-size: cover;
    opacity: 0.20;
  }

  .laif-archive-intro::after,
  .laif-edition-grid::before,
  .laif-film-single__body--editorial-only::before {
    display: none;
  }

  .laif-shorts-programme__hero::before {
    right: -8rem;
    bottom: -5rem;
    display: block;
    width: 23rem;
    opacity: 0.13;
  }
}

/* Film pages share the homepage's paper and official seed illustrations. */
.laif-film-page {
  position: relative;
  isolation: isolate;
  background-color: #fffaf1;
}

.laif-film-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    url("./laif-seeds/seed-cluster.webp"),
    url("./laif-seeds/seed-3.webp"),
    url("./laif-seeds/seed-2.webp"),
    url("./laif-seeds/seed-cluster.webp");
  background-position:
    calc(100% + 4rem) -5rem,
    -1.5rem 48%,
    calc(100% + 1rem) 70%,
    -6rem calc(100% + 5rem);
  background-size: 19rem auto, 6rem auto, 7rem auto, 23rem auto;
  background-repeat: no-repeat;
  opacity: 0.16;
}

@media (max-width: 600px) {
  .laif-film-page::before {
    background-position:
      calc(100% + 5rem) -2rem,
      -2rem 48%,
      calc(100% + 2rem) 75%,
      -5rem calc(100% + 4rem);
    background-size: 13rem auto, 4rem auto, 4rem auto, 15rem auto;
    opacity: 0.12;
  }
}

/* WordPress root padding must not leave white gutters around film pages. */
body.single-laif_film {
  background-color: #fffaf1;
}

body.single-laif_film .laif-film-page {
  margin-inline: calc(-1 * clamp(1rem, 3vw, 2.5rem)) !important;
}
