/*
  home.css — Homepage photo mosaic (index.html only)
  ───────────────────────────────────────────────────
  Loaded after main.css; uses its tokens. Replaces the old tilted
  .hero-frame slideshow (those rules in main.css are now unused).

    .hm            mosaic wrapper (right column of the hero)
    .hm-main       large tile — cycles photos, caption + album link
    .hm-side       two small tiles — cycle their own photos
    .hm-progress   thin bar showing time until the next main photo
    .hm-pause      pause / play (required for auto-changing content)
*/

.hm {
  position: relative;
  width: 100%;
}
/* Soft colour blobs behind the tiles */
.hm::before,
.hm::after {
  content: '';
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}
.hm::before {
  width: 46%;
  aspect-ratio: 1;
  top: -7%;
  right: -8%;
  background: var(--accent-yellow);
  opacity: 0.28;
}
.hm::after {
  width: 26%;
  aspect-ratio: 1;
  bottom: 6%;
  left: -7%;
  background: var(--accent-green);
  opacity: 0.22;
}

.hm-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  aspect-ratio: 1.15;
}
.hm-tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--brand-light);
  box-shadow: 0 18px 50px rgba(0, 49, 105, 0.16), 0 3px 10px rgba(0, 0, 0, 0.06);
}
.hm-main { grid-row: 1 / 3; }
.hm-side:nth-of-type(2) { border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 8px; }
.hm-side:nth-of-type(3) { border-radius: 8px var(--radius-lg) var(--radius-lg) var(--radius-lg); }

.hm-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}
.hm-slide.is-active { opacity: 1; }
.hm-main .hm-slide.is-active { animation: hm-zoom 7s ease-out both; }
@keyframes hm-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }

/* Dark fade at the bottom so the caption stays readable on any photo */
.hm-main::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0, 24, 69, 0), rgba(0, 24, 69, 0.78));
  pointer-events: none;
}

.hm-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  color: #fff;
}
.hm-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  opacity: 0.85;
}
.hm-event {
  display: block;
  margin-top: 2px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}
.hm-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hm-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.hm-progress {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 66px;
  z-index: 2;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.hm-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transform-origin: left;
  transform: scaleX(0);
}
.hm-progress.is-running span { animation: hm-progress var(--hm-dur, 5.4s) linear forwards; }
.hm.is-paused .hm-progress span { animation-play-state: paused; }
@keyframes hm-progress { to { transform: scaleX(1); } }

.hm-pause {
  position: absolute;
  top: 6px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 24, 69, 0.45);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.hm-pause:hover { background: rgba(0, 24, 69, 0.7); }

.hm-more {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 16px;
  float: right;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
}
.hm-more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* "Est. Aug 2009" badge (styled by main.css) sits over the tiles */
.hm .hero-float-badge { z-index: 3; top: 38%; bottom: auto; left: -34px; }

/* ── Tablet / phone: hero stacks; show the mosaic under the text ── */
@media (max-width: 900px) {
  .hm { max-width: 600px; margin: 8px auto 0; }
  .hm-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    aspect-ratio: auto;
    gap: 10px;
  }
  .hm-main { grid-row: auto; grid-column: 1 / 3; aspect-ratio: 4 / 3; }
  .hm-side { aspect-ratio: 4 / 3; }
  .hm-side:nth-of-type(2),
  .hm-side:nth-of-type(3) { border-radius: var(--radius-md); }
  .hm .hero-float-badge { display: none; }
  .hm::before { top: -4%; right: -4%; }
  .hm::after { left: -4%; }
}
@media (max-width: 600px) {
  .hm-event { font-size: 16px; }
  .hm-caption { left: 14px; right: 14px; bottom: 14px; }
  .hm-progress { left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-slide { transition: none; }
  .hm-main .hm-slide.is-active { animation: none; }
  .hm-progress, .hm-pause { display: none; }
  .hm-link { transition: none; }
}
