/* ==========================================================================
   CESI graduation programme (capability/graduation.php).

   The page the QR code printed for the ceremony opens, so it is laid out for
   a phone first. It borrows the printed brochure's language — the green
   cover with a brass frame, the timeline with brass dots, surnames in
   capitals — but every value resolves to a site.css token and the type is
   the site's own, so it sits on brand rather than beside it.
   ========================================================================== */

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

/* Section headings sit a size below the programme pages': these titles are
   long ("Graduation & Certification Ceremony") and must hold on a phone. */
.grad-h2 { font-size: clamp(32px, 4.2vw, 48px); }

/* The brochure prints surnames in capitals. They are stored in title case
   and raised here, so a screen reader says the name rather than spelling it. */
.grad .surname { text-transform: uppercase; font-weight: 800; letter-spacing: .02em; }

/* In-page targets clear the sticky site header. */
.grad [id] { scroll-margin-top: 104px; }

/* Hero: the brochure cover ------------------------------------------------ */

.grad-hero {
  position: relative; overflow: hidden;
  margin: 24px var(--pad-x) 0; padding: 72px 40px 60px;
  border-radius: 32px; text-align: center; color: #fff;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(201, 169, 110, .16), transparent 70%),
    var(--green);
}
/* The cover's inset hairline frame. */
.grad-hero::before {
  content: ''; position: absolute; inset: 14px; pointer-events: none;
  border: 1px solid rgba(201, 169, 110, .45); border-radius: 22px;
}

.grad-hero__org {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase; font-weight: 700;
  color: var(--brass-on-green); line-height: 1.6;
}
/* Outfit ships no italic, so the italic voices run on Nunito's. */
.grad-hero__strap {
  margin-top: 22px; font-style: italic; font-weight: 600; font-size: 17px;
  color: rgba(255, 255, 255, .85);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
}
.grad-hero__strap .grad-hero__sep { color: var(--brass-on-green); font-style: normal; }

.grad-hero__title {
  margin-top: 18px;
  font-family: var(--display); font-weight: 600; color: var(--brass-on-green);
  font-size: clamp(76px, 12vw, 128px); line-height: .95; letter-spacing: .01em;
}
.grad-hero__tail {
  display: block; margin-top: 10px;
  font-family: var(--sans); font-style: italic; font-weight: 600;
  font-size: clamp(22px, 3.4vw, 34px); line-height: 1.2; letter-spacing: .01em;
}

/* Two brass hairlines meeting at a diamond. */
.grad-rule {
  position: relative; width: min(320px, 70%); height: 1px; margin: 30px auto 26px;
  background: linear-gradient(90deg, transparent, var(--brass-on-green) 20%, var(--brass-on-green) 80%, transparent);
}
.grad-rule::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  background: var(--brass-on-green); transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 0 6px var(--green);
}

.grad-hero__occasion {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(20px, 2.6vw, 28px); line-height: 1.3; text-wrap: balance;
}
.grad-hero__label {
  margin-top: 34px; font-size: 12px; letter-spacing: .32em; text-transform: uppercase;
  font-weight: 700; color: var(--brass-on-green);
}
.grad-hero__date {
  margin-top: 12px; font-family: var(--display); font-weight: 600;
  font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25;
}
.grad-hero__venue {
  margin-top: 6px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 600; color: rgba(255, 255, 255, .78);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px;
}
.grad-hero__initiative {
  margin: 40px auto 0; max-width: 46ch;
  font-style: italic; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .62);
}

/* Jump links ------------------------------------------------------------- */

.grad-jump { padding: 28px var(--pad-x) 0; }
.grad-jump ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.grad-jump a {
  display: block; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--hairline); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: border-color .15s, color .15s;
}
.grad-jump a:hover { border-color: var(--brass); color: var(--green); }

/* The three parts of the day ---------------------------------------------- */

/* Heading beside the timeline on a wide screen, holding its place while the
   longer timelines scroll past. */
.grad-part {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px; align-items: start;
}
.grad-part__head { position: sticky; top: 120px; }
.grad-part__head .kicker { display: block; margin-bottom: 12px; }
.grad-part__time {
  margin-top: 14px; font-style: italic; font-size: 18px; color: var(--muted);
}
.grad-part__head::after {
  content: ''; display: block; width: 64px; height: 2px; margin-top: 24px; background: var(--brass);
}

/* Timeline: time, a brass dot on a brass rail, then the item. The rail is
   drawn per item, from the first dot to the last. */
.timeline {
  --tl-time: 60px;
  --tl-gap: 14px;
  --tl-dot: 13px;
  --tl-pad: 14px;
  --tl-first-line: 13px; /* half the title's first line */
}
.timeline__item {
  position: relative;
  display: grid; grid-template-columns: var(--tl-time) var(--tl-dot) minmax(0, 1fr);
  column-gap: var(--tl-gap); align-items: start;
  padding: var(--tl-pad) 0;
}
.timeline__item::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 2px;
  left: calc(var(--tl-time) + var(--tl-gap) + var(--tl-dot) / 2 - 1px);
  background: rgba(176, 141, 87, .35);
}
.timeline__item:first-child::before { top: calc(var(--tl-pad) + var(--tl-first-line)); }
.timeline__item:last-child::before { bottom: auto; height: calc(var(--tl-pad) + var(--tl-first-line)); }
.timeline__item:only-child::before { display: none; }

.timeline__time {
  font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 26px;
  color: var(--green); text-align: right; font-variant-numeric: tabular-nums;
}
.timeline__dot {
  position: relative; z-index: 1;
  width: var(--tl-dot); height: var(--tl-dot); margin-top: calc(var(--tl-first-line) - var(--tl-dot) / 2);
  border-radius: 50%; border: 2px solid var(--brass); background: #fff;
}
.section--cream .timeline__dot { background: var(--cream); }

.timeline__title { font-size: 18px; line-height: 26px; font-weight: 600; color: var(--ink); }
.timeline__note { margin-top: 2px; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* Key moments: the team presentations, the conferment, the procession. */
.timeline__item--key .timeline__title { color: var(--green); font-weight: 800; }
.timeline__item--key .timeline__dot {
  background: var(--brass); box-shadow: 0 0 0 4px rgba(176, 141, 87, .22);
}
.section--cream .timeline__item--key .timeline__dot { background: var(--brass); }

/* Breaks: a quieter line. */
.timeline__item--pause .timeline__title { font-style: italic; font-weight: 400; color: var(--muted); }

/* The assessment panel, once names are in. */
.grad-panel {
  margin-top: 32px; padding: 26px 30px;
  background: var(--cream); border-left: 3px solid var(--brass); border-radius: 0 18px 18px 0;
}
.section--cream .grad-panel { background: #fff; }
.grad-panel__title { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--green); margin-bottom: 12px; }
.grad-panel li { font-size: 16px; line-height: 1.6; color: var(--body); }

/* Order of procession --------------------------------------------------- */

.procession { columns: 2; column-gap: 56px; }
.procession li { break-inside: avoid; }
.procession__row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline;
  padding: 16px 4px; border-bottom: 1px solid var(--hairline); color: var(--ink);
}
.procession__row:hover { color: var(--ink); }
.procession__row:hover .procession__name { color: var(--green); }
.procession__num {
  font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--brass);
  font-variant-numeric: tabular-nums;
}
.procession__name { font-size: 17px; line-height: 1.4; }
.procession__name .surname { color: var(--green); }
.procession__company { font-style: italic; font-size: 14px; color: var(--muted); text-align: right; }

/* Graduates ------------------------------------------------------------- */

.graduates { max-width: 1000px; }
.graduate {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "photo head" "photo bio";
  column-gap: 44px; padding: 44px 0; border-top: 1px solid var(--hairline);
}
.graduate:first-child { border-top: 0; padding-top: 0; }

/* The brochure's brass-ringed portrait. */
.graduate__photo {
  grid-area: photo; width: 168px; height: 168px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--brass); background: var(--sand);
  box-shadow: 0 10px 24px rgba(27, 42, 34, .12);
}
.graduate__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.graduate__photo--initials {
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #2A6049, var(--green) 70%);
  font-family: var(--display); font-weight: 600; font-size: 54px; color: var(--brass-on-green);
  letter-spacing: .04em;
}

.graduate__head { grid-area: head; }
.graduate__name { font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.2; color: var(--green); }
.graduate__name .surname { font-weight: 700; }
.graduate__company { margin-top: 4px; font-style: italic; font-weight: 600; font-size: 16px; color: var(--brass); }

.graduate__bio { grid-area: bio; margin-top: 14px; }
.graduate__bio p { font-size: 16px; line-height: 1.65; color: var(--body); max-width: 68ch; overflow-wrap: break-word; }
.graduate__bio p + p { margin-top: 12px; }

/* About the credential ------------------------------------------------- */

.grad-credential {
  margin: 0 var(--pad-x) 96px; padding: 72px;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; align-items: center;
  background: var(--green); border-radius: 32px; color: #fff;
}
.grad-credential .kicker { display: block; margin-bottom: 14px; }
.grad-credential__body { margin-top: 20px; font-size: 18px; line-height: 1.65; color: rgba(255, 255, 255, .88); max-width: 60ch; }

