/*
 * Aftab Gallery — shared page styles (editable block pages)
 *
 * Loaded on the live site AND inside the WordPress editor, so the editor looks like the page.
 * Pages are built from standard WordPress blocks. Each block carries one of the ag-… class
 * names below (Block settings → Advanced → Additional CSS class).
 * Everything is scoped under .ag-page, so the header, footer, product pages and Kadence pages
 * are not affected.
 */

@font-face {
  font-family: ag-cormorant;
  src: url("../cormorant/Cormorant-Regular.woff2") format("woff2"),
    url("../cormorant/Cormorant-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: ag-cormorant;
  src: url("../cormorant/Cormorant-Medium.woff2") format("woff2"),
    url("../cormorant/Cormorant-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ================= Tokens and base ================= */

.ag-page {
  --ag-ground: #f2f2f2;
  --ag-surface: #fff;
  --ag-stone: #e9e6e1;
  --ag-ink: #1e1e1e;
  --ag-head: #2b2b2b;
  --ag-body: #595959;
  --ag-muted: #666;
  --ag-line: #d6d3ce;
  --ag-bronze: #7a5a38;
  --ag-bronze-dark: #5f4529;
  --ag-dark: #1c1b1a;
  --ag-on-dark: #f2f2f2;
  --ag-on-dark-muted: #c9c5bf;
  --ag-serif: ag-cormorant, cormorant, "Cormorant", "Cormorant Garamond", georgia, "Times New Roman", serif;
  --ag-sans: "Jost", "Helvetica Neue", arial, sans-serif;
  --ag-section: clamp(72px, 9vw, 150px);
  --ag-gap: clamp(20px, 2.4vw, 40px);

  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--ag-ground);
  color: var(--ag-body);
  font-family: var(--ag-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

@media (min-width: 1280px) {
  .ag-page {
    font-size: 17px;
  }
}

.ag-page *,
.ag-page *::before,
.ag-page *::after {
  box-sizing: border-box;
}

.ag-page p,
.ag-page h1,
.ag-page h2,
.ag-page h3,
.ag-page figure,
.ag-page ul {
  margin: 0;
}

/* The theme adds spacing and rounded corners to blocks inside pages; the design sets its own. */
.ag-page .wp-block-group,
.ag-page .wp-block-buttons,
.ag-page .wp-block-button,
.ag-page .wp-block-image,
.ag-page .wp-block-video,
.ag-page .wp-block-list {
  margin-top: 0;
  margin-bottom: 0;
}

.ag-page .wp-block-image img,
.ag-page .wp-block-video video {
  margin: 0;
  border-radius: 0;
}

.ag-page a {
  color: inherit;
}

.ag-page :focus-visible {
  outline: 2px solid var(--ag-bronze);
  outline-offset: 3px;
}

/* House rule: body text justified on both sides, on every screen. Headings and labels stay left. */
.ag-page p,
.ag-page li {
  font-size: inherit;
  line-height: inherit;
  text-align: justify;
  text-align-last: left;
  /* Words split only where the page marks it (the same in every browser). */
  hyphens: manual;
  -webkit-hyphens: manual;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

/* Comfortable reading: body lines stop at about 85 characters, even on very wide screens. */
.ag-page p {
  max-width: 64ch;
}

.ag-page p.ag-eyebrow,
.ag-page p.ag-label,
.ag-page .ag-term__value {
  text-align: left;
}

/* ================= Layout ================= */

.ag-page .ag-section {
  display: flex;
  flex-direction: column;
  padding-block: var(--ag-section);
  padding-inline: 0;
}

.ag-page .ag-section--white {
  background: var(--ag-surface);
}

.ag-page .ag-section--stone {
  background: var(--ag-stone);
}

.ag-page .ag-wrap {
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 4.5vw, 64px);
  width: 90%;
  max-width: 1668px;
  margin-inline: auto;
}

.ag-page .ag-narrow {
  max-width: 1668px;
}

.ag-page .ag-section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  max-width: none;
}

/* ================= Type ================= */

.ag-page p.ag-eyebrow,
.ag-page p.ag-label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--ag-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ag-bronze);
}

.ag-page p.ag-eyebrow::before {
  content: "";
  flex: none;
  width: 28px;
  height: 1px;
  background: currentcolor;
}

.ag-page .ag-h1,
.ag-page .ag-h2,
.ag-page .ag-h3 {
  font-family: var(--ag-serif);
  font-weight: 400;
  color: var(--ag-head);
  text-wrap: balance;
  text-transform: none;
}

.ag-page .ag-h1 {
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.012em;
}

.ag-page .ag-h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.008em;
}

.ag-page .ag-h3 {
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
}

.ag-page p.ag-lead {
  font-size: clamp(17px, 1.35vw, 20px);
  font-weight: 300;
  line-height: 1.7;
  color: var(--ag-head);
  hyphens: manual;
  -webkit-hyphens: manual;
}

.ag-page .ag-prose {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1em;
  max-width: 62ch;
}

.ag-page .ag-prose > .ag-eyebrow {
  align-self: flex-start;
}

/* ================= Buttons (WordPress Buttons block) ================= */

.ag-page .ag-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 30px;
  margin: 0;
}

.ag-page .ag-btn .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 30px;
  border: 1px solid var(--ag-ink);
  border-radius: 0;
  background: var(--ag-ink);
  color: var(--ag-on-dark);
  font-family: var(--ag-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.ag-page .ag-btn .wp-block-button__link:hover {
  background: var(--ag-bronze-dark);
  border-color: var(--ag-bronze-dark);
  color: var(--ag-on-dark);
}

.ag-page .ag-link .wp-block-button__link {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ag-head);
  font-family: var(--ag-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: none;
}

.ag-page .ag-link .wp-block-button__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 1px;
  background: currentcolor;
  transition: width 0.35s ease;
}

.ag-page .ag-link .wp-block-button__link:hover::after,
.ag-page .ag-link .wp-block-button__link:focus-visible::after {
  width: 100%;
}

.ag-page .ag-link--light .wp-block-button__link {
  color: var(--ag-on-dark);
}

/* ================= Images ================= */

.ag-page .wp-block-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  object-fit: cover;
}

.ag-page .wp-element-caption,
.ag-page .wp-block-image figcaption {
  margin: 10px 0 0;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-align: left;
  text-transform: uppercase;
  color: var(--ag-muted);
}

/* ================= 1. Hero: photo on top, title card overlapping it ================= */

.ag-page .ag-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ag-page .ag-hero__media {
  width: 100%;
  height: clamp(320px, 52vw, 820px);
  max-height: 78vh;
  min-height: 300px;
  background: var(--ag-stone);
  overflow: hidden;
}

.ag-page .ag-hero__media img {
  height: 100% !important;
  object-position: 50% 55%;
}

/* On computers the photo follows the mouse slightly (set by the page script). */
.ag-page .ag-hero--move .ag-hero__media img {
  transform: translate3d(var(--ag-mx, 0px), var(--ag-my, 0px), 0) scale(1.02);
  will-change: transform;
}

/* Shorter photo (Contact page) */
.ag-page .ag-hero--short .ag-hero__media {
  height: clamp(260px, 38vw, 580px);
}

.ag-page .ag-hero .ag-wrap {
  position: relative;
  z-index: 1;
}

.ag-page .ag-hero__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  padding: 32px 0 0;
}

@media (min-width: 900px) {
  .ag-page .ag-hero__card {
    width: min(860px, 72%);
    margin-top: clamp(-220px, -12vw, -120px);
    padding: clamp(40px, 4vw, 64px) clamp(40px, 4.5vw, 72px) 0 0;
    background: transparent;
  }

  /* The card is 25% see-through, so the photo shows behind it. */
  .ag-page .ag-hero__card::before {
    content: "";
    position: absolute;
    inset: 0 0 0 -100vw;
    z-index: -1;
    background: rgba(242, 242, 242, 0.75);
  }

  /* A shade darker so the small label stays readable over the photo. */
  .ag-page .ag-hero__card p.ag-eyebrow {
    color: var(--ag-bronze-dark);
  }
}

/* Page titles: Every Word Starts With A Capital. */
.ag-page .ag-h1 {
  text-transform: capitalize;
}

/*
 * Live site, computers and tablets in landscape: the photo always ends exactly under the title,
 * so no line of text ever sits on the edge of the photo. The see-through panel sits behind the
 * label and title only; the sentence and buttons sit below the photo. (The editor keeps the
 * simpler layout above.)
 */
@media (min-width: 900px) {
  @supports (grid-template-rows: subgrid) {
    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: minmax(0, 1fr) auto auto auto auto;
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero > .ag-hero__media {
      grid-row: 1 / 4;
      grid-column: 1;
      align-self: stretch;
      height: auto;
      max-height: none;
      min-height: min(clamp(320px, 52vw, 820px), 78vh);
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero--short > .ag-hero__media {
      min-height: min(clamp(260px, 38vw, 580px), 70vh);
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero > .ag-wrap {
      display: contents;
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero__card {
      --ag-card-pad: clamp(40px, 4.5vw, 80px);
      position: relative;
      z-index: 1;
      display: grid;
      grid-row: 2 / 6;
      grid-column: 1;
      grid-template-rows: subgrid;
      grid-template-columns: minmax(0, 1fr);
      justify-self: start;
      align-items: start;
      gap: 0;
      width: fit-content;
      max-width: min(90%, 1668px);
      margin: 0 0 0 max(5%, calc((100% - 1668px) / 2));
      padding: 0 var(--ag-card-pad) 0 0;
      background: none;
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero__card::before {
      position: static;
      inset: auto;
      grid-row: 1 / 3;
      grid-column: 1;
      align-self: stretch;
      margin: 0 calc(-1 * var(--ag-card-pad)) 0 -100vw;
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero__card > * {
      grid-column: 1;
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero__card > .ag-eyebrow {
      grid-row: 1;
      justify-self: start;
      margin-top: clamp(40px, 3.6vw, 64px);
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero__card > .ag-h1 {
      grid-row: 2;
      margin: clamp(18px, 1.6vw, 26px) 0 clamp(30px, 2.8vw, 50px);
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero__card > .ag-lead {
      grid-row: 3;
      max-width: 38em;
      margin-top: clamp(30px, 2.6vw, 44px);
    }

    body:not(.wp-admin):not(.editor-styles-wrapper) .ag-page .ag-hero__card > .wp-block-buttons {
      grid-row: 4;
      margin-top: clamp(28px, 2.4vw, 40px);
    }
  }
}

/* ================= 2. Terms at a glance (drawing title block) ================= */

.ag-page .ag-terms {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--ag-line);
  border-left: 1px solid var(--ag-line);
}

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

@media (min-width: 1000px) {
  .ag-page .ag-terms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ag-page .ag-term {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: clamp(22px, 2.4vw, 34px);
  border-right: 1px solid var(--ag-line);
  border-bottom: 1px solid var(--ag-line);
}

.ag-page p.ag-term__value {
  font-family: var(--ag-serif);
  font-size: clamp(22px, 1.8vw, 27px);
  line-height: 1.25;
  color: var(--ag-head);
  text-wrap: balance;
}

/* ================= 3. Audience columns ================= */

.ag-page .ag-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 4vw, 64px) var(--ag-gap);
}

@media (min-width: 900px) {
  .ag-page .ag-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ag-page .ag-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.ag-page .ag-col > .wp-block-image {
  aspect-ratio: 3 / 2;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--ag-stone);
}

.ag-page .ag-col > .wp-block-image img {
  height: 100% !important;
  transition: transform 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.ag-page .ag-col:hover > .wp-block-image img {
  transform: scale(1.035);
}

@media (min-width: 600px) and (max-width: 899px) {
  .ag-page .ag-col {
    display: grid;
    grid-template: "img title" auto "img text" 1fr / minmax(0, 0.85fr) minmax(0, 1fr);
    column-gap: 32px;
    row-gap: 14px;
  }

  .ag-page .ag-col > .wp-block-image {
    grid-area: img;
    aspect-ratio: 1 / 1;
    margin: 0;
  }

  .ag-page .ag-col > .ag-h3 {
    grid-area: title;
    align-self: end;
  }

  .ag-page .ag-col > p {
    grid-area: text;
  }
}

@media (min-width: 900px) {
  .ag-page .ag-col > .wp-block-image {
    aspect-ratio: 4 / 5;
  }
}

/* ================= 4. Numbered steps ================= */

.ag-page .ag-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 var(--ag-gap);
  counter-reset: ag-step;
}

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

/* Four in a row only when each column is wide enough for even, justified text. */
@media (min-width: 1500px) {
  .ag-page .ag-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ag-page .ag-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--ag-head);
  counter-increment: ag-step;
}

.ag-page .ag-step::before {
  content: counter(ag-step, decimal-leading-zero);
  font-family: var(--ag-serif);
  font-size: 44px;
  line-height: 1;
  color: var(--ag-bronze);
}

/* ================= 5. Images beside text ================= */

.ag-page .ag-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 96px);
  align-items: center;
}

@media (min-width: 900px) {
  .ag-page .ag-split {
    grid-template-columns: 1.1fr 1fr;
  }
}

.ag-page .ag-plates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 639px) {
  .ag-page .ag-plates {
    gap: 10px;
  }
}

.ag-page .ag-plates > .wp-block-image img {
  height: auto !important;
  aspect-ratio: 5 / 4;
  background: var(--ag-surface);
}

.ag-page .ag-checks {
  display: flex;
  flex-direction: column;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.ag-page .ag-checks li {
  position: relative;
  margin: 0;
  padding: 14px 0 14px 30px;
  border-top: 1px solid var(--ag-line);
  line-height: 1.55;
}

.ag-page .ag-checks li:last-child {
  border-bottom: 1px solid var(--ag-line);
}

.ag-page .ag-checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 21px;
  width: 12px;
  height: 7px;
  border-left: 1.5px solid var(--ag-bronze);
  border-bottom: 1.5px solid var(--ag-bronze);
  transform: rotate(-45deg);
}

/* ================= 6. Dark band with background video ================= */

.ag-page .ag-band {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(460px, 48vw, 720px);
  padding-block: clamp(56px, 7vw, 110px);
  background: var(--ag-dark);
  color: var(--ag-on-dark-muted);
  overflow: hidden;
  isolation: isolate;
}

.ag-page .ag-band > .ag-band__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  margin: 0;
}

.ag-page .ag-band > .ag-band__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ag-page .ag-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(20 19 18 / 88%) 0%, rgb(20 19 18 / 62%) 45%, rgb(20 19 18 / 18%) 100%);
  pointer-events: none;
}

