/* Hero (templates/includes/hero_component.html): light and text-led, the page
   photo faded and blurred behind dark text; optional element tile (desktop).
   Tokens: agrex.css, docs/design-tokens.md. */
.agx-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--agx-white);
}
.agx-hero__in {
  position: relative;
  padding-top: 36px;
  padding-bottom: 40px;
}

/* Background photo: vertical mask only below 992px, plus a horizontal mask
   (text side clear) from 992px. No overlay, no glass. */
/* The photo sits in a centred frame of at most 1440px; beyond it the page
   is white. Each mask has its own layer: frame (horizontal, desktop),
   fade (right edge, only when the frame is narrower than the viewport),
   inner (vertical). Up to 1440px the frame is the full width. */
.agx-hero__bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: min(100%, 1440px);
  transform: translateX(-50%);
  pointer-events: none;
}
.agx-hero__bg-fade { position: absolute; inset: 0; }
@media (min-width: 1441px) {
  .agx-hero__bg-fade {
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 84%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 84%, transparent 100%);
  }
}
.agx-hero__bg-inner {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, transparent 100%);
}
.agx-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  opacity: .3;
  filter: blur(5px);
  transform: scale(1.04);
}

/* Text column */
.agx-hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
  max-width: 720px;
}
.agx-hero--tile .agx-hero__text { max-width: 720px; }
.agx-hero__title {
  margin: 0;
  font-size: 38px;
  line-height: 1.08;
  color: var(--agx-ink);
}
/* Long titles (a word of 17+ letters or more than 45 characters, design_tags.
   long_title): smaller, so they fit the column without breaking words. */
.agx-hero__title.agx-hero__title--long { font-size: clamp(32px, 3.6vw, 48px); }
.agx-hero__subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--agx-muted);
}
/* cta_buttons.html wrapper: 6px extra above (gap 22px), 12px between buttons */
.agx-hero__cta { margin-top: 6px; gap: 12px !important; }
.agx-hero .agx-btn--secondary { background-color: rgba(255, 255, 255, .7); }
.agx-hero .agx-btn--secondary:hover { background-color: var(--agx-surface); }

/* Breadcrumb as the first line of the text column */
.site-breadcrumb--hero .site-breadcrumb__list { padding: 0; flex-wrap: wrap; }
.site-breadcrumb--hero .site-breadcrumb__list > li:last-child { overflow: visible; }

/* Element tile: desktop only */
.agx-hero__aside { display: none; }

@media (min-width: 992px) {
  .agx-hero { display: flex; min-height: 420px; }
  .agx-hero--compact { min-height: 320px; }
  .agx-hero__in {
    display: flex;
    align-items: center;
    width: 100%;
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .agx-hero__grid { width: 100%; }
  .agx-hero--tile .agx-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 64px;
    align-items: center;
  }
  .agx-hero__bg {
    -webkit-mask-image: linear-gradient(90deg, transparent 28%, #000 68%);
    mask-image: linear-gradient(90deg, transparent 28%, #000 68%);
  }
  .agx-hero__bg-inner {
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 62%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 62%, transparent 100%);
  }
  .agx-hero__img { opacity: .38; }
  .agx-hero__title { font-size: 58px; line-height: 1.04; }
  .agx-hero__subtitle { font-size: 18px; line-height: 1.55; }

  .agx-hero__aside { display: flex; flex-direction: column; gap: 12px; }
  .agx-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 280px;
    height: 280px;
    padding: 20px 22px 18px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: var(--agx-radius-card);
    background: rgba(255, 255, 255, .84);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .agx-tile__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
  }
  .agx-tile__number { color: var(--agx-muted); }
  .agx-tile__name { font-weight: 600; color: var(--agx-ink); }
  .agx-tile__symbol {
    margin-left: -4px;
    font-size: 128px;
    font-weight: 600;
    line-height: .85;
    letter-spacing: -0.04em;
    color: var(--agx-ink);
  }
  .agx-tile__symbol--plus { margin-left: -2px; font-weight: 500; }
  /* Several symbols: grid instead of the large symbol */
  .agx-tile__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    font-size: 20px;
  }
  .agx-tile__grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); font-size: 18px; }
  .agx-tile__grid span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border: 1px solid var(--agx-line);
    border-radius: 8px;
    background: var(--agx-white);
    font-weight: 600;
    line-height: 1;
    color: var(--agx-ink);
  }
  .agx-tile__facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--agx-line);
  }
  .agx-tile__facts dt {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--agx-muted);
  }
  .agx-tile__facts dd {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--agx-ink);
  }
  .agx-tile__caption {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
    color: var(--agx-muted);
  }
}

/* Eyebrow above the title: gold dot (both variants) */
.agx-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--agx-muted);
}
.agx-hero__eyebrow::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--agx-gold);
}

/* Variant "Periodensystem" (includes/hero_periodic.html): no photo, text left,
   periodic table right; one column below 992px. */
.agx-hero--periodic .agx-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}
.agx-hero--periodic .agx-hero__text { max-width: none; }
.agx-pt-wrap {
  --agx-pt-cell: min(28px, (100% - 17 * 3px) / 18);
  min-width: 0;
}
.agx-pt {
  display: grid;
  grid-template-columns: repeat(18, var(--agx-pt-cell));
  grid-template-rows: repeat(7, auto);
  gap: 3px;
}
.agx-pt__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid #EBEBEB;
  border-radius: 3px;
  background: #FAFAFA;
  /* symbol size: 11px on desktop, down to 7px on narrow phones (fits the cell) */
  font-size: clamp(7px, 2.2vw, 11px);
  font-weight: 700;
  line-height: 1;
  color: var(--agx-white);
}
/* Lit cell: pen drawing (content.periodic.feder_svg) instead of a fill, the
   symbol on a white patch above it; the whole cell fades/scales in. */
.agx-pt__cell--lit {
  position: relative;
  border-color: transparent;
  background: transparent;
  color: var(--agx-teal);
  animation: agx-pt-in .55s cubic-bezier(.2, .8, .2, 1) both;
}
.agx-feder { display: block; overflow: visible; }
.agx-pt__cell--lit .agx-feder { position: absolute; inset: 0; width: 100%; height: 100%; }
.agx-pt__sym {
  position: relative;
  z-index: 1;
  padding: 0 1px;
  border-radius: 2px;
  background: #FFFFFF;
  line-height: 1.1;
}
@keyframes agx-pt-in {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .agx-pt__cell--lit { animation: none; }
}
.agx-pt__legend {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--agx-muted);
}
.agx-pt__key {
  flex: none;
  align-self: flex-start;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}
.agx-pt__legend strong { font-weight: 500; color: var(--agx-ink); }

@media (min-width: 992px) {
  .agx-hero--periodic { min-height: 640px; }
  .agx-hero--periodic .agx-hero__grid {
    grid-template-columns: minmax(0, 1fr) 556px;
    gap: 64px;
    align-items: center;
  }
  .agx-hero--periodic .agx-hero__title {
    font-size: 50px;
    line-height: 1.06;
    font-weight: 600;
    letter-spacing: -0.015em;
  }
  .agx-pt-wrap { --agx-pt-cell: 28px; }
}

/* Secondary link button in the hero without the arrow (design); the jump
   button (#anchor) keeps its down arrow. */
.agx-hero__cta .agx-btn--secondary:not([href^="#"]) > svg { display: none; }
