/* ==========================================================================
   EON25 Projects page (archive-project.php) and project pages (single-project.php)
   Rebuild of fieldoperations.net/projects and fieldoperations.net/project/high-line:
   values match the originals, each element has one pl- class. EON changes are at
   the end of this file: the EON header (logo + menu) and the EON footer, the
   project header (logo + Close), filters, and card photos that fill their frame.
   Loaded on those two pages only, after style.css.
   ========================================================================== */

/* The original uses Helvetica Now Display Bold and Text Medium (Monotype,
   licensed to Field Operations), registered at weight 400. These faces use a
   locally installed copy if there is one, otherwise the closest system cut. */
:root {
  --pl-default: #0d0d0d;
  --pl-inverse: #fff;
  --pl-secondary: #757575;
  --pl-secondary-inverse: gray;
  --pl-overlay-dark: #0006;
  --pl-overlay-dark-light: #0000001a;
  --pl-overlay-blur: #ffffffb3;
  --pl-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --pl-font-display: var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif);   /* EON: the site font */
  --pl-font-text: var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif);

  --inner-gutter: 12px;
  --outer-gutter: 12px;
  --grid-columns: 6;
  --custom-underline-offset: 1px;
  --custom-underline-height: 1px;

  --pl-spacing-header: 2.3125rem;
  --pl-nav-categories: 3rem;
  --pl-hero-offset: 4rem;
  --pl-spacing-1: 0.125rem;
  --pl-spacing-2: 0.25rem;
  --pl-spacing-3: 0.5rem;
  --pl-spacing-4: 0.75rem;
  --pl-spacing-5: 1rem;
  --pl-spacing-6: 1rem;
  --pl-spacing-8: 1.5rem;
  --pl-spacing-9: 2rem;
  --pl-spacing-11: 2.5rem;
  --pl-spacing-12: 3rem;
  --pl-spacing-14: 5rem;
  --pl-spacing-15: 6rem;
  --pl-spacing-18: 12rem;

  --pl-heading-01-size: 1.875rem;
  --pl-heading-01-tracking: normal;
  --pl-heading-03-size: 1.125rem;
  --pl-heading-03-tracking: 0.01em;
  --pl-body-01-size: 1rem;
}

@media (min-width: 768px) {
  :root {
    --grid-columns: 16;
    --pl-nav-categories: 2.5rem;
    --pl-spacing-11: 3rem;
    --pl-spacing-12: 4rem;
    --pl-spacing-14: 6rem;
    --pl-spacing-15: 8rem;
    --pl-spacing-18: 14rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --inner-gutter: 16px;
    --outer-gutter: 16px;
    --pl-hero-offset: 3.5rem;
    --pl-spacing-6: 1.25rem;
    --pl-spacing-8: 2rem;
    --pl-spacing-9: 2.5rem;
    --pl-spacing-11: 4rem;
    --pl-spacing-12: 5rem;
    --pl-spacing-14: 8rem;
    --pl-spacing-15: 10rem;
    --pl-spacing-18: 16rem;
    --pl-heading-01-size: 2.875rem;
    --pl-heading-01-tracking: -0.005em;
    --pl-heading-03-size: 1.5rem;
    --pl-heading-03-tracking: 0;
    --pl-body-01-size: 1.125rem;
  }
}

@media (min-width: 1599px) {
  :root {
    --pl-heading-01-size: 3.5rem;
    --pl-heading-03-size: 1.75rem;
    --pl-heading-03-tracking: -0.005em;
  }
}

@media (min-width: 2400px) {
  :root {
    --pl-heading-01-size: 4.25rem;
    --pl-heading-03-size: 2rem;
    --pl-body-01-size: 1.375rem;
  }
}

/* ---------- Base ---------- */
*,
::after,
::before {
  box-sizing: border-box;
  border: 0 solid;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  line-height: 1.5;
  font-family: var(--pl-font-text);
  -webkit-tap-highlight-color: transparent;
  background-color: var(--pl-default);
  scroll-padding-top: 1rem;
}

h1,
h2,
h3,
p {
  font-size: inherit;
  font-weight: inherit;
}

ul {
  list-style: none;
}

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

img,
svg,
video {
  display: block;
  vertical-align: middle;
}

img,
video {
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
  appearance: button;
}

[hidden]:where(:not([hidden="until-found"])) {
  display: none !important;
}

