/*
 * Wedding design-system primitives.
 * Intentionally opt-in: tokens are prefixed --ds-* and every component is .ds-*.
 * Existing invitation and standalone pages keep their current styling unless
 * they explicitly use one of these classes. No remote fonts or assets are loaded.
 */
:root {
  /* Identity palette: brighter colors are accents; body copy stays on deep browns. */
  --ds-color-paper: #f4e9d5;
  --ds-color-paper-light: #fff9ee;
  --ds-color-paper-deep: #e4c7a5;
  --ds-color-ink: #322a23;
  --ds-color-ink-muted: #5c4b3c;
  --ds-color-brown: #883419;
  --ds-color-brown-deep: #6e2817;
  --ds-color-brown-editorial: #4e4626;
  --ds-color-coral: #eb7d3d;
  --ds-color-magenta: #dd1f55;
  --ds-color-magenta-text: #c51d4d;
  --ds-color-orange: #e4911e;
  --ds-color-olive: #9c9851;
  --ds-color-olive-deep: #55552b;
  --ds-color-surface-rose: #fff1ef;
  --ds-color-border-rose: #e8b5a7;
  --ds-color-surface-olive: #f2f0df;
  --ds-color-border-olive: #c9c59b;
  --ds-color-border: #c6a985;
  --ds-color-focus: #6e2817;

  /* Allura and Montserrat are preferred identity faces when locally available. */
  --ds-font-display: "Allura", "Segoe Script", "Brush Script MT", cursive;
  --ds-font-heading: "Montserrat", "Avenir Next", Arial, sans-serif;
  --ds-font-body: "Montserrat", "Avenir Next", Arial, sans-serif;
  --ds-font-editorial: "Libre Baskerville", Georgia, serif;

  --ds-text-xs: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --ds-text-sm: clamp(0.875rem, 0.84rem + 0.18vw, 1rem);
  --ds-text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --ds-text-lg: clamp(1.125rem, 1.02rem + 0.5vw, 1.375rem);
  --ds-text-xl: clamp(1.375rem, 1.15rem + 1.1vw, 1.875rem);
  --ds-text-2xl: clamp(1.75rem, 1.35rem + 2vw, 2.75rem);
  --ds-text-3xl: clamp(2.25rem, 1.55rem + 3.5vw, 4rem);
  --ds-text-display: clamp(3.25rem, 2.2rem + 7vw, 7rem);

  --ds-space-1: 0.25rem;
  --ds-space-2: 0.5rem;
  --ds-space-3: 0.75rem;
  --ds-space-4: 1rem;
  --ds-space-5: 1.5rem;
  --ds-space-6: 2rem;
  --ds-space-7: 3rem;
  --ds-space-8: 4rem;
  --ds-space-9: 6rem;
  --ds-gutter: clamp(1rem, 4vw, 2.5rem);
  --ds-content-width: 72rem;
  --ds-reading-width: 46rem;

  --ds-radius-sm: 0.375rem;
  --ds-radius-md: 0.75rem;
  --ds-radius-lg: 1.25rem;
  --ds-radius-pill: 999px;
  --ds-shadow-card: 0 0.75rem 2rem rgb(78 52 32 / 10%);
  --ds-shadow-raised: 0 0.25rem 0.75rem rgb(78 52 32 / 14%);
  --ds-focus-ring: 0 0 0 0.2rem var(--ds-color-paper-light), 0 0 0 0.38rem var(--ds-color-focus);

  /* Motifs are decorative CSS backgrounds; use <img> plus manifest alt text
     whenever the artwork conveys information to the reader. */
  --ds-motif-maedeup: url("identity/maedeup-mark.png");
  --ds-motif-monogram: url("identity/db-monogram.png");
  --ds-motif-floral-paper: url("identity/floral-paper-background.jpg");
  --ds-motif-travel: url("identity/travel-house-illustration.jpg");
}

.ds-display {
  color: var(--ds-color-brown);
  font-family: var(--ds-font-display);
  font-size: var(--ds-text-display);
  font-weight: 400;
  line-height: 0.95;
  text-wrap: balance;
}

.ds-heading {
  color: var(--ds-color-brown-editorial);
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-2xl);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

.ds-heading--small {
  font-size: var(--ds-text-xl);
}

.ds-body {
  color: var(--ds-color-ink);
  font-family: var(--ds-font-body);
  font-size: var(--ds-text-base);
  line-height: 1.65;
  overflow-wrap: break-word;
}

.ds-editorial {
  color: var(--ds-color-ink-muted);
  font-family: var(--ds-font-editorial);
  font-size: var(--ds-text-lg);
  line-height: 1.7;
  overflow-wrap: break-word;
}

