/* ===== Tokens ===== */
:root {
  --paper: #F7F3EC;
  --surface: #FFFFFF;
  --ink: #1C1C1A;
  --pine: #2B3A2E;
  --sage: #5C6E52;
  --sage-soft: #A9B69C;
  --gold: #C08A4E;
  --border: rgba(43, 58, 46, 0.16);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;

  --measure: 62ch;
  --gap-section: clamp(4rem, 8vw, 8rem);

  --bg-historia: #F7F3EC;
  --bg-galeria: #EFEAE0;
  --bg-local: #F1EEE3;
  --bg-informacoes: #E9E4D6;
  --bg-rsvp: #F1EEE3;
  --bg-presentes: #EFEAE0;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--pine);
  margin: 0;
  line-height: 1.1;
}

p { margin: 0 0 1em; }

a { color: var(--pine); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--pine);
  color: var(--paper);
  padding: 0.75em 1.25em;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ===== Layout helpers ===== */
section {
  padding: var(--gap-section) 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
}

#historia,
#galeria,
#local,
#informacoes,
#rsvp,
#presentes {
  scroll-margin-top: 5rem;
}

#historia { background: var(--bg-historia); }
#galeria { background: var(--bg-galeria); }
#local { background: var(--bg-local); }
#informacoes { background: var(--bg-informacoes); }
#rsvp { background: var(--bg-rsvp); }
#presentes { background: var(--bg-presentes); }

#historia, #galeria, #local, #informacoes, #rsvp, #presentes {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

#historia > *, #galeria > *, #local > *, #informacoes > *, #rsvp > *, #presentes > * {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 500;
  margin-bottom: 2.5rem;
}

/* ===== Buttons ===== */
.button {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.9em 1.9em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.button[hidden] { display: none; }

.button--primary {
  background: var(--gold);
  color: var(--paper);
}
.button--primary:hover {
  background: #a97539;
}

.button--ghost {
  background: transparent;
  border-color: var(--pine);
  color: var(--pine);
}
.button--ghost:hover {
  background: var(--pine);
  color: var(--paper);
}

/* ===== Nav ===== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 236, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-nav__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav__brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--pine);
  text-decoration: none;
}

.site-nav__links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--sage);
}
.site-nav__links a:hover {
  color: var(--pine);
}

.site-nav__links a.is-active {
  color: var(--pine);
  font-weight: 600;
}

@media (max-width: 640px) {
  .site-nav__inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav__links {
    gap: 1rem;
    flex-shrink: 0;
  }
  .site-nav__links a {
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .site-nav__brand {
    flex-shrink: 0;
  }
}

/* ===== Hero ===== */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  max-width: none;
  padding-top: 4rem;
  padding-bottom: 4rem;
  background:
    linear-gradient(180deg, rgba(28, 28, 26, 0.35), rgba(28, 28, 26, 0.55)),
    url("../assets/img/hero.webp") center / cover no-repeat;
}

.hero__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  animation: hero-in 0.9s ease both;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__kicker {
  font-size: 1rem;
  color: var(--paper);
  margin-bottom: 0.5rem;
}

.hero__names {
  font-size: clamp(2.5rem, 9vw, 6rem);
  font-weight: 500;
  color: var(--paper);
  overflow-wrap: break-word;
}

.hero__amp {
  display: inline-block;
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
  margin: 0 0.15em;
}

.hero__date {
  font-size: 1.15rem;
  color: var(--paper);
  margin-top: 0.75rem;
  margin-bottom: 2.5rem;
}

.countdown {
  display: flex;
  gap: clamp(1rem, 4vw, 2.5rem);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
}

.countdown__value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.countdown__label {
  font-size: 0.8rem;
  color: rgba(247, 243, 236, 0.75);
  margin-top: 0.4em;
}

/* ===== Story ===== */
.story__entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.story__entry--reverse .story__text { order: 2; }
.story__entry--reverse .story__image { order: 1; }

.story__text {
  max-width: var(--measure);
}

.story__text h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.story__image {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--sage-soft), var(--sage));
  border-radius: 2px;
  overflow: hidden;
}

