/* ==========================================================================
   About — loaded only on page-templates/about.php.

   .pr-banner, .pr-crumbs, .pr-lockup, .pr-rule, .pr-title, .pr-meta, .pr-cta,
   .pr-prose and the [data-reveal] scroll reveal come from
   prestige-components.css and are NOT restated here. The section layouts
   follow the homepage's own (watermark, CTA card) and the widget library's
   split and feature row; like home.css and single.css they are scoped to this
   template.

   Values come from prestige-tokens.css — no hex in this file.
   ========================================================================== */

/* --- Banner -------------------------------------------------------------- */
/* Same 0.62 wash as contact: the accessibility floor for white text over
 * this photography. Do not lighten it. */
[data-a="banner"] {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.62)),
    var(--pr-banner-image);
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  /* The header is fixed and out of flow; pad the banner clear of it. */
  padding-top: var(--pr-header-height, 0px);
}

/* --- Intro: photo left, lockup + story right ---------------------------- */

[data-a="intro"] {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  padding: var(--section-pad) var(--gutter-page);
}

[data-a="introsplit"] {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 660fr) minmax(0, 840fr);
  gap: clamp(36px, 6.25vw, 120px);
  align-items: center;
}

/* The photo and the badge stack in one grid cell, both in normal flow. */
[data-a="intromedia"] {
  position: relative;
  display: grid;
  margin: 0;
}
[data-a="intromedia"] > img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-feature);
  background: var(--surface);
}

/* Optional badge — renders only when "Photo badge, main line" is filled in. */
[data-a="badge"] {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  justify-self: end;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: clamp(20px, 2.6vw, 50px) clamp(20px, 2.6vw, 50px) 0 0;
  padding: clamp(14px, 1.15vw, 22px) clamp(18px, 1.46vw, 28px);
  background: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}
[data-a="badgetext"] {
  font-family: var(--font-display);
  font-size: var(--card-title);
  line-height: 1.1;
  color: var(--paper);
}

[data-a="introcopy"] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(28px, 2.6vw, 50px);
  min-width: 0;
  position: relative;
}
[data-a="introcopy"] > :not([data-a="watermark"]) { position: relative; z-index: 1; }

[data-a="lockup"] {
  width: fit-content;
  max-width: 100%;
}

/* Centred on the whole text column — heading and copy — at every width
   (BugHerd #156). A child of it, so 50% IS its centre. It sat on the heading
   alone, which put it high above the copy. The homepage's mark, at the
   homepage's faint fill. */
[data-a="watermark"] {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  width: clamp(300px, 31.22vw, 599px);
  aspect-ratio: 599.435 / 599;
  pointer-events: none;
}

[data-a="introtitle"] {
  font-size: var(--display-xl);
  /* Three lines deep, so line-height 1 read as gappy (BugHerd #80). */
  line-height: 0.9;
  /* No negative top pull: it cancelled the eyebrow's spacing below (#81). */
  margin: 0 0 -0.091em;
}

/* The intro's eyebrow gets air below it (BugHerd #81). The component pulls it
   tight with a negative margin, which suits one-line titles but crowded this
   three-line one. */
[data-a="intro"] .pr-lockup > .pr-lockup__eyebrow:first-of-type {
  margin-bottom: clamp(6px, 0.63vw, 12px);
}

/* --- Optional facts strip ------------------------------------------------ */
/* Renders only when the Facts strip repeater has rows. */
[data-a="facts"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  background: var(--surface);
}
[data-a="fact"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: clamp(18px, 1.46vw, 28px) 16px;
  text-align: center;
}
[data-a="fact"] + [data-a="fact"] { border-left: 1px solid var(--paper); }
[data-a="factvalue"] {
  font-family: var(--font-display);
  font-size: var(--card-title);
  line-height: 1.1;
  color: var(--ink);
}
/* The caption is .pr-meta; only the dd's default indent needs clearing. */
[data-a="factlabel"] { margin: 0; }

/* --- Split: a dark editorial band -------------------------------------- */
/* The heading and red rule left, the copy right past a hairline — the
   Service intro's editorial split — over the photo as a background, not
   beside it (the intro above already pairs one with text). The wash is
   0.88 — near the testimonial band's 0.90, since the explorer's own photos
   sit on top — and well over the 0.62 floor for white text. */

[data-a="split"] {
  background:
    linear-gradient(rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.88)),
    var(--pr-split-image) center / cover no-repeat,
    var(--ink);
  box-shadow: var(--shadow-band);
  padding: var(--section-pad) var(--gutter-page);
}

