@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap');

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --primary: #B20738;
  --secondary-1: #D0C8A8;
  --secondary-2: #EBC73B;
  --dark: #1a1a1a;
  --light: #f9f7f2;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.18);
  --radius: 12px;
  --transition: 0.3s ease;
  --navbar-height: 72px;
  /* Set by announcement.js when a message is shown (matches bar height) */
  --announcement-band: 0px;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Bitter', Georgia, serif;
  color: var(--dark);
  background: var(--light);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

ul { list-style: none; }

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background:
    radial-gradient(
      circle 180px at var(--nav-mx, -200px) var(--nav-my, 50%),
      rgba(235, 199, 59, 0.55) 0%,
      rgba(235, 199, 59, 0.2) 40%,
      transparent 70%
    ),
    var(--secondary-1);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: visible;
}

.navbar__inner {
  max-width: full;
  margin: 0 auto;
  padding: 0 2rem;
  padding-right: 73.4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  white-space: nowrap;
}

.navbar__logo-wrapper {
  position: relative;
  z-index: 1001;
  align-self: flex-start;
  flex-shrink: 0;
  margin-right: 2rem;
  margin-left: clamp(-880000px, calc((12000px - 100vw) / 2.18), 0px);
  background: radial-gradient(
    circle,
    rgba(178, 7, 56, 0.45) 0%,
    rgba(178, 7, 56, 0.15) 40%,
    transparent 70%
  );
}

.navbar__logo-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(70px, 15.8vw, 220px);
  height: clamp(70px, 15.8vw, 220px);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(178, 7, 56, 0.45) 0%,
    rgba(178, 7, 56, 0.15) 40%,
    transparent 70%
  );
  z-index: -1;
  pointer-events: none;
}

.navbar__logo {
  height: clamp(100px, 12.64vw, 176px);
  width: auto;
  position: relative;
  top: 4px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  transition: transform var(--transition);
  margin-left: 10px;
}

.navbar__logo:hover {
  transform: scale(1.05);
}

.navbar__links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.navbar__link {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--primary);
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition);
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: width var(--transition);
}

.navbar__link:hover::after,
.navbar__link--active::after {
  width: 100%;
}

.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.navbar__hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Announcement ticker (under navbar, all pages) ─── */
.announcement {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  z-index: 999;
  height: var(--announcement-band);
  overflow: hidden;
  background: linear-gradient(90deg, #8e052d 0%, var(--primary) 50%, #8e052d 100%);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-family: 'Bitter', Georgia, serif;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
}

.announcement__viewport {
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 2%, #000 98%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 2%, #000 98%, transparent 100%);
}

.announcement__track {
  display: flex;
  width: max-content;
  flex-shrink: 0;
  animation: announcement-marquee 45s linear infinite;
  will-change: transform;
}

.announcement__chunk {
  flex-shrink: 0;
  padding-right: 4rem;
  white-space: nowrap;
}

@keyframes announcement-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .announcement__track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 0.35rem 0.75rem;
  }

  .announcement__chunk {
    padding-right: 0;
    white-space: normal;
  }

  .announcement__chunk[aria-hidden='true'] {
    display: none;
  }
}

/* ── Hero Section (Home) ────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: calc(var(--navbar-height) + var(--announcement-band));
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 2rem;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.02em;
  animation: fadeInUp 1s ease forwards;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 400;
  margin-top: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 1s ease 0.3s forwards;
  opacity: 0;
}

/* ── Page Hero (smaller, for About/Eboard) ──────────── */
.page-hero {
  margin-top: calc(var(--navbar-height) + var(--announcement-band));
  padding: 5rem 2rem 3rem;
  background: var(--primary);
  color: var(--white);
  text-align: center;
}

.page-hero__title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
}

.page-hero__subtitle {
  font-size: 1.1rem;
  margin-top: 0.5rem;
  opacity: 0.85;
}

/* ── Sections ───────────────────────────────────────── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section__heading {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1rem;
}

.section__divider {
  width: 60px;
  height: 4px;
  background: var(--secondary-2);
  border-radius: 2px;
  margin: 0 auto 2.5rem;
}

.section__text {
  max-width: 750px;
  margin: 0 auto;
  text-align: left;
  font-size: 1.08rem;
  color: #444;
  line-height: 1.85;
}

/*
 * Safe zone (Upcoming Events / calendar): extra space so thumbs can scroll the page
 * past this dense, interactive block without accidentally opening an event on the way
 * to the footer. Vertical room + slightly wider side gutters than generic sections.
 */
.section--events {
  padding-top: 6rem;
  padding-bottom: 6.5rem;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

/* ── Calendar ───────────────────────────────────────── */
.calendar-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  .calendar-wrapper {
    overflow-x: clip;
  }
}

.calendar-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  .calendar-body {
    overflow-x: clip;
  }
}

.calendar-body .calendar-grid {
  flex: 1;
  min-width: 0;
}

/* Touch: bias toward vertical page scroll on the dense grid (not an iframe, but same gesture conflict). */
@media (hover: none) and (pointer: coarse) {
  .calendar-body,
  .calendar-grid,
  .calendar-grid__day,
  .calendar-event,
  .calendar-event--multiday {
    touch-action: pan-y;
  }

  .calendar-toolbar,
  .calendar-legend {
    touch-action: manipulation;
  }
}

/* ── Calendar Legend ────────────────────────────────── */
.calendar-legend {
  width: 200px;
  flex-shrink: 0;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calendar-legend__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary-1);
}

.calendar-legend__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.25rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
  user-select: none;
}

.calendar-legend__item:hover {
  background: #f5f3ee;
}

.calendar-legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.calendar-legend__label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--dark);
  line-height: 1.3;
  transition: color var(--transition), text-decoration var(--transition);
}

.calendar-legend__item--active .calendar-legend__label {
  color: var(--dark);
}

.calendar-legend__item--hidden .calendar-legend__swatch {
  opacity: 0.25;
}

.calendar-legend__item--hidden .calendar-legend__label {
  text-decoration: line-through;
  color: #aaa;
}

/* ── Calendar loading indicator ────────────────────── */
.calendar-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: #888;
  animation: calLoadFadeIn 0.3s ease;
}

.calendar-loading__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary-2);
  animation: calLoadBounce 1.2s ease-in-out infinite;
}

.calendar-loading__dot:nth-child(2) {
  animation-delay: 0.15s;
}

.calendar-loading__dot:nth-child(3) {
  animation-delay: 0.3s;
}

.calendar-loading__text {
  margin-left: 0.35rem;
  font-style: italic;
}

@keyframes calLoadBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes calLoadFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* First-time visitor: more prominent loading state */
.calendar-loading--first {
  padding: 1.5rem 1rem;
  font-size: 0.95rem;
  color: #666;
}

.calendar-loading--first .calendar-loading__dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.calendar-toolbar__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.calendar-toolbar__nav {
  display: flex;
  gap: 0.5rem;
}

.btn {
  font-family: 'Bitter', serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  border: 2px solid var(--primary);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  color: var(--primary);
}

.btn:hover {
  background: var(--primary);
  color: var(--white);
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
}

.btn--primary:hover {
  background: #8e052d;
  border-color: #8e052d;
}

.btn--download {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn--download:hover {
  background: #8e052d;
  border-color: #8e052d;
  color: var(--white);
}

.btn--small {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}

.calendar-import {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
}

.calendar-import input[type="text"] {
  font-family: 'Bitter', serif;
  padding: 0.5rem 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  flex: 1;
  min-width: 200px;
  transition: border-color var(--transition);
}

.calendar-import input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

.calendar-import label.btn {
  position: relative;
  overflow: hidden;
}

.calendar-import label.btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto;
  /* Grow rows vertically for stacked events; width stays within 7 equal columns */
  grid-auto-rows: minmax(80px, auto);
  gap: 2px;
  background: #e0ddd4;
  border-radius: var(--radius);
  overflow-x: clip;
  overflow-y: visible;
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
  align-items: stretch;
  justify-items: stretch;
}

