/* ===================== GLOBAL ===================== */

html {
  overflow-y: scroll;
  /* prevents layout shift */
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
}

/* ===================== THEME SYSTEM ===================== */

:root {
  --bg-gradient: linear-gradient(180deg, #20a39e, #23001e);
  --primary: #ef5b5b;
  --accent: #ffba49;

  --surface: #ffffff;
  --surface-2: rgba(255, 255, 255, 0.08);

  --text: #ffffff;
  --card-text: #23001e;

  --navbar-bg: rgba(0, 0, 0, 0.65);
  --navbar-text: rgba(255, 255, 255, 0.8);
  --navbar-active: var(--accent);
  --navbar-hover: var(--accent);

  --overlay-bg: rgba(0, 0, 0, 0.7);
}

/* SUNSET */
.theme-sunset {
  --bg-gradient: linear-gradient(180deg, #ffba49, #ef5b5b);
  --primary: #20a39e;
  --accent: #23001e;

  --navbar-bg: rgba(35, 0, 30, 0.7);
}

/* CLAY */
.theme-clay {
  --bg-gradient: linear-gradient(180deg, #1e555c, #3a2e39);

  --primary: #f15152;
  --accent: #edb183;

  --surface: #f4d8cd;
  --surface-2: rgba(244, 216, 205, 0.12);

  --text: #f4d8cd;
  --card-text: #1e555c;

  --navbar-bg: rgba(244, 216, 205, 0.92);
  --navbar-text: #1e555c;
  --navbar-active: #3a2e39;
  --navbar-hover: #3a2e39;
}

/* ===================== HERO ===================== */

.hero-title {
  width: 100%;
  height: 350px;
  overflow: hidden;
  cursor: pointer;
}

.hero-title img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ===================== NAVIGATION ===================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-2);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 14px 10px;
}

.nav-links button {
  position: relative;
  background: none;
  border: none;

  color: var(--navbar-text);
  opacity: 0.75;

  cursor: pointer;
  font-size: 17px;

  padding: 6px 4px;
  transition: 0.25s ease;
}

.nav-links button::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;

  width: 0%;
  height: 2px;
  background: var(--navbar-active);
  transition: width 0.25s ease;
}

.nav-links button:hover {
  opacity: 1;
  color: var(--navbar-hover);
}

.nav-links button:hover::after,
.nav-links button.active-tab::after {
  width: 100%;
}

/* ===================== TABS ===================== */

.tab {
  display: none;
  padding: 20px;
}

.tab.active {
  display: block;
}

/* ===================== PHOTO GRID ===================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Desktop only */
@media (min-width: 769px) {
  .photo-right {
    object-position: right center;
  }
}

/* ===================== GRID / CARDS ===================== */

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  width: 70%;
  margin: auto;
}

.card {
  background: var(--surface);
  color: var(--card-text);

  padding: 20px;
  border-radius: 15px;

  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.card h3,
.card p {
  margin: 0;
}

/* ===================== TEXT HELPERS ===================== */

.highlight {
  font-weight: bold;
  text-decoration: underline;
}

/* ===================== BUTTONS ===================== */

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
}

.accent {
  background: var(--primary);
  color: var(--text);
}

/* ===================== RSVP CTA ===================== */

.rsvp-cta {
  display: flex;
  justify-content: center;
  margin-top: 25px;
}

.rsvp-cta .btn {
  padding: 24px 80px;
  font-size: 22px;
  font-weight: bold;
  border-radius: 25px;
}

/* ===================== EVENT CARDS ===================== */

.event-card {
  position: relative;
  min-height: 70vh;
}

.card-main {
  transition: 0.3s;
}

.card-main .btn {
  margin-top: 15px;
  background: #a1a4a7;
  color: var(--text);
  border-radius: 6px;
}

.card-main .event-img {
  width: 100%;
  height: 40vh;
  object-fit: cover;
  border-radius: 12px;
}

