/*
 * media.css — an event's photos and videos (_includes/partials/media.njk):
 * the teaser on the event page (#gallery.media-teaser) and the media page
 * (.media-page, /<event>/media/). Filtering and the lightbox: assets/js/media.js.
 */

/* ---- tiles (photos + YouTube videos), shared by both views ---- */
.media-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--heading-color), transparent 90%);
}
.media-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.media-tile:hover img,
.media-tile:focus-visible img {
  transform: scale(1.03);
}
.media-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 10px 8px;
  font-size: 13px;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 0.2s;
}
.media-tile:hover .media-cap,
.media-tile:focus-visible .media-cap,
.media-tile.is-video .media-cap {
  opacity: 1;
}
.media-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}
.media-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  background: var(--accent-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.media-play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-35%, -50%);
  border-left: 15px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.media-meta {
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
  font-variant-numeric: tabular-nums;
}

/* ---- teaser: highlights mosaic ---- */
.media-mosaic {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
  aspect-ratio: 16 / 7;
  margin-bottom: 26px;
}
.media-mosaic .media-tile {
  border-radius: 14px;
}
.media-mosaic .media-tile:first-child {
  grid-row: span 2;
}
@media (max-width: 767px) {
  .media-mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    aspect-ratio: auto;
  }
  .media-mosaic .media-tile { aspect-ratio: 4 / 3; }
  .media-mosaic .media-tile:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 9; }
  .media-mosaic .media-tile:nth-child(n+4) { display: none; }
}

/* ---- teaser: album cards ---- */
.media-albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.media-album-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 86%);
  border-radius: 14px;
  background: var(--surface-color);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s, border-color 0.2s;
}
.media-album-card:hover,
.media-album-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-color);
}
.media-album-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: color-mix(in srgb, var(--heading-color), transparent 92%);
}
.media-album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-album-cover.is-empty {
  display: grid;
  place-items: center;
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}
.media-album-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.media-album-body {
  display: grid;
  gap: 2px;
  padding: 12px 14px 14px;
}
/* Roboto, not the heading font: Raleway has no Greek. */
.media-album-body strong {
  font-family: var(--default-font);
  font-size: 16px;
  font-weight: 700;
  color: var(--heading-color);
}
.media-cta {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.media-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 999px;
  background: var(--accent-color);
  color: var(--contrast-color, #fff);
  font-weight: 500;
}
.media-cta-btn:hover,
.media-cta-btn:focus-visible {
  color: var(--contrast-color, #fff);
  filter: brightness(1.08);
}

/* ---- media page ---- */
/* No hero behind the fixed header here: give it its scrolled (solid) look
   from the start and start the content below it. */
body:has(.media-page) .header {
  --background-color: rgba(1, 8, 33, 1);
}
.media-page {
  padding-top: var(--header-height);
  padding-bottom: 60px;
}
.media-head {
  display: grid;
  gap: 8px;
  padding-block: 34px 18px;
}
.media-crumb {
  font-size: 13px;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}
.media-crumb a {
  color: var(--accent-color);
}
.media-head h1 {
  margin: 0;
  font-family: var(--default-font);
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 700;
  color: var(--heading-color);
}
.media-head p {
  margin: 0;
  max-width: 70ch;
}
.media-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 10;
  padding-block: 10px;
  background: var(--background-color);
  border-bottom: 1px solid color-mix(in srgb, var(--heading-color), transparent 88%);
}
.media-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.media-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 80%);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.media-chip .n {
  font-size: 12px;
  color: color-mix(in srgb, var(--default-color), transparent 40%);
  font-variant-numeric: tabular-nums;
}
.media-chip[aria-pressed="true"] {
  background: var(--heading-color);
  border-color: var(--heading-color);
  color: #fff;
}
.media-chip[aria-pressed="true"] .n {
  color: rgba(255, 255, 255, 0.75);
}
.media-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
}
.media-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.media-filter .lbl {
  margin-right: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--default-color), transparent 40%);
}
.media-subchip {
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 80%);
  border-radius: 8px;
  background: transparent;
  color: var(--default-color);
  font-size: 13px;
  cursor: pointer;
}
.media-subchip[aria-pressed="true"] {
  border-color: var(--accent-color);
  color: var(--accent-color);
  font-weight: 500;
}
.media-album {
  padding-top: 26px;
}
.media-album[hidden] {
  display: none;
}
.media-album-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.media-album-head h2 {
  margin: 0;
  font-family: var(--default-font);
  font-size: 24px;
  font-weight: 700;
  color: var(--heading-color);
}
.media-open {
  margin-left: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-color);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.media-album-desc {
  max-width: 75ch;
  margin: -2px 0 14px;
  font-size: 15px;
}
/* Masonry: tiles keep their own shape (--ar from the photo's size). */
.media-grid {
  columns: 240px;
  column-gap: 10px;
}
.media-grid .media-tile {
  break-inside: avoid;
  margin-bottom: 10px;
  aspect-ratio: var(--ar);
}
.media-grid .media-tile[hidden] {
  display: none;
}
/* The overview ("All") shows each album's first photos; media.js adds the
   class and the "whole album" button. */
.media-album.is-collapsed .media-tile:nth-child(n+9) {
  display: none;
}
.media-empty {
  padding: 30px 20px;
  border: 1px dashed color-mix(in srgb, var(--heading-color), transparent 75%);
  border-radius: 14px;
  text-align: center;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
@media (max-width: 575px) {
  .media-grid { columns: 2; column-gap: 8px; }
  .media-grid .media-tile { margin-bottom: 8px; }
  .media-album-head h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .media-tile img, .media-album-card { transition: none; }
}
