/*
   NOTE: `--fig-white` does not exist. The token is `--fig-siegel-white`
   (Figma names it "Siegell-White", with the double L). Every `var(--fig-white)`
   here resolved to nothing, so the declaration was dropped: hero text inherited
   dark instead of going white, and the red buttons rendered black label text.
   Text now uses the same semantic inverse tokens as the rest of the site, so
   the hero and buttons stay consistent with the shared components.
*/
/* ==========================================================================
   Technical Center — archive-technical_resource.php
   Figma: "Technical center Desktop" 172:9266 (1440) / "Technical center Mobile" 175:11694 (393)

   Audit measurements (§7.2, 2026-07-31):
   Hero: 1440×621 desktop, 393×700 mobile. Badge + H1 + subtitle, NO CTAs.
   Layout: 40px gutter → 332px sidebar → 38px gap → 990px grid → 40px gutter (total 1440)
   Content starts at y=32 below hero bottom.
   Card (desktop): 315×426. Thumb: 315×315, 12px padding. Gap: 12px. Text body gap: 6px.
   Card (mobile): 180×270. 2-col grid, 9px gap-x, 28px gap-y.
   Filter panel: 332×194, 1px border, heading 44px, 12px horizontal padding.
   Search bar: 331×36.
   CTA Banner at y=2708, height=560 — uses shared home/cta-banner.php template.
   ========================================================================== */

/* ── Hero ──────────────────────────────────────────────────────────────── */

.tech-hero {
  position: relative;
  height: 621px; /* shorter than other heroes — reproduce exactly */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tech-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.tech-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 60%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* I172:9480;38:1584 — content sits 40 from the frame edge (16 + 24), 24 clear
   of the bottom, with 24 between the heading block and the paragraph. */
.tech-hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--content-w);
  margin-inline: auto;
  width: 100%;
  box-sizing: content-box;
  padding: 0 var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

/* I172:9480;38:1585 — badge and heading are a 12-gap pair inside that 24. */
.tech-hero__heading-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* Product Badge 328:33487 — a translucent white chip, not bare text: Aktiv
   SemiBold 12/12.15 at -0.048px, p-4, radius 2. It was .t-caption, which is
   Bold with +0.6px tracking and no chip at all. */
.tech-hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--r-sm);
  color: var(--text-label);
  font: var(--fw-semibold) 0.75rem/0.759375rem var(--font-heading); /* 12 / 12.15 */
  letter-spacing: -0.048px;
  text-transform: none;
}

.tech-hero__heading {
  color: var(--text-heading-inverse);
  margin: 0;
  max-width: 777px;   /* drawn width of the heading box */
}

.tech-hero__subtitle {
  color: var(--text-body-inverse);
  margin: 0;
  max-width: 672px;   /* drawn width of the paragraph box */
}

/* ── Main content layout ─────────────────────────────────────────────── */

.tech-main {
  background: var(--fig-siegel-white);
}

.tech-main__inner {
  max-width: var(--content-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  box-sizing: content-box;
  display: flex;
  align-items: flex-start;
  gap: 38px; /* sidebar 332 + gap 38 + grid 990 = 1360 = --content-w */
  padding-block: 32px 80px;
}

/* ── Filter sidebar ──────────────────────────────────────────────────── */

.tech-sidebar {
  flex: 0 0 332px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 120px; /* sticks below sticky header */
}

/* Search bar — 331×36 */
.tech-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding-inline: 12px;
  border: 1px solid var(--fig-neutral-200);
  border-radius: var(--r-sm);
  background: var(--fig-siegel-white);
}

.tech-search__icon {
  flex-shrink: 0;
  color: var(--fig-neutral-400);
}

.tech-search__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-body-primary);
  min-width: 0;
}

.tech-search__input::placeholder { color: var(--fig-neutral-400); }

/* Filter panel — 332×194, 1px border all sides */
.tech-filter {
  border: 1px solid var(--fig-neutral-200);
  border-radius: var(--r-sm);
}

/* Heading row — 44px tall, 12px horizontal padding */
.tech-filter__heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding-inline: 12px;
  border-block-end: 1px solid var(--fig-neutral-100);
}

.tech-filter__label { color: var(--text-heading-primary); }

.tech-filter__clear {
  color: var(--fig-neutral-500);
  text-decoration: none;
  transition: color var(--dur-base) ease-out;
}

@media (hover: hover) and (pointer: fine) {
  .tech-filter__clear:hover { color: var(--text-heading-primary); }
}

/* Filter form body */
.tech-filter__form { padding: 12px; }

.tech-filter__group {
  border: none;
  margin: 0;
  padding: 0;
}

.tech-filter__group-label {
  display: block;
  color: var(--text-heading-primary);
  margin-bottom: 10px;
}

.tech-filter__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tech-filter__option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: 20px;
}

.tech-filter__checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--fig-red-600);
  cursor: pointer;
}

.tech-filter__option-text {
  color: var(--text-body-primary);
  line-height: 1.25;
}

/* ── Document grid ──────────────────────────────────────────────────────── */

.tech-main__content { flex: 1; min-width: 0; }

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Document card ──────────────────────────────────────────────────────── */
/*
  315×426 desktop.
  Outer: flex-col gap:12 (between thumb area and text body).
  Thumb: 315×315, bg neutral/primary, padding:12, overflow:hidden, relative.
  Text: flex-col gap:6 (title → subtitle → btn).
  Button: full-width, bg red, padding:14 all sides, border-radius 2px, gap:8.
*/
form.tech-search label {
    display: none;
}
.tech-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--fig-siegel-white);
}

/* Thumb area: square, bg neutral, 12px padding, badge sits in top-left */
.tech-card__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f5f6f6; /* --bg/neutral/primary from Figma */
  
  overflow: hidden;
}

.tech-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* document preview — preserve letterboxing inside padding */
  display: block;
}

.tech-card__img--placeholder {
  background: var(--fig-neutral-100);
}

/* Badge — top-left overlay, 4px padding, 2px radius, neutral bg */
.tech-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #e6e7e7; /* --colour/neutral/100 */
  padding: 4px;
  border-radius: var(--r-sm);
  color: var(--text-heading-primary);
  line-height: 1;
  text-transform: uppercase;
}

/* Text body: title → subtitle → download button */
.tech-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tech-card__title {
  color: var(--text-heading-primary);
}

.tech-card__desc {
  color: var(--text-body-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Two lines are reserved whether or not the excerpt fills them — the
     paragraph frame in 175:11271 is a fixed 25px, and without it a card with a
     one-line description came out shorter than the rest of its row. */
  min-height: 25px;
}

/* Button pinned to the bottom so every card in a row ends level. */
.tech-card__body {
  flex: 1;
}

.tech-card__btn {
  margin-top: auto;
}

/* Download button: full-width, 46px tall (14px padding × 2 + ~18px line), red, 2px radius */
.tech-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: var(--fig-red-600);
  color: var(--text-label);
  border: 1px solid var(--fig-red-600);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: opacity var(--dur-base) ease-out;
  margin-top: 2px; /* visual separation from subtitle */
}

@media (hover: hover) and (pointer: fine) {
  .tech-card__btn:hover { opacity: .85; }
}

.tech-card__btn:focus-visible {
  outline: 2px solid var(--btn-stroke-focused);
  outline-offset: 2px;
}

.tech-card__btn-icon { flex-shrink: 0; }

/* ── Mobile utility bar — 175:12958, 369×90 ──────────────────────────── */

.tech-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  padding-inline: 16px;
  border-block-end: 1px solid var(--fig-neutral-100);
  margin-bottom: 16px;
}

.tech-mobile-bar__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--fig-neutral-300);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text-heading-primary);
}

.tech-mobile-bar__sort {
  border: 1px solid var(--fig-neutral-300);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  background: var(--fig-siegel-white);
  color: var(--text-heading-primary);
  cursor: pointer;
}

/* ── Mobile filter dialog ───────────────────────────────────────────────── */

.tech-filter-dialog {
  border: none;
  border-radius: var(--r-base) var(--r-base) 0 0;
  padding: 0;
  margin: auto 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}

.tech-filter-dialog::backdrop {
  background: rgba(0,0,0,.4);
}

.tech-filter-dialog__inner {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tech-filter-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tech-filter-dialog__close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-heading-primary);
  line-height: 0;
}

.tech-filter-dialog__apply {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding-inline: 24px;
  background: var(--fig-red-600);
  color: var(--text-label);
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* No-results message */
.tech-no-results {
  color: var(--text-body-primary);
  padding-block: 40px;
  text-align: center;
}

/* ── Pagination ─────────────────────────────────────────────────────────── */

.tech-main__content .page-numbers {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  flex-wrap: wrap;
}

.tech-main__content .page-numbers li a,
.tech-main__content .page-numbers li span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--fig-neutral-200);
  border-radius: var(--r-sm);
  color: var(--text-body-primary);
  text-decoration: none;
  font: var(--fw-medium) 0.875rem/1 var(--font-heading);
}

.tech-main__content .page-numbers li span.current {
  background: var(--fig-red-600);
  border-color: var(--fig-red-600);
  color: var(--text-label);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

/* Fluid 1024–1439 */
@media (max-width: 1439px) and (min-width: 1024px) {
  .tech-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet 768–1023: sidebar collapses above grid, 2-col cards */
@media (max-width: 1023px) {
  .tech-main__inner {
    flex-direction: column;
    gap: 24px;
    padding-block: 24px 64px;
  }

  .tech-sidebar {
    position: static;
    width: 100%;
    flex: 0 0 auto;
  }

  .tech-filter {
    max-width: 480px;
  }

  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Mobile ≤767: mobile bar visible, sidebar hidden, 2-col cards (180px), filter in dialog */
@media (max-width: 767px) {
  .tech-hero {
    height: 700px;
  }

  .tech-hero__inner {
    padding: 0 20px 32px;
  }

  .tech-hero__heading {
    font: var(--fw-bold) 3rem/3.15rem var(--font-heading);
    letter-spacing: var(--ls-tight);
  }

  .tech-main__inner {
    flex-direction: column;
    padding-inline: 0;
    gap: 0;
    padding-block: 0 64px;
  }

  /* Hide desktop sidebar; show mobile bar */
  .tech-sidebar { display: none; }
  .tech-mobile-bar { display: flex; }

  .tech-main__content {
    padding-inline: 16px;
  }

  /* 2-col grid: (369 - 16 - 9 - 16) / 2 ≈ 164px → use 1fr */
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px 9px; /* gap-y 28px from Figma metadata; use 9px for tighter mobile feel per card size */
  }

  /* Mobile card: 180×270 */
  .tech-card__thumb {
    /* image height ~180px (square) on 1fr columns ≈ 156px → use aspect-ratio */
    aspect-ratio: 1 / 1;
    padding: 8px;
  }

  .tech-card__badge {
    top: 8px;
    left: 8px;
  }

  .tech-card__btn {
    padding: 10px 8px;
    font-size: 0.75rem;
  }

  .tech-card__btn-icon { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tech-card__btn,
  .tech-filter__clear { transition: none; }
}

/* ── CTA Banner ───────────────────────────────────────────────────────────── */
/*
   No width override here any more. 172:9411 draws this banner 1408 wide inset
   by 16, against the 1360 inset 40 that 83:3507 uses on the home page and that
   every other section on the site lines up to. Reproducing that 24px-per-side
   difference made the banner visibly wider than everything above it on the same
   page, so the shared 1360 is used instead and the archive stays consistent
   with the rest of the site. The two frames genuinely differ — this is a
   deliberate normalisation, not a measurement.
*/

/* ── Load more ───────────────────────────────────────────────────────────────
   172:9266 draws one continuous grid with no pager, so the archive appends in
   place rather than paging away. The button sits centred under the grid and
   removes itself on the last page.
   ---------------------------------------------------------------------------- */

.tech-load-more {
  display: flex;
  justify-content: center;
  padding-block: 40px 0;
}

.tech-load-more__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: var(--btn-primary);
  border: 1px solid var(--btn-primary);
  border-radius: var(--r-sm);
  color: var(--fig-siegel-white);
  cursor: pointer;
  transition: background var(--dur-fast) linear, border-color var(--dur-fast) linear;
}

@media (hover: hover) and (pointer: fine) {
  .tech-load-more__btn:hover {
    background: var(--fig-siegel-black);
    border-color: var(--fig-siegel-black);
  }
}

.tech-load-more__btn:focus-visible {
  outline: 2px solid var(--btn-stroke-focused);
  outline-offset: 2px;
}

.tech-load-more__btn[disabled] {
  opacity: .7;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .tech-load-more__btn { transition: none; }
}