/* OVERLAY */
.card-overlay {
  position: absolute;
  inset: 0;
  box-sizing: border-box;

  background: var(--surface);
  color: var(--card-text);

  border-radius: 15px;
  padding: 20px;

  display: flex;
  flex-direction: column;
  overflow-y: auto;

  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;

  transition: 0.3s ease;
}

.event-card.active .card-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===================== SHIRT ===================== */

#shirt img {
  max-width: 500px;
  border-radius: 10px;
  cursor: pointer;
}

.shirt-blurb {
  text-align: center;
  margin: 10px 0;
}

/* ===================== MODALS ===================== */

.modal {
  display: none;
  position: fixed;
  inset: 0;

  background: var(--overlay-bg);
  z-index: 2000;

  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--surface);
  color: var(--card-text);

  padding: 20px 20px 20px 20px;
  border-radius: 12px;

  width: 90%;
  max-width: 800px;
  height: 85vh;

  position: relative;

  display: flex;
  flex-direction: column;
}

/* HERO BANNER MODAL */
.modal.compact {
  align-items: center;
  justify-content: center;
}

.modal.compact .modal-content {
  width: auto;
  max-width: 320px;
  height: auto;

  padding: 18px 20px;

  border-radius: 14px;

  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

#heroModal.modal {
  background: rgba(0, 0, 0, 0.4);
}

#heroModal .close {
  top: 6px;
  right: 10px;
  font-size: 20px;
}

/* IMAGE MODAL */
.image-modal {
  background: transparent;
  box-shadow: none;

  width: auto;
  height: auto;

  max-width: 90vw;
  max-height: 90vh;

  padding: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  position: relative;
  /* IMPORTANT for close button */
}

.image-modal img {
  display: block;

  max-width: 100%;
  max-height: 90vh;

  width: auto;
  height: auto;

  border-radius: 12px;
}

/* CLOSE BUTTON */
.close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);

  cursor: pointer;
  z-index: 5;
}

.close:hover {
  filter: brightness(0.9);
}

/* IFRAME */
iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===================== FOOTER ===================== */

footer {
  text-align: center;
  padding: 15px;
  margin-top: 20px;
}

/* ===================== MOBILE ===================== */

@media (max-width: 768px) {

  .tab {
    padding: 12px;
  }

  /* HERO TITLE */
  .hero-title {
    height: 180px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero-title img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  /* NAV LINKS */
  .nav-links {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: space-around;
  }

  .nav-links button {
    font-size: 14px;
  }

  /* STACK PHOTOS */
  .photo-grid {
    display: flex;
    flex-direction: column;
  }

  .photo-grid img {
    height: 45vh;
  }

  .photo-grid img:nth-child(1),
  .photo-grid img:nth-child(2) {
    object-position: top;
  }

  /* SINGLE COLUMN */
  .grid-2 {
    width: 100%;
  }

  .card {
    padding: 15px;
  }

  .card-overlay {
    padding: 15px;
  }

  .event-card .close {
    top: 8px;
    right: 8px;
  }

  .btn {
    min-height: 44px;
  }

  .rsvp-cta .btn {
    width: 100%;
    padding: 18px;
    font-size: 18px;
  }

  .modal {
    align-items: flex-start;
    padding-top: 10vh;
    padding-top: env(safe-area-inset-top, 20px);
  }

  .modal-content {
    width: calc(100% - 24px);
    height: 85vh;
    margin: 10px 12px 0 12px;
  }

  /* IMAGE MODAL MOBILE */
  .image-modal {
    max-width: 94vw;
    max-height: 88vh;
  }

  .image-modal .close {
    top: 8px;
    right: 8px;
    background-color: #333;
  }

  .image-modal img {
    width: 90vw;
    max-height: 85vh;
  }

  #shirt img {
    width: 100%;
    max-width: none;
    height: auto;
  }

  body {
    overflow-x: hidden;
  }
}