/* Portfolio page (projects.html). Every rule is scoped to .portfolio-page so shared pages are
   unaffected; reusable parts (filter chips, tags, facts, tabs, gallery) live in components.css.
   Mobile first: single column, then tablet (≥600px) and desktop (≥880px, the approved layout). */

/* ------------------------------------------------------------------ Hero */

.portfolio-page .pf-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "content"
    "quote"
    "media";
  row-gap: var(--space-6);
  padding-block: var(--space-8) var(--space-6);
}

.portfolio-page .pf-hero__content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  container: pf-hero / inline-size;
}

.portfolio-page .pf-hero__eyebrow {
  color: var(--color-brand);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.portfolio-page .pf-hero__title {
  margin-block-start: 4px;
  color: var(--color-brand);
  font-size: clamp(38px, 14.4cqi, 64px);
  font-weight: var(--weight-display);
  line-height: 1.25;
}

.portfolio-page .pf-hero__subtitle {
  margin-block-start: 6px;
  font-family: var(--font-heading);
  font-size: clamp(18px, 6.5cqi, 29px);
  font-weight: var(--weight-heading);
  line-height: 1.5;
}

.portfolio-page .pf-hero__lead {
  margin-block-start: 12px;
  font-size: clamp(15px, 4.1cqi, 18px);
  line-height: 1.85;
}

.portfolio-page .pf-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: stretch;
  margin-block-start: 22px;
  padding-block-start: 16px;
  border-top: var(--rule);
}

.portfolio-page .pf-highlights__item {
  display: grid;
  align-content: start;
  gap: 2px;
  padding-inline: 12px;
}

.portfolio-page .pf-highlights__item:first-child {
  padding-inline-start: 0;
}

.portfolio-page .pf-highlights__item + .pf-highlights__item {
  border-inline-start: var(--rule);
}

.portfolio-page .pf-highlights__title {
  font-family: var(--font-heading);
  font-size: clamp(12px, 3.9cqi, 17px);
  font-weight: var(--weight-heading);
  line-height: 1.5;
}

.portfolio-page .pf-highlights__text {
  font-size: clamp(11px, 3.4cqi, 15px);
  line-height: 1.6;
}

/* The illustration is shown whole: anchored to the top right, never cropped or enlarged
   beyond the column; its white paper blends into the page. */
.portfolio-page .pf-hero__media {
  grid-area: media;
  display: grid;
  align-items: start;
}

.portfolio-page .pf-hero__image {
  width: 100%;
  height: auto;
}

.portfolio-page .pf-hero__quote {
  grid-area: quote;
  display: grid;
  justify-items: start;
  align-self: center;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: var(--weight-heading);
  line-height: 1.55;
}

.portfolio-page .pf-hero__quote .icon {
  width: 26px;
  height: 20px;
  margin-block-end: 6px;
  color: var(--color-brand);
}

.portfolio-page .pf-hero__quote::after {
  content: "";
  justify-self: stretch;
  height: 2px;
  margin-block-start: 12px;
  background: var(--color-brand);
}

/* ------------------------------------------------------ Filters and grid */

.portfolio-page .pf-projects {
  padding-block: var(--space-2) var(--space-6);
}

.portfolio-page .pf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-block-start: var(--space-6);
}

.portfolio-page .pf-grid__item {
  min-width: 0;
}

.portfolio-page .pf-empty {
  margin-block-start: var(--space-6);
  padding: var(--space-6);
  border: var(--border);
  border-radius: var(--radius-panel);
  text-align: center;
}

.portfolio-page .project-card--portfolio {
  padding: 0;
  border-radius: var(--radius-panel);
  container-type: inline-size;
}

/* Every card image sits in the same 16:9 frame, shown whole and never enlarged past its own
   pixels, so old (2:1) and new (3:2) illustrations line up without cropping. */
.portfolio-page .project-card__media {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin: 8px 8px 0;
}

.portfolio-page .project-card--portfolio .project-card__image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  aspect-ratio: auto;
  object-fit: contain;
}

.portfolio-page .project-card--portfolio .project-card__body {
  padding: 20px 14px 16px;
}

.portfolio-page .project-card--portfolio .project-card__title {
  font-size: clamp(15px, 6.7cqi, 19px);
  line-height: 1.5;
}

.portfolio-page .project-card--portfolio .project-card__subtitle {
  font-size: clamp(12.5px, 5.3cqi, 15px);
  margin-block-start: 4px;
}

.portfolio-page .project-card--portfolio .tag-list {
  margin-block-start: 20px;
}

.portfolio-page .project-card--portfolio .tag {
  font-size: clamp(11px, 4.3cqi, 12px);
}

.portfolio-page .project-card--portfolio .project-card__link {
  padding-block-start: 18px;
  font-size: clamp(13px, 5.3cqi, 15px);
}

