/* Gallery & Multimedia Styles with Refined Admissions Typography */
.award-grade {
  line-height: 1.5;
}

.award-desc small {
  display: block;
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
}

.certificate-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 48px 0 22px;
}

.certificate-heading h3 {
  font-size: 30px;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.certificate-heading p {
  font-size: 14px;
  color: var(--muted);
  max-width: 440px;
  line-height: 1.7;
}

.certificate-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.certificate-card {
  display: block;
  text-align: left;
  background: none;
  padding: 0;
  width: 100%;
  min-width: 0;
}

.certificate-card .certificate-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1.06;
  background: #efeee5;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: background 0.2s, transform 0.2s;
}

.certificate-card:hover .certificate-cover {
  background: #e2e7d5;
  transform: translateY(-3px);
}

.certificate-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #253d3212);
}

.certificate-card strong {
  font-size: 13px;
  line-height: 1.45;
  display: block;
  margin-top: 11px;
  font-weight: 600;
  color: var(--ink);
}

.certificate-card small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
  line-height: 1.4;
}

.award-certificate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 23px 0;
}

.award-certificate-grid .certificate-cover {
  aspect-ratio: 1.2;
}

.photo-jump {
  display: table;
  margin-top: 18px;
}

.photography-section {
  background: #eeeee5;
  border-bottom: 1px solid var(--line);
}

.photography-section .section-heading {
  margin-bottom: 35px;
}

.photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.photo-toolbar .filter-row {
  margin-bottom: 0;
  flex-wrap: wrap;
}

.photo-count {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.photo-grid {
  columns: 3;
  column-gap: 25px;
}

.photograph {
  break-inside: avoid;
  margin: 0 0 32px;
  display: inline-block;
  width: 100%;
  vertical-align: top;
}

.photo-button {
  padding: 0;
  background: transparent;
  display: block;
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.photo-button img {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 0.25s;
  aspect-ratio: var(--image-ratio);
  object-fit: contain;
  background: #d9dbcf;
}

.photo-button:hover img {
  filter: brightness(1.08);
}

.photo-expand {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: #fffdf2e8;
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  font-size: 20px;
}

.photo-button:hover .photo-expand, .photo-button:focus-visible .photo-expand {
  opacity: 1;
  transform: translateY(0);
}

.photograph figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 13px;
  padding-top: 12px;
}

.photograph figcaption strong {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.02em;
}

.photograph figcaption small {
  font-size: 11.5px;
  color: var(--muted);
}

.photo-colophon {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #ccd0bf;
  padding-top: 20px;
  margin-top: 10px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.media-dialog {
  width: min(1120px, calc(100% - 36px));
  padding: 24px 28px 18px;
  max-height: calc(100dvh - 30px);
  background: #f7f6ef;
  border-radius: 10px;
}

.media-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 20px;
}

.media-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e7e7dd;
  border-radius: 6px;
  min-height: 180px;
  overflow: hidden;
}

.media-stage img {
  max-height: calc(100dvh - 240px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.media-dialog.certificate-view .media-stage {
  background: #e7e8df;
}

.media-loading {
  position: absolute;
  left: 0;
  right: 0;
  top: 45%;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--paper);
  padding: 8px 14px;
  width: fit-content;
  margin: auto;
  border-radius: 4px;
}

.media-caption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 25px;
  padding: 18px 0 12px;
}

.media-caption h2 {
  font-size: 22px;
  letter-spacing: -0.025em;
  line-height: 1.3;
  max-width: 760px;
  font-weight: 600;
}

.media-caption p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.media-caption a {
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid #a6b39d;
  white-space: nowrap;
  padding-bottom: 2px;
  margin-top: 4px;
  color: var(--ink);
  transition: color 0.15s, border-color 0.15s;
}

.media-caption a:hover {
  color: var(--orange);
  border-color: var(--orange);
}

.media-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 12px;
  color: var(--muted);
  gap: 20px;
}

.media-controls button {
  background: none;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
  color: var(--ink);
  transition: color 0.15s;
}

.media-controls button:disabled {
  opacity: 0.3;
  cursor: default;
}

.media-controls button:hover:not(:disabled) {
  color: var(--orange);
}

@media (max-width: 1100px) {
  .header nav {
    gap: 15px;
  }
  .certificate-gallery {
    gap: 12px;
  }
  .certificate-card .certificate-cover {
    padding: 8px;
  }
  .photo-grid {
    column-gap: 19px;
  }
}