@media (max-width: 639px) {
  .ag-page .ag-band::after {
    background: linear-gradient(0deg, rgb(20 19 18 / 92%) 0%, rgb(20 19 18 / 70%) 55%, rgb(20 19 18 / 25%) 100%);
  }
}

.ag-page .ag-band .ag-h2 {
  color: var(--ag-on-dark);
}

.ag-page .ag-band p.ag-eyebrow {
  color: #d2b48f;
}

.ag-page .ag-band .ag-prose {
  max-width: 640px;
}

.ag-page .ag-band__toggle {
  position: absolute;
  right: 5%;
  bottom: 20px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--ag-on-dark-muted);
  font-family: var(--ag-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.ag-page .ag-band__toggle:hover {
  color: var(--ag-on-dark);
}

@media (prefers-reduced-motion: reduce) {
  .ag-page .ag-band > .ag-band__media video {
    visibility: hidden;
  }

  .ag-page .ag-col > .wp-block-image img {
    transition: none;
  }
}

/* ================= 7. Two-column text ================= */

.ag-page .ag-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 80px);
  align-items: start;
}

@media (min-width: 900px) {
  .ag-page .ag-two {
    grid-template-columns: 1fr 1.2fr;
  }
}

/* ================= 8. Enquiry form ================= */

.ag-page .ag-enquiry {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 96px);
}

@media (min-width: 1000px) {
  .ag-page .ag-enquiry {
    grid-template-columns: 0.8fr 1.2fr;
  }
}

.ag-page .ag-contact-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--ag-line);
  font-size: 15px;
}

.ag-page .ag-contact-line a {
  text-decoration: none;
  color: var(--ag-head);
  overflow-wrap: anywhere;
}

/* Contact page: less empty space under the form, before the footer */
.ag-page--contact > .ag-section:last-child {
  padding-bottom: clamp(48px, 5vw, 80px);
}

/* Contact page: underline the links so they read as links */
.ag-page--contact .ag-contact-line a,
.ag-page .ag-opening .ag-contact-line a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--ag-line);
  transition: text-decoration-color 0.2s ease;
}

.ag-page--contact .ag-contact-line a:hover,
.ag-page .ag-opening .ag-contact-line a:hover {
  text-decoration-color: var(--ag-bronze);
}

.ag-page .ag-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 28px;
  margin: 0;
}

.ag-page .ag-field {
  display: grid;
  align-content: end;
  gap: 8px;
  grid-column: span 2;
}

@media (min-width: 640px) {
  .ag-page .ag-field--half {
    grid-column: span 1;
  }
}

.ag-page .ag-field label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ag-head);
}

.ag-page .ag-field label small {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--ag-muted);
}

.ag-page .ag-field input,
.ag-page .ag-field select,
.ag-page .ag-field textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1px solid var(--ag-line);
  border-radius: 0;
  background: var(--ag-surface);
  color: var(--ag-ink);
  font-family: var(--ag-sans);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
  appearance: none;
  transition: border-color 0.2s ease;
}

.ag-page .ag-field textarea {
  min-height: 160px;
  resize: vertical;
}

