/* ==========================================================================
   Cátia & Filipe — 27.07.2025
   Fine Art Editorial · paleta quente
   ========================================================================== */

:root {
  --cream:        #FAF7F2;
  --cream-deep:   #F2EDE4;
  --ink:          #3A3733;
  --ink-soft:     #6E675E;
  --olive:        #6B7A3A;
  --amber:        #B8834A;
  --hairline:     #D9D0C2;

  --serif:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

.sep  { color: var(--hairline); padding: 0 .35em; }
.amp  { color: var(--olive); font-style: italic; }

.rule {
  width: 1px; height: 4.5rem;
  margin: 3rem auto 0;
  background: linear-gradient(to bottom, var(--hairline), transparent);
}

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

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  text-align: center;
  color: #fff;
  background: var(--cream-deep);
}

.hero__media { position: absolute; inset: 0; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* o casal vive no terço superior-esquerdo; o texto assenta por baixo */
  object-position: 42% 26%;
}

.hero__veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(28,24,20,.30) 0%,
      rgba(28,24,20,.06) 26%,
      rgba(28,24,20,.30) 55%,
      rgba(28,24,20,.72) 100%);
}

.hero__inner {
  position: relative;
  grid-row: 2;
  padding: 0 var(--gutter) clamp(4.5rem, 11vh, 7rem);
  text-shadow: 0 1px 20px rgba(20,16,12,.45);
}

.hero__eyebrow {
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  opacity: .85;
}

.monogram {
  margin: 0;
  font-weight: 300;
  font-size: clamp(3.75rem, 13vw, 7.5rem);
  line-height: .92;
  letter-spacing: .02em;
}
.monogram .amp {
  color: #C7D18E;
  font-size: .62em;
  vertical-align: .08em;
  padding: 0 .06em;
}

.hero__date {
  margin: 1.5rem 0 0;
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .92;
}
.hero__date .sep { color: rgba(255,255,255,.5); }

.hero__motto {
  margin: 2rem auto 0;
  max-width: 22rem;
  font-style: italic;
  font-size: clamp(1.1875rem, 2.8vw, 1.5rem);
  line-height: 1.45;
  opacity: .95;
}

.hero__scroll {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1.5rem;
  color: rgba(255,255,255,.7);
  transition: opacity .3s, transform .3s;
}
.hero__scroll:hover { opacity: 1; transform: translateX(-50%) translateY(3px); }

/* em ecrãs baixos e largos o casal sobe demasiado */
@media (min-aspect-ratio: 16/10) {
  .hero__media img { object-position: 42% 30%; }
}

/* ============================ PORTA DE ENTRADA ========================== */

.gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  color: #fff;
  background: var(--cream-deep);
}

.gate__media { position: fixed; inset: 0; }
.gate__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 42% 30%;
}
.gate__veil {
  position: fixed; inset: 0;
  background: linear-gradient(to bottom, rgba(28,24,20,.46), rgba(28,24,20,.66));
}

.gate__inner {
  position: relative;
  padding: var(--gutter);
  text-shadow: 0 1px 20px rgba(20,16,12,.5);
}

.gate .monogram { font-size: clamp(3.5rem, 12vw, 6rem); }

.gate__date {
  margin: 1.25rem 0 0;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .9;
}
.gate__date .sep { color: rgba(255,255,255,.45); }

.gate__form { margin: 3.5rem auto 0; max-width: 21rem; }

.gate__label {
  display: block;
  margin-bottom: .85rem;
  font-style: italic;
  font-size: 1.0625rem;
  opacity: .92;
}

.gate__row {
  display: flex;
  align-items: stretch;
  gap: .5rem;
  border-bottom: 1px solid rgba(255,255,255,.42);
  transition: border-color .25s;
}
.gate__row:focus-within { border-color: rgba(255,255,255,.9); }