[inert] {
  pointer-events: none;
  cursor: default;
}

[inert],
[inert] * {
  -webkit-user-select: none;
  user-select: none;
}

.pl-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border-width: 0;
}

/* ---------- Type ---------- */
.pl-heading-01 {
  font-family: var(--pl-font-display);
  font-weight: 500;
  font-size: var(--pl-heading-01-size);
  line-height: 105%;
  letter-spacing: var(--pl-heading-01-tracking);
}

.pl-heading-03 {
  font-family: var(--pl-font-display);
  font-weight: 400;
  font-size: var(--pl-heading-03-size);
  line-height: 110%;
  letter-spacing: var(--pl-heading-03-tracking);
}

.pl-body-01 {
  font-family: var(--pl-font-text);
  font-weight: 400;
  font-size: var(--pl-body-01-size);
  line-height: 115%;
  letter-spacing: -0.015em;
}

.pl-secondary {
  color: var(--pl-secondary);
}

.pl-secondary-inverse {
  color: var(--pl-secondary-inverse);
}

/* Fluid container: viewport minus the outer gutter on each side. */
.pl-container {
  width: calc(100% - 2 * var(--outer-gutter));
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Links: underline hovers and focus rings ---------- */
.pl-focus {
  outline-style: solid;
  outline-width: 0;
}

.pl-focus:focus-visible {
  outline: 2px solid var(--pl-default);
  outline-offset: 3px;
}

.pl-focus-inverse:focus-visible {
  outline-color: var(--pl-inverse) !important;
}

/* 1px underline that wipes in from the left on hover. The original declares a
   colour fade for leaving, but its minified CSS renamed the variable, so the
   line disappears instantly; leaving the property unregistered matches that. */
.pl-u,
.pl-u-group {
  --custom-underline-color: transparent;
  --pl-u-pad: max(
    var(--custom-underline-height),
    calc(var(--custom-underline-height) + var(--custom-underline-offset))
  );
  margin-bottom: calc(-1 * var(--pl-u-pad));
  padding-bottom: var(--pl-u-pad);
  background-image: linear-gradient(var(--custom-underline-color), var(--custom-underline-color));
  background-repeat: no-repeat;
  background-position: 0% calc(100% + min(0px, var(--custom-underline-offset)));
  background-size: 0% var(--custom-underline-height);
  transition:
    --custom-underline-color 0.125s ease-in,
    background-size 0s var(--pl-ease-in-out) 0.15s;
}

.pl-u:hover,
.pl-group:hover .pl-u-group {
  --custom-underline-color: currentcolor;
  background-size: 100% var(--custom-underline-height);
  transition:
    --custom-underline-color 50ms ease-in,
    background-size 0.2s var(--pl-ease-in-out);
}

/* The current item: line visible at rest; on hover it redraws from the left. */
.pl-u[data-selected="true"] {
  background-image:
    linear-gradient(currentcolor, currentcolor),
    linear-gradient(var(--custom-underline-color), var(--custom-underline-color));
  background-position:
    100% calc(100% + min(0px, var(--custom-underline-offset))),
    0% calc(100% + min(0px, var(--custom-underline-offset)));
  background-size:
    100% var(--custom-underline-height),
    0% var(--custom-underline-height);
  transition: background-size var(--pl-ease-in-out);
}

.pl-u[data-selected="true"]:hover {
  --custom-underline-color: currentcolor;
  background-image:
    linear-gradient(transparent, transparent),
    linear-gradient(var(--custom-underline-color), var(--custom-underline-color));
  background-size:
    0% var(--custom-underline-height),
    100% var(--custom-underline-height);
  transition:
    --custom-underline-color 0.25s ease-in,
    background-size 0.3s var(--pl-ease-in-out);
}

.pl-link {
  display: inline-flex;
  align-items: center;
  gap: var(--pl-spacing-2);
}

.pl-btn {
  display: flex;
  align-items: center;
  width: fit-content;
  cursor: pointer;
  transition-property: color, background-color, border-color, outline-color, text-decoration-color,
    fill, stroke;
  transition-timing-function: var(--pl-ease-in-out);
  transition-duration: 0.3s;
}

@media (hover: hover) {
  .pl-btn--hover-secondary:hover {
    color: var(--pl-secondary);
  }
}

/* ---------- Page shell ---------- */
.pl-body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--pl-default);
  color: var(--pl-default);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pl-skip {
  position: absolute;
  top: 62px;
  inset-inline-start: -999px;
  z-index: 99999;
  padding: 8px 12px;
}