.ag-page .ag-field select {
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, #595959 50%), linear-gradient(135deg, #595959 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.ag-page .ag-field input:hover,
.ag-page .ag-field select:hover,
.ag-page .ag-field textarea:hover {
  border-color: #b5b0a9;
}

.ag-page .ag-field input:focus,
.ag-page .ag-field select:focus,
.ag-page .ag-field textarea:focus {
  border-color: var(--ag-bronze);
  outline: 1px solid var(--ag-bronze);
  outline-offset: 0;
}

/* A tick box with its sentence (e.g. agreeing to hear about new pieces) */
.ag-page .ag-optin {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  grid-column: 1 / -1;
}

.ag-page .ag-optin input {
  display: grid;
  place-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  padding: 0;
  border: 1px solid #b5b0a9;
  border-radius: 0;
  background: var(--ag-surface);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.ag-page .ag-optin input::before {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 1.5px solid var(--ag-on-dark);
  border-bottom: 1.5px solid var(--ag-on-dark);
  transform: translateY(-2px) rotate(-45deg);
  opacity: 0;
}

.ag-page .ag-optin input:checked {
  border-color: var(--ag-ink);
  background: var(--ag-ink);
}

.ag-page .ag-optin input:checked::before {
  opacity: 1;
}

.ag-page .ag-optin input:hover {
  border-color: var(--ag-ink);
}

.ag-page .ag-optin input:focus-visible {
  outline: 2px solid var(--ag-bronze);
  outline-offset: 2px;
}

.ag-page .ag-optin label {
  text-wrap: pretty;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ag-body);
  cursor: pointer;
}

/* Country field: type, and matching countries show in a list */
.ag-page .ag-combo {
  position: relative;
}

.ag-page .ag-combo input {
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, #595959 50%), linear-gradient(135deg, #595959 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.ag-page .ag-combo input[aria-expanded="true"] {
  background-image: linear-gradient(135deg, transparent 50%, #595959 50%), linear-gradient(45deg, #595959 50%, transparent 50%);
  background-position: calc(100% - 22px) calc(50% - 2px), calc(100% - 16px) calc(50% - 2px);
}

.ag-page .ag-combo input[aria-invalid="true"] {
  border-color: #a33a2a;
}

.ag-page .ag-combo__list {
  position: absolute;
  z-index: 30;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  max-height: 264px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  background: var(--ag-surface);
  border: 1px solid var(--ag-bronze);
  box-shadow: 0 14px 30px rgba(30, 30, 30, 0.12);
}

.ag-page .ag-combo__list[hidden] {
  display: none;
}

.ag-page .ag-combo__list li {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #ebe8e3;
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  hyphens: manual;
  -webkit-hyphens: manual;
  color: var(--ag-head);
  cursor: pointer;
  list-style: none;
}

.ag-page .ag-combo__list li::before,
.ag-page .ag-combo__list li::marker {
  content: none;
}

.ag-page .ag-combo__list li:last-child {
  border-bottom: 0;
}

.ag-page .ag-combo__list li:hover,
.ag-page .ag-combo__list li[aria-selected="true"] {
  background: var(--ag-stone);
}

.ag-page .ag-combo__list li.is-chosen {
  color: var(--ag-bronze-dark);
  font-weight: 500;
}

.ag-page .ag-combo__list li.ag-combo__empty {
  color: var(--ag-muted);
  cursor: default;
  background: none;
}

.ag-page p.ag-combo__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  color: #a33a2a;
}

.ag-page .ag-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ag-page .ag-form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  grid-column: span 2;
}

.ag-page .ag-form__foot p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  color: var(--ag-muted);
}

.ag-page .ag-form__foot a {
  color: var(--ag-head);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ag-page .ag-form__submit {
  min-height: 52px;
  padding: 14px 30px;
  border: 1px solid var(--ag-ink);
  border-radius: 0;
  background: var(--ag-ink);
  color: var(--ag-on-dark);
  font-family: var(--ag-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.ag-page .ag-form__submit:hover {
  background: var(--ag-bronze-dark);
  border-color: var(--ag-bronze-dark);
}

.ag-page .ag-form__submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ag-page .ag-form__status {
  grid-column: span 2;
  margin: 0;
  padding: 14px 18px;
  border-left: 2px solid var(--ag-bronze);
  background: var(--ag-ground);
  color: var(--ag-head);
  text-align: left;
}

.ag-page .ag-form__status.is-error {
  border-left-color: #a33a2a;
}

/* ================= 9. Closing line ================= */

.ag-page .ag-closing {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  justify-items: start;
  padding-block: clamp(48px, 6vw, 88px);
  border-top: 1px solid var(--ag-line);
}

/* Title and buttons share a row when both fit; otherwise the buttons move under the title,
   so the title never has to break. */
@media (min-width: 900px) {
  .ag-page .ag-closing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px 48px;
  }

  .ag-page .ag-closing > * {
    flex: 0 1 auto;
  }
}

.ag-page .ag-closing .ag-h3 {
  font-size: clamp(26px, 2.4vw, 36px);
  font-weight: 400;
}

/* ================= Two ways (choice of two) ================= */

.ag-page .ag-choice {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(48px, 5vw, 80px) var(--ag-gap);
}

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

.ag-page .ag-option {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.ag-page .ag-option > .wp-block-image {
  aspect-ratio: 4 / 3;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--ag-stone);
}

.ag-page .ag-option > .wp-block-image img {
  height: 100% !important;
  transition: transform 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.ag-page .ag-option:hover > .wp-block-image img {
  transform: scale(1.035);
}

.ag-page .ag-option > .ag-actions {
  margin-top: 4px;
}

/* ================= Material index ================= */

.ag-page .ag-split > .ag-split__img {
  align-self: stretch;
  min-height: 360px;
  overflow: hidden;
  background: var(--ag-stone);
}

.ag-page .ag-split > .ag-split__img img {
  height: 100% !important;
}

@media (max-width: 899px) {
  .ag-page .ag-split > .ag-split__img {
    min-height: 0;
    aspect-ratio: 3 / 2;
  }
}

.ag-page .ag-index {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  border-top: 1px solid var(--ag-line);
}

.ag-page .ag-index__row {
  display: grid;
  grid-template-columns: minmax(96px, 0.34fr) minmax(0, 1fr);
  gap: 8px 24px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--ag-line);
}

.ag-page p.ag-index__name {
  font-family: var(--ag-serif);
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.1;
  text-align: left;
  color: var(--ag-head);
}

@media (max-width: 479px) {
  .ag-page .ag-index__row {
    grid-template-columns: 1fr;
  }
}

/* ================= Steps with a picture ================= */

.ag-page .ag-step--image {
  padding-top: 0;
  border-top: 0;
}

.ag-page .ag-step--image > .wp-block-image {
  order: -2;
  aspect-ratio: 5 / 4;
  margin-bottom: 6px;
  overflow: hidden;
  background: var(--ag-surface);
}

.ag-page .ag-step--image > .wp-block-image img {
  height: 100% !important;
}

.ag-page .ag-step--image::before {
  order: -1;
  padding-top: 22px;
  border-top: 1px solid var(--ag-head);
}

/* ================= Questions (Details block) ================= */

.ag-page .ag-faqs {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--ag-line);
}

.ag-page .ag-faq {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--ag-line);
}

