/* Variables */
:root {
  --uwblack: #111111;
  --black: #000000;
  --white: #ffffff;
  --accent: #71050d;
  --muted: #666666;
  --max-width: 1100px;
}

@import url("https://use.typekit.net/uhz1rxa.css");

@font-face {
  font-family: "backup";
  src: url("assets/backup.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Basic reset */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    "Spectral",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  color: var(--white);
  background-color: var(--black);
  line-height: 1.4;
}

a {
  color: var(--accent);
}

p {
  font-size: 1.25rem;
}

h2 {
  font-weight: 400;
}
img {
  max-width: 100%;
  height: auto;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: #fff;
  color: #000;
  padding: 8px;
  z-index: 999;
}
.skip-link:focus {
  left: 10px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  transition:
    background-color 0.25s ease,
    backdrop-filter 0.25s ease,
    box-shadow 0.25s ease;
  background-color: transparent;
  will-change: transform;
  padding: 20px 60px;
}
.site-header.sticky {
  background-color: var(--uwblack);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.site-header.sticky .brand {
  height: 48px;
  transition: height 0.25s ease;
}

.brand {
  height: 90px;
  transition: height 0.1s ease;
}

@media (max-width: 800px) {
  .site-header.sticky .brand {
    height: 40px;
  }
  .brand {
    height: 60px;
  }
}
.site-nav {
  display: flex;
  align-items: center;
}
.nav-list {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  font-family: "sarah-script", "backup", "Great Vibes", cursive;
  font-weight: normal;
  font-size: 2.25rem;
}
.nav-list a {
  color: var(--white);
  text-decoration: none;
  position: relative;
  padding: 8px;
}

/* underline expand from left */
.nav-list a::after {
  content: "";
  position: absolute;
  height: 6px;
  left: 0;
  bottom: 0;
  background: var(--accent);
  width: 0;
  transition: width 0.35s ease;
}
.nav-list a:hover::after,
.nav-list a:focus::after {
  width: 100%;
}

/* Mobile nav toggle (simple) */
/* Mobile hamburger & nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--white);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}
.nav-toggle .hamburger {
  display: inline-block;
  width: 28px;
  height: 20px;
  position: relative;
}
.nav-toggle .hamburger span {
  display: block;
  background: var(--white);
  height: 2px;
  border-radius: 2px;
  width: 100%;
  position: absolute;
  left: 0;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.nav-toggle .hamburger span:nth-child(1) {
  top: 0;
}
.nav-toggle .hamburger span:nth-child(2) {
  top: 9px;
}
.nav-toggle .hamburger span:nth-child(3) {
  bottom: 0;
}
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  /* keep background-attachment default; enable fixed on larger screens for a subtle parallax effect */
}
@media (min-width: 900px) {
  .panel {
    background-attachment: fixed;
  }
}
@media (prefers-reduced-motion: reduce) {
  .panel {
    background-attachment: scroll;
  }
}

.panel-inner {
  width: 100%; /* ensure flex children expand full width instead of shrink-to-fit */
  max-width: var(--max-width);
  padding: 1rem;
  text-align: center;
}

/* panel-content wrapper is used for visual nudges that shouldn't be overridden by animate.css */
.panel-content {
  display: block;
}

/* schedule table - semantic and consistent borders */
.schedule-wrap {
  margin: 1rem auto;
  width: 95%;
  max-width: 1600px;
  background: rgba(230, 230, 230, 0.9);
}
#schedule .panel-inner {
  max-width: 1200px;
  text-align: center;
}
.schedule {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}
.schedule th,
.schedule td {
  padding: 1rem;
  border: 1px solid #d7d7d7;
  text-align: left;
  vertical-align: top;
}
.schedule th {
  background: var(--accent);
  font-weight: 600;
  color: white;
  border: 1px solid var(--accent);
}
.schedule th:first-child,
.schedule td:first-child {
  /* allow times to break cleanly when needed; preserve whitespace behavior for ranges */
  white-space: break-spaces;
  font-weight: 600;
  word-break: normal;
}
.schedule td {
  min-height: 56px;
}