.calendar-grid__header {
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  padding: 0.75rem 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-grid__day {
  background: var(--white);
  padding: 0.5rem;
  position: relative;
  cursor: default;
  overflow-x: hidden;
  overflow-y: visible;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 80px;
  min-width: 0;
  align-self: stretch;
  height: 100%;
  box-sizing: border-box;
}

.calendar-grid__day:hover {
  background: #faf8f3;
}

.calendar-grid__day--empty {
  background: #f5f3ee;
}

.calendar-grid__day--today {
  background: #fff7e0;
  box-shadow: inset 0 0 0 2px var(--secondary-2);
}

.calendar-grid__day-number {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
  flex-shrink: 0;
}

.calendar-grid__day--today .calendar-grid__day-number {
  color: var(--primary);
  font-weight: 800;
}

.calendar-grid__events {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: hidden;
}

.calendar-event {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--white);
  cursor: pointer;
  transition: filter var(--transition);
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
}

.calendar-event:hover {
  filter: brightness(0.85);
}

.calendar-event--multiday {
  align-self: start;
  z-index: 2;
  padding: 0 8px;
  color: #fff;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.7rem;
  font-weight: 500;
  height: 20px;
  line-height: 20px;
  border-radius: 4px;
  transition: filter var(--transition);
  min-width: 0;
  max-width: 100%;
}

.calendar-event--multiday:hover {
  filter: brightness(0.85);
}

/* Event detail popup */
.event-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  pointer-events: none;
}

.event-popup.active {
  display: flex;
  pointer-events: auto;
}

.event-popup__card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 450px;
  width: 90%;
  position: relative;
  animation: scaleIn 0.25s ease;
}

.event-popup__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.event-popup__detail {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.event-popup__detail strong {
  color: var(--dark);
}

.event-popup__card .event-popup__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  transition: color var(--transition);
}

.event-popup__close:hover {
  color: var(--primary);
}

/* ── Cards (Workshops / General) ────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--secondary-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
  overflow: hidden;
  min-height: 0;
}

/* Photo cards: height follows image so .card__body is never overlapped */
.card__image--natural {
  height: auto;
  min-height: 200px;
  padding: 0;
  display: block;
  background: linear-gradient(135deg, #B20738 0%, #EBC73B 100%);
}

.card__image-photo {
  width: 100%;
  height: auto;
  max-height: min(52vh, 420px);
  object-fit: contain;
  object-position: center;
  display: block;
}

.card__body {
  padding: 1.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.card__tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  background: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.card__tag--gold {
  background: var(--secondary-2);
  color: var(--dark);
}

.card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.card__text {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.7;
}

/* ── Eboard Cards ───────────────────────────────────── */
.eboard-list {
  max-width: full;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.eboard-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow var(--transition);
}

.eboard-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.eboard-card:hover {
  box-shadow: var(--shadow-lg);
}

.eboard-card:nth-child(even) {
  flex-direction: row-reverse;
}

.eboard-card__photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  border: 4px solid var(--secondary-2);
  transition: transform var(--transition), border-color var(--transition);
  background: var(--secondary-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--primary);
  overflow: hidden;
}

.eboard-card__photo:hover {
  transform: scale(1.07);
  border-color: var(--primary);
}

.eboard-card__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eboard-card__info {
  flex: 1;
}

.eboard-card__name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.eboard-card__role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary-2);
  margin-bottom: 0.75rem;
}

.eboard-card__bio {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.7;
}

/* ── Eboard Modal ───────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 550px;
  width: 100%;
  overflow: hidden;
  animation: scaleIn 0.3s ease;
}

/* Eboard profile modal: gallery (left) + text (right) */
.modal--eboard {
  position: relative;
  max-width: min(1200px, 96vw);
  padding: 0;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.38);
}

.modal--eboard .modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 6;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--primary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.15s ease;
}

.modal--eboard .modal__close:hover {
  background: var(--primary);
  color: var(--white);
}

.modal__body--eboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 500px;

  padding: 0;
}