.ag-page .ag-faq summary {
  position: relative;
  display: block;
  padding: 22px 44px 22px 0;
  font-family: var(--ag-serif);
  font-size: clamp(21px, 1.7vw, 25px);
  line-height: 1.25;
  color: var(--ag-head);
  cursor: pointer;
  list-style: none;
}

.ag-page .ag-faq summary::-webkit-details-marker {
  display: none;
}

.ag-page .ag-faq summary::before,
.ag-page .ag-faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 14px;
  height: 1px;
  background: var(--ag-bronze);
  transition: transform 0.25s ease;
}

.ag-page .ag-faq summary::after {
  transform: rotate(90deg);
}

.ag-page .ag-faq[open] summary::after {
  transform: rotate(0deg);
}

.ag-page .ag-faq > p {
  max-width: 62ch;
  padding: 0 0 24px;
}

.ag-page .ag-faq a {
  color: var(--ag-head);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ================= Phones ================= */

@media (max-width: 639px) {
  .ag-page .ag-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ag-page .ag-actions .ag-btn,
  .ag-page .ag-actions .ag-btn .wp-block-button__link {
    width: 100%;
  }

  .ag-page .ag-actions .ag-link {
    align-self: flex-start;
  }

  .ag-page .ag-form__submit {
    width: 100%;
  }
}

/* ================= Inside the WordPress editor only ================= */
/* The editor adds its own width limits and spacing around every block; undo them here so the
   editor shows the page the way visitors see it. */

.editor-styles-wrapper .wp-block.ag-page {
  max-width: none;
  margin: 0;
}

.editor-styles-wrapper .ag-page .wp-block:not(.ag-wrap) {
  max-width: none;
  margin-top: 0;
  margin-bottom: 0;
}

.editor-styles-wrapper .ag-page .wp-block.ag-wrap {
  margin-top: 0;
  margin-bottom: 0;
}

.editor-styles-wrapper .ag-page .ag-wrap {
  max-width: 1668px;
}

.editor-styles-wrapper .ag-page .ag-narrow {
  max-width: 1668px;
}

.editor-styles-wrapper .ag-page .ag-hero__card {
  margin-top: 0;
}

@media (min-width: 900px) {
  .editor-styles-wrapper .ag-page .ag-hero__card {
    margin-top: clamp(-220px, -12vw, -120px);
  }
}

.editor-styles-wrapper .ag-page .wp-block-image > div,
.editor-styles-wrapper .ag-page .wp-block-image .components-resizable-box__container {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
}

.editor-styles-wrapper .ag-page .ag-hero__media img,
.editor-styles-wrapper .ag-page .ag-col > .wp-block-image img {
  height: 100% !important;
}

.editor-styles-wrapper .ag-page .ag-band > .ag-band__media {
  z-index: 0;
}

.editor-styles-wrapper .ag-page .ag-band::after {
  z-index: 0;
}

.editor-styles-wrapper .ag-page .ag-band > .ag-wrap {
  position: relative;
  z-index: 1;
}

.editor-styles-wrapper .ag-page .wp-block-shortcode {
  font-family: var(--ag-sans);
}

.editor-styles-wrapper .ag-page .ag-faq > p {
  padding-bottom: 24px;
}

/* ================= Aftab Registry: serial number check ================= */

.ag-page .ag-registry {
  display: grid;
  gap: 28px;
}

.ag-page .ag-registry__form {
  display: grid;
  gap: 10px;
  margin: 0;
}

.ag-page .ag-registry__form label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ag-head);
}

.ag-page .ag-registry__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ag-page .ag-registry__row input {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 56px;
  padding: 14px 18px;
  border: 1px solid var(--ag-line);
  border-radius: 0;
  background: var(--ag-surface);
  color: var(--ag-ink);
  font-family: var(--ag-sans);
  font-size: 18px;
  letter-spacing: 0.08em;
  box-shadow: none;
  appearance: none;
}

.ag-page .ag-registry__row input::placeholder {
  letter-spacing: 0.02em;
}

.ag-page .ag-registry__row input:hover {
  border-color: #b5b0a9;
}

.ag-page .ag-registry__row input:focus {
  border-color: var(--ag-bronze);
  outline: 1px solid var(--ag-bronze);
  outline-offset: 0;
}

.ag-page .ag-registry__row .ag-form__submit {
  flex: 0 0 auto;
  min-height: 56px;
}

@media (max-width: 479px) {
  .ag-page .ag-registry__row .ag-form__submit {
    flex: 1 1 100%;
  }
}

.ag-page .ag-registry__result {
  display: grid;
  gap: 20px;
}

.ag-page .ag-registry__result:empty {
  display: none;
}

.ag-page .ag-registry__result .ag-form__status a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The record card */
.ag-page .ag-record {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--ag-surface);
  border: 1px solid var(--ag-line);
}

@container (min-width: 600px) {
  .ag-page .ag-record:has(.ag-record__image) {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

@container (max-width: 599px) {
  .ag-page .ag-record__image {
    aspect-ratio: 16 / 10;
    height: auto;
    min-height: 0;
  }
}

.ag-page .ag-record__image {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

.ag-page .ag-record__body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: clamp(24px, 3vw, 40px);
}

.ag-page p.ag-record__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ag-bronze-dark);
}

.ag-page p.ag-record__badge::before {
  content: "";
  flex: none;
  width: 16px;
  height: 9px;
  border-left: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  transform: rotate(-45deg) translateY(-2px);
}

.ag-page .ag-record__title {
  margin: 0;
  font-family: var(--ag-serif);
  font-size: clamp(26px, 2.4vw, 36px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ag-head);
}

.ag-page .ag-record__details {
  display: grid;
  margin: 6px 0 0;
  border-top: 1px solid var(--ag-line);
}

.ag-page .ag-record__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  padding: 11px 0;
  border-bottom: 1px solid var(--ag-line);
}

.ag-page .ag-record__row dt {
  min-width: 7.5em;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.8;
  text-transform: uppercase;
  color: var(--ag-muted);
}

.ag-page .ag-record__row dd {
  margin: 0;
  text-align: left;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ag-head);
  overflow-wrap: anywhere;
}

.ag-page p.ag-record__link {
  margin: 4px 0 0;
  text-align: left;
}

.ag-page .ag-record__link a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  color: var(--ag-head);
}

