/* ==========================================================================
   components.css — reusable building blocks
   Buttons, photo frames, text block, reveal animations.
   (Shared foundations copied from the earlier wedding sites, then restyled
   through tokens.css. Components for this couple are added below.)
   Naming: .block, .block__part, .block--variant  (the "BEM" convention)
   ========================================================================== */

/* ---------- Button ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0.8rem 2.2rem;
  border: 1px solid var(--color-black);
  border-radius: 999px;
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.35s var(--ease-out), color 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.button:hover {
  background: transparent;
  color: var(--color-black);
  transform: translateY(-2px);
}

.button--outline {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-ink);
}

.button--outline:hover {
  background: var(--color-ink);
  color: var(--color-white);
}

/* White outline, for use over dark photos */
.button--light {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.8);
}

.button--light:hover {
  background: var(--color-white);
  color: var(--color-black);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------- Photo frames ---------- */
.photo {
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}

.photo:hover img { transform: scale(1.04); }

.photo--corner { border-radius: var(--radius-corner); }   /* one rounded corner, like the original */

/* ---------- Text block ---------- */
/* :where() keeps this rule weak, so components inside a .prose block can set their own colour */
:where(.prose) p { color: var(--color-ink-soft); }
.prose .button-row { margin-top: var(--space-4); }

/* ======================= Elijah & Mwaka components ======================= */

/* ---------- Gold accent for small touches (the "&" between their names) ---------- */
.gold { color: var(--color-gold); }

/* ---------- Section heading in their serif ---------- */
.section-heading {
  margin-bottom: var(--space-4);
  font-size: var(--text-2xl);
  letter-spacing: 0.01em;
}

/* ---------- Home: names beside a framed portrait, on the studio charcoal ---------- */
.hero-split {
  padding-block: var(--space-6) var(--section-pad);
  background: var(--color-charcoal);
  color: var(--color-white);
}

.hero-split__inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 860px) {
  .hero-split__inner { grid-template-columns: 1.15fr 0.85fr; }
}

.hero-split__names {
  margin-bottom: var(--space-4);
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.hero-split__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gold);
}

/* On narrow screens the venue drops to its own line, so the separator dot isn't needed */
@media (max-width: 480px) {
  .hero-split__meta span[aria-hidden] { display: none; }
}

/* The portrait stays at or below its real size (720 px) so it never looks soft */
.hero-split__photo {
  width: 100%;
  max-width: 26rem;
  aspect-ratio: 2 / 3;
  margin-inline: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

/* ---------- Love story photo ---------- */
.story-photo {
  max-width: 28rem;
  aspect-ratio: 4 / 5;
  margin-inline: auto;
}

.story-photo img { object-position: center 20%; }

/* ---------- Three portraits overlapping, the middle one in front ---------- */
.portrait-trio {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: center;
  max-width: 900px;
  margin-inline: auto;
}

.portrait-trio__side { aspect-ratio: 2 / 3; }
.portrait-trio__side:first-child { margin-right: -12%; }
.portrait-trio__side:last-child  { margin-left: -12%; }

.portrait-trio__main {
  position: relative;
  z-index: 1;
  aspect-ratio: 2 / 3;
  box-shadow: 0 30px 60px -25px rgba(20, 20, 20, 0.5);
}

/* ---------- Ornament: a thin gold line with a diamond in the middle ---------- */
.ornament {
  display: block;
  position: relative;
  width: 8rem;
  height: 1px;
  margin: 0 auto var(--space-4);
  background: var(--color-gold);
}

.ornament::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--color-gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ---------- You're Invited ---------- */
.invite { text-align: center; }

.invite__lead {
  max-width: 34ch;
  margin: 0 auto var(--space-4);
  font-size: var(--text-lg);
  font-style: italic;
}

.invite__text {
  max-width: 44ch;
  margin: 0 auto var(--space-5);
  color: var(--color-ink-soft);
}

/* ---------- Event Details: venue photo above the heading ---------- */
.details-header {
  margin-bottom: var(--space-6);
  text-align: center;
}

.details-header p { color: var(--color-ink-soft); }

/* The venue photo is only 640 px wide, so it is never shown larger */
.details-header__photo {
  max-width: 640px;
  margin: 0 auto var(--space-5);
  aspect-ratio: 16 / 10;
}

/* ---------- Four information cards ---------- */
.info-cards {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 640px)  { .info-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .info-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.info-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--color-line);
  border-top: 2px solid var(--color-gold);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  text-align: center;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.info-card p { margin: 0; color: var(--color-ink-soft); }

.info-card__mark {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-gold);
}

.info-card__title {
  margin-bottom: var(--space-1);
  font-size: var(--text-lg);
  font-weight: 400;
}

.info-card__times {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
}

.info-card__times div {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.info-card__times dt { color: var(--color-ink-soft); }
.info-card__times dd { margin: 0; font-family: var(--font-display); }

.info-card .info-card__highlight {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  color: var(--color-ink);
}

.info-card__link {
  margin-top: auto;
  padding-top: var(--space-4);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-gold-deep);
}

.info-card__link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Photo band: a short quote over a dark photo ---------- */
.photo-band {
  display: grid;
  place-items: center;
  min-height: clamp(16rem, 32vw, 24rem);
  padding: var(--space-6) var(--gutter);
  background-position: center;
  background-size: cover;
  color: var(--color-white);
  text-align: center;
}

.photo-band--flowers {
  background-image: linear-gradient(rgba(20, 20, 20, 0.45), rgba(20, 20, 20, 0.55)), url("../img/flowers.jpg");
}

.photo-band--silk {
  background-image: linear-gradient(rgba(20, 20, 20, 0.62), rgba(20, 20, 20, 0.72)), url("../img/silk.jpg");
}

.photo-band__quote {
  max-width: 26ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.35;
}

/* ---------- Register: form beside the details card ---------- */
.register { align-items: start; }

/* ---------- RSVP form (shown closed: the fieldset is disabled) ---------- */
.rsvp-form__closed {
  display: inline-block;
  margin-bottom: var(--space-5);
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--color-gold-deep);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--color-gold-deep);
}

.rsvp-form__fields {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  border: 0;
}

/* Greyed out, so it is clear the form can't be filled in */
.rsvp-form__fields:disabled { opacity: 0.55; }
.rsvp-form__fields:disabled .button { cursor: not-allowed; transform: none; }
.rsvp-form__fields .button { justify-self: start; }   /* button-sized, not stretched by the grid */

.field-row {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 600px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

.field {
  display: grid;
  gap: var(--space-1);
}

.field label,
.field legend {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.55rem 0;
  border: 0;
  border-bottom: 1px solid var(--color-grey-mid);
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
}

.field textarea { resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--color-gold-deep);
}

/* Yes / No choice */
.field--choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  border: 0;
}

.field--choice legend { float: left; margin-right: var(--space-3); }

.field--choice label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-ink);
}

/* ---------- Details card: the day at a glance, in charcoal and gold ---------- */
.summary-card {
  padding: var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--color-charcoal);
  color: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.summary-card__label {
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.summary-card__names {
  margin-bottom: var(--space-4);
  font-size: var(--text-xl);
  font-weight: 400;
}

.summary-card__list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.summary-card__list div {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.summary-card__list dt {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
}

.summary-card__list dd {
  margin: 0;
  font-family: var(--font-display);
}

/* ---------- Reveal on scroll (driven by js/main.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* If JavaScript is off, show everything */
.no-js .reveal {
  opacity: 1;
  transform: none;
}