.story__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story__image--b { background: linear-gradient(135deg, #d9c9a8, var(--gold)); }
.story__image--c { background: linear-gradient(135deg, var(--pine), var(--sage)); }

@media (max-width: 720px) {
  .story__entry,
  .story__entry--reverse {
    grid-template-columns: 1fr;
  }
  .story__entry--reverse .story__text,
  .story__entry--reverse .story__image {
    order: initial;
  }
}

/* ===== Gallery ===== */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 12rem;
  gap: 0.75rem;
}

.gallery__item {
  background: linear-gradient(160deg, var(--sage-soft), var(--pine) 140%);
  border-radius: 2px;
  overflow: hidden;
}

.gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__item--tall {
  grid-row: span 2;
}

.gallery__item:nth-child(3n+2) { background: linear-gradient(160deg, #e4d5b7, var(--gold) 140%); }
.gallery__item:nth-child(3n+3) { background: linear-gradient(160deg, var(--sage), var(--pine) 140%); }

@media (max-width: 640px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 9rem;
  }
}

/* ===== Venue ===== */
.venue__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.venue__details dl {
  margin: 0;
}

.venue__row {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.venue__row dt {
  font-size: 0.85rem;
  color: var(--sage);
  margin-bottom: 0.3em;
}

.venue__row dd {
  margin: 0;
  font-size: 1.05rem;
}

.venue__map {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
}

.venue__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 720px) {
  .venue__grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Info cards ===== */
.info__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.info__card {
  border: 1px solid var(--border);
  padding: 2rem;
}

.info__card h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.info__card p {
  margin: 0;
  color: var(--ink);
}

@media (max-width: 720px) {
  .info__grid {
    grid-template-columns: 1fr;
  }
}

/* ===== RSVP ===== */
.rsvp {
  max-width: 40rem;
  text-align: left;
}

.rsvp__intro {
  color: var(--sage);
}

.rsvp__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: none;
  padding: 0;
  margin: 0;
}

.field label,
.field legend {
  font-size: 0.9rem;
  color: var(--sage);
  padding: 0;
}

.field input[type="text"],
.field input[type="number"],
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75em 0.9em;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 2px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
}

.radio-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1rem;
  color: var(--ink);
}

.rsvp__success {
  margin-top: 2rem;
  padding: 1.75rem;
  border: 1px solid var(--gold);
  background: rgba(192, 138, 78, 0.08);
}

.rsvp__success h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.rsvp__success p {
  margin: 0;
}

.rsvp__list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rsvp__list li {
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(192, 138, 78, 0.3);
  font-size: 0.95rem;
}

.rsvp__success .button {
  margin-top: 1.5rem;
}

/* ===== Gifts ===== */
.gifts__intro {
  max-width: var(--measure);
  color: var(--sage);
}

.gifts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.gift-card {
  border: 1px solid var(--border);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--surface);
}

.gift-card__image {
  width: calc(100% + 3.5rem);
  margin: -1.75rem -1.75rem 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--border);
}

.gift-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gift-card h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  font-family: var(--font-body);
}

.gift-card__desc {
  color: var(--sage);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.gift-card__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gift-card__price {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.25rem;
  margin: 0;
}

.gift-card__cta {
  align-self: flex-start;
}

@media (max-width: 860px) {
  .gifts__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .gifts__grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 3rem 1.5rem 4rem;
  border-top: 1px solid var(--border);
  color: var(--sage);
}

.site-footer__names {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--pine);
  margin: 0 0 0.25rem;
}

.site-footer__date,
.site-footer__hashtag {
  margin: 0.15rem 0;
  font-size: 0.9rem;
}

/* ===== Modal ===== */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 26, 0.5);
}

.modal__panel {
  position: relative;
  background: var(--paper);
  max-width: 26rem;
  padding: 2.25rem;
  border: 1px solid var(--border);
}

.modal__panel h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.modal__panel .button {
  margin-top: 1rem;
}

/* ===== Cart FAB ===== */
.cart-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--pine);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 0.75em 1.25em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(28, 28, 26, 0.25);
  font-family: var(--font-body);
  font-weight: 600;
}
.cart-fab[hidden] { display: none; }

.cart-fab__count {
  background: var(--gold);
  color: var(--paper);
  border-radius: 999px;
  min-width: 1.5em;
  height: 1.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.cart-fab__total {
  font-size: 0.9rem;
}

/* ===== Cart Drawer ===== */
.drawer[hidden] { display: none; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 26, 0.5);
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(24rem, 100%);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.drawer__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--pine);
}

.drawer__items {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.drawer__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75em 0;
  border-bottom: 1px solid var(--border);
}

.drawer__item-name {
  flex: 1;
  font-size: 0.95rem;
}

.drawer__item-price {
  color: var(--gold);
  font-family: var(--font-display);
}

.drawer__item-remove {
  background: none;
  border: none;
  color: var(--sage);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.drawer__footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.drawer__total {
  margin: 0 0 0.75rem;
}

/* ===== Checkout modal ===== */
.modal__panel--checkout {
  max-width: 24rem;
  text-align: center;
}

.checkout__qrcode {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.checkout__label {
  display: block;
  font-size: 0.85rem;
  color: var(--sage);
  text-align: left;
  margin-bottom: 0.25rem;
}

.checkout__payload {
  width: 100%;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.5em;
  border: 1px solid var(--border);
  resize: none;
  margin-bottom: 0.75rem;
}

.checkout__note {
  font-size: 0.85rem;
  color: var(--sage);
}

.checkout__thanks {
  font-family: var(--font-display);
  color: var(--pine);
  font-size: 1.1rem;
}