.modal__gallery {
  position: relative;
  background: #D0C8A8;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Tiny GIF decorations: transforms live on .modal__gallery-deco-wrap, not the <img>, so animated GIFs keep playing. */
.modal__gallery-deco-wrap {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  user-select: none;
  transform-origin: center center;
}

.modal__gallery-deco {
  display: block;
  height: auto;
  max-width: 100%;
  -webkit-user-drag: none;
  user-select: none;
  /* Do not add transform, filter, or opacity here — breaks GIF animation in many browsers */
}

.modal__gallery-main {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 2.75rem 2.5rem;
  box-sizing: border-box;
}

.modal__gallery-img {
  max-width: 100%;
  max-height: min(62vh, 700px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal__gallery-emoji {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--secondary-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  line-height: 1;
}

.modal__gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: var(--white);
  color: var(--primary);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition), color var(--transition), transform 0.15s ease;
}

.modal__gallery-nav:hover {
  background: var(--primary);
  color: var(--white);
}

.modal__gallery-nav--prev {
  left: 0.5rem;
}

.modal__gallery-nav--next {
  right: 0.5rem;
}

.modal__gallery-nav[hidden] {
  display: none;
}

.modal__gallery-counter {
  position: absolute;
  bottom: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dark);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.modal__gallery-counter[hidden] {
  display: none;
}

.modal__aside {
  padding: 2rem 1.75rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
}

.modal--eboard .modal__name {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 2.25rem 0 0;
  line-height: 1.25;
}

.modal--eboard .modal__role {
  font-size: 1rem;
  margin: 0.35rem 0 0.85rem;
  font-weight: 600;
  color: var(--secondary-2);
  opacity: 1;
}

.modal--eboard .modal__description {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.75;
  margin: 0;
}

.modal--eboard .modal__description p + p {
  margin-top: 0.65em;
}

.modal--eboard .modal__description ul,
.modal--eboard .modal__description ol {
  margin: 0.5em 0 0;
  padding-left: 1.25em;
}

.modal--eboard .modal__description ul {
  list-style: disc;
}

.modal--eboard .modal__description ol {
  list-style: decimal;
}

.modal--eboard .modal__description a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

@keyframes modal-bio-link-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.modal__bio-link {
  margin: 0.85rem 0 0;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
}

.modal__bio-link__sep {
  color: var(--dark);
  opacity: 0.4;
  font-weight: 400;
  user-select: none;
}

.modal__bio-link[hidden] {
  display: none !important;
}

.modal__bio-link a {
  display: inline-block;
  color: #B20738;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  animation: modal-bio-link-float 10.8s ease-in-out infinite;
}

.modal__bio-link a:hover,
.modal__bio-link a:visited,
.modal__bio-link a:focus,
.modal__bio-link a:active {
  color: #B20738;
  font-weight: 700;
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .modal__bio-link a {
    animation: none;
  }
}


/* ── Footer ─────────────────────────────────────────── */
.footer {
  background: var(--dark);
  color: var(--secondary-1);
  padding: 2.5rem 2rem;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer__left {
  font-size: 0.9rem;
  opacity: 0.85;
}

.footer__left a {
  color: var(--secondary-1);
  text-decoration: none;
  transition: color var(--transition);
}

.footer__left a:hover {
  color: var(--secondary-2);
}

.footer__left a:visited {
  color: var(--secondary-1);
}

.footer__socials {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.footer__social-label {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary-1);
  letter-spacing: 0.04em;
  opacity: 0.95;
}

.footer__social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: flex-end;
}

.footer__social-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--secondary-1);
  text-decoration: none;
  transition: color var(--transition);
  opacity: 0.85;
}

.footer__social-link:hover {
  color: var(--secondary-2);
  opacity: 1;
}

.footer__social-link:visited {
  color: var(--secondary-1);
}

.footer__social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.footer__affiliation {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  opacity: 0.75;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.footer__affiliation-logos {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer__affiliation-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
}

.footer__affiliation-x {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary-1);
  line-height: 1;
}

.footer__disclaimer {
  width: 100%;
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 1rem;
  color: var(--secondary-1);
  font-style: italic;
}

.footer__credit {
  width: 100%;
  text-align: right;
  font-size: 0.65rem;
  opacity: 0.45;
  margin-top: 0.75rem;
  color: var(--secondary-1);
}

.footer__credit a {
  color: var(--secondary-1);
  text-decoration: none;
  transition: color var(--transition);
}

.footer__credit a:hover {
  color: var(--secondary-2);
  opacity: 1;
}

.footer__credit a:visited {
  color: var(--secondary-1);
}

/* ── Paw trail ──────────────────────────────────────── */
.paw-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  overflow: hidden;
}