/* Responsive event cards (single-line layout per card) */
.events-list {
  display: block;
  gap: 0.5rem;
  margin: 1rem 0;
  width: 95%;
  max-width: 1200px;
  text-align: left;
}
.event-card {
  background: #ffffff;
  color: var(--black);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.event-header {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  gap: 0.1rem;
  justify-content: flex-start;
}
.event-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--uwblack);
}
.event-location {
  color: var(--muted);
  font-size: 0.95rem;
}
.event-body {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.time-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(113, 5, 13, 0.06);
  color: var(--accent);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  flex: 0 0 200px;
  min-width: 200px;
  justify-content: flex-start;
  white-space: nowrap;
}
.time-pill i {
  font-size: 1rem;
  color: var(--accent);
}
.event-desc {
  margin: 0;
  color: #333333;
  font-size: 0.95rem;
  line-height: 1.3;
  flex: 1 1 auto;
}

/* Make sure schedule wrap can grow naturally with content when needed */
.schedule-wrap {
  padding: 0.5rem 0;
  background: transparent;
}

@media (max-width: 800px) {
  .event-header {
    flex-direction: column;
    gap: 0;
  }
  .event-body {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  .time-pill {
    flex: 0 0 auto;
    width: auto;
  }
  .event-desc {
    font-size: 0.95rem;
  }
}

/* desktop: wider columns to fill space */
@media (min-width: 1200px) {
  .schedule {
    table-layout: fixed;
  }
  .schedule th:nth-child(1),
  .schedule td:nth-child(1) {
    width: 25%;
  }
  .schedule th:nth-child(2),
  .schedule td:nth-child(2) {
    width: 30%;
  }
  .schedule th:nth-child(3),
  .schedule td:nth-child(3) {
    width: 30%;
  }
}

/* Mobile: slightly narrower first column (date/time), wider event and location columns */
@media (max-width: 800px) {
  .schedule {
    table-layout: fixed;
  }
  .schedule th:nth-child(1),
  .schedule td:nth-child(1) {
    width: 25%;
  }
  .schedule th:nth-child(2),
  .schedule td:nth-child(2) {
    width: 37%;
  }
  .schedule th:nth-child(3),
  .schedule td:nth-child(3) {
    width: 35%;
  }
}

.event-cell {
  position: relative;
  display: inline-block;
}
.event-info-icon {
  color: #c0c0c0;
  cursor: pointer;
  margin-right: 0.4rem;
  font-size: 0.8rem;
  transition: opacity 0.2s ease;
}
.event-info-icon:hover {
  opacity: 0.7;
}
.event-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  background: var(--white);
  color: var(--black);
  border: 2px solid var(--accent);
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.5;
  width: 220px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  pointer-events: none;
}
.event-cell:hover .event-tooltip {
  display: block;
}
.event-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0.75rem;
  border: 6px solid transparent;
  border-top-color: var(--accent);
}
/* Mobile: show tooltip on click */
.event-info-icon.active ~ .event-tooltip {
  display: block;
}
@media (max-width: 800px) {
  .event-tooltip {
    width: 180px;
    font-size: 0.95rem;
    padding: 0.6rem;
  }
}

/* clean up any previously used grid selectors (leave them harmless) */
.schedule-grid {
  display: none !important;
}
.schedule-row,
.cell {
  display: block !important;
}

/* nudge RSVP section content slightly upward so it sits a bit higher than the center */
#rsvp .panel-content {
  transform: translateY(-10vh);
}
@media (max-width: 800px) {
  #rsvp .panel-content {
    transform: translateY(-6vh);
  }
}

/* respect reduced-motion settings for users who prefer less movement */
@media (prefers-reduced-motion: reduce) {
  #rsvp .panel-content {
    transform: none !important;
  }
}

/* footer logo bleeds slightly out of the white footer */
.site-footer {
  overflow: visible;
}
.footer-grid {
  overflow: visible;
}
.footer-logo {
  height: 170px;
  margin-top: -110px;
  position: relative;
  z-index: 3;
  display: block;
}

/* nudge RSVP section content slightly upward so it sits a bit higher than the center */
#rsvp .panel-content {
  transform: translateY(-6vh);
}
@media (max-width: 800px) {
  #rsvp .panel-content {
    transform: translateY(-9vh);
  }
}