.portfolio-page .project-card--portfolio .project-card__link[aria-current="true"] {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ------------------------------------------------------------ Detail panel */

.portfolio-page .pf-detail {
  padding-block: var(--space-2) var(--space-8);
  scroll-margin-top: var(--space-4);
}

.portfolio-page .pf-detail__panel {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-5);
  border: var(--rule);
  border-radius: 12px;
}

.portfolio-page .pf-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "info"
    "gallery";
  gap: var(--space-6);
  scroll-margin-top: var(--space-4);
}

/* Without JavaScript all projects are listed one after another. */
.portfolio-page .pf-project + .pf-project {
  padding-block-start: var(--space-8);
  border-top: var(--rule);
}

.portfolio-page .pf-detail__panel.is-enhanced .pf-project + .pf-project {
  padding-block-start: 0;
  border-top: 0;
}

.portfolio-page .pf-project__info {
  grid-area: info;
  min-width: 0;
  container: pf-info / inline-size;
}

.portfolio-page .pf-project__gallery {
  grid-area: gallery;
  min-width: 0;
}

.portfolio-page .pf-crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-brand);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.portfolio-page .pf-crumbs__list li + li::before {
  content: "›";
  display: inline-block;
  margin-inline: 8px;
}

.portfolio-page .pf-crumbs__link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.portfolio-page .pf-project__title {
  margin-block-start: 8px;
  font-size: clamp(21px, 5.3cqi, 30px);
  font-weight: var(--weight-heading);
  line-height: 1.45;
}

.portfolio-page .pf-project__title:focus-visible {
  outline-offset: 4px;
}

.portfolio-page .pf-project__subtitle {
  margin-block-start: 4px;
  font-size: clamp(16px, 3.8cqi, 21px);
  font-weight: 600;
  line-height: 1.6;
}

.portfolio-page .pf-project__summary {
  margin-block-start: 16px;
  font-size: 17px;
  line-height: 1.9;
}

.portfolio-page .fact-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-block-start: 18px;
}

.portfolio-page .tabs {
  margin-block-start: 20px;
}

.portfolio-page .pf-pager {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}

.portfolio-page .pf-pager__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--color-brand);
  font-size: var(--fs-ui);
  font-weight: 700;
}

.portfolio-page .pf-pager__button .icon {
  font-size: 20px;
}

.portfolio-page .pf-pager__button:not(:disabled):hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.portfolio-page .pf-pager__button:disabled {
  cursor: not-allowed;
  opacity: var(--muted-opacity);
}

/* ------------------------------------------------------------------ CTA */

.portfolio-page .pf-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* Decorative line drawing behind the call to action (a background layer, so it is the only
   absolutely positioned block on the page); its pale centre carries the text. */
.portfolio-page .pf-cta__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: grid;
}

.portfolio-page .pf-cta__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
}

.portfolio-page .pf-cta__inner {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding-block: 40px 44px;
  text-align: center;
}

.portfolio-page .pf-cta__title {
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: var(--weight-heading);
  line-height: 1.5;
}

.portfolio-page .pf-cta__text {
  font-size: var(--fs-body);
  line-height: 1.8;
}

.portfolio-page .pf-cta .button {
  margin-block-start: 12px;
  min-width: 180px;
}

/* ----------------------------------------------------------- ≥ 600px */

@media (min-width: 600px) {
  .portfolio-page .pf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-page .fact-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ----------------------------------------------------------- ≥ 880px: approved desktop layout */

@media (min-width: 880px) {
  /* RTL columns from the right: quote, illustration, text. */
  .portfolio-page .pf-hero__inner {
    grid-template-columns: auto minmax(0, 5.2fr) minmax(0, 3.9fr);
    grid-template-areas: "quote media content";
    column-gap: clamp(16px, 2vw, 28px);
    padding-block: clamp(28px, 3.3vw, 48px) clamp(20px, 2.2vw, 32px);
  }

  .portfolio-page .pf-hero__content {
    align-items: flex-end;   /* RTL: left-aligned text column, as approved */
    text-align: left;
  }

  .portfolio-page .pf-highlights {
    text-align: right;
  }

  .portfolio-page .pf-hero__media {
    margin-block-start: calc(-1 * clamp(28px, 3.3vw, 48px));
  }

  .portfolio-page .pf-hero__quote {
    align-self: center;
    font-size: clamp(15px, 1.45vw, 19px);
    padding-block-end: clamp(20px, 4vw, 60px);
  }

  .portfolio-page .pf-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(16px, 1.9vw, 25px) clamp(12px, 1.4vw, 18px);
  }

  .portfolio-page .pf-detail__panel {
    padding: clamp(16px, 1.8vw, 24px);
  }

  /* RTL columns: information on the right, gallery on the left. */
  .portfolio-page .pf-project {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "info gallery";
    align-items: start;
    column-gap: clamp(20px, 2.4vw, 32px);
  }

  .portfolio-page .pf-cta__inner {
    padding-block: clamp(36px, 3.6vw, 52px) clamp(40px, 4vw, 58px);
  }
}
