/*
Theme Name: Analogue Artefacts
Theme URI:
Author:
Description: Starter WordPress theme for Analogue Artefacts.
Version: 1.0.3
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: analogue-artefacts
*/

/* Base starter styles */
:root {
  --aa-bg: #0d0d0d;
  --aa-paper: #f2f2f2;
  --aa-text: #f2f2f2;
  --aa-muted: rgba(242, 242, 242, 0.72);
  --aa-separator: rgba(242, 242, 242, 0.25);
  --aa-glow-blue: rgba(0, 122, 255, 0.35);
  --aa-glow-red: rgba(255, 69, 58, 0.25);
  --aa-header-bg-image: url("assets/images/meny-background.jpg");
  --aa-header-height: 280px;
  /* Inner pages: compact bar, black */
  --aa-header-inner-bg: #000000;
  --aa-header-inner-height: 72px;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--aa-bg);
  color: var(--aa-text);
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--aa-paper);
}

.site-header .site-logo-link:hover,
.site-header .site-logo-link:focus-visible {
  color: inherit;
}

.site-header .site-nav a:hover,
.site-header .site-nav a:focus,
.site-header .site-nav a:active {
  color: var(--aa-muted);
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--aa-separator);
}

/* Front page: full-width photo header + image menu strip */
.site-header--front {
  height: var(--aa-header-height);
  min-height: var(--aa-header-height);
  overflow: hidden;
}

.site-header--front::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--aa-header-inner-bg); /* letterboxing behind image when narrower than strip */
  background-image: var(--aa-header-bg-image);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover; /* Desktop default */
  transform: scale(1.01); /* Avoid 1px edge artifacts on some screens */
}

/*
 * Very wide viewports: `cover` scales until the strip width is filled; if the
 * result is taller than 280px, top/bottom crop. Height-scaled sizing keeps
 * --aa-header-height (280px) and menu strip alignment; sides may show black
 * letterboxing (preferred) when the image is narrower than the viewport.
 */
@media (min-width: 1200px) {
  .site-header--front::before {
    background-size: auto 100%;
    background-position: center center;
    transform: scale(1.01);
  }
}

.site-header--front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 13, 13, 0.15) 0%,
    rgba(13, 13, 13, 0.22) 58%,
    rgba(13, 13, 13, 0.45) 100%
  );
}

/* All other pages: compact bar, black, text menu */
.site-header--inner {
  height: var(--aa-header-inner-height);
  min-height: var(--aa-header-inner-height);
  background-color: var(--aa-header-inner-bg);
  overflow: visible;
}

.site-header--inner::before,
.site-header--inner::after {
  display: none;
}

.site-main,
.site-footer {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
}

.site-header__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 1.5rem;
  padding-left: max(0.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
}

.site-header--front .site-header__inner {
  height: var(--aa-header-height);
  min-height: var(--aa-header-height);
}

.site-header--inner .site-header__inner {
  height: var(--aa-header-inner-height);
  min-height: var(--aa-header-inner-height);
  align-items: center;
}

.site-title {
  margin: 0;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 0.95;
}

.site-branding {
  position: absolute;
  top: 4px;
  left: max(0.25rem, env(safe-area-inset-left, 0px));
  z-index: 2;
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.site-header--inner .site-branding {
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
}

.site-logo-link {
  display: inline-flex;
  align-items: center;
}

.site-logo {
  display: block;
  width: auto;
  max-width: min(40vw, 320px);
  max-height: 72px;
  height: auto;
}

.site-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.site-nav .site-image-menu {
  gap: clamp(0.4rem, 1.2vw, 0.85rem);
  align-items: stretch;
}

.site-header--front .site-nav a {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aa-muted);
}

.site-nav {
  margin-left: auto;
  flex-shrink: 0;
}

/* Wide screens — front page: menu strip fills header height */
@media (min-width: 993px) {
  .site-header--front .site-nav {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: 100%;
    min-height: var(--aa-header-height);
    justify-content: stretch;
  }

  .site-header--front .site-nav__panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    justify-content: stretch;
  }

  /* Inner pages: horizontal text links */
  .site-header--inner .site-nav--text {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: stretch;
    height: 100%;
    min-height: var(--aa-header-inner-height);
    margin-left: auto;
    flex-shrink: 0;
  }

  .site-header--inner .site-nav--text .site-nav__toggle {
    display: none;
  }

  .site-header--inner .site-nav__panel--text {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .site-text-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.5rem, 1.5vw, 1.25rem);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .site-text-menu__item {
    margin: 0;
    padding: 0;
  }

  .site-text-menu a {
    display: inline-block;
    padding: 0.35rem 0.5rem;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--aa-muted);
  }
}