.pl-skip:focus-visible {
  inset-inline-start: var(--outer-gutter);
}

.pl-page {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  background-color: var(--pl-inverse);
}

.pl-transition-page {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  height: 100%;
}

/* Page transitions: the incoming page fades in over the white page background.
   During open-project the new page is lifted above the site header (z 9999);
   afterwards it is static again, so on a directly loaded project page the
   site header stays on top, as on the original. */
.pl-transition-page.is-entering {
  opacity: 0;
}

.pl-transition-page.is-open-project {
  position: relative;
  z-index: 9999;
  transition: opacity 0.3s ease-out;
}

.pl-transition-page.is-close-project {
  transition: opacity 0.4s ease-out;
}

.pl-transition-page.is-default {
  transition: opacity 0.35s ease-out;
}

.pl-main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  margin-top: calc(-1 * var(--pl-spacing-header));
}

.pl-main:focus {
  outline: none;
}

/* Fades in once 5% of the element is on screen (inViewport). */
.pl-reveal {
  opacity: 0;
  transition: opacity 0.3s var(--pl-ease-in-out) 0.1s;
}

.pl-reveal[data-in-viewport] {
  opacity: 1;
}

/* ---------- Page hero ---------- */
.pl-hero {
  display: flex;
  margin-top: var(--pl-spacing-18);
  padding-bottom: var(--pl-spacing-11);
}

.pl-hero__text {
  width: 100%;
  color: var(--pl-default);
  text-wrap: balance;
}

@media (min-width: 768px) {
  .pl-hero__text {
    width: calc(13 / 16 * (100% + var(--inner-gutter)) - var(--inner-gutter));
  }
}

/* ---------- Filter area (the bar itself: EON changes, below) ---------- */
.pl-cats {
  position: relative;
}

.pl-cats__watch {
  position: absolute;
  width: 100%;
  height: 1px;
  pointer-events: none;
}

.pl-cats__watch--top {
  top: 0;
}

.pl-cats__watch--bottom {
  bottom: var(--pl-spacing-header);
}

/* ---------- Project listing ---------- */
.pl-listing {
  display: flex;
  flex-direction: column;
  row-gap: var(--pl-spacing-11);
  margin-top: var(--pl-spacing-9);
}

.pl-list {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--inner-gutter);
  row-gap: var(--pl-spacing-11);
}

.pl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.pl-card:has(:focus-visible),
.pl-next:has(:focus-visible) {
  outline: 2px solid var(--pl-default);
  outline-offset: 3px;
}

.pl-media {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
}

.pl-media__frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Blocks right-click saving and dragging, as on the original. */
[data-media-protected]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.pl-page img,
.pl-page video {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Images fade in once loaded. */
.pl-page img:not([data-no-reveal]) {
  opacity: 0;
  transition: opacity 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}

.pl-page img:not([data-no-reveal])[data-loaded] {
  opacity: 1;
}

.pl-media__img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* EON: any cover photo fills the 3:2 card frame */
}

.pl-media__img--cover,
.pl-media__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pl-media__video {
  display: block;
  transition-property: all;
  transition-timing-function: var(--pl-ease-in-out);
  transition-duration: 0.15s;
}

/* Hovering anywhere on a card zooms its media to 1.03. */
.pl-zoom {
  transition: transform 0.5s cubic-bezier(0.28, 1, 0.5, 1);
}

.pl-group:hover .pl-zoom {
  transform: scale(1.03);
}

.pl-card__info {
  display: flex;
  flex-direction: column;
  gap: var(--inner-gutter);
  width: 100%;
  margin-top: var(--pl-spacing-3);
}

.pl-card__head {
  display: flex;
  column-gap: var(--inner-gutter);
}

.pl-card__titles {
  flex-grow: 1;
}

.pl-card__link {
  --custom-underline-offset: -3px;
}

/* The title link covers the whole card. */
.pl-card__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.pl-card__link:focus {
  outline: none;
}

/* Cards without a description let the title block grow instead. */
.pl-card__head--grow {
  flex-grow: 1;
}