.gate__row input {
  flex: 1;
  min-width: 0;
  padding: .6rem .2rem;
  border: 0;
  background: none;
  color: #fff;
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: .08em;
  text-align: center;
}
.gate__row input:focus { outline: none; }
.gate__row input[aria-invalid="true"] { color: #F3C7B6; }

.gate__row button {
  flex: 0 0 auto;
  width: 2.75rem;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: #fff;
  opacity: .7;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
}
.gate__row button:hover { opacity: 1; transform: translateX(2px); }

.gate__erro {
  margin: 1.1rem 0 0;
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .1em;
  color: #F3C7B6;
}

/* ============================ SECÇÕES =================================== */

.section {
  padding: clamp(4.5rem, 11vw, 9rem) var(--gutter);
  text-align: center;
}

.section__title {
  margin: 0 0 1.25rem;
  font-weight: 300;
  font-size: clamp(1.875rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: .01em;
}

.section__lead {
  margin: 0 auto;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.0625rem;
}

/* ---- contador ---- */

.counter { padding-bottom: 0; }

.counter__label {
  margin: 0;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.counter__value {
  margin: .75rem 0 0;
  font-size: clamp(3.25rem, 11vw, 6.5rem);
  line-height: 1;
  font-weight: 300;
  color: var(--amber);
}
.counter__unit {
  font-size: .26em;
  letter-spacing: .24em;
  text-transform: uppercase;
  font-family: var(--sans);
  color: var(--ink-soft);
  vertical-align: .9em;
  margin-left: .2em;
}

/* ---- filme ---- */

.film__frame {
  margin: 3rem auto 0;
  max-width: 62rem;
  background: #1B1815;
  box-shadow: 0 2px 3px rgba(58,55,51,.06), 0 18px 48px rgba(58,55,51,.13);
}
.film__frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #1B1815;
}

.film__nota {
  margin: 1.25rem 0 0;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.film__nota a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: color .25s, border-color .25s;
}
.film__nota a:hover { color: var(--ink); border-color: var(--amber); }

/* mantido para a página do arquivo, que ainda usa o cartão */
.film__card {
  position: relative;
  display: block;
  margin: 3rem auto 0;
  max-width: 62rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1B1815;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 2px 3px rgba(58,55,51,.06), 0 18px 48px rgba(58,55,51,.13);
}

.film__card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.film__card:hover img { transform: scale(1.03); }

.film__veil {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,16,12,.18), rgba(20,16,12,.62));
}

.film__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -55%);
  width: 5.5rem; height: 5.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 50%;
  padding-left: .35rem;
  transition: background-color .35s, border-color .35s;
}
.film__card:hover .film__play {
  background: rgba(255,255,255,.14);
  border-color: #fff;
}

.film__cta {
  position: absolute;
  left: 0; right: 0; bottom: 2rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.375rem;
  letter-spacing: .02em;
  text-shadow: 0 1px 16px rgba(20,16,12,.5);
}
.film__cta small {
  display: block;
  margin-top: .4rem;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .8;
}

/* ============================ GALERIA =================================== */

.voltar {
  margin: 0 0 2.5rem;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.voltar a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color .25s, border-color .25s;
}
.voltar a:hover { color: var(--ink); border-color: var(--hairline); }

/* A barra de capítulos acompanha o scroll: com 1086 fotografias, quem está a
   meio da Festa não pode ter de voltar ao topo para mudar de secção. */
