/* ==========================================================================
   COMPONENTS: header, navigation, footer, links, carousel, gallery, form
   ========================================================================== */

/* ---------- Header + navigation ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(10px, 1.5vw, 22px) var(--gutter) 0 clamp(14px, 2.4vw, 34px);
  color: #fff;
  transition: transform 0.55s var(--ease);
}
/* the home hero is shown clean, as in Figma: no dark fade until you scroll */
body:has(#hero) .site-header:not(.is-scrolled)::before {
  opacity: 0;
}
/* Home: the big hero logo flies up into the header and becomes the monogram (js/logo-morph.js).
   Until it has arrived, the header's monogram stays hidden, so there is only ever one logo. */
.js body:has(#hero) .site-header:not(.is-logo-docked) .brand {
  opacity: 0;
  pointer-events: none;
}
.hero__logo.is-flown {
  visibility: hidden;
}
.fly-logo {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 110;
  max-width: none;
  height: auto;
  transform-origin: 0 0;
  pointer-events: none;
}
body.nav-open .fly-logo {
  visibility: hidden !important;
}
/* soft dark fade behind the header once the page has scrolled */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -26px 0;
  z-index: -1;
  background: linear-gradient(rgba(24, 20, 20, 0.45), rgba(24, 20, 20, 0));
  opacity: 0.55; /* keeps the menu readable over bright photos */
  transition: opacity 0.4s;
  pointer-events: none;
}
.site-header.is-scrolled::before {
  opacity: 1;
}
.site-header.is-hidden {
  transform: translateY(-110%);
}

.brand {
  position: relative;
  z-index: 3;
  display: block;
}
.brand img {
  height: clamp(44px, 4.3vw, 64px);
  width: auto;
}

.site-nav {
  position: relative;
  z-index: 2;
  padding-top: clamp(6px, 1.2vw, 18px);
}
.nav-list {
  display: flex;
  gap: clamp(16px, 2.1vw, 32px);
  font-family: var(--font-ui);
  font-size: clamp(13px, 1.55vw, 23px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.2;
}
.nav-list a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.nav-list a:hover::after,
.nav-list a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Desktop/tablet: nav + monogram at Figma size (1440 x 1024), never larger than the design */
@media (min-width: 861px) {
  .site-header {
    --se: min(calc(100vw / 1440), calc(100vh / 1024));
    padding: calc(var(--se) * 26) calc(var(--se) * 33) 0 calc(var(--se) * 24.5);
  }
  .brand img {
    height: max(44px, calc(var(--se) * 65));
  }
  .site-nav {
    padding-top: 0;
    margin-top: calc(var(--se) * 4);
  }
  .nav-list {
    gap: calc(var(--se) * 20);
    font-size: max(13px, calc(var(--se) * 24));
  }
  /* EN / ES stands a little apart from the page links */
  .nav-list .lang { margin-left: calc(var(--se) * 16); }
  /* Spanish words are longer: a little less space so the menu stays on the photograph */
  html[lang="es"] .nav-list { gap: calc(var(--se) * 10); }
}
.nav-toggle {
  display: none;
  position: relative;
  z-index: 3;
  width: 44px;
  height: 44px;
  margin: 4px -8px 0 0;
}
.nav-toggle span {
  position: absolute;
  left: 9px;
  right: 9px;
  height: 1.5px;
  background: #fff;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 26px; }
.site-header.is-open .nav-toggle span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.site-header.is-open .nav-toggle span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* Tablet + mobile: full-screen menu */
@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--burgundy) url("../assets/images/textures/texture-burgundy.jpg") center / cover;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
  }
  .site-header.is-open .site-nav {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s var(--ease);
  }
  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 3vh, 24px);
    font-family: var(--font-ui);
    font-size: clamp(22px, 6vw, 34px);
    letter-spacing: 0.01em;
  }
  .site-header.is-hidden.is-open {
    transform: none;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark);
  color: #fff;
  padding: clamp(22px, 2.4vw, 34px) var(--gutter);
  font-family: var(--font-grotesk);
  font-size: clamp(13px, 1.15vw, 17px);
  letter-spacing: 0.01em;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 32px;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px clamp(16px, 2vw, 28px);
}
.site-footer__links a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-footer__links a:hover {
  border-bottom-color: currentColor;
}
.site-footer__links strong {
  font-weight: 700;
}