@media (min-width: 768px) {
  .pl-card__info {
    flex-direction: row;
  }

  .pl-card__head:not(.pl-card__head--grow),
  .pl-card__desc {
    width: calc(8 / 16 * (100% + var(--inner-gutter)) - var(--inner-gutter));
  }
}

@media (min-width: 1024px) {
  .pl-card--half {
    width: calc(8 / 16 * (100% + var(--inner-gutter)) - var(--inner-gutter));
  }
}

/* Play / pause button on videos. */
.pl-video-toggle {
  position: absolute;
  bottom: var(--inner-gutter);
  inset-inline-end: var(--inner-gutter);
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
  background-color: var(--pl-overlay-dark-light);
  color: var(--pl-inverse);
  -webkit-backdrop-filter: blur(60px);
  backdrop-filter: blur(60px);
  outline-style: solid;
  outline-width: 0;
  transition-property: color, background-color, border-color, outline-color;
  transition-timing-function: var(--pl-ease-in-out);
  transition-duration: 0.3s;
}

.pl-video-toggle svg {
  width: 24px;
  height: 24px;
}

.pl-video-toggle:focus-visible {
  outline: 2px solid var(--pl-inverse) !important;
  outline-offset: 3px;
}

@media (hover: hover) {
  .pl-video-toggle:hover {
    background-color: var(--pl-overlay-dark);
    color: var(--pl-inverse);
  }
}

/* ---------- Project page ---------- */
.pl-phero__stage {
  position: relative;
  display: flex;
  align-items: flex-end;   /* EON: the project name sits at the bottom of the photo / video */
  height: calc(100svh - var(--pl-hero-offset));
}

/* a soft shade at the bottom of the photo, so the white name stays readable on light photos */
.pl-phero__stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.pl-phero__title {
  position: relative;
  z-index: 10;
  padding-inline: var(--inner-gutter);
  padding-bottom: clamp(1.25rem, 3vw, 2.5rem);
  color: var(--pl-inverse);
}

.pl-phero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.pl-intro {
  display: grid;
  gap: var(--inner-gutter);
  padding-top: var(--inner-gutter);
  margin-bottom: var(--pl-spacing-12);
}

@media (min-width: 1024px) {
  .pl-intro {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Project content blocks (full project pages) ---------- */
.pl-block-media {
  margin-bottom: var(--inner-gutter);
}

.pl-block-media .pl-media,
.pl-block-pair .pl-media {
  aspect-ratio: auto;
}

.pl-block-media .pl-media__frame,
.pl-block-pair .pl-media__frame {
  height: auto;
}

.pl-block-pair__grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--inner-gutter);
  row-gap: 0;
}

.pl-block-pair__col {
  grid-column: span var(--grid-columns) / span var(--grid-columns);
}

.pl-block-pair .pl-media {
  margin-bottom: var(--inner-gutter);
}

.pl-block-text,
.pl-block-quote {
  margin-top: var(--pl-spacing-11);
  margin-bottom: var(--pl-spacing-12);
}

/* Statement paragraphs: heading-03 type, 8 columns with one column of air on the right. */
.pl-block-text__body {
  width: 100%;
  max-width: 900px;
}

.pl-block-text__body p + p {
  margin-top: var(--pl-spacing-6);
}

.pl-block-quote__body {
  display: flex;
  flex-direction: column;
  row-gap: var(--pl-spacing-4);
  width: 100%;
  margin-left: auto;
}

.pl-block-quote__mark {
  position: absolute;
  transform: translateX(-100%);
}

/* Facts: credits note + Year / Role / Size / Client / Select Awards. */
.pl-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: var(--inner-gutter);
  row-gap: var(--pl-spacing-12);
  margin-top: var(--pl-spacing-12);
  margin-bottom: var(--pl-spacing-15);
}

.pl-facts__note {
  width: 100%;
  max-width: 900px;
}

.pl-facts__note p {
  padding-right: var(--inner-gutter);
}

.pl-facts__list {
  width: 100%;
}

.pl-facts__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--inner-gutter);
  padding-block: var(--pl-spacing-3);
  border-top: 1px solid #cfcfcf;
  /* column context for the label/value widths (6 on phones, 8 inside w-cols-8) */
  --pl-row-cols: 6;
}

.pl-facts__label {
  width: calc(2 / var(--pl-row-cols) * (100% + var(--inner-gutter)) - var(--inner-gutter));
}