[data-a="splitgrid"] {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  /* min-content: the title's longest word (IMPROVEMENT, at the 110 cut)
     widens its column rather than running into the hairline. */
  grid-template-columns: minmax(min-content, 620fr) minmax(0, 900fr);
  gap: clamp(36px, 5.21vw, 100px);
  /* Stretch, so the hairline runs the full height of the heading; the copy
     centres itself inside its column. */
  align-items: stretch;
}

[data-a="splithead"] { min-width: 0; }
[data-a="splithead"] .pr-lockup__eyebrow { color: var(--paper); }

/* The display size of the intro title, so the band carries the same weight
   as the lockup above it. */
[data-a="splittitle"] {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-xl);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper);
}

[data-a="splitcopy"] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(20px, 1.56vw, 30px);
  min-width: 0;
  padding-left: clamp(36px, 5.21vw, 100px);
}

/* --- Project explorer: tabs left, a photo panel right ------------------ */
/* Every panel shares ONE grid cell and fades on data-active, as the homepage
   testimonials do, so the section never changes height between tabs.
   Behaviour: assets/js/pages/about.js. */

[data-a="explorer"] {
  max-width: var(--content-max);
  margin: clamp(48px, 4.17vw, 80px) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 560fr) minmax(0, 960fr);
  gap: clamp(24px, 2.6vw, 50px);
  align-items: start;
}

[data-a="tablist"] {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
}

[data-a="tab"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 56px;
  padding: clamp(12px, 0.94vw, 18px) clamp(16px, 1.25vw, 24px);
  font-family: var(--font-display);
  font-size: clamp(20px, 1.35vw, 26px);
  line-height: 1.15;
  text-align: left;
  color: var(--surface);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-left: 2px solid transparent;
  cursor: pointer;
}
[data-a="tab"]:hover { color: var(--paper); }
/* The design's red as a rule, marking the open tab. */
[data-a="tab"][aria-selected="true"] {
  color: var(--paper);
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

[data-a="tabarrow"] {
  flex: none;
  width: 22px;
  height: 22px;
  opacity: 0.4;
  transform: translateX(-6px);
  transition: transform .45s ease, opacity .45s ease;
}
[data-a="tab"]:hover [data-a="tabarrow"],
[data-a="tab"][aria-selected="true"] [data-a="tabarrow"] {
  opacity: 1;
  transform: translateX(0);
}

[data-a="panels"] { display: grid; min-width: 0; }

[data-a="panel"] {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s ease, visibility .32s;
}
[data-a="panel"][data-active="1"] {
  opacity: 1;
  visibility: visible;
}

[data-a="panel"] > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

[data-a="panelbody"] {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(16px, 1.56vw, 30px);
  padding: clamp(22px, 1.88vw, 36px);
}
[data-a="panelcopy"] {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 320px;
  min-width: 0;
}
[data-a="paneltitle"] {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--card-title);
  line-height: 1.1;
  color: var(--paper);
}

/* --- Values: the feature row as a bordered grid ------------------------- */

[data-a="values"] {
  padding: var(--section-pad) var(--gutter-page) 0;
}

[data-a="valueshead"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(40px, 4.17vw, 80px);
}
[data-a="valueshead"] .pr-rule { margin-left: auto; margin-right: auto; }

/* White cards like the home Service Area card, the icon in a ring. Hover is
   the service point tiles': the ring fills with the accent and lifts. */
[data-a="valuegrid"] {
  --pr-value-gap: clamp(12px, 1.04vw, 20px);
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--pr-value-gap);
  list-style: none;
  padding: 0;
}

[data-a="value"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: clamp(24px, 2.08vw, 40px) clamp(20px, 1.67vw, 32px);
  /* The home Service Area card: paper, the large radius, a soft shadow and
     no outline, the shadow lighter than that card's (BugHerd #94). */
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-soft);
  text-align: center;
}

[data-a="valuering"] {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(44px, 2.92vw, 56px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--ink);
  color: var(--ink);
  transition: background-color .4s ease, border-color .4s ease, color .4s ease, transform .45s cubic-bezier(.22, .61, .36, 1);
}
[data-a="value"]:hover [data-a="valuering"] { background: var(--accent); border-color: var(--accent); color: var(--paper); transform: translateY(-4px); }

[data-a="valueicon"] {
  width: 50%;
  height: 50%;
}

[data-a="valuetext"] {
  font-size: var(--body);
  line-height: var(--leading-card);
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}

/* --- Photos: the team photo large, two beside it ------------------------ */

/* The floor-plan pattern behind the values, the photos and the Get in touch
   card: the home page's In the News image (BugHerd #95). One wrapper carries it so
   it runs on unbroken from the values heading down. */