/* All values start on one line, however long the labels are. */
@supports (grid-template-columns: subgrid) {
  .ag-page .ag-record__details {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 24px;
  }

  .ag-page .ag-record__row {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
  }
}

/* Transfer request (opens under the card) */
.ag-page .ag-transfer {
  margin: 0;
  border: 1px solid var(--ag-line);
  background: var(--ag-surface);
}

.ag-page .ag-transfer summary {
  position: relative;
  display: block;
  padding: 20px 56px 20px clamp(20px, 3vw, 40px);
  font-family: var(--ag-serif);
  font-size: clamp(20px, 1.7vw, 24px);
  line-height: 1.3;
  color: var(--ag-head);
  cursor: pointer;
  list-style: none;
}

.ag-page .ag-transfer summary::-webkit-details-marker {
  display: none;
}

.ag-page .ag-transfer summary::before,
.ag-page .ag-transfer summary::after {
  content: "";
  position: absolute;
  right: clamp(20px, 3vw, 40px);
  top: 50%;
  width: 14px;
  height: 1px;
  background: var(--ag-bronze);
  transition: transform 0.25s ease;
}

.ag-page .ag-transfer summary::after {
  transform: rotate(90deg);
}

.ag-page .ag-transfer[open] summary::after {
  transform: rotate(0deg);
}

.ag-page .ag-transfer__form {
  padding: 4px clamp(20px, 3vw, 40px) clamp(24px, 3vw, 40px);
}

.ag-page p.ag-transfer__intro {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ag-body);
}

/* Three steps in a row (e.g. how a transfer works) */
@media (min-width: 1400px) {
  .ag-page .ag-steps--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 640px) and (max-width: 1399px) {
  .ag-page .ag-steps--three {
    grid-template-columns: 1fr;
  }
}

/* Text-only columns in pairs (e.g. what the registry record gives you) */
.ag-page .ag-cols--text {
  grid-template-columns: 1fr;
  gap: 0 var(--ag-gap);
}

@media (min-width: 800px) {
  .ag-page .ag-cols--text {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ag-page .ag-cols--text .ag-col {
  display: flex;
  gap: 12px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--ag-head);
}

/* ================= Page opening without a photo (tool or form first) ================= */
/* Used by pages whose job is a tool or a form: the title, a short text, and the tool itself,
   all visible straight away. */

.ag-page .ag-opening {
  padding-top: clamp(56px, 6vw, 110px);
}

.ag-page .ag-opening__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 3vw, 44px);
  align-items: start;
}

@media (min-width: 1000px) {
  .ag-page .ag-opening__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas: "intro panel" "details panel";
    grid-template-rows: auto 1fr;
    column-gap: clamp(48px, 5vw, 96px);
  }

  .ag-page .ag-opening__intro {
    grid-area: intro;
  }

  .ag-page .ag-opening__grid > .ag-panel {
    grid-area: panel;
  }

  .ag-page .ag-opening__details {
    grid-area: details;
  }
}

.ag-page .ag-opening__intro,
.ag-page .ag-opening__details {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1em;
  max-width: 62ch;
}

/* A white panel that holds a tool or a form */
.ag-page .ag-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: clamp(24px, 3vw, 48px);
  background: var(--ag-surface);
  border: 1px solid var(--ag-line);
  container-type: inline-size;
}

/* The registry check: a panel drawn like an engraved plate (double hairline) */
.ag-page .ag-panel--plate {
  border-color: var(--ag-head);
  box-shadow: inset 0 0 0 6px var(--ag-surface), inset 0 0 0 7px var(--ag-line);
}

/* A wide photograph with a small gallery label under it */
.ag-page .ag-photo-band {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 14px;
  padding-block: 0 clamp(56px, 7vw, 110px);
}

.ag-page .ag-photo-band > .wp-block-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ag-stone);
}

@media (min-width: 700px) {
  .ag-page .ag-photo-band > .wp-block-image {
    aspect-ratio: 21 / 9;
  }
}

.ag-page .ag-photo-band > .wp-block-image img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
}

.ag-page .ag-photo-band > .ag-wrap {
  align-self: center;
  width: 90%;
  max-width: 1668px;
  margin-inline: auto;
}

.ag-page .ag-photo-band > .ag-wrap > p.ag-label {
  color: var(--ag-muted);
}

/* ================= Registry: certificate ================= */

.ag-page .ag-certificate {
  display: grid;
  gap: 18px;
  padding: clamp(28px, 4vw, 56px);
  background: var(--ag-surface);
  border: 1px solid var(--ag-head);
  box-shadow: inset 0 0 0 8px var(--ag-surface), inset 0 0 0 9px var(--ag-line);
  text-align: center;
}

.ag-page p.ag-certificate__brand {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ag-head);
}

.ag-page .ag-certificate__title {
  margin: 0;
  font-family: var(--ag-serif);
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ag-head);
}

.ag-page p.ag-certificate__intro {
  max-width: 46ch;
  margin: 0 auto;
  text-align: center;
  text-align-last: center;
  color: var(--ag-body);
}

.ag-page .ag-certificate__details {
  display: grid;
  margin: 8px 0 0;
  border-top: 1px solid var(--ag-line);
  text-align: left;
}

.ag-page .ag-certificate__row {
  display: grid;
  grid-template-columns: 13em minmax(0, 1fr);
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ag-line);
}

.ag-page .ag-certificate__row dt {
  min-width: 11em;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.8;
  text-transform: uppercase;
  color: var(--ag-muted);
}

.ag-page .ag-certificate__row dd {
  margin: 0;
  font-family: var(--ag-serif);
  font-size: 20px;
  line-height: 1.4;
  color: var(--ag-head);
}

.ag-page p.ag-certificate__foot {
  margin: 0;
  font-size: 13px;
  text-align: center;
  text-align-last: center;
  color: var(--ag-muted);
}

.ag-page p.ag-certificate__actions {
  margin: 0;
  text-align: center;
}