/* Footer that sits on top of a photo (Home) */
.site-footer--overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: transparent;
  text-shadow: 0 1px 12px rgba(30, 40, 70, 0.4);
}

@media (max-width: 640px) {
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  /* phone: the "Based in Ibiza · … · © 2026 PEC" line stays on one line */
  .site-footer__meta {
    white-space: nowrap;
    font-size: clamp(8.5px, 2.85vw, 13px);
  }
}

/* ---------- Text links with an arrow ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-ui);
  font-size: clamp(14px, 1.65vw, 24px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #fff;
}
.link-arrow span {
  display: inline-block;
  transition: transform 0.45s var(--ease);
}
.link-arrow:hover span {
  transform: translateX(6px);
}
.link-arrow--big {
  font-family: var(--font-grotesk);
  font-size: clamp(22px, 2.9vw, 42px);
}

/* ---------- Testimonial carousel ---------- */
.carousel {
  position: relative;
  background: #111;
  color: #fff;
}
.carousel__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar {
  display: none;
}
.carousel__track:focus-visible {
  outline-offset: -6px;
}
.slide {
  position: relative;
  flex: 0 0 100%;
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: 0 var(--gutter);
  overflow: hidden;
}
.slide__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 70%;
}
/* 4th photo: the ceremony aisle seen from behind */
.slide:nth-child(4) .slide__photo {
  object-position: 50% 60%;
}
.slide:nth-child(1) .slide__photo {
  object-position: 50% 50%;
}
/* subtle dark band so the quote stays readable over the photograph */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(0, 0, 0, 0) 22%,
    rgba(0, 0, 0, 0.38) 40%,
    rgba(0, 0, 0, 0.38) 58%,
    rgba(0, 0, 0, 0) 76%
  );
  pointer-events: none;
}
.slide__quote {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin-top: -6vh;
  text-align: center;
  font-family: "Cormorant Garamond", var(--font-serif);
  font-size: clamp(18px, 1.85vw, 27px);
  line-height: 1.5;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}
.slide__name {
  margin-bottom: 0.5em;
  letter-spacing: 0.04em;
}
.slide__meta {
  margin-top: 0.7em;
  opacity: 0.92;
}

/* phone: the photograph sits on top at its own proportions so both people stay in view,
   and the quote reads on the dark ground below it */