@media (max-width: 760px) {
  .certificate-heading {
    display: block;
    margin-top: 34px;
  }
  .certificate-heading h3 {
    font-size: 26px;
  }
  .certificate-heading p {
    margin-top: 12px;
    font-size: 13.5px;
  }
  .certificate-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 16px;
  }
  .certificate-gallery .certificate-card:last-child {
    grid-column: 1 / -1;
    max-width: calc(50% - 8px);
  }
  .certificate-card strong {
    font-size: 12.5px;
  }
  .certificate-card .certificate-cover {
    aspect-ratio: 1.1;
    padding: 10px;
  }
  .award-certificate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .photo-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .photo-toolbar .filter-row {
    gap: 6px;
  }
  .photo-toolbar .filter {
    font-size: 11.5px;
    padding: 7px 13px;
  }
  .photo-grid {
    columns: 2;
    column-gap: 16px;
  }
  .photograph {
    margin-bottom: 24px;
  }
  .photograph figcaption {
    display: block;
    padding-top: 10px;
  }
  .photograph figcaption strong {
    font-size: 13.5px;
  }
  .photograph figcaption small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
  }
  .photo-expand {
    opacity: 1;
    width: 28px;
    height: 28px;
    font-size: 17px;
    bottom: 9px;
    right: 9px;
  }
  .photo-colophon {
    font-size: 10.5px;
    line-height: 1.7;
    flex-direction: column;
    gap: 3px;
  }
  .media-dialog {
    padding: 16px;
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }
  .media-stage img {
    max-height: calc(100dvh - 270px);
  }
  .media-caption {
    flex-direction: column;
    gap: 8px;
    padding: 14px 0;
  }
  .media-caption h2 {
    font-size: 20px;
  }
  .media-caption a {
    margin-top: 0;
    font-size: 12px;
  }
  .media-top .eyebrow {
    font-size: 11px;
  }
  .media-controls button {
    gap: 8px;
  }
  .media-top {
    margin-bottom: 10px;
  }
}

@media (max-width: 390px) {
  .photo-grid {
    column-gap: 12px;
  }
  .filter-row {
    gap: 5px;
  }
  .photo-toolbar .filter {
    font-size: 11px;
    padding: 7px 11px;
  }
  .photograph figcaption strong {
    font-size: 12.5px;
  }
  .award-certificate-grid {
    grid-template-columns: 1fr;
  }
  .award-certificate-grid .certificate-cover {
    max-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-button img, .photo-expand, .certificate-cover {
    transition: none;
  }
}

@media print {
  .photography-section {
    background: white;
  }
  .photo-grid {
    columns: 3;
  }
  .photo-button {
    display: block !important;
  }
  .photo-expand, .media-dialog {
    display: none !important;
  }
  .certificate-gallery {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .certificate-card {
    display: block !important;
  }
  .photo-colophon {
    font-size: 9px;
  }
  .photography-section .section-space {
    padding: 25px 0;
  }
}

/* Event Video Feature Section */
.event-video-feature {
  display: grid;
  grid-template-columns: 0.8fr 1.6fr;
  gap: 46px;
  align-items: center;
  border-top: 1px solid #cdd4c1;
  margin-top: 48px;
  padding-top: 46px;
  scroll-margin-top: 125px;
}

.event-video-copy .eyebrow {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 20px;
}

.event-video-copy h3 {
  font-size: clamp(34px, 4vw, 50px);
  letter-spacing: -0.04em;
  font-weight: 600;
}

.event-video-copy h3 em {
  color: var(--orange);
}

.event-video-copy > p:not(.eyebrow) {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 20px;
  max-width: 330px;
}

.event-video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #556754;
  margin-top: 23px;
}

.event-project-link {
  display: flex;
  align-items: center;
  gap: 24px;
  background: transparent;
  border-bottom: 1px solid #aab79d;
  font-size: 13px;
  font-weight: 600;
  padding: 0 0 5px;
  margin-top: 24px;
  color: var(--ink);
  transition: color 0.15s;
}

.event-project-link:hover {
  color: var(--orange);
}

.event-video-figure {
  margin: 0;
  min-width: 0;
}

.event-video-figure video, .detail-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 544;
  background: #17281f;
  object-fit: contain;
  border-radius: 6px;
}

.event-video-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  padding-top: 10px;
}

.event-video-figure figcaption a {
  border-bottom: 1px solid #b7c2ab;
  white-space: nowrap;
}

.detail-video {
  margin-top: 20px;
}

.library-controls {
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .event-video-feature {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 33px;
    margin-top: 33px;
  }
  .event-video-copy h3 {
    font-size: 36px;
  }
  .event-video-copy > p:not(.eyebrow) {
    max-width: none;
    font-size: 14px;
  }
  .event-video-meta {
    margin-top: 17px;
    font-size: 10.5px;
  }
  .event-project-link {
    margin-top: 17px;
    font-size: 12.5px;
  }
  .event-video-copy .eyebrow {
    margin-bottom: 15px;
  }
  .event-video-figure figcaption {
    font-size: 11px;
    gap: 10px;
  }
  .library-controls {
    gap: 8px;
  }
  .library-controls .filter {
    font-size: 11.5px;
    padding: 7px 13px;
  }
}

@media print {
  .event-video-feature {
    display: block;
  }
  .event-video-figure video, .event-video-meta {
    display: none;
  }
  .event-video-figure:before {
    content: 'USIYPT presentation video available on the website.';
    font-size: 11px;
  }
}
