:root {
  color-scheme: light;
  --background: #f1efe9;
  --surface: #fffdf9;
  --surface-soft: #f7f5ef;
  --text: #202823;
  --muted: #626a64;
  --border: #d9d5ca;
  --accent: #52695c;
  --accent-dark: #2f4639;
  --gold: #a78654;
  --focus: #185abc;
  --shadow: 0 1.5rem 4rem rgba(37, 46, 40, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.95), transparent 34rem),
    var(--background);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

a {
  color: var(--accent-dark);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #14281d;
}

a:focus-visible {
  border-radius: 0.2rem;
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--accent-dark);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(calc(100% - 2rem), 72rem);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3.5rem) 0 2rem;
}

.service-header {
  margin: 0 auto clamp(1.5rem, 4vw, 2.5rem);
}

.memorial-card {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem);
  overflow: hidden;
  border: 1px solid rgba(112, 110, 101, 0.24);
  border-radius: 0.5rem;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: var(--shadow);
}

.memorial-portrait-wrap {
  position: relative;
  width: min(11.5rem, 55vw);
  margin: 0 auto;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: #fff;
  box-shadow: 0 1rem 2.5rem rgba(37, 46, 40, 0.15);
}

.memorial-portrait-wrap[hidden] {
  display: none;
}

.memorial-portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 165 / 200;
  border-radius: 0.1rem;
  object-fit: cover;
}

.service-summary {
  min-width: 0;
  text-align: center;
}

h1,
h2,
p {
  margin-top: 0;
}

.service-summary h1 {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.78rem, 1.4vw, 0.88rem);
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.person-name {
  margin-bottom: 1.2rem;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.memorial-rule {
  width: 4.5rem;
  height: 1px;
  margin: 0 auto 1.45rem;
  background: rgba(167, 134, 84, 0.62);
}

.memorial-rule::before,
.memorial-rule::after {
  content: none;
}

.memorial-rule span {
  display: none;
}

.event-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem 1.25rem;
  width: min(100%, 36rem);
  margin: 0 auto;
  text-align: left;
}

.event-detail {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  min-width: 0;
}

.event-detail[hidden] {
  display: none;
}

.event-detail dt {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.event-detail dd {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 580;
  line-height: 1.4;
}

.language-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 2.5rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.language-selector[hidden] {
  display: none;
}

.language-selector a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
}

.language-selector a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.language-separator {
  color: var(--border);
}

.broadcast {
  max-width: 64rem;
  margin: 0 auto;
}

.viewer-toolbar {
  display: contents;
}

.viewer-language-selector {
  display: none;
}

.status-panel {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin: 0 0 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: rgba(255, 253, 249, 0.9);
}

.status-indicator {
  width: 0.58rem;
  height: 0.58rem;
  margin-top: 0.43rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(167, 134, 84, 0.13);
}

.status-panel.is-live .status-indicator {
  background: #b53b32;
  box-shadow: 0 0 0 4px rgba(181, 59, 50, 0.13);
}