.site-image-menu {
  height: var(--aa-header-height);
  min-height: var(--aa-header-height);
  max-height: var(--aa-header-height);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding-left: clamp(0.35rem, 1vw, 0.65rem);
  padding-right: max(clamp(0.35rem, 1vw, 0.65rem), env(safe-area-inset-right, 0px));
  gap: clamp(0.4rem, 1.2vw, 0.85rem);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  box-sizing: border-box;
}

.site-image-menu__item {
  flex: 0 0 auto;
  height: var(--aa-header-height);
  min-height: var(--aa-header-height);
  max-height: var(--aa-header-height);
  box-sizing: border-box;
}

.site-image-menu__item a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: var(--aa-header-height);
  padding: 0 clamp(0.35rem, 1vw, 0.65rem);
  box-sizing: border-box;
}

.site-image-menu__item img,
.site-image-menu__img {
  display: block;
  width: auto;
  height: var(--aa-header-height);
  min-height: var(--aa-header-height);
  max-height: var(--aa-header-height);
  object-fit: cover;
  object-position: center;
  box-shadow: none;
  border: 0;
}

/* Text label: hidden on desktop when an image is shown; always used in mobile dropdown */
.site-image-menu__label {
  display: inline-block;
  padding: 0 0.65rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aa-paper);
}

@media (min-width: 993px) {
  .site-image-menu__item--has-image .site-image-menu__label {
    display: none;
  }
}

/* Hamburger: hidden on wide screens; shown ≤992px */
.site-nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.35rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--aa-paper);
  line-height: 0;
}

.site-nav__toggle:focus-visible {
  outline: none;
}

.site-nav__toggle-img {
  display: block;
  width: auto;
  height: auto;
  max-height: 40px;
  max-width: 56px;
  object-fit: contain;
}

.site-nav__toggle-bars {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--aa-paper);
  box-shadow: 0 -8px 0 var(--aa-paper), 0 8px 0 var(--aa-paper);
}

.site-nav:not(.is-open) .site-nav__toggle-img--close {
  display: none;
}

.site-nav.is-open .site-nav__toggle-img--open {
  display: none;
}

body.aa-nav-open {
  overflow: hidden;
}

@media (max-width: 992px) {
  /* Photo header height: scope to .site-header--front (not body.front-page — that class can be missing). */
  .site-header--front {
    --aa-header-height: clamp(68px, 14vh, 99px);
  }

  body:not(.front-page) {
    --aa-header-inner-height: 40px;
  }

  .site-header--front .site-header__inner {
    align-items: flex-start;
    justify-content: flex-start;
    padding-bottom: 0.1rem;
  }

  .site-header--front .site-logo {
    max-height: 42px;
    max-width: min(64vw, 260px);
  }

  body:not(.front-page) .site-logo {
    max-height: 39px;
    max-width: min(56vw, 220px);
  }

  /* Dropdown anchors under the toggle (not the bottom of the header band) */
  .site-header--front {
    overflow: visible;
  }

  /* After changing header height, keep the banner artwork aligned */
  .site-header--front::before {
    /* Layer 1: mobile image (Customizer or file fallback). Layer 2: default desktop image. */
    background-image:
      var(--aa-header-bg-image-mobile, url("assets/images/meny-background-mobile.jpg")),
      var(--aa-header-bg-image);
    /*
     * Mobile: scale by height so top/bottom never crop and no black space appears under image.
     * (Side crop can happen on very wide screens, which is usually less noticeable.)
     */
    background-size: auto 100%;
    background-position: center center;
    transform: none;
  }

  .site-nav {
    position: absolute;
    top: max(0px, env(safe-area-inset-top, 0px));
    right: max(0.15rem, env(safe-area-inset-right, 0px));
    width: auto;
    height: auto;
    margin: 0;
    z-index: 30;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .site-nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 52px;
    padding: 0.15rem 0.25rem;
    margin: 0;
    box-sizing: border-box;
  }

  /*
   * Hamburger assets live in assets/images/ham/ — size with max-* only so wide or tall
   * artwork isn’t forced tiny by a small max-width (previous 72px cap hid large graphics).
   */
  .site-header--front .site-nav__toggle-img {
    display: block;
    width: auto;
    height: auto;
    max-height: min(72px, 22vw);
    max-width: min(160px, 44vw);
    object-fit: contain;
  }

  body:not(.front-page) .site-nav__toggle-img {
    display: block;
    width: auto;
    height: auto;
    max-height: min(64px, 20vw);
    max-width: min(140px, 40vw);
    object-fit: contain;
  }

  .site-nav__toggle-bars {
    width: 38px;
    height: 2px;
    box-shadow: 0 -12px 0 var(--aa-paper), 0 12px 0 var(--aa-paper);
  }

  .site-nav__panel {
    position: absolute;
    top: calc(100% + 0.2rem);
    right: 0;
    left: auto;
    width: min(22rem, calc(100vw - 1.25rem));
    max-width: calc(100vw - 1.25rem);
    box-sizing: border-box;
    z-index: 40;
    max-height: min(70vh, calc(100dvh - 5rem));
    overflow-y: auto;
    padding: 0.2rem max(0.35rem, env(safe-area-inset-right)) 0.3rem max(0.35rem, env(safe-area-inset-left));
    background: rgba(13, 13, 13, 0.96);
    border: 1px solid var(--aa-separator);
    border-radius: 4px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
    visibility: hidden;
    opacity: 0;
    transform: none;
    pointer-events: none;
    transition: none;
  }

  .site-nav.is-open .site-nav__panel {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .site-header--inner .site-nav__panel {
    background: rgba(0, 0, 0, 0.97);
  }

  .site-text-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 0;
    row-gap: 0;
  }

  .site-text-menu__item {
    margin: 0;
    padding: 0;
  }

  .site-text-menu__item a {
    display: block;
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1.15;
    color: var(--aa-muted);
  }

  /* Reset desktop strip heights — items were min-height: var(--aa-header-height) each */
  .site-image-menu {
    height: auto;
    min-height: 0;
    max-height: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-left: 0;
    padding-right: 0;
    overflow: visible;
    gap: 0;
    row-gap: 0;
  }

  .site-image-menu__item {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    line-height: 1.15;
  }

  .site-image-menu__item a {
    justify-content: flex-start;
    align-items: center;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0.2rem 0.4rem;
    line-height: 1.15;
  }

  .site-image-menu__item img,
  .site-image-menu__img {
    display: none !important;
  }

  .site-image-menu__label {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1.15;
  }
}