.chapters {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 3rem calc(var(--gutter) * -1) 0;
  padding: .9rem var(--gutter);
  background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.chapters.is-presa { border-bottom-color: var(--hairline); }

.chapters ul {
  margin: 0; padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: .35rem 1.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.chapters ul::-webkit-scrollbar { display: none; }
.chapters li { flex: 0 0 auto; }

.chapters a {
  display: inline-block;
  padding: .3rem 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.chapters a:hover { color: var(--ink); border-color: var(--hairline); }
.chapters a[aria-current="true"] { color: var(--ink); border-color: var(--amber); }

.gallery__placeholder {
  margin: 4rem auto 0;
  color: var(--ink-soft);
  font-style: italic;
}

.chapter { margin-top: clamp(3.5rem, 8vw, 6rem); scroll-margin-top: 5rem; }

/* voltar ao topo — aparece depois do primeiro ecrã */
.topo {
  position: fixed;
  right: clamp(1rem, 3vw, 2.5rem);
  bottom: clamp(1rem, 3vw, 2.5rem);
  z-index: 30;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: rgba(250, 247, 242, .94);
  backdrop-filter: blur(10px);
  color: var(--ink-soft);
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .3s, transform .3s, visibility .3s, color .25s, border-color .25s;
}
.topo.is-visivel { opacity: 1; visibility: visible; transform: none; }
.topo:hover { color: var(--ink); border-color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) {
  .topo { transition: opacity .3s, visibility .3s; transform: none; }
}

/* rodapé da galeria: sair sem ter de rolar até ao fim de tudo */
.fim-galeria {
  margin-top: clamp(4rem, 9vw, 7rem);
  text-align: center;
}
.fim-galeria a {
  display: inline-block;
  padding: .9rem 2.25rem;
  border: 1px solid var(--ink-soft);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .3s, color .3s, border-color .3s;
}
.fim-galeria a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.chapter__title {
  margin: 0 0 .35rem;
  font-weight: 300;
  font-size: clamp(1.375rem, 3vw, 1.875rem);
}

.chapter__count {
  margin: 0 0 2rem;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: .5rem;
}
@media (min-width: 60rem) {
  .grid { gap: .75rem; }
}

.grid a {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--cream-deep);
  aspect-ratio: 1;
  /* com ~1000 miniaturas, poupa ao browser o layout do que está fora do ecrã */
  content-visibility: auto;
  contain-intrinsic-size: auto 15rem;
}

.grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .75s cubic-bezier(.2,.7,.2,1), opacity .4s;
}
.grid a:hover img { transform: scale(1.035); }

/* ============================ A HISTÓRIA ================================ */

.historia { padding-bottom: clamp(3rem, 8vw, 6rem); }
.historia__abertura { padding-bottom: 0; }

.hist {
  --hist-gap: clamp(.5rem, 1.4vw, 1rem);
  --hist-ar: 66rem;          /* largura máxima dos blocos contidos */
  margin-top: clamp(3rem, 8vw, 6rem);
}

/* cada bloco entra devagar quando chega ao ecrã */
.hist > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1);
}
.hist > .is-visivel { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hist > * { opacity: 1; transform: none; transition: none; }
}

.hist a { display: block; overflow: hidden; background: var(--cream-deep); }
.hist img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.hist a:hover img { transform: scale(1.025); }

/* --- larguras --- */

/* A largura toda, mas nunca mais alta do que o ecrã: uma fotografia que
   obriga a rolar para se ver inteira deixa de funcionar como respiro. */
.hist__full { margin: var(--hist-gap) 0; }
.hist__full a {
  height: min(82vh, 40rem);
  aspect-ratio: auto;
}
/* numa faixa mais panorâmica do que a fotografia, o corte tem de sair de
   baixo: as caras vivem no terço superior. */
.hist__full img { object-position: center 32%; }
@media (max-width: 46rem) {
  .hist__full a { height: min(70vh, 30rem); }
}

.hist__duo,
.hist__trio {
  display: grid;
  gap: var(--hist-gap);
  margin: var(--hist-gap) auto;
  max-width: var(--hist-ar);
  padding: 0 var(--hist-gap);
}
.hist__duo { grid-template-columns: 1fr; }
.hist__trio { grid-template-columns: 1fr; }

@media (min-width: 46rem) {
  .hist__duo { grid-template-columns: 1fr 1fr; }
  .hist__trio { grid-template-columns: repeat(3, 1fr); }
}

