/* Homepage article list + highlighted teasers (also used on archive/blog listings) */

.teaser-meta {
  color: var(--copy-color);
  font-size: 1.4rem;
  margin-block-end: 1rem;
}

.teaser-meta a {
  color: var(--yop-red);
  font-weight: 700;
  text-decoration: none;
}

.teaser-excerpt {
  color: inherit;
}

.teaser-list {
  display: grid;
  gap: 2rem;
}

.teaser,
.teaser-highlight::before,
.teaser-highlight .card-inner {
  corner-shape: var(--border-shape);
}

.teaser {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: minmax(0, 1fr);
  background: var(--white);
  color: #111;
  border-radius: var(--border-radius);
  overflow: hidden;
  --object-text-color: #111;
}

@media (min-width: 720px) {
  .teaser:not(.teaser-highlight).has-image {
    grid-template-columns: 22rem minmax(0, 1fr);
  }
}

.teaser-image {
  display: block;
  background: #111;
  min-height: 16rem;
}

.teaser-image picture,
.teaser-image img {
  width: 100%;
  height: 100%;
}

.teaser-image img {
  object-fit: cover;
}

.teaser > div {
  padding: 2rem 2.2rem 2.2rem;
}

.teaser h2 {
  margin-block: 0 0.8rem;
  font-size: 2.2rem;
}

.teaser h2 a {
  color: var(--yop-red);
  text-decoration: none;
}

.teaser h2 a:hover,
.teaser h2 a:focus {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

.teaser .teaser-meta {
  color: #555;
}

.teaser .teaser-excerpt {
  color: #222;
  margin: 0;
}

main:has(.teaser-highlights) {
  width: 100%;
}

main:has(.teaser-highlights) .teaser-list {
  width: min(100% - 3.2rem, var(--content-max));
  margin-inline: auto;
}

.teaser-highlights {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  margin-block-end: calc(var(--vertical-flow) * 8);
  gap: calc(var(--vertical-flow) * 2);
  padding-block: var(--vertical-flow);
  padding-inline: var(--vertical-flow);
}

@media (min-width: 60rem) {
  .teaser-highlights {
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--vertical-flow) * 4);
    padding-block: calc(var(--vertical-flow) * 4);
    padding-inline: calc(var(--vertical-flow) * 4);
  }
}

.teaser-highlight {
  position: relative;
  overflow: visible;
  background: transparent;
  grid-template-columns: 1fr;
}

@property --teaser-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.teaser-highlight::before {
  --teaser-angle: 0deg;
  content: "";
  position: absolute;
  z-index: -1;
  inset-block-start: -1rem;
  inset-inline-start: -1rem;
  width: calc(100% + 2rem);
  height: calc(100% + 2rem);
  border-radius: var(--border-radius);
  pointer-events: none;
  background: conic-gradient(
    from var(--teaser-angle),
    #b00000,
    #cc3333,
    #00548b,
    #cc3333,
    #b00000
  );
  animation: teaser-highlight-rotate 10s linear infinite;
}

@keyframes teaser-highlight-rotate {
  to {
    --teaser-angle: 360deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  .teaser-highlight::before {
    animation: none;
  }
}

.teaser-highlight .card-inner {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  height: 100%;
  background: var(--white);
  border-radius: var(--border-radius);
}

.teaser-highlight .teaser-image {
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
}

.teaser-highlight h2 {
  font-size: 2.6rem;
}

.teaser-flag {
  color: var(--yop-red);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