/* Front page hero (full width; inner matches .site-main column) */
.site-main:has(> .aa-hero:first-child),
.site-main:has(> article.aa-da-page > .aa-hero:first-child) {
  padding-top: 0;
}

/* Visually hidden (screen reader only) — WordPress core class when present; fallback here */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.aa-hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  min-height: clamp(18rem, 42vh, 28rem);
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(2rem, 4.5vw, 3.75rem);
  background-color: var(--aa-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--aa-separator);
}

/* Background image only — no gradient overlay */
.aa-hero--has-bg {
  background-image: var(--aa-hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.aa-hero__inner {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  display: block;
  text-align: center;
}

.aa-hero__headline {
  margin: 0 auto;
  max-width: min(35ch, 100%);
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--aa-paper);
  font-size: clamp(1.2rem, 2.6vw, 1.85rem);
}

@media (min-width: 993px) {
  .aa-hero {
    min-height: 600px;
    height: 600px;
    /* Extra bottom padding lifts the headline slightly above the lower edge */
    padding-bottom: clamp(3rem, 5.5vw, 4.5rem);
  }
}

@media (max-width: 768px) {
  .aa-hero {
    min-height: clamp(16rem, 52vh, 24rem);
    height: auto;
  }
}

/*
 * Starting page only: remove thin section dividers (not full viewport width — they sit inside .site-main).
 * Hero keeps its own bottom border (full-bleed). aa-front-sections is added in functions.php; front-page is a fallback.
 */
body.aa-front-sections .site-main > .aa-news,
body.aa-front-sections .site-main > .aa-editorial,
body.aa-front-sections .site-main > .aa-projects,
body.aa-front-sections .site-main > .aa-resources,
body.front-page .site-main > .aa-news,
body.front-page .site-main > .aa-editorial,
body.front-page .site-main > .aa-projects,
body.front-page .site-main > .aa-resources {
  border-bottom: none !important;
  border-top: none !important;
}

/* News — latest post in category “news” (slug: news) */
.aa-news {
  width: 100%;
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--aa-separator);
}

.aa-news__container {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
}

.aa-news__section-title {
  margin: 0 0 1.25rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--aa-paper);
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
}

.aa-news__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.aa-news__grid--no-thumb {
  grid-template-columns: 1fr;
}

.aa-news__media-link {
  display: block;
  border: 1px solid rgba(242, 242, 242, 0.12);
  overflow: hidden;
  line-height: 0;
}

.aa-news__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.aa-news__title {
  margin: 0 0 0.75rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.15;
  color: var(--aa-paper);
}

.aa-news__title a {
  color: inherit;
  text-decoration: none;
}

.aa-news__title a:hover {
  opacity: 0.9;
}

.aa-news__excerpt {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  line-height: 1.55;
  color: var(--aa-muted);
}