.ds-eyebrow {
  color: var(--ds-color-brown);
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ds-container {
  box-sizing: border-box;
  margin-inline: auto;
  max-width: var(--ds-content-width);
  min-width: 0;
  width: calc(100% - var(--ds-gutter) - var(--ds-gutter));
}

.ds-container--reading {
  max-width: var(--ds-reading-width);
}

.ds-section {
  padding-block: clamp(var(--ds-space-7), 8vw, var(--ds-space-9));
}

.ds-stack {
  display: grid;
  gap: var(--ds-space-4);
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.ds-stack > *,
.ds-grid > * {
  max-width: 100%;
  min-width: 0;
}

.ds-stack--compact {
  gap: var(--ds-space-2);
}

.ds-stack--loose {
  gap: var(--ds-space-6);
}

.ds-cluster {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-3) var(--ds-space-4);
}

.ds-grid {
  display: grid;
  gap: clamp(var(--ds-space-4), 3vw, var(--ds-space-6));
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.ds-grid--two,
.ds-grid--three {
  grid-template-columns: minmax(0, 1fr);
}

.ds-surface {
  background: var(--ds-color-paper-light);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-lg);
  box-sizing: border-box;
  box-shadow: var(--ds-shadow-card);
  color: var(--ds-color-ink);
  min-width: 0;
  padding: clamp(var(--ds-space-5), 4vw, var(--ds-space-7));
  width: 100%;
}

.ds-surface--paper {
  background-color: var(--ds-color-paper);
  border-color: var(--ds-color-paper-deep);
}

.ds-surface--floral {
  background-color: var(--ds-color-paper-light);
  background-image: linear-gradient(rgb(255 249 238 / 88%), rgb(255 249 238 / 88%)), var(--ds-motif-floral-paper);
  background-position: center;
  background-size: cover;
}

.ds-surface--rose {
  background: var(--ds-color-surface-rose);
  border-color: var(--ds-color-border-rose);
}

.ds-surface--olive {
  background: var(--ds-color-surface-olive);
  border-color: var(--ds-color-border-olive);
}

.ds-surface--warm {
  background: #f8e4d3;
  border-color: #e7b18e;
}

.ds-button {
  align-items: center;
  appearance: none;
  border: 2px solid transparent;
  border-radius: var(--ds-radius-pill);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-sm);
  font-weight: 700;
  justify-content: center;
  line-height: 1.2;
  min-height: 2.875rem;
  padding: 0.7rem 1.4rem;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ds-button--primary {
  background: var(--ds-color-brown);
  color: var(--ds-color-paper-light);
}

.ds-button--primary:hover {
  background: var(--ds-color-brown-deep);
  box-shadow: var(--ds-shadow-raised);
}

.ds-button--secondary {
  background: var(--ds-color-paper-light);
  border-color: var(--ds-color-brown);
  color: var(--ds-color-brown);
}

.ds-button--secondary:hover {
  background: var(--ds-color-paper);
}

.ds-button--coral {
  background: var(--ds-color-coral);
  color: var(--ds-color-ink);
}

.ds-button--coral:hover {
  background: #f28b4d;
  box-shadow: var(--ds-shadow-raised);
}

.ds-button--olive {
  background: var(--ds-color-olive-deep);
  color: var(--ds-color-paper-light);
}

.ds-button--olive:hover {
  background: #454522;
}

.ds-button:active {
  transform: translateY(1px);
}

.ds-link {
  color: var(--ds-color-brown);
  font-weight: 600;
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.ds-link:hover {
  color: var(--ds-color-brown-deep);
}

.ds-button:focus-visible,
.ds-link:focus-visible,
.ds-focusable:focus-visible {
  box-shadow: var(--ds-focus-ring);
  outline: 2px solid var(--ds-color-focus);
  outline-offset: 3px;
}

.ds-divider {
  align-items: center;
  color: var(--ds-color-brown);
  display: flex;
  gap: var(--ds-space-4);
  justify-content: center;
  margin-block: var(--ds-space-6);
}

.ds-divider::before,
.ds-divider::after {
  background: var(--ds-color-paper-deep);
  content: "";
  flex: 1 1 2rem;
  height: 1px;
}

.ds-divider--maedeup::before,
.ds-divider--maedeup::after {
  max-width: 8rem;
}

.ds-ornament {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  display: block;
  flex: none;
}

.ds-ornament--maedeup {
  aspect-ratio: 292 / 331;
  background-image: var(--ds-motif-maedeup);
  width: clamp(3.25rem, 12vw, 6rem);
}

.ds-ornament--monogram {
  aspect-ratio: 303 / 174;
  background-image: var(--ds-motif-monogram);
  width: clamp(5rem, 24vw, 10rem);
}

.ds-ornament--floral {
  aspect-ratio: 2 / 1;
  background-image: var(--ds-motif-floral-paper);
  background-size: cover;
  border-radius: var(--ds-radius-md);
  width: min(100%, 34rem);
}

.ds-ornament--travel {
  aspect-ratio: 1122 / 1402;
  background-image: var(--ds-motif-travel);
  border-radius: var(--ds-radius-md);
  width: min(100%, 20rem);
}

.ds-button--full-mobile {
  width: 100%;
}

@media (min-width: 48rem) {
  .ds-grid--two,
  .ds-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ds-button--full-mobile {
    width: auto;
  }
}

@media (min-width: 72rem) {
  .ds-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-button {
    transition: none;
  }
}

/*
 * Opt-in bridge for the invitation DOM produced by assets/app.js.
 * index.html alone loads this sheet, so the independent stationery pages keep
 * their own existing presentation. Keep app.js-generated classes unchanged.
 * The renderer assigns legacy palette variables inline; the important token
 * aliases below keep those existing variable-based rules on the approved palette.
 */
html {
  --bg: var(--ds-color-paper) !important;
  --ink: var(--ds-color-ink) !important;
  --accent: var(--ds-color-magenta-text) !important;
  --deep: var(--ds-color-brown) !important;
  --line: var(--ds-color-paper-deep) !important;
  scroll-behavior: smooth;
}

body {
  background: var(--ds-color-paper);
  color: var(--ds-color-ink);
  font-family: var(--ds-font-body);
  font-size: var(--ds-text-base);
}

.site-nav {
  background: color-mix(in srgb, var(--ds-color-paper-light) 94%, transparent);
  border-color: var(--ds-color-paper-deep);
  color: var(--ds-color-ink);
}

.brand {
  color: var(--ds-color-brown);
  font-family: var(--ds-font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  line-height: 1;
}

.nav-link,
.language-button,
.text-button {
  color: var(--ds-color-ink-muted);
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-xs);
  font-weight: 600;
  min-height: 2.75rem;
  padding: 0.65rem 0.15rem;
}

.nav-link:hover,
.nav-link.active,
.language-button.active {
  color: var(--ds-color-magenta-text);
  border-bottom-color: var(--ds-color-magenta-text);
}

.page {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.photo-panel {
  background-color: var(--ds-color-olive);
  background-image: var(--ds-motif-floral-paper);
  background-position: center;
  background-size: cover;
}

.photo-panel:after {
  background: linear-gradient(180deg, rgb(50 42 35 / 6%) 45%, rgb(50 42 35 / 48%));
}

.section {
  background-color: var(--ds-color-paper-light);
  border-color: var(--ds-color-paper-deep);
}

.section:nth-of-type(even) {
  background-color: var(--ds-color-paper);
}

.section:first-child {
  background-color: var(--ds-color-paper-light);
  background-image: linear-gradient(rgb(255 249 238 / 82%), rgb(255 249 238 / 82%)), var(--ds-motif-floral-paper);
  background-position: center;
  background-size: cover;
}

.section-label,
.eyebrow,
.date,
time {
  color: var(--ds-color-brown);
  font-family: var(--ds-font-heading);
  font-weight: 600;
}

.eyebrow,
.section-label {
  color: var(--ds-color-magenta-text);
}

h1 {
  color: var(--ds-color-brown);
  font-family: var(--ds-font-display);
  font-size: clamp(4rem, 7vw, 6.5rem);
  font-weight: 400;
  line-height: 0.88;
  text-wrap: balance;
}

h2 {
  color: var(--ds-color-brown-editorial);
  font-family: var(--ds-font-editorial);
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

h3 {
  color: var(--ds-color-brown-editorial);
  font-family: var(--ds-font-heading);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.25;
}

p {
  color: var(--ds-color-ink-muted);
  font-family: var(--ds-font-body);
  font-size: var(--ds-text-base);
  line-height: 1.7;
  overflow-wrap: break-word;
}

.date {
  color: var(--ds-color-brown);
}

.primary-button,
.secondary-button {
  align-items: center;
  border-radius: var(--ds-radius-pill);
  display: inline-flex;
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-xs);
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0.08em;
  line-height: 1.25;
  min-height: 2.875rem;
  padding: 0.75rem 1.25rem;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button {
  background: var(--ds-color-brown);
  border: 2px solid var(--ds-color-brown);
  color: var(--ds-color-paper-light);
}

.primary-button:hover {
  background: var(--ds-color-brown-deep);
  border-color: var(--ds-color-brown-deep);
  box-shadow: var(--ds-shadow-raised);
}

.secondary-button {
  background: var(--ds-color-paper-light);
  border: 2px solid var(--ds-color-brown);
  color: var(--ds-color-brown);
}

.secondary-button:hover {
  background: var(--ds-color-paper);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.action-row {
  gap: var(--ds-space-3);
}

.map {
  border: 1px solid var(--ds-color-paper-deep);
  border-radius: var(--ds-radius-md);
}

.swatch {
  border-color: var(--ds-color-paper-light);
  box-shadow: 0 0 0 1px var(--ds-color-paper-deep);
}

.timeline {
  border-color: var(--ds-color-olive);
}

.event:before {
  background: var(--ds-color-coral);
}

.faq details {
  border-color: var(--ds-color-paper-deep);
}

summary {
  color: var(--ds-color-brown-editorial);
  font-family: var(--ds-font-heading);
  font-weight: 600;
  line-height: 1.5;
}

.hotel {
  background: var(--ds-color-paper-light);
  border: 1px solid var(--ds-color-paper-deep);
  border-radius: var(--ds-radius-md);
}

.hotel:nth-child(3n+2) {
  background: var(--ds-color-surface-olive);
  border-color: var(--ds-color-border-olive);
}

.hotel:nth-child(3n) {
  background: var(--ds-color-surface-rose);
  border-color: var(--ds-color-border-rose);
}

.hotel small {
  color: var(--ds-color-ink-muted);
  font-family: var(--ds-font-heading);
}

.hotel a {
  color: var(--ds-color-brown);
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-xs);
  font-weight: 700;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.gift-box {
  background-color: var(--ds-color-paper);
  background-image: linear-gradient(rgb(255 249 238 / 88%), rgb(255 249 238 / 88%)), var(--ds-motif-floral-paper);
  background-position: center;
  background-size: cover;
  border: 1px solid var(--ds-color-paper-deep);
  border-radius: var(--ds-radius-lg);
}

.gift-box h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.qr-placeholder,
.qr-image {
  background: repeating-linear-gradient(45deg, var(--ds-color-brown) 0 5px, var(--ds-color-paper-light) 5px 10px);
  border: 1px solid var(--ds-color-paper-deep);
  border-radius: var(--ds-radius-sm);
}

.qr-placeholder {
  color: var(--ds-color-paper-light);
  font-family: var(--ds-font-heading);
  font-weight: 700;
}

.footer {
  background: var(--ds-color-brown-editorial);
  color: var(--ds-color-paper-light);
  font-family: var(--ds-font-display);
  font-size: var(--ds-text-2xl);
}

.footer span {
  color: var(--ds-color-paper-deep);
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-xs);
}

.modal {
  background: rgb(50 42 35 / 58%);
}

.modal-card {
  background: var(--ds-color-paper-light);
  border: 1px solid var(--ds-color-paper-deep);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-card);
  color: var(--ds-color-ink);
}

.modal-card p {
  color: var(--ds-color-ink-muted);
}

.close-button {
  color: var(--ds-color-brown);
}

.form-grid label {
  color: var(--ds-color-brown);
  font-family: var(--ds-font-heading);
  font-weight: 600;
  line-height: 1.5;
}

input,
select,
textarea {
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-color-ink);
  font-family: var(--ds-font-body);
  font-size: var(--ds-text-base);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-link:focus-visible,
.language-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.close-button:focus-visible,
.hotel a:focus-visible,
summary:focus-visible {
  box-shadow: var(--ds-focus-ring);
  outline: 2px solid var(--ds-color-focus);
  outline-offset: 3px;
  position: relative;
  z-index: 1;
}

.form-status {
  color: var(--ds-color-brown);
  font-family: var(--ds-font-body);
}

@media (max-width: 760px) {
  .site-nav {
    gap: 0.5rem;
    padding-inline: clamp(0.875rem, 4vw, 1.25rem);
  }

  .brand {
    font-size: clamp(1.05rem, 4.3vw, 1.35rem);
  }

  .languages {
    gap: 0.4rem;
  }

  .language-button {
    min-width: 2.75rem;
    padding-inline: 0.25rem;
  }

  h1 {
    font-size: clamp(3.75rem, 15vw, 4.75rem);
  }

  h2 {
    font-size: clamp(2rem, 9vw, 2.7rem);
  }

  .section {
    padding-inline: clamp(1.25rem, 7vw, 1.75rem);
  }

  .gift-box {
    padding: clamp(1.25rem, 6vw, 1.875rem);
  }

  .qr-images {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .section-photo,
  .primary-button,
  .secondary-button {
    transition: none;
  }
}