/* respect reduced-motion settings for users who prefer less movement */
@media (prefers-reduced-motion: reduce) {
  #rsvp .panel-content {
    transform: none !important;
  }
}
/* Hero */
.hero {
  background-color: var(--black);
  background-image: url("assets/background-black.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Logo mask wrapper keeps the existing sizing but allows an overlay texture to be clipped to the SVG */
.logo-mask {
  display: inline-block; /* use inline-block so width follows the image intrinsic size */
  margin: 0 auto 60px;
  position: relative;
  line-height: 0; /* prevent descender gaps */
  /* Clip everything inside the wrapper to the SVG silhouette so children may animate independently */
  -webkit-mask-image: url("assets/event-logo.svg");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("assets/event-logo.svg");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}
.event-logo {
  display: block;
  width: clamp(
    160px,
    36vw,
    420px
  ); /* give a responsive intrinsic width so the wrapper sizes correctly */
  height: auto;
  max-height: 60vh;
}

/* Overlay: diamond texture sits beneath a fixed mask (on .logo-mask) and is rotated independently */
.logo-overlay {
  position: absolute;
  inset: 0; /* match the wrapper bounds */
  pointer-events: none;
  background-image: url("assets/diamond-logo-overlay.webp");
  background-size: 130%;
  background-position: center;
  opacity: 1;
  transform-origin: 50% 50%;
  will-change: transform;
  animation:
    overlayRotate 80s linear infinite,
    diamondBrightness 2s ease infinite alternate;
}

@keyframes overlayRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes diamondBrightness {
  from {
    filter: brightness(90%);
  }
  to {
    filter: brightness(120%);
  }
}

/* Reduced motion: do not animate the overlay */
@media (prefers-reduced-motion: reduce) {
  .logo-overlay {
    animation: none !important;
  }
  .logo-mask {
    -webkit-mask-image: url("assets/event-logo.svg");
    mask-image: url("assets/event-logo.svg");
  }
}

/* Fallback: if masks aren't supported, slightly tint using blend mode */
@supports not (-webkit-mask-image: url("assets/event-logo.svg")) {
  .logo-overlay {
    mix-blend-mode: overlay;
    opacity: 0.9;
  }
}

/* Reduced motion: keep static overlay */
@media (prefers-reduced-motion: reduce) {
  .logo-overlay {
    transition: none !important;
  }
}

.lead {
  max-width: 900px;
  margin: 1.25rem auto;
  color: var(--white);
  font-weight: normal;
  font-size: 1.2rem;
}

.lead-dark {
  color: var(--uwblack);
  font-size: 1rem;
}

.scroll-btn {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: transparent;
  border: none; /* visual box removed, hit target preserved */
  color: var(--white);
  padding: 0;
  border-radius: 8px;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease;
}
.scroll-btn img {
  width: 64%; /* slightly larger arrow */
  height: auto;
  display: block;
}
.scroll-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px) scale(1.03);
}
.scroll-btn:focus,
.scroll-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
@media (max-width: 800px) {
  .scroll-btn {
    width: 48px;
    height: 48px;
  }
  .scroll-btn img {
    width: 68%;
  }
}

/* Light section */
.light {
  background-color: var(--white);
  color: var(--black);
  background-image: url("assets/background-light.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.light .panel-inner {
  color: var(--black);
}

.clipped-heading {
  position: relative;
  /* keep block layout so vertical flow and centering remain stable */
  display: block;
  font-family: "sarah-script", "backup", "Great Vibes", cursive;
  font-size: 6rem;
  margin: 0 0 1rem;
  line-height: 1;
  /* image clipped into text */
  background-image: url("assets/overlay-blackdiamond.webp");
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-size: cover;
  background-position: center;
}

/* Accent underline with centered diamond (positioned outside flow so it doesn't affect layout) */
.clipped-heading::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px; /* placed below the text so it doesn't shift its layout */
  transform: translateX(-50%);
  width: 64px;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(113, 5, 13, 0.12);
}

.clipped-heading.white::after {
  background: var(--white);
}

.clipped-date::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px; /* placed below the text so it doesn't shift its layout */
  transform: translateX(-50%);
  width: 64px;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(113, 5, 13, 0.12);
}

/* smaller sizes on mobile */
@media (max-width: 800px) {
  .clipped-heading {
    font-size: clamp(2.6rem, 9vw, 4rem);
  }
  .clipped-heading::after {
    width: 44px;
    height: 4px;
    bottom: -6px;
  }
  .clipped-heading::before {
    width: 9px;
    height: 9px;
    bottom: -5px;
  }
}

/* Utility class for plain headings that may want the same treatment */
.accent-underline {
  position: relative;
  display: inline-block;
}
.accent-underline::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -6px;
  width: 56px;
  height: 5px;
  background: var(--accent);
}
.accent-underline::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  bottom: -4px;
  width: 10px;
  height: 10px;
  background: var(--accent);
}