.grad-levels { margin: 32px 0 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grad-levels__item {
  display: flex; flex-direction: column; gap: 6px; padding: 20px;
  border: 1px solid rgba(201, 169, 110, .5); border-radius: 18px;
}
.grad-levels__name { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; line-height: 1.35; }
.grad-levels__band { font-style: italic; font-weight: 600; font-size: 16px; color: var(--brass-on-green); }

/* .btn--white inherits its colour, which here is white on white. */
.grad-credential .btn--white { color: var(--green); }
.grad-credential .btn--white:hover { color: var(--brass); }

.grad-credential__cert { margin: 0; justify-self: center; max-width: 320px; }
.grad-credential__cert img {
  width: 100%; height: auto; border-radius: 6px;
  box-shadow: 0 28px 56px rgba(0, 0, 0, .35); transform: rotate(2deg);
}

/* Gallery -------------------------------------------------------------- */

.grad-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grad-gallery a { display: block; border-radius: 16px; overflow: hidden; background: var(--sand); }
.grad-gallery img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  transition: transform .3s;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .grad-gallery a:hover img { transform: scale(1.03); }
}
.grad-gallery__empty {
  max-width: 60ch; padding: 24px 28px; border-radius: 20px;
  border: 1px dashed rgba(176, 141, 87, .6); background: #fff;
  font-size: 17px; line-height: 1.6; color: var(--body);
}
/* The gallery leads the page once there are photographs, on white. */
.grad-photos:not(.section--cream) .grad-gallery__empty { background: var(--cream); }

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

@media (max-width: 1024px) {
  .grad-part { grid-template-columns: 1fr; gap: 32px; }
  .grad-part__head { position: static; }
  .grad-credential { grid-template-columns: 1fr; padding: 56px; }
  .grad-credential__cert { max-width: 260px; }
}

@media (max-width: 860px) {
  .procession { columns: 1; }
}

@media (max-width: 720px) {
  .grad-hero { margin: 16px 16px 0; padding: 48px 22px 40px; border-radius: 24px; }
  .grad-hero::before { inset: 10px; border-radius: 17px; }
  /* Too narrow for the strapline and venue on one line each: they stack,
     and the separators go rather than dangle at a line end. */
  .grad-hero__strap, .grad-hero__venue { flex-direction: column; align-items: center; }
  .grad-hero .grad-hero__sep { display: none; }
  .grad-hero__strap { font-size: 15px; margin-top: 18px; gap: 2px; }
  .grad-hero__label { margin-top: 28px; }
  .grad-hero__initiative { margin-top: 30px; font-size: 13px; }

  .grad-jump { padding: 20px 16px 0; }
  .grad-jump ul { gap: 6px; }
  .grad-jump a { padding: 9px 14px; font-size: 13px; }

  .timeline { --tl-time: 46px; --tl-gap: 10px; --tl-dot: 11px; --tl-pad: 12px; --tl-first-line: 12px; }
  .timeline__time { font-size: 15px; line-height: 24px; }
  .timeline__title { font-size: 16px; line-height: 24px; }
  .timeline__note { font-size: 14px; }
  .grad-panel { padding: 22px 22px; }

  .procession__row { grid-template-columns: 32px minmax(0, 1fr); padding: 14px 2px; }
  .procession__num { font-size: 17px; }
  .procession__name { font-size: 16px; }
  .procession__company { grid-column: 2; text-align: left; margin-top: 2px; }

  /* Portrait beside the name, profile full width beneath. */
  .graduate {
    grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: auto auto;
    grid-template-areas: "photo head" "bio bio";
    column-gap: 18px; padding: 32px 0;
  }
  .graduate__photo { width: 84px; height: 84px; border-width: 2px; }
  .graduate__photo--initials { font-size: 28px; }
  .graduate__head { align-self: center; }
  .graduate__name { font-size: 21px; }
  .graduate__company { font-size: 15px; }
  .graduate__bio { margin-top: 18px; }
  .graduate__bio p { font-size: 15.5px; }

  .grad-credential { margin: 0 16px 56px; padding: 40px 24px; border-radius: 24px; gap: 36px; }
  .grad-credential__body { font-size: 16.5px; }
  .grad-levels { grid-template-columns: 1fr; gap: 8px; margin: 26px 0 30px; }
  .grad-levels__item {
    flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
    gap: 2px 12px; padding: 16px 18px; border-radius: 14px;
  }
  .grad-credential .btn { display: block; width: 100%; }
  .grad-credential__cert { max-width: 220px; }
  .grad-credential__cert img { box-shadow: 0 14px 28px rgba(0, 0, 0, .3); }

  .grad-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grad-gallery a { border-radius: 12px; }
}
