/* Shared navigation controls and consistent camp portrait framing. */
.site-footer .back-to-top,
.course-footer .back-to-top {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  min-width: 52px;
  min-height: 52px;
  max-width: 100%;
  padding: 12px 20px;
  border: 1px solid #ffffff85;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: 700 16px/1.4 'PT Sans', Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s;
}
.site-footer .back-to-top:hover,
.course-footer .back-to-top:hover {
  background: #397a74;
  border-color: #397a74;
  text-decoration: none;
}
footer .back-to-top:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
footer .back-to-top svg { display: block; flex: none; width: 22px; height: 22px; }

.team-grid .portrait {
  position: relative;
  flex: none;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #fff;
}
.team-grid .portrait img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
  object-position: center;
}

/* A clear reading order for the programme card, including narrow screens. */
.event-card { align-items: start; }
.event-card .event-copy { min-width: 0; text-align: left; }
.event-card .event-copy h3 {
  color: #061b39;
  line-height: 1.18;
  margin: 0 0 20px;
  text-wrap: balance;
}
.event-title-ending { display: block; }
.event-card .event-when {
  display: grid;
  gap: 4px;
  margin: 0;
  line-height: 1.45;
}
.event-when strong { color: #276861; font-size: 1.1875rem; font-weight: 700; }
.event-when span { color: #425768; font-size: 1rem; }
.event-card .event-description { margin: 22px 0 0; font-size: 1.125rem; line-height: 1.65; }
.event-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px 24px;
  margin: 24px 0 0;
  padding: 20px 0;
  border-top: 1px solid #061b3926;
  border-bottom: 1px solid #061b3926;
}
.event-facts > div { min-width: 0; }
.event-facts dt { color: #425768; font-size: .875rem; line-height: 1.45; }
.event-facts dd { margin: 4px 0 0; color: #061b39; font-size: 1.0625rem; line-height: 1.45; font-weight: 700; }
.event-card .event-audience { display: grid; gap: 8px; margin: 18px 0 0; color: #425768; font-size: 1rem; line-height: 1.55; }
.event-card .text-cta { justify-content: flex-start; text-align: left; margin-top: 26px; }
@media (max-width: 540px) {
  .event-card .event-copy h3 { font-size: 1.625rem; margin-bottom: 18px; }
  .event-card .event-description { margin-top: 20px; }
  .event-facts { gap: 16px 20px; margin-top: 22px; padding-block: 18px; }
  .event-section .text-cta { margin-top: 30px; }
}

/* Matching desktop tiles, regardless of the original photograph dimensions. */
@media (min-width: 821px) {
  .gallery { align-items: start; gap: 24px; }
  .gallery .gallery-item { aspect-ratio: 4 / 3; overflow: hidden; }
  .gallery .gallery-wide { grid-column: auto; }
  .gallery .gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
  .school-gallery { align-items: start; gap: 28px 24px; }
  .school-gallery figure { min-width: 0; margin: 0; }
  .school-gallery img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
  }
  .school-gallery figcaption { min-height: 3.6em; }
}

/* Two identical groups make the slow left-to-right loop seamless. */
.brand-ribbon { --ribbon-gap: 34px; gap: 0; }
.brand-ribbon-track {
  display: flex;
  flex: none;
  width: max-content;
  animation: bridge-ribbon-right 90s linear infinite;
}
.brand-ribbon-group {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-around;
  gap: var(--ribbon-gap);
  min-width: 100vw;
  padding-right: var(--ribbon-gap);
}
.brand-ribbon:hover .brand-ribbon-track { animation-play-state: paused; }
@keyframes bridge-ribbon-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}
@media (max-width: 540px) { .brand-ribbon { --ribbon-gap: 25px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .site-footer .back-to-top, .course-footer .back-to-top { transition: none; }
  .brand-ribbon-track { animation: none; transform: none; }
}
@media print {
  footer .back-to-top { display: none !important; }
  .brand-ribbon-track { animation: none; transform: none; }
}
.site-header #main-nav a[href="/ai-course.html"] {
  max-width: 23ch;
  white-space: normal;
  line-height: 1.25;
}
@media (max-width: 800px) {
  .site-header #main-nav a[href="/ai-course.html"] { max-width: none; }
}