.aa-news__excerpt p {
  margin: 0 0 0.65rem;
}

.aa-news__excerpt p:last-child {
  margin-bottom: 0;
}

.aa-news__more-wrap {
  margin: 1rem 0 0;
}

.aa-news__more {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aa-muted);
}

.aa-news__more:hover {
  color: var(--aa-paper);
}

.aa-news__all-wrap {
  margin: clamp(1.5rem, 3vw, 2rem) 0 0;
  text-align: center;
}

.aa-news__all-button {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--aa-paper);
  border: 1px solid var(--aa-separator);
  background: transparent;
  box-sizing: border-box;
}

.aa-news__all-button:hover {
  border-color: var(--aa-paper);
}

@media (max-width: 768px) {
  .aa-news__grid {
    grid-template-columns: 1fr;
  }
}

/* Front page Projects — nine latest, square masonry + archive button */
.aa-projects {
  width: 100%;
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--aa-separator);
}

.aa-projects__container {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
}

.aa-projects__section-title {
  margin: 0 0 1.25rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--aa-paper);
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
}

.aa-projects__masonry {
  column-count: 3;
  column-gap: 1rem;
}

.aa-projects__item {
  break-inside: avoid;
  margin-bottom: 1rem;
}

.aa-projects__link {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(242, 242, 242, 0.12);
  line-height: 0;
}

.aa-projects__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  box-shadow: none;
}

.aa-projects__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0.75rem;
  box-sizing: border-box;
  background: rgba(242, 242, 242, 0.06);
}

.aa-projects__placeholder-text {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  color: var(--aa-muted);
  line-height: 1.3;
}

.aa-projects__actions {
  margin: clamp(1.5rem, 3vw, 2rem) 0 0;
  text-align: center;
}

.aa-projects__button {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--aa-paper);
  border: 1px solid var(--aa-separator);
  background: transparent;
  box-sizing: border-box;
}

.aa-projects__button:hover {
  border-color: var(--aa-paper);
}

@media (max-width: 992px) {
  .aa-projects__masonry {
    column-count: 2;
  }
}

/* Horizontal small screens: same anti-crop behavior as portrait */
@media (max-width: 992px) and (orientation: landscape) {
  .site-header--front,
  .site-header--front .site-header__inner {
    /* Let height be driven by full-width mobile image ratio (900x130) */
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 900 / 130;
  }

  .site-header--front::before {
    /* Landscape mobile: show full image width, no crop */
    background-size: 100% auto !important;
    background-position: center top !important;
    transform: none;
  }
}

@media (max-width: 640px) {
  .aa-projects__masonry {
    column-count: 1;
  }
}

/* Front page Resources — 3 projects, Resources category; centered headings; full-bleed bg; square thumbs */
.aa-resources {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(1.25rem, 2.5vw, 1.75rem);
  border-bottom: 1px solid var(--aa-separator);
  background-color: var(--aa-bg);
}

.aa-resources--has-bg::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  top: 0;
  z-index: 0;
  background-color: var(--aa-bg);
  background-image: var(--aa-resources-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.aa-resources__overlay {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  top: 0;
  z-index: 1;
  background: rgba(13, 13, 13, 0.72);
  pointer-events: none;
}

.aa-resources__container {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
}

.aa-resources__header {
  text-align: center;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.aa-resources__title {
  margin: 0 0 0.5rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--aa-paper);
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
}

.aa-resources__sub {
  margin: 0;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  line-height: 1.5;
  color: var(--aa-muted);
}

.aa-resources__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
  align-items: start;
}

.aa-resources__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.aa-resources__thumb {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(242, 242, 242, 0.12);
  line-height: 0;
}

.aa-resources__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  box-shadow: none;
}

.aa-resources__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 8rem;
  background: rgba(242, 242, 242, 0.06);
}

.aa-resources__post-title {
  display: block;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.2;
  color: var(--aa-paper);
  text-align: center;
}

.aa-resources__actions {
  margin: clamp(1rem, 2vw, 1.35rem) 0 0;
  text-align: center;
}

.aa-resources__button {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--aa-paper);
  border: 1px solid var(--aa-separator);
  background: transparent;
  box-sizing: border-box;
}

.aa-resources__button:hover {
  border-color: var(--aa-paper);
}

@media (max-width: 768px) {
  .aa-resources__grid {
    grid-template-columns: 1fr;
  }
}

/* Editorial — same horizontal width as News (.site-main column); full-bleed bg via ::before */
.aa-editorial {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--aa-separator);
  background-color: var(--aa-bg);
}