[data-a="plan"] {
  background: var(--wash-plan), var(--pr-plan-image) center / cover no-repeat, var(--paper);
}

[data-a="photos"] {
  padding: var(--section-pad) var(--gutter-page) 0;
}

[data-a="photogrid"] {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(12px, 1.04vw, 20px);
}

[data-a="photomain"],
[data-a="photoside"] {
  overflow: hidden;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-cta);
  background: var(--surface);
}
[data-a="photomain"] { grid-row: 1 / 3; }
/* The side photos take their height from the main one: size containment
   keeps their own intrinsic height out of the row sizing. */
[data-a="photoside"] { contain: size; }

[data-a="photogrid"] img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
[data-a="photomain"] img { aspect-ratio: 16 / 11; }

/* A slow zoom on hover ([data-shot] carries the transition). */
[data-a="photogrid"] > div:hover [data-shot] { transform: scale(1.05); }

[data-a="photoscta"] {
  margin: clamp(28px, 2.6vw, 50px) 0 0;
  text-align: center;
}

/* --- Closing card ------------------------------------------------------ */
/* The card straddles the footer edge: site.js overwrites margin-bottom with
   the measured half-height. This is the pre-JS value, as on the homepage. */
[data-a="ctawrap"] {
  position: relative;
  z-index: 5;
  margin-top: clamp(64px, 6.25vw, 120px);
  margin-bottom: clamp(-128px, -6.67vw, -52px);
}

[data-a="cta-row"] {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(20px, 2.4vw, 44px);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-cta);
  padding: clamp(32px, 4.84vw, 93px) clamp(24px, 4.06vw, 78px);
}

[data-a="ctacopy"] {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 0.94vw, 18px);
  flex: 1 1 420px;
  min-width: 0;
}
[data-a="ctacopy"] .pr-prose { max-width: 786px; }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1199px) {
  [data-a="valuegrid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  /* Titles and copy centre at tablet and below. */
  [data-a="introsplit"] {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(56px, 8vw, 80px);
  }
  [data-a="intromedia"] {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }
  [data-a="watermark"] { opacity: 0.5; }

  [data-a="introcopy"] { align-items: center; }
  [data-a="lockup"] {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  [data-a="lockup"] p { text-align: center; }

  [data-a="introbody"],
  [data-a="splithead"],
  [data-a="splitcopy"],
  [data-a="ctacopy"] {
    text-align: center;
    align-items: center;
  }

  /* The band stacks; the hairline turns from a divider into a rule above. */
  [data-a="splitgrid"] { grid-template-columns: minmax(0, 1fr); }
  [data-a="splithead"] .pr-sectionhead { align-items: center; }
  [data-a="splitcopy"] {
    padding: clamp(28px, 4vw, 40px) 0 0;
    border-left: 0;
    border-top: 1px solid var(--hairline);
  }

  /* The explorer stacks: the tabs become a scrolling row of chips (the
     blog and gallery filter's shape, inverted for ink) above the panel. */
  [data-a="explorer"] { grid-template-columns: minmax(0, 1fr); }
  [data-a="tablist"] {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    border-top: 0;
    scrollbar-width: thin;
  }
  [data-a="tab"] {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    padding: 0 18px;
    font-size: 18px;
    white-space: nowrap;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
  }
  [data-a="tab"][aria-selected="true"] {
    color: var(--ink);
    background: var(--paper);
    border-color: var(--paper);
  }
  [data-a="tabarrow"] { display: none; }
  [data-a="panelbody"] { justify-content: center; text-align: center; }
  [data-a="panelcopy"] { align-items: center; }

  /* Main photo across the top, the two side photos in a row under it. */
  [data-a="photogrid"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }
  [data-a="photomain"] { grid-row: auto; grid-column: 1 / -1; }
  [data-a="photoside"] { contain: none; }
  [data-a="photoside"] img { aspect-ratio: 4 / 3; height: auto; }

  [data-a="cta-row"] {
    flex-direction: column;
    text-align: center;
  }
  /* In a column the 420px basis becomes a HEIGHT — the card grew ~400px. */
  [data-a="ctacopy"] { flex: 0 0 auto; }
}

@media (max-width: 575px) {
  [data-a="valuegrid"] { grid-template-columns: minmax(0, 1fr); }
  [data-a="photomain"] img { aspect-ratio: 4 / 3; }

  [data-a="facts"] { grid-template-columns: minmax(0, 1fr); }
  [data-a="panel"] > img { aspect-ratio: 4 / 3; }
  [data-a="fact"] + [data-a="fact"] {
    border-left: 0;
    border-top: 1px solid var(--paper);
  }
}