.paw-trail__print {
  position: absolute;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.paw-trail__print img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.paw-trail__print--fade {
  opacity: 0;
}

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive — Tablet ───────────────────────────── */
@media (max-width: 768px) {
  :root {
    --navbar-height: 64px;
  }

  .navbar__inner {
    padding: 0 1rem;
    height: 64px;
  }

  .navbar__links {
    display: none;
    position: absolute;
    top: calc(64px + var(--announcement-band));
    left: 0;
    width: 100%;
    background: var(--secondary-1);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }

  .navbar__links.open {
    display: flex;
  }

  .navbar__hamburger {
    display: flex;
  }

  .hero {
    height: 70vh;
    min-height: 360px;
    margin-top: calc(var(--navbar-height) + var(--announcement-band));
  }

  .page-hero {
    margin-top: calc(var(--navbar-height) + var(--announcement-band));
    padding: 3.5rem 1.5rem 2rem;
  }

  .page-hero__subtitle {
    font-size: 0.95rem;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .section--events {
    padding-top: 3.75rem;
    padding-bottom: 4.5rem;
    padding-left: max(2rem, env(safe-area-inset-left, 0px) + 1rem);
    padding-right: max(2rem, env(safe-area-inset-right, 0px) + 1rem);
  }

  .section__text {
    font-size: 1rem;
  }

  .calendar-body {
    flex-direction: column;
  }

  .calendar-legend {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem 1rem;
  }

  .calendar-legend__title {
    width: 100%;
    margin-bottom: 0.25rem;
    padding-bottom: 0.35rem;
  }

  .calendar-toolbar__title {
    font-size: 1.3rem;
  }

  .btn--small {
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
  }

  .calendar-grid {
    grid-auto-rows: minmax(56px, auto);
  }

  .calendar-grid__day {
    padding: 0.3rem;
    min-height: 56px;
  }

  .calendar-grid__header {
    font-size: 0.7rem;
    padding: 0.5rem 0.15rem;
  }

  .calendar-event {
    font-size: 0.6rem;
    padding: 1px 3px;
  }

  .calendar-event--multiday {
    font-size: 0.6rem;
    padding: 0 3px;
    height: 16px;
    line-height: 16px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .card__image {
    height: 170px;
  }

  .card__image--natural {
    height: auto;
    min-height: 170px;
  }

  .card__body {
    padding: 1.25rem;
  }

  .eboard-card {
    flex-direction: column !important;
    text-align: center;
    padding: 1.5rem;
    gap: 1.25rem;
  }

  .eboard-card__photo {
    width: 120px;
    height: 120px;
    font-size: 2.5rem;
  }

  .eboard-card__name {
    font-size: 1.3rem;
  }

  .eboard-card__bio {
    font-size: 0.9rem;
  }

  .eboard-list {
    gap: 2rem;
  }

  .modal-overlay {
    padding: 1rem;
  }

  .modal__body--eboard {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .modal__aside {
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.5rem 1.25rem;
    text-align: center;
  }

  .modal--eboard .modal__name {
    margin-right: 0;
  }

  .modal__gallery-main {
    min-height: 200px;
    padding: 1rem 2.5rem 2.25rem;
  }

  .modal__gallery-img {
    max-height: 45vh;
  }

  .event-popup__card {
    padding: 1.5rem;
  }

  .event-popup__title {
    font-size: 1.15rem;
  }

  .event-popup__detail {
    font-size: 0.88rem;
  }

  .footer {
    padding: 2rem 1.5rem;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .footer__left {
    font-size: 0.82rem;
  }

  .footer__affiliation {
    justify-content: center;
  }

  .footer__socials {
    align-items: center;
    gap: 0.5rem;
  }

  .footer__social-row {
    justify-content: center;
    gap: 1rem;
  }

  .footer__social-link {
    font-size: 0.8rem;
  }

  .footer__credit {
    text-align: center;
  }
}

/* ── Responsive — Phone ───────────────────────────── */
@media (max-width: 480px) {
  :root {
    --navbar-height: 56px;
  }

  .navbar__inner {
    height: 56px;
  }

  .navbar__links {
    top: calc(56px + var(--announcement-band));
    padding: 1.25rem 1.5rem;
  }

  .hero {
    height: 55vh;
    min-height: 300px;
    margin-top: calc(var(--navbar-height) + var(--announcement-band));
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__subtitle {
    font-size: 0.9rem;
  }

  .page-hero {
    margin-top: calc(var(--navbar-height) + var(--announcement-band));
    padding: 2.5rem 1rem 1.5rem;
  }

  .announcement {
    font-size: 0.78rem;
  }

  .page-hero__title {
    font-size: 1.8rem;
  }

  .page-hero__subtitle {
    font-size: 0.85rem;
  }

  .section {
    padding: 2rem 1rem;
  }

  .section--events {
    padding-top: 2.75rem;
    padding-bottom: 3.75rem;
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px) + 0.75rem);
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px) + 0.75rem);
  }

  .section__heading {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }

  .section__divider {
    margin-bottom: 1.5rem;
  }

  .section__text {
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .calendar-toolbar__title {
    text-align: center;
    font-size: 1.1rem;
  }

  .calendar-toolbar__nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }

  .btn--small {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
  }

  .calendar-grid {
    grid-auto-rows: minmax(44px, auto);
    gap: 1px;
    border-radius: 8px;
  }

  .calendar-grid__header {
    font-size: 0.58rem;
    padding: 0.35rem 0.1rem;
    letter-spacing: 0;
  }

  .calendar-grid__day {
    padding: 2px;
    min-height: 44px;
  }

  .calendar-grid__day-number {
    font-size: 0.68rem;
  }

  .calendar-event {
    font-size: 0.5rem;
    padding: 1px 2px;
    border-radius: 3px;
  }

  .calendar-event--multiday {
    font-size: 0.5rem;
    padding: 0 2px;
    height: 14px;
    line-height: 14px;
    border-radius: 3px;
  }

  .calendar-legend {
    padding: 0.5rem 0.75rem;
    gap: 0.35rem;
  }

  .calendar-legend__title {
    font-size: 0.82rem;
  }

  .calendar-legend__swatch {
    width: 10px;
    height: 10px;
  }

  .calendar-legend__label {
    font-size: 0.72rem;
  }

  .calendar-legend__item {
    padding: 0.25rem 0.2rem;
    gap: 0.35rem;
  }

  .event-popup__card {
    padding: 1.25rem;
    width: 95%;
  }

  .event-popup__title {
    font-size: 1.05rem;
    padding-right: 1.5rem;
  }

  .event-popup__detail {
    font-size: 0.82rem;
  }

  .card__image {
    height: 140px;
  }

  .card__image--natural {
    height: auto;
    min-height: 140px;
  }

  .card__image-photo {
    max-height: min(48vh, 320px);
  }

  .card__body {
    padding: 1rem;
  }

  .card__title {
    font-size: 1.1rem;
  }

  .card__text {
    font-size: 0.88rem;
  }

  .card__tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.6rem;
  }

  .eboard-card {
    padding: 1.25rem;
    gap: 1rem;
  }

  .eboard-card__photo {
    width: 100px;
    height: 100px;
    font-size: 2rem;
    border-width: 3px;
  }

  .eboard-card__name {
    font-size: 1.15rem;
  }

  .eboard-card__role {
    font-size: 0.88rem;
  }

  .eboard-card__bio {
    font-size: 0.85rem;
  }

  .eboard-list {
    gap: 1.5rem;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .modal--eboard .modal__name {
    font-size: 1.2rem;
  }

  .modal--eboard .modal__role {
    font-size: 0.88rem;
  }

  .modal--eboard .modal__description {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  .modal__gallery-nav {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.4rem;
  }

  .modal__gallery-main {
    min-height: 180px;
    padding: 0.75rem 2.25rem 2rem;
  }

  .modal__gallery-img {
    max-height: 40vh;
  }

  .footer {
    padding: 1.5rem 1rem;
  }

  .footer__left {
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .footer__socials {
    gap: 0.45rem;
  }

  .footer__social-row {
    gap: 0.75rem;
  }

  .footer__social-label {
    font-size: 0.72rem;
  }

  .footer__social-link {
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .footer__social-link svg {
    width: 16px;
    height: 16px;
  }

  .footer__credit {
    font-size: 0.58rem;
    margin-top: 0.75rem;
  }
}