.pl-facts__value {
  max-width: 900px;
  width: calc(4 / var(--pl-row-cols) * (100% + var(--inner-gutter)) - var(--inner-gutter));
}

.pl-facts__item {
  margin-top: var(--pl-spacing-3);
  padding-top: var(--pl-spacing-3);
  border-top: 1px solid #cfcfcf;
}

.pl-facts__item:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

@media (min-width: 768px) {
  .pl-block-pair__col {
    grid-column: span 8 / span 8;
  }

  .pl-block-text__body,
  .pl-facts__note {
    /* w-cols-8 + pr-cols-1 */
    width: calc(8 / 16 * (100% + var(--inner-gutter)) - var(--inner-gutter));
    padding-right: calc(1 / 16 * (100% + var(--inner-gutter)));
  }

  .pl-block-text__body--right {
    margin-left: auto;
  }

  .pl-block-quote__body,
  .pl-facts__list {
    width: calc(8 / 16 * (100% + var(--inner-gutter)) - var(--inner-gutter));
  }

  .pl-facts__row {
    --pl-row-cols: 8;
  }

  .pl-facts__value {
    width: calc(6 / 8 * (100% + var(--inner-gutter)) - var(--inner-gutter));
    padding-right: calc(1 / 8 * (100% + var(--inner-gutter)));
  }
}

/* Width comes from .pl-container (the original's .container[class] beats w-full). */
.pl-next {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: var(--pl-spacing-14);
}

.pl-next__label {
  position: absolute;
  top: var(--inner-gutter);
  left: var(--inner-gutter);
  z-index: 100;
  color: var(--pl-inverse);
}

.pl-next .pl-media {
  position: relative;
}

.pl-next__info {
  width: 100%;
  gap: var(--inner-gutter);
  margin-top: var(--pl-spacing-3);
}

/* ---------- Footer ---------- */
.pl-spacer {
  padding-top: var(--pl-spacing-18);
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 1ms !important;
  }
}

/* ==========================================================================
   EON changes
   ========================================================================== */

/* style.css makes html/body full height; here the window scrolls, as in the reference */
html.pl-html, html.pl-html body { height: auto; }
html.pl-html body { min-height: 100svh; }

/* Leaving for a project page: the page fades out first (0.35 s, as the reference) */
.pl-transition-page.is-leaving {
  opacity: 0;
  transition: opacity 0.35s ease-out;
}

/* The EON header (template-parts/site-header.php) sits on a bar that takes the
   colour of what is behind it: white on the page, dark over the footer. It hides
   while the category bar is stuck, as in the reference. The masks and the theme
   are added by projects-page.js. */