/* modern responsive schedule grid (keeps accessibility via ARIA roles in markup) */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 1rem auto;
  width: 90%;
  max-width: 900px;
  background: rgba(230, 230, 230, 0.9);
}
.schedule-row {
  display: contents;
}
.schedule-grid .cell {
  background: #fff;
  padding: 0.75rem;
  border: 1px solid #e6e6e6;
  text-align: left;
}
.schedule-row.header .cell {
  font-weight: 400;
  background: rgba(245, 245, 245, 0.95);
}
/* stacked on small screens: keep each row as a 3-column grid so content stays readable */
@media (max-width: 800px) {
  .schedule-grid {
    grid-template-columns: 1fr;
  }
  /* keep header row aligned 3 columns */
  .schedule-row.header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0.25rem;
    align-items: center;
  }
  /* ensure rows remain 3 columns (time | event | location) on narrow screens */
  .schedule-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0.25rem;
    align-items: center;
  }
  .schedule-grid .cell {
    padding: 0.6rem;
    font-size: 0.95rem;
  }
}

/* Dark section */
.dark {
  background-image: url("assets/background-dark.webp");
  color: var(--white);
}

.wine-dark {
  background-image: url("assets/background-wine.webp");
  color: var(--white);
}
.clipped-heading.white {
  color: var(--white);
  -webkit-text-fill-color: unset;
  background-clip: border-box;
  background-image: url("assets/overlay-whitediamond.webp");
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-size: cover;
  background-position: center;
}

/* smaller clipped date variant used in hero */
.clipped-date {
  font-size: 2.25rem;
  margin: 0.25rem 0 1rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}
@media (max-width: 800px) {
  .clipped-date {
    font-size: 1.25rem;
  }
}

.btn {
  display: inline-block;
  padding: 0.75rem 1rem;
  border: none;
  text-decoration: none;
  color: var(--white);
  background: var(--muted);
}
.btn.primary {
  background: var(--uwblack);
  border: 2px solid var(--accent);
  outline: 2px solid var(--uwblack);
}

.btn.primary:hover {
  background: var(--accent);
}
.rsvp-btn-spacing {
  margin-bottom: 4rem;
}

/* Contact links within the RSVP panel */
.contact-links {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center; /* centered under the heading */
  align-items: center;
}
.contact-links .btn {
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
}
.contact-links .btn i {
  margin-right: 0.6rem;
}
@media (max-width: 480px) {
  .contact-links {
    justify-content: center;
  }
  .contact-links .btn {
    width: 100%;
    text-align: center;
  }
}

.site-footer {
  width: 100%;
  background: var(--white);
  color: var(--black);
  padding: 1.5rem 0 2.5rem; /* extra bottom padding */
  margin-top: 0; /* remove gap above footer */
  position: relative;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.04);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  flex-wrap: wrap;
}
.footer-centered {
  flex-direction: column;
  text-align: center;
}
.footer-row {
  font-size: 0.95rem;
  color: #333;
  margin-top: 0.5rem;
}

@media (min-width: 900px) {
  .footer-centered {
    flex-direction: column;
  }
  .footer-row {
    margin-top: 0.5rem;
  }
}

/* Responsive */
@media (max-width: 800px) {
  .nav-list {
    display: none;
    position: absolute;
    top: 60px;
    right: 16px;
    background: rgba(0, 0, 0, 0.75);
    flex-direction: column;
    padding: 1rem;
    border-radius: 8px;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }
  .logo-mask {
    margin: 0 auto 20px;
  }

  .clipped-heading {
    font-size: 3rem;
  }

  .clipped-date {
    font-size: 2rem;
  }
  .brand {
    height: 60px;
  }
  .event-logo {
    max-height: 45vh;
  }
  .lead {
    font-size: 1rem;
  }

  .lead-dark {
    font-size: 1rem;
    display: none;
  }

  .schedule {
    width: 100%;
  }

  .schedule th,
  .schedule td {
    padding: 0.65rem 0.35rem;
    border: none;
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
  }
  .rsvp-btn-spacing {
    margin-bottom: 2rem;
  }
  /* show hamburger and hide text borders for mobile */
  .nav-toggle {
    border-radius: 8px;
    padding: 0.35rem;
  }
  .site-header {
    padding: 12px 18px;
  }
}

/* Accessibility: focus states */
a:focus,
button:focus {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* When JS is enabled, hide animate targets by default to avoid flash/pop (no-JS keeps content visible) */
.js [data-animate] {
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
}
.js [data-animate].animate__animated {
  opacity: 1;
  transform: none;
}

/* ensure animate.css animations persist final state */
.animate__animated {
  animation-fill-mode: both;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  /* and keep animated elements visible */
  .js [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }
}