.aa-editorial--has-bg::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  top: 0;
  z-index: 0;
  background-color: var(--aa-bg);
  background-image: var(--aa-editorial-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.aa-editorial__overlay {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  top: 0;
  z-index: 1;
  background: rgba(13, 13, 13, 0.72);
  pointer-events: none;
}

.aa-editorial__container {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
}

.aa-editorial__section-title {
  margin: 0 0 1.25rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--aa-paper);
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
}

.aa-editorial__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.aa-editorial__grid--no-thumb {
  grid-template-columns: 1fr;
}

.aa-editorial__media-link {
  display: block;
  border: 1px solid rgba(242, 242, 242, 0.12);
  overflow: hidden;
  line-height: 0;
}

.aa-editorial__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.aa-editorial__title {
  margin: 0 0 0.75rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.15;
  color: var(--aa-paper);
}

.aa-editorial__title a {
  color: inherit;
  text-decoration: none;
}

.aa-editorial__excerpt {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  line-height: 1.55;
  color: var(--aa-muted);
}

.aa-editorial__excerpt p {
  margin: 0 0 0.65rem;
}

.aa-editorial__excerpt p:last-child {
  margin-bottom: 0;
}

.aa-editorial__excerpt--full img,
.aa-editorial__excerpt--full video,
.aa-editorial__excerpt--full iframe {
  max-width: 100%;
  height: auto;
}

.aa-editorial__more-wrap {
  margin: 1rem 0 0;
}

.aa-editorial__more {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aa-muted);
}

@media (max-width: 768px) {
  .aa-editorial__grid {
    grid-template-columns: 1fr;
  }
}

.site-main {
  padding-top: clamp(2rem, 4vw, 4rem);
  padding-bottom: clamp(0.5rem, 1.25vw, 1rem);
}

h1,
h2,
.entry-title {
  margin: 0 0 0.65rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--aa-paper);
}

h1 {
  font-size: clamp(2.1rem, 7vw, 5rem);
}

h2,
.entry-title {
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
}

p,
li,
.entry-content,
.entry-excerpt {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  color: var(--aa-muted);
}

article {
  margin-bottom: clamp(2.2rem, 4vw, 3.6rem);
}

/* Tight gap above footer: last block in main column */
.site-main > *:last-child {
  margin-bottom: 0;
}

.site-main .entry-content > :last-child,
.site-main .aa-project-archive__intro.entry-content > :last-child {
  margin-bottom: 0;
}

img,
.wp-post-image,
.wp-block-image img,
.wp-block-post-featured-image img {
  border: 1px solid rgba(242, 242, 242, 0.12);
  box-shadow:
    0 0 0 1px rgba(242, 242, 242, 0.04) inset,
    0 0 18px var(--aa-glow-blue),
    0 0 28px var(--aa-glow-red);
}

.site-header img {
  border: 0;
  box-shadow: none;
}

/* Singular pages/posts: full content; classic & block images stay visible */
.entry-content img,
.entry-content video,
.entry-content iframe,
.entry-content .wp-block-image img,
.entry-content .wp-block-gallery img {
  max-width: 100%;
  height: auto;
}

.entry-content figure {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

/* Core Button block — match site CTAs (.aa-news__all-button, .aa-projects__button, …) */
.entry-content .wp-block-button .wp-block-button__link {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  /* Beat block inline colors so front matches theme buttons */
  color: var(--aa-paper) !important;
  border: 1px solid var(--aa-separator);
  background-color: transparent !important;
  background-image: none !important;
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.entry-content .wp-block-button .wp-block-button__link:hover,
.entry-content .wp-block-button .wp-block-button__link:focus,
.entry-content .wp-block-button .wp-block-button__link:focus-visible {
  color: var(--aa-paper) !important;
  border-color: var(--aa-paper);
  background-color: transparent !important;
  background-image: none !important;
  outline: none;
}

.entry-content .wp-block-button .wp-block-button__link:visited {
  color: var(--aa-paper) !important;
}

.entry-content .wp-block-button__width-100 .wp-block-button__link {
  display: block;
  width: 100%;
  text-align: center;
}

.entry-featured-image {
  margin: 0 0 1.25rem;
  line-height: 0;
}

.entry-featured-image__img {
  display: block;
  width: 100%;
  height: auto;
}

.page-links {
  margin-top: 1.5rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--aa-muted);
}

/* Micro-label catalog style */
.micro-label,
.aa-micro-label,
.wp-block-post-terms,
.wp-block-image figcaption {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--aa-separator);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--aa-muted);
}

/* Asymmetrical masonry utilities */
.aa-masonry {
  column-count: 3;
  column-gap: 1rem;
}

.aa-masonry > * {
  break-inside: avoid;
  margin-bottom: 1rem;
}