.status-message {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.status-message p {
  margin-bottom: 0.15rem;
}

.status-message p:first-child {
  color: var(--text);
  font-weight: 700;
}

.status-message p:last-child {
  margin-bottom: 0;
}

.player-shell {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border: 1px solid #202522;
  border-radius: 0.35rem;
  background: #101311;
  box-shadow: 0 1.25rem 3rem rgba(31, 39, 34, 0.16);
}

.player-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-fallback {
  width: min(90%, 34rem);
  margin: 0;
  padding: 1rem;
  color: #f5f5f5;
  text-align: center;
}

.watch-button {
  min-width: min(80%, 18rem);
  min-height: 3.25rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 0.35rem;
  color: #fff;
  background: var(--accent-dark);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.watch-button:hover {
  background: #21362a;
}

.watch-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

body.eventlive-layout {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #fff;
}

body.eventlive-layout .page-shell {
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  place-items: center;
}

body.eventlive-layout .service-header,
body.eventlive-layout .service-information,
body.eventlive-layout .contact-message,
body.eventlive-layout noscript {
  display: none;
}

body.eventlive-layout .broadcast {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 1rem;
}

body.eventlive-layout .status-panel {
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 253, 249, 0.98);
}

body.eventlive-layout .viewer-toolbar {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.75rem;
  width: min(75vw, calc((100vh - 8rem) * 16 / 9));
  width: min(75vw, calc((100dvh - 8rem) * 16 / 9));
  max-width: calc(100vw - 2rem);
}

body.eventlive-layout .viewer-language-selector {
  display: flex;
  gap: 0.42rem;
  align-items: center;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  color: #9a7b4c;
  background: rgba(255, 253, 249, 0.98);
  font-size: 0.82rem;
  white-space: nowrap;
}

body.eventlive-layout .viewer-language-selector a {
  color: var(--muted);
  text-decoration-thickness: 1px;
}

body.eventlive-layout .viewer-language-selector a[aria-current="page"] {
  color: #8f7042;
  font-weight: 700;
  text-decoration: none;
}

body.eventlive-layout .status-indicator {
  margin-top: 0;
}

body.eventlive-layout .status-message {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
  justify-content: center;
  font-size: 0.86rem;
}

body.eventlive-layout .status-message p {
  margin: 0;
}

body.eventlive-layout .status-message p:first-child::after {
  content: " —";
}

body.eventlive-layout .spanish-youtube-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 2.15rem;
  margin-left: auto;
  padding: 0.38rem 0.7rem;
  border: 1px solid rgba(143, 112, 66, 0.38);
  border-radius: 0.35rem;
  color: #735831;
  background: #f4eadb;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

body.eventlive-layout .spanish-youtube-link:hover,
body.eventlive-layout .spanish-youtube-link:focus-visible {
  border-color: #8f7042;
  background: #ecddc7;
}

body.eventlive-layout .spanish-youtube-link[hidden] {
  display: none;
}

body.eventlive-layout .player-shell {
  width: min(75vw, calc((100vh - 8rem) * 16 / 9));
  width: min(75vw, calc((100dvh - 8rem) * 16 / 9));
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 8rem);
  max-height: calc(100dvh - 8rem);
  margin: 0;
  border: 2px solid rgba(55, 66, 59, 0.72);
  border-radius: 0.7rem;
  background: #202823;
  box-shadow:
    0 1px 2px rgba(31, 39, 34, 0.14),
    0 0.8rem 2.25rem rgba(31, 39, 34, 0.14);
}

@media (max-width: 42.99rem) {
  body.eventlive-layout .viewer-toolbar {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    width: min(92vw, calc((100dvh - 10rem) * 16 / 9));
  }

  body.eventlive-layout .viewer-language-selector {
    justify-self: start;
    padding-block: 0.48rem;
  }

  body.eventlive-layout .status-message {
    flex-wrap: wrap;
  }

  body.eventlive-layout .status-panel {
    flex-wrap: wrap;
  }

  body.eventlive-layout .spanish-youtube-link {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  body.eventlive-layout .status-message p:first-child::after {
    content: "";
  }

  body.eventlive-layout .player-shell {
    width: min(92vw, calc((100dvh - 10rem) * 16 / 9));
  }
}

.service-information,
.viewing-help,
.contact-message {
  max-width: 48rem;
  margin: 2rem auto 0;
  text-align: center;
}

.service-information,
.contact-message {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
}

.service-information[hidden],
.contact-message[hidden] {
  display: none;
}

.viewing-help {
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.88rem;
}

.viewing-help h2 {
  margin-bottom: 0.45rem;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.viewing-help p {
  margin-bottom: 0.3rem;
}

.site-footer {
  width: min(calc(100% - 2rem), 64rem);
  margin: 1rem auto 0;
  padding: 1.5rem 0 2.25rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.75rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (min-width: 43rem) {
  .memorial-card {
    grid-template-columns: minmax(13rem, 14.5rem) minmax(0, 1fr);
    align-items: stretch;
  }

  .memorial-portrait-wrap {
    width: 100%;
    height: 100%;
    margin: 0;
  }

  .memorial-portrait {
    height: 100%;
  }

  .service-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .language-selector {
    justify-content: center;
  }
}

@media (max-width: 22rem) {
  #event-date {
    gap: 0.35rem;
  }

  #event-date dd {
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }
}

@media (max-width: 31rem) {
  .page-shell,
  .site-footer {
    width: min(calc(100% - 1rem), 72rem);
  }

  .memorial-card {
    padding: 1.15rem;
  }

  .event-details {
    grid-template-columns: 1fr;
  }

  .status-panel {
    margin-inline: 0.15rem;
  }
}

@media print {
  .skip-link,
  .broadcast,
  .viewing-help {
    display: none;
  }

  body {
    background: #fff;
  }

  .memorial-card {
    border: 0;
    box-shadow: none;
  }
}