@media (max-width: 860px) {
  .slide {
    place-items: end center;
    padding-bottom: clamp(84px, 13svh, 110px);
  }
  .slide__photo {
    inset: 0 0 auto 0;
    height: max(300px, calc(100svh - 372px));
    -webkit-mask-image: linear-gradient(#000 78%, transparent);
    mask-image: linear-gradient(#000 78%, transparent);
  }
  .slide::after { display: none; }
  .slide__quote {
    margin-top: 0;
    font-size: clamp(16px, 4.3vw, 19px);
    line-height: 1.42;
  }
  .slide:nth-child(1) .slide__photo { object-position: 60% 50%; }
  .slide:nth-child(2) .slide__photo { object-position: 56% 50%; }
  .slide:nth-child(3) .slide__photo { object-position: 38% 50%; }
  .slide:nth-child(4) .slide__photo { object-position: 48% 60%; }
}

.carousel__btn {
  position: absolute;
  z-index: 3;
  bottom: clamp(36px, 7vh, 90px);
  width: clamp(76px, 8vw, 120px);
  height: 48px;
  display: grid;
  place-items: center;
  transition: opacity 0.4s, transform 0.45s var(--ease), visibility 0s;
}
.carousel__btn svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.carousel__btn--prev {
  left: clamp(var(--gutter), 10.7vw, 160px);
}
.carousel__btn--next {
  right: clamp(var(--gutter), 5vw, 90px);
}
.carousel__btn--prev svg {
  transform: scaleX(-1);
}
.carousel__btn--prev:hover { transform: translateX(-6px); }
.carousel__btn--next:hover { transform: translateX(6px); }
.carousel__btn[hidden-state="true"],
.carousel__btn.is-off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Projects gallery: one tile per wedding ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(6px, 0.9vw, 14px);
  padding: clamp(6px, 0.9vw, 14px);
  background: var(--dark) url("../assets/images/textures/texture-dark.jpg") center / cover;
}
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #3b3839;
  color: #fff;
  text-decoration: none;
}
/* black and white; the colour comes back when the pointer rests on the photo */
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform 1.2s var(--ease), filter 0.7s var(--ease);
  -webkit-user-drag: none;
  user-select: none;
}
/* soft shade so the names stay readable over any photo */
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.3);
  transition: background 0.7s var(--ease);
  pointer-events: none;
}
.tile__cap {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  padding: 0 6%;
  text-align: center;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.tile__names {
  font-size: clamp(18px, 1.85vw, 28px);
  line-height: 1.15;
}
.tile__venue {
  font-size: clamp(13px, 1.15vw, 18px);
  line-height: 1.2;
  opacity: 0.92;
}
.tile:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -6px;
}
.tile:focus-visible img,
.tile:active img {
  filter: none;
}
.tile:focus-visible::after,
.tile:active::after {
  background: rgba(10, 10, 10, 0.12);
}
/* only on devices that really have hover (not touch screens) */
@media (hover: hover) and (pointer: fine) {
  .tile:hover img {
    filter: none;
    transform: scale(1.05);
  }
  .tile:hover::after {
    background: rgba(10, 10, 10, 0.12);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile img,
  .tile::after {
    transition: none;
  }
  .tile:hover img {
    transform: none;
  }
}
@media (max-width: 640px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

/* English / Spanish versions of a text drawn by script: only the one for the page language shows */
html:not([lang="es"]) .es,
html[lang="es"] .en {
  display: none;
}

/* ---------- Inquiry form ---------- */
.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 26px) clamp(16px, 3vw, 44px);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.field--full {
  grid-column: 1 / -1;
}
.field label {
  font-size: clamp(18px, 1.65vw, 24px);
  line-height: 1.2;
}
.field label small {
  font-size: 0.7em;
  opacity: 0.75;
  letter-spacing: 0.02em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--gray);
  color: var(--dark);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--dark) 50%),
    linear-gradient(135deg, var(--dark) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.field textarea {
  min-height: 130px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}
.field [aria-invalid="true"] {
  border-color: #ffb9a8;
}
.field__error {
  min-height: 0;
  color: #ffd2c6;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.35;
}
.field__error:empty {
  display: none;
}

.form__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 6px;
}
.btn {
  display: inline-block;
  min-width: 210px;
  padding: 14px 36px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.65vw, 24px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  transition: background-color 0.3s, transform 0.3s var(--ease), opacity 0.3s;
}
.btn:hover {
  background: #7189ba;
  transform: translateY(-2px);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}
.form__note {
  font-family: var(--font-ui);
  font-size: 13px;
  opacity: 0.85;
}
.form__status {
  grid-column: 1 / -1;
  padding: 14px 18px;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  border-left: 3px solid #fff;
  background: rgba(255, 255, 255, 0.12);
}
.form__status[hidden] {
  display: none;
}
.form__status.is-success { border-color: #bfe3b4; }
.form__status.is-error   { border-color: #ffb9a8; }
.form__status a {
  text-decoration: underline;
}
/* honeypot field: hidden from people, visible to simple spam bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 560px) {
  .form {
    grid-template-columns: 1fr;
  }
  .btn {
    width: 100%;
  }
}

/* ---------- Language switch (EN / ES), last item of the navigation ---------- */
.nav-list .lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.nav-list .lang button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  padding: 6px 0;
  opacity: 0.75;
  border-bottom: 1px solid transparent;
  transition: opacity 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav-list .lang button:hover,
.nav-list .lang button[aria-pressed="true"] {
  opacity: 1;
}
.nav-list .lang button[aria-pressed="true"] {
  border-bottom-color: currentColor;
}
.nav-list .lang span {
  opacity: 0.75;
}

/* Secondary button (WhatsApp): outlined, next to "Send inquiry" */
.btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  color: #fff;
}
.btn--ghost svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}