.pl-html .site-header { padding-bottom: calc(var(--pad) * 0.55); }
.pl-html .site-header > .site-logo,
.pl-html .site-header > .main-nav { position: relative; z-index: 1; }
.pl-html:not(.menu-open) .site-header[data-theme="light"] { color: var(--ink); }
.pl-html:not(.menu-open) .site-header[data-theme="dark"],
.pl-html:not(.menu-open) .site-header[data-theme="transparent"] { color: var(--text); }
.pl-header__masks { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.pl-header__mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: inset(100% 0 100% 0);
}
.pl-header__mask--light { background-color: #fff; }
.pl-header__mask--dark { background-color: var(--ink); }
.pl-header__mask--transparent { background-color: transparent; }
.pl-html:not(.menu-open) .site-header[data-theme="light"] .pl-header__mask--light,
.pl-html:not(.menu-open) .site-header[data-theme="dark"] .pl-header__mask--dark,
.pl-html:not(.menu-open) .site-header[data-theme="transparent"] .pl-header__mask--transparent { clip-path: inset(0 0 0 0); }
/* the header fades out as the filter row reaches it, and back in (projects-page.js) */
.pl-html .site-header { transition: color 0.45s, opacity 0.3s var(--pl-ease-in-out), visibility 0.3s; }
.pl-html .site-header[data-hidden] { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .pl-html .site-header { transition: none; } }

/* The EON header is fixed above the page, so the page does not slide up under it */
.pl-main { margin-top: 0; }

/* Phone menu open: the frosted menu and the header sit above the page */
html.pl-html.menu-open .mobile-menu { z-index: 1000; }
html.pl-html.menu-open .site-header { z-index: 1001; }

.pl-card[hidden] { display: none !important; }
.pl-empty { margin-top: var(--pl-spacing-5); }

/* Filter options are buttons: they change the list, they don't lead anywhere */
button.pl-link { cursor: pointer; text-align: left; }

/* ---------- Project pages ---------- */

/* Opened from the Projects page or "Next project": the EON logo + Close replace
   the menu (as the reference's project header), and the page fades in (0.3 s). */
html:not(.is-opened) .pl-project-header { display: none; }
html.is-opened #siteHeader,
html.is-opened #mobileMenu { display: none; }
/* EON: Close on the right, on the logo's centre line (phones too, where the menu button's spacing is not wanted) */
.pl-project-header .main-nav {
  display: block;
  width: auto;
  margin-left: auto;
  margin-right: 0;
  margin-top: calc(var(--logo-w) * 295.36 / 1301.65 * 0.36 - var(--nav-cap) / 2 - 4px);
  text-align: right;
}
.pl-close { display: inline-block; padding: 4px 0; color: inherit; text-decoration: none; }
.pl-close svg.word { display: block; height: var(--nav-cap); width: auto; fill: currentColor; }
.pl-project-header a:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
html.is-opened [data-pl-page] { animation: pl-fade-in 0.3s ease-out both; }
@keyframes pl-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Back from a project with Close: the list fades in where it was left (0.4 s) */
html.is-closing [data-pl-page] { opacity: 0; }

/* Quote: the closing mark belongs to the text; the opening one hangs outside */
.pl-block-quote blockquote { position: relative; }

@media (prefers-reduced-motion: reduce) {
  html.is-opened [data-pl-page] { animation: none; }
}

/* Videos in the content: a light ground while they load */
.pl-blocks [data-pl-video] { background-color: #f0f0f0; }

/* ---------- Filter bar (Projects page) ----------
   "Filter", then a drop-down list per column (Scope, Typology, Region): a heading
   with an arrow on a full-width line; clicking it opens its list in a dark panel
   over the projects (one list open at a time). Each list keeps its own choice and
   the choices combine. The bar sticks to the top while the list scrolls (the
   header hides meanwhile).
   768 px and up: one row lined up under the header menu ("Filter" under the logo).
   Phones: "Filter" + the current choice; tapping opens the drop-down lists, one
   under the other, with "Show N projects" to close. */
.pl-filter {
  --pl-dd-bg: var(--ink, #231F20);       /* the open lists: the EON ink */
  --pl-dd-text: #fff;
  --pl-dd-dim: rgba(255, 255, 255, 0.62);
  position: sticky;
  top: 0;
  z-index: 999;
}

.pl-filter__bar {
  position: relative;
  z-index: 1;
  background-color: var(--pl-inverse);
}

.pl-filter__overlay { display: none; }
.pl-empty .pl-link { display: inline; }

/* "Filter" and its "Clear" (shown once something is chosen) */
.pl-filter__label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: var(--pl-spacing-5);
  margin: 0;
}
.pl-filter__name { color: var(--pl-default); font-weight: 500; }
.pl-filter__clear { font-weight: 500; transition: color 0.15s; }
.pl-filter__clear:hover { color: var(--pl-default); }

/* A drop-down list: heading + chosen value + arrow (▶ closed, ▼ open), on a line */
.pl-dd { position: relative; min-width: 0; }

.pl-dd__head {
  display: flex;
  align-items: center;
  gap: var(--pl-spacing-3);
  width: 100%;
  margin: 0;
  padding: 0 0 var(--pl-spacing-4);
  border: 0;
  border-bottom: 1px solid var(--pl-default);
  background: none;
  color: var(--pl-default);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.pl-dd__title { flex: none; transition: color 0.15s; }
.pl-dd__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-dd__value:empty { display: none; }
.pl-dd[data-chosen] .pl-dd__title { color: var(--pl-secondary); }   /* "Scope  Landscape": the choice reads first */
.pl-dd__arrow {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  margin-left: auto;
  fill: currentColor;
  transition: transform 0.25s var(--pl-ease-in-out);
}
.pl-dd[data-dd-open] .pl-dd__arrow { transform: rotate(90deg); }

/* The open list: a dark panel under the heading */
.pl-dd__drop {
  background-color: var(--pl-dd-bg);
  color: var(--pl-dd-text);
}
.pl-dd__list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: var(--pl-spacing-4);
  margin: 0;
  padding: var(--pl-spacing-5) var(--pl-spacing-5) var(--pl-spacing-8);
  list-style: none;
}
.pl-dd__item {
  color: var(--pl-dd-dim);
  font-weight: 500;
  text-align: left;
  transition: color 0.15s;
}
.pl-dd__item:hover,
.pl-dd__item[data-selected="true"] { color: var(--pl-dd-text); }

@media (min-width: 768px) {
  .pl-filter__toggle,
  .pl-filter__done { display: none; }

  /* One row: "Filter" under the logo (a quarter), then the lists in equal columns */
  .pl-filter__bar.pl-container { width: auto; margin: 0; padding-inline: var(--pad, 2.5rem); }
  .pl-filter__panel {
    display: grid;
    grid-template-columns: var(--pl-grid, 25% repeat(3, minmax(0, 1fr)));
    align-items: start;
    column-gap: 0;
    padding-block: var(--pl-spacing-4);
  }
  .pl-filter__group { min-width: 0; }
  .pl-filter__group--all { padding-right: var(--pl-spacing-8); }
  .pl-dd { --pl-dd-gap: var(--pl-spacing-8); padding-right: var(--pl-dd-gap); }

  /* the list drops over the projects, as wide as its heading's line */
  .pl-dd__drop {
    position: absolute;
    top: 100%;
    left: 0;
    right: var(--pl-dd-gap);
    z-index: 2;
    max-height: min(70vh, 32rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s var(--pl-ease-in-out), transform 0.2s var(--pl-ease-in-out), visibility 0s linear 0.2s;
  }
  .pl-dd[data-dd-open] .pl-dd__drop {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s var(--pl-ease-in-out), transform 0.2s var(--pl-ease-in-out);
  }
}

@media (max-width: 767.98px) {
  .pl-filter__toggle {
    display: flex;
    align-items: center;
    gap: var(--inner-gutter);
    width: 100%;
    height: var(--pl-nav-categories);
    cursor: pointer;
    text-align: left;
  }

  /* "Filter" in 2 of 6 columns, the current choice after it, a + / − on the right */
  .pl-filter__toggle > .pl-filter__name {
    flex: none;
    width: calc(2 / 6 * (100% + var(--inner-gutter)) - var(--inner-gutter));
  }

  .pl-filter__summary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .pl-filter__sign { position: relative; flex: none; width: 11px; height: 11px; }
  .pl-filter__sign::before,
  .pl-filter__sign::after {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 11px;
    height: 1px;
    background: currentColor;
    transition: transform 0.3s var(--pl-ease-in-out);
  }
  .pl-filter__sign::after { transform: rotate(90deg); }
  .pl-filter[data-open] .pl-filter__sign::after { transform: rotate(0deg); }

  /* The lists fold open under the bar (0fr → 1fr, 300 ms) */
  .pl-filter__drop {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows 0.3s var(--pl-ease-in-out), visibility 0s linear 0.3s;
  }

  .pl-filter[data-open] .pl-filter__drop {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows 0.3s var(--pl-ease-in-out);
  }

  .pl-filter__panel {
    display: flex;
    flex-direction: column;
    gap: var(--pl-spacing-3);
    min-height: 0;
    max-height: calc(100vh - var(--pl-nav-categories));
    overflow: hidden auto;
  }

  .pl-filter[data-open] .pl-filter__panel { padding: var(--pl-spacing-3) 0 var(--pl-spacing-8); }

  .pl-filter__group--all { display: none; }   /* "Filter" is the bar itself on phones */

  /* each list: a full-width heading line; tapping it opens its dark panel under it */
  .pl-dd__head { min-height: 2.75rem; padding: var(--pl-spacing-4) 0; }
  .pl-dd__drop { display: none; }
  .pl-dd[data-dd-open] .pl-dd__drop { display: block; }
  .pl-dd__list { row-gap: var(--pl-spacing-5); }

  .pl-filter__done { align-self: flex-start; margin-top: var(--pl-spacing-5); }

  /* The projects dim under the open filter; tapping them closes it */
  .pl-filter[data-open] .pl-filter__overlay {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pl-dd__arrow, .pl-dd__drop, .pl-filter__drop { transition: none !important; }
}