.aa-masonry > *:nth-child(3n + 1) img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.aa-masonry > *:nth-child(3n + 2) img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.aa-masonry > *:nth-child(3n) img {
  aspect-ratio: 1 / 1.25;
  object-fit: cover;
}

.site-footer {
  padding: 0.35rem 0 1.25rem;
  margin-top: 0;
  border-top: 1px solid var(--aa-separator);
  color: var(--aa-muted);
  font-family: "Space Grotesk", system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.site-footer__content {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.88rem;
  line-height: 1.55;
}

.site-footer__content > *:first-child {
  margin-top: 0;
}

.site-footer__content h1,
.site-footer__content h2,
.site-footer__content h3,
.site-footer__content h4 {
  color: var(--aa-paper);
  text-transform: none;
  letter-spacing: 0.02em;
}

.site-footer__content p,
.site-footer__content li {
  color: var(--aa-muted);
}

.site-footer__fallback {
  margin: 0;
}

.site-footer__meta {
  margin: 0 0 0.65rem;
  padding: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

.site-footer__cookie-link {
  color: var(--aa-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-footer__cookie-link:hover,
.site-footer__cookie-link:focus-visible {
  color: var(--aa-paper);
  border-bottom-color: var(--aa-paper);
  outline: none;
}

@media (max-width: 900px) {
  .aa-masonry {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  /* Narrow phones: even shorter photo header */
  .site-header--front {
    --aa-header-height: clamp(57px, 12vh, 83px);
  }

  .site-main,
  .site-footer {
    width: min(1200px, calc(100% - 2rem));
  }

  .site-header--front .site-header__inner {
    width: 100%;
    max-width: none;
    height: var(--aa-header-height);
    min-height: var(--aa-header-height);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding-bottom: 0;
  }

  .site-header--front .site-logo {
    max-width: min(68vw, 260px);
    max-height: 39px;
  }

  .site-header--front .site-branding {
    top: 4px;
    transform: none;
    left: max(0.25rem, env(safe-area-inset-left, 0px));
  }

  body:not(.front-page) .site-logo {
    max-height: 36px;
    max-width: min(58vw, 220px);
  }

  .aa-masonry {
    column-count: 1;
  }
}

/*
 * Vertical / portrait viewports: fixed front header band.
 * Uses max-aspect-ratio (width <= height) for reliable portrait targeting.
 */
@media (max-width: 992px) and (max-aspect-ratio: 1/1) {
  .site-header--front,
  .site-header--front .site-header__inner {
    --aa-header-height: 183px;
    height: 183px;
    min-height: 183px;
    max-height: 183px;
  }

  /* Portrait: keep top of the mobile banner visible */
  .site-header--front::before {
    background-position: center top !important;
    transform: none;
  }
}

/* Blog index (/blog/): 300×300 cards, 3 columns, category filter buttons */
.aa-blog {
  width: 100%;
  max-width: min(1200px, calc(100% - 3rem));
  margin-left: auto;
  margin-right: auto;
}

.aa-blog__masthead {
  text-align: center;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.aa-blog__page-title {
  margin: 0;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--aa-paper);
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
}

.aa-blog__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.aa-blog-filter {
  display: inline-block;
  padding: 0.45rem 1rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--aa-muted);
  border: 1px solid var(--aa-separator);
  background: transparent;
  box-sizing: border-box;
  line-height: 1.2;
}

.aa-blog-filter:hover,
.aa-blog-filter--active {
  color: var(--aa-paper);
  border-color: var(--aa-paper);
}

.aa-blog__grid {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  justify-content: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.aa-blog article.aa-blog-card {
  margin-bottom: 0;
}

.aa-blog-card {
  width: 300px;
  max-width: 100%;
  height: 300px;
  box-sizing: border-box;
}

.aa-blog-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(242, 242, 242, 0.12);
  overflow: hidden;
  box-sizing: border-box;
  background: var(--aa-bg);
  transition:
    border-color 0.22s ease,
    box-shadow 0.28s ease,
    transform 0.28s ease;
}

.aa-blog-card__link:hover {
  border-color: rgba(242, 242, 242, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  transform: translateY(-4px);
}

.aa-blog-card__link:focus-visible {
  outline: 2px solid var(--aa-paper);
  outline-offset: 3px;
}

.aa-blog-card__media {
  flex: 0 0 50%;
  min-height: 0;
  overflow: hidden;
  background: rgba(242, 242, 242, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.aa-blog-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  box-shadow: none;
  transform: scale(1);
  transition: transform 0.4s ease;
}

.aa-blog-card__link:hover .aa-blog-card__image {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .aa-blog-card__link,
  .aa-blog-card__image {
    transition: none;
  }

  .aa-blog-card__link:hover {
    transform: none;
  }

  .aa-blog-card__link:hover .aa-blog-card__image {
    transform: none;
  }
}

.aa-blog-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 4rem;
  background: rgba(242, 242, 242, 0.06);
}

.aa-blog-card__body {
  flex: 0 0 50%;
  min-height: 0;
  padding: 0.65rem 0.75rem 0.4rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  overflow: visible;
}

.aa-blog-card__title {
  flex-shrink: 0;
  margin: 0 0 0.35rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
  color: var(--aa-paper);
  text-transform: none;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aa-blog-card__excerpt {
  --aa-excerpt-lines: 5;
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--aa-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-line-clamp: var(--aa-excerpt-lines);
  line-clamp: var(--aa-excerpt-lines);
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: calc(var(--aa-excerpt-lines) * 0.72rem * 1.35);
  max-height: calc(var(--aa-excerpt-lines) * 1lh);
}

.aa-blog__pagination {
  margin-top: clamp(0.75rem, 2vw, 1.25rem);
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.aa-blog__pagination .navigation,
.aa-blog__pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.aa-blog__pagination ul.page-numbers {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.aa-blog__pagination ul.page-numbers li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aa-blog__pagination a.page-numbers,
.aa-blog__pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.35rem 0.6rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--aa-muted);
  border: 1px solid var(--aa-separator);
  text-decoration: none;
  box-sizing: border-box;
}

.aa-blog__pagination a.page-numbers:hover,
.aa-blog__pagination span.page-numbers.current {
  color: var(--aa-paper);
  border-color: var(--aa-paper);
}

.aa-blog__empty {
  text-align: center;
  color: var(--aa-muted);
}

@media (max-width: 992px) {
  .aa-blog__grid {
    grid-template-columns: repeat(2, 300px);
  }
}

@media (max-width: 640px) {
  .aa-blog__grid {
    grid-template-columns: minmax(0, 300px);
    justify-content: center;
  }
}

/* Digitalized Artefacts page: intro + optional content after featured project */
.aa-da-page {
  width: 100%;
}

.aa-da-page__intro,
.aa-da-page__after {
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.aa-da-page__intro {
  margin-top: clamp(1rem, 2vw, 1.5rem);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.aa-da-page__intro h2,
.aa-da-page__intro h3,
.aa-da-page__intro h4,
.aa-da-page__after h2,
.aa-da-page__after h3,
.aa-da-page__after h4 {
  color: var(--aa-paper);
}

.aa-da-page__featured-project {
  width: 100%;
  max-width: min(1200px, calc(100% - 3rem));
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.aa-da-page__portfolio-cta {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  text-align: center;
}

.aa-da-page__after {
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

.aa-da-page__empty {
  text-align: center;
}

/* Resources page: editor content first, then filters + blog grid */
.aa-resources-page__blocks {
  width: 100%;
}

.aa-resources-page__blocks-header {
  margin-bottom: 0;
}

.aa-resources-page__entry.entry-content {
  margin-top: clamp(0.75rem, 1.5vw, 1.25rem);
}

.aa-resources-page__portfolio {
  margin-top: clamp(1rem, 2vw, 1.5rem);
  padding-top: clamp(0.65rem, 1.5vw, 1.1rem);
  border-top: 1px solid var(--aa-separator);
}

/* Resources page: portfolio masthead + blog card grid (posts in Resources + optional secondary category filters) */
.aa-resources-page .aa-resources-page__posts {
  width: 100%;
  max-width: min(1200px, calc(100% - 3rem));
  margin-left: auto;
  margin-right: auto;
}

/* Projects archive (/projects/): 700×300 rows, 300×300 image left, filters; Editorial + Digitalized Artefacts excluded in PHP */
.aa-project-archive {
  width: 100%;
  max-width: min(1200px, calc(100% - 3rem));
  margin-left: auto;
  margin-right: auto;
}

.aa-project-archive__masthead {
  text-align: center;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.aa-project-archive__title {
  margin: 0;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--aa-paper);
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
}

.aa-project-archive__intro {
  max-width: 52rem;
  margin: 1rem auto 0;
  text-align: left;
}

.aa-project-archive__intro h2,
.aa-project-archive__intro h3,
.aa-project-archive__intro h4 {
  color: var(--aa-paper);
}

.aa-project-archive__filters {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.aa-project-archive__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.aa-project-archive article.aa-project-card {
  margin-bottom: 0;
}

.aa-project-card {
  width: 700px;
  max-width: 100%;
  height: 300px;
  box-sizing: border-box;
}

.aa-project-card__link {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(242, 242, 242, 0.12);
  overflow: hidden;
  box-sizing: border-box;
  background: var(--aa-bg);
  transition:
    border-color 0.22s ease,
    box-shadow 0.28s ease,
    transform 0.28s ease;
}

.aa-project-card__link:hover {
  border-color: rgba(242, 242, 242, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  transform: translateY(-3px);
}

.aa-project-card__media {
  flex: 0 0 300px;
  width: 300px;
  height: 300px;
  min-width: 0;
  overflow: hidden;
  background: rgba(242, 242, 242, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.aa-project-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  box-shadow: none;
}

.aa-project-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(242, 242, 242, 0.06);
}

.aa-project-card__body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 0.85rem 1rem 0.45rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  overflow: visible;
}

.aa-project-card__title {
  flex-shrink: 0;
  margin: 0 0 0.5rem;
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  line-height: 1.15;
  color: var(--aa-paper);
  text-transform: none;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aa-project-card__excerpt {
  /* Integer line count × line-height = full lines only (no half-row clip); ellipsis on last line */
  --aa-excerpt-lines: 11;
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--aa-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 11;
  line-clamp: 11;
  -webkit-line-clamp: var(--aa-excerpt-lines);
  line-clamp: var(--aa-excerpt-lines);
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: calc(var(--aa-excerpt-lines) * 0.82rem * 1.45);
  max-height: calc(var(--aa-excerpt-lines) * 1lh);
}

.aa-project-archive__pagination {
  margin-top: clamp(0.75rem, 2vw, 1.25rem);
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.aa-project-archive__pagination .navigation,
.aa-project-archive__pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.aa-project-archive__pagination ul.page-numbers {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.aa-project-archive__pagination ul.page-numbers li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aa-project-archive__pagination a.page-numbers,
.aa-project-archive__pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.35rem 0.6rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--aa-muted);
  border: 1px solid var(--aa-separator);
  text-decoration: none;
  box-sizing: border-box;
}

.aa-project-archive__pagination a.page-numbers:hover,
.aa-project-archive__pagination span.page-numbers.current {
  color: var(--aa-paper);
  border-color: var(--aa-paper);
}

.aa-project-archive__empty {
  text-align: center;
  color: var(--aa-muted);
}

@media (max-width: 768px) {
  .aa-project-card {
    height: auto;
  }

  .aa-project-card__link {
    flex-direction: column;
    height: auto;
  }

  .aa-project-card__media {
    flex: 0 0 auto;
    width: 100%;
    max-width: 300px;
    height: 300px;
    margin: 0 auto;
  }

  .aa-project-card__body {
    min-height: 6rem;
  }

  .aa-project-card__excerpt {
    --aa-excerpt-lines: 12;
    -webkit-line-clamp: 12;
    line-clamp: 12;
    -webkit-line-clamp: var(--aa-excerpt-lines);
    line-clamp: var(--aa-excerpt-lines);
  }
}

/* Cookie consent banner (CookiePolicyRules.txt; dark theme tokens) */
.aa-cookie-banner[data-visible="false"] {
  display: none;
}

.aa-cookie-banner[data-visible="true"] {
  display: block;
}

.aa-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50000;
  box-sizing: border-box;
  padding: 0.85rem max(0.75rem, env(safe-area-inset-left, 0px)) max(0.85rem, env(safe-area-inset-bottom, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px));
  background: rgba(13, 13, 13, 0.97);
  border-top: 1px solid var(--aa-separator);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55);
}

.aa-cookie-banner__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  width: min(1200px, calc(100% - 3rem));
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.aa-cookie-banner__text {
  flex: 1 1 auto;
  min-width: 0;
}

.aa-cookie-banner__message {
  margin: 0 0 0.35rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--aa-muted);
}

.aa-cookie-banner__link {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--aa-paper);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.aa-cookie-banner__link:hover,
.aa-cookie-banner__link:focus-visible {
  border-bottom-color: var(--aa-paper);
  outline: none;
}

.aa-cookie-banner__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.aa-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-sizing: border-box;
  border-radius: 0;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.aa-cookie-btn--necessary {
  color: var(--aa-muted);
  background: transparent;
  border: 1px solid var(--aa-separator);
}

.aa-cookie-btn--necessary:hover,
.aa-cookie-btn--necessary:focus-visible {
  color: var(--aa-paper);
  border-color: var(--aa-paper);
  outline: none;
}

.aa-cookie-btn--accept-all {
  color: var(--aa-bg);
  background: var(--aa-paper);
  border: 1px solid var(--aa-paper);
}

.aa-cookie-btn--accept-all:hover,
.aa-cookie-btn--accept-all:focus-visible {
  background: transparent;
  color: var(--aa-paper);
  outline: none;
}

@media (max-width: 768px) {
  .aa-cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .aa-cookie-banner__actions {
    justify-content: stretch;
  }

  .aa-cookie-btn {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }
}