/* os pares são todos em paisagem: 3/2 respeita o enquadramento original */
.hist__duo a { aspect-ratio: 3 / 2; }
.hist__trio a { aspect-ratio: 1; }

.hist__solo {
  margin: clamp(2.5rem, 6vw, 5rem) auto;
  max-width: 34rem;
  padding: 0 var(--hist-gap);
}
.hist__solo a { aspect-ratio: 4 / 5; }

/* --- respiros --- */

.hist__cap {
  margin: clamp(4.5rem, 11vw, 8rem) auto clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  font-weight: 300;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  letter-spacing: .01em;
  color: var(--ink);
}
.hist__cap::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  margin: 1.25rem auto 0;
  background: var(--hairline);
}

.hist__quote {
  margin: clamp(4rem, 10vw, 7.5rem) auto;
  max-width: 34rem;
  padding: 0 var(--gutter);
  text-align: center;
}
.hist__quote p {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.375rem, 3.2vw, 1.875rem);
  line-height: 1.55;
  color: var(--ink);
}
.hist__quote footer {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================ ARQUIVO =================================== */

.arquivo { background: var(--cream-deep); }

.arquivo__btn {
  display: inline-block;
  margin-top: 2.5rem;
  padding: .9rem 2.25rem;
  border: 1px solid var(--ink-soft);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .3s, color .3s, border-color .3s;
}
.arquivo__btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

/* ============================ VOTOS ===================================== */

.vows { background: var(--cream-deep); }

.vows__intro {
  margin: 0 auto 3.5rem;
  max-width: 26rem;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1.9;
  color: var(--ink-soft);
}

.vows__pair {
  display: grid;
  gap: clamp(3rem, 7vw, 5rem);
  max-width: 58rem;
  margin: 0 auto;
}
@media (min-width: 52rem) {
  .vows__pair { grid-template-columns: 1fr 1fr; align-items: start; }
}

.vows__one { margin: 0; }

.vows__text {
  margin: 0 auto;
  max-width: 26rem;
  font-style: italic;
  font-size: clamp(1.1875rem, 2.6vw, 1.5rem);
  line-height: 1.6;
  color: var(--ink);
}

/* o eco: os dois fecharam com a mesma ideia */
.vows__text em {
  font-style: italic;
  color: var(--amber);
}

.vows__attr {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: .6875rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================ AGRADECIMENTO ============================= */

.thanks__text {
  margin: 0 auto;
  max-width: var(--measure);
  color: var(--ink-soft);
}

.thanks__sign {
  margin: 2.75rem 0 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 300;
}

/* ============================ RODAPÉ ==================================== */

.footer {
  padding: 3.5rem var(--gutter) 4.5rem;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .12em;
  color: var(--ink-soft);
}

.footer p { margin: 0 0 .75rem; }

.footer__title {
  margin-bottom: 2rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.125rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.credits {
  margin: 0 auto 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 4rem;
  max-width: 40rem;
}

.credits__item { margin: 0; }

.credits dt {
  font-size: .625rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .7;
}

.credits dd {
  margin: .4rem 0 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0;
}

.credits a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: border-color .25s;
}
.credits a:hover { border-color: var(--amber); }

.credits__loc {
  display: block;
  margin-top: .2rem;
  font-family: var(--sans);
  font-size: .625rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .6;
}

.footer__note { opacity: .65; letter-spacing: .1em; }

/* ============================ PHOTOSWIPE ================================ */

.pswp { --pswp-bg: #1B1815; --pswp-placeholder-bg: #2A2622; }

/* o botão de descarregar é um <a>, não herda os estilos base do pswp__button */
a.pswp__button--download {
  width: 50px;
  height: 60px;
  display: grid;
  place-items: center;
  background: none;
  color: #fff;
  opacity: .75;
  text-decoration: none;
  transition: opacity .2s;
}
a.pswp__button--download:hover { opacity: 1; }
a.pswp__button--download svg { width: 26px; height: 26px; display: block; }