@media (max-width: 479px) {
  .ag-page .ag-certificate__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* The certificate page (opens on its own, ready to print) */
body.ag-cert-doc {
  margin: 0;
  background: #f2f2f2;
}

.ag-page.ag-cert-page {
  display: grid;
  justify-items: center;
  gap: 24px;
  min-height: 100vh;
  padding: clamp(24px, 5vw, 72px) 16px;
  box-sizing: border-box;
}

.ag-cert-page .ag-certificate {
  width: min(100%, 760px);
  box-sizing: border-box;
}

.ag-page .ag-certificate > p {
  margin-inline: auto;
}

.ag-page img.ag-certificate__logo {
  width: 150px;
  height: auto;
  margin: 0 auto 6px;
  border-radius: 0;
}

.ag-page p.ag-cert-page__back {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ag-page p.ag-cert-page__back a {
  color: var(--ag-muted);
  text-decoration: none;
}

@page {
  size: A4;
  margin: 14mm;
}

@media print {
  body.ag-cert-doc {
    background: #fff;
  }

  .ag-page.ag-cert-page {
    min-height: 0;
    padding: 0;
  }

  .ag-page p.ag-certificate__actions,
  .ag-page p.ag-cert-page__back {
    display: none;
  }
}

/* ================= Registry: the owner's private page ================= */

.ag-page .ag-owner__card {
  container-type: inline-size;
}

@media (min-width: 1000px) {
  .ag-page .ag-opening__grid > .ag-owner__card {
    grid-area: panel;
  }
}

/* Links inside the text read as links */
.ag-page--owner p a,
.ag-page .ag-owner__notes a {
  color: var(--ag-head);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--ag-line);
  transition: text-decoration-color 0.2s ease;
}

.ag-page--owner p a:hover,
.ag-page .ag-owner__notes a:hover {
  text-decoration-color: currentcolor;
}

/* Notes written by the studio */
.ag-page .ag-owner__notes ul,
.ag-page .ag-owner__notes ol {
  display: grid;
  gap: 0.4em;
  margin: 0;
  padding-left: 1.2em;
}

.ag-page .ag-owner__notes ul {
  list-style: disc;
}

.ag-page .ag-owner__notes ol {
  list-style: decimal;
}

.ag-page .ag-owner__notes li::marker {
  color: var(--ag-bronze);
}

.ag-page .ag-owner__notes strong,
.ag-page .ag-owner__notes b {
  font-weight: 500;
  color: var(--ag-head);
}

.ag-page .ag-owner__notes blockquote {
  margin: 0;
  padding-left: 22px;
  border-left: 1px solid var(--ag-bronze);
  font-family: var(--ag-serif);
  font-size: clamp(21px, 1.7vw, 25px);
  line-height: 1.35;
  color: var(--ag-head);
}

.ag-page .ag-owner__notes blockquote p {
  text-align: left;
}

/* Workshop photos */
.ag-page .ag-owner__photos {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 3vw, 44px) var(--ag-gap);
}

/* Columns follow the number of photos, so a photo is never left alone on the last row. */
@media (min-width: 600px) {
  .ag-page .ag-owner__photos--2,
  .ag-page .ag-owner__photos--4,
  .ag-page .ag-owner__photos--many {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 700px) {
  .ag-page .ag-owner__photos--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .ag-page .ag-owner__photos--many {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ag-page .ag-owner__photos--1 {
  max-width: 1100px;
}

.ag-page .ag-owner__photo {
  display: grid;
  align-content: start;
  gap: 12px;
  margin: 0;
}

.ag-page .ag-owner__photo > a {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--ag-stone);
  cursor: zoom-in;
}

.ag-page .ag-owner__photos--1 .ag-owner__photo > a {
  aspect-ratio: 3 / 2;
}

.ag-page .ag-owner__photo img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.ag-page .ag-owner__photo > a:hover img {
  transform: scale(1.02);
}

.ag-page .ag-owner__photo figcaption {
  margin: 0;
  font-size: 12px;
  font-style: normal;
  text-align: left;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--ag-muted);
}

/* Documents */
.ag-page .ag-owner__docs {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--ag-line);
}

.ag-page .ag-owner__doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ag-line);
  color: var(--ag-head);
  text-decoration: none;
}

.ag-page .ag-owner__doc-text {
  display: grid;
  gap: 4px;
}

.ag-page .ag-owner__doc-name {
  font-family: var(--ag-serif);
  font-size: clamp(22px, 1.8vw, 27px);
  line-height: 1.2;
}

.ag-page .ag-owner__doc-meta {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ag-muted);
}

.ag-page .ag-owner__doc-open {
  position: relative;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.ag-page .ag-owner__doc-open::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 1px;
  background: currentcolor;
  transition: width 0.35s ease;
}

.ag-page .ag-owner__doc:hover .ag-owner__doc-open::after,
.ag-page .ag-owner__doc:focus-visible .ag-owner__doc-open::after {
  width: 100%;
}

/* Photo viewer */
html:has(.ag-lightbox[open]) {
  overflow: hidden;
}

.ag-page .ag-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(28, 27, 26, 0.97);
  color: var(--ag-on-dark);
}

.ag-page .ag-lightbox::backdrop {
  background: rgba(28, 27, 26, 0.97);
}

.ag-page .ag-lightbox[open] {
  display: grid;
  place-items: center;
}

.ag-page .ag-lightbox__figure {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 0;
  padding: 64px 72px 56px;
}

.ag-page .ag-lightbox__figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 144px);
  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);
  margin: 0;
  border-radius: 0;
  object-fit: contain;
}

.ag-page .ag-lightbox figcaption,
.ag-page p.ag-lightbox__count {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
  color: var(--ag-on-dark-muted);
}

.ag-page p.ag-lightbox__count {
  position: absolute;
  top: 26px;
  left: 28px;
  margin: 0;
}

.ag-page .ag-lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ag-on-dark);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.ag-page .ag-lightbox button:hover {
  opacity: 1;
}

.ag-page .ag-lightbox__close {
  top: 10px;
  right: 10px;
}

.ag-page .ag-lightbox__prev,
.ag-page .ag-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.ag-page .ag-lightbox__prev {
  left: 8px;
}

.ag-page .ag-lightbox__next {
  right: 8px;
}

.ag-page .ag-lightbox.is-single .ag-lightbox__prev,
.ag-page .ag-lightbox.is-single .ag-lightbox__next,
.ag-page .ag-lightbox.is-single .ag-lightbox__count {
  display: none;
}

@media (max-width: 639px) {
  .ag-page .ag-lightbox__figure {
    padding: 64px 0 56px;
  }

  .ag-page .ag-lightbox__figure img {
    max-width: 100vw;
  }

  .ag-page .ag-lightbox__prev,
  .ag-page .ag-lightbox__next {
    top: auto;
    bottom: 4px;
    transform: none;
  }
}

/* ================= FAQ page ================= */

/* Index of topics under the title */
.ag-page .ag-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ag-page .ag-topics li {
  margin: 0;
  list-style: none;
  text-align: left;
}

.ag-page .ag-topics li::marker {
  content: none;
}

.ag-page .ag-topics a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ag-head);
}

.ag-page .ag-topics a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 22px;
  height: 1px;
  background: currentcolor;
  transition: width 0.35s ease;
}

.ag-page .ag-topics a:hover::after,
.ag-page .ag-topics a:focus-visible::after {
  width: 100%;
}

/* One group of questions: title on the left, questions on the right */
.ag-page .ag-faq-group {
  padding-block: clamp(44px, 5vw, 80px);
  scroll-margin-top: 110px;
}

.ag-page .ag-faq-group:first-child {
  padding-top: 0;
}

.ag-page .ag-faq-group:last-child {
  padding-bottom: 0;
}

.ag-page--faq > .ag-section--white > .ag-wrap {
  gap: 0;
}

/* Links inside the opening text read as links */
.ag-page--faq .ag-opening p a {
  color: var(--ag-head);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--ag-line);
  transition: text-decoration-color 0.2s ease;
}

.ag-page--faq .ag-opening p a:hover {
  text-decoration-color: currentcolor;
}

@media (prefers-reduced-motion: no-preference) {
  html:has(.ag-page--faq) {
    scroll-behavior: smooth;
  }
}

/* ================= Home ================= */

/* Image tiles: selected pieces and categories */
.ag-page .ag-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 3.4vw, 56px) clamp(14px, 2vw, 40px);
}

@media (min-width: 900px) {
  .ag-page .ag-tiles--pieces {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ag-page .ag-tiles--rooms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ag-page .ag-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.ag-page .ag-tile > .wp-block-image {
  flex: none;
  aspect-ratio: 5 / 4;
  margin: 0 0 8px;
  overflow: hidden;
  background: var(--ag-stone);
}

.ag-page .ag-tiles--rooms .ag-tile > .wp-block-image {
  aspect-ratio: 4 / 5;
}

.ag-page .ag-tile > .wp-block-image a {
  display: block;
  height: 100%;
}

.ag-page .ag-tile > .wp-block-image img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.ag-page .ag-tile:hover > .wp-block-image img {
  transform: scale(1.035);
}

.ag-page p.ag-tile__name {
  font-family: var(--ag-serif);
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.2;
  text-align: left;
  color: var(--ag-head);
}

.ag-page p.ag-tile__name a {
  color: inherit;
  text-decoration: none;
}

.ag-page p.ag-tile__name a:hover,
.ag-page p.ag-tile__name a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.ag-page p.ag-tile__meta {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-align: left;
  text-transform: uppercase;
  color: var(--ag-muted);
}

/* The link under a group of tiles */
.ag-page .ag-tiles + .ag-actions {
  margin-top: clamp(-8px, -0.5vw, 0px);
}

/* Three cards side by side (Home: ways to work with us). Below 1200px each card lies
   on its side (photo left, text right), so the text never gets too narrow. */
@media (min-width: 600px) and (max-width: 1199px) {
  .ag-page .ag-choice--three .ag-option {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
    grid-auto-rows: auto;
    align-content: start;
    column-gap: 32px;
    row-gap: 14px;
  }

  .ag-page .ag-choice--three .ag-option > .wp-block-image {
    grid-column: 1;
    grid-row: 1 / span 5;
    aspect-ratio: 1 / 1;
    margin: 0;
  }

  .ag-page .ag-choice--three .ag-option > :not(.wp-block-image) {
    grid-column: 2;
  }
}

@media (max-width: 1199px) {
  .ag-page .ag-choice--three {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1200px) {
  .ag-page .ag-choice--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* The links line up along the bottom of the three cards. */
  .ag-page .ag-choice--three .ag-option > .ag-actions {
    margin-top: auto;
    padding-top: 4px;
  }
}

/* Home sections use the Home page's own fonts: the theme's Cormorant and Jost, exactly as
   the narration and Featured Works above them. */
.ag-page--home-sections {
  --ag-serif: cormorant, "Cormorant", georgia, "Times New Roman", serif;
}

/* Home sections sit on the Home page's own background, like the banner, narration and
   Featured Works above them; one section space between each. */
.ag-page--home-sections > .ag-section + .ag-section {
  padding-top: 0;
}

/* Home: "Selected pieces" move slowly in a row. Hover, touch or the arrows stop them;
   the row can also be swiped. */
.ag-page .ag-home-pieces {
  gap: clamp(36px, 4.5vw, 64px);
}

.ag-page .ag-home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
}

.ag-page .ag-marquee__arrows {
  display: flex;
  flex: none;
  gap: 10px;
}

.ag-page .ag-marquee__arrows button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--ag-line);
  border-radius: 0;
  background: transparent;
  color: var(--ag-head);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.ag-page .ag-marquee__arrows button:hover {
  border-color: var(--ag-ink);
}

.ag-page .ag-marquee {
  --ag-tgap: clamp(14px, 2vw, 40px);
  --ag-card: 72vw;
  overflow-x: auto;
  overflow-y: hidden;
  padding-inline: max(5%, calc((100% - 1668px) / 2));
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.ag-page .ag-marquee::-webkit-scrollbar {
  display: none;
}

@media (min-width: 600px) {
  .ag-page .ag-marquee {
    --ag-card: 42vw;
  }
}

@media (min-width: 900px) {
  .ag-page .ag-marquee {
    --ag-card: calc((min(90vw, 1668px) - 2 * var(--ag-tgap)) / 3);
  }
}

@media (min-width: 1200px) {
  .ag-page .ag-marquee {
    --ag-card: calc((min(90vw, 1668px) - 3 * var(--ag-tgap)) / 4);
  }
}

.ag-page .ag-marquee__track {
  display: flex;
  gap: var(--ag-tgap);
  width: max-content;
}

.ag-page .ag-marquee .ag-tile {
  flex: none;
  width: var(--ag-card);
}

.ag-page .ag-marquee .ag-tile > .wp-block-image a {
  cursor: pointer;
}
