/*
 * Mobile QA safeguards.
 *
 * Loaded after each page's own styles. Keeps the original desktop and tablet
 * composition intact while making the small-screen version easier to tap and
 * preventing the shared marketing header from clipping at 360–375px.
 */

/* Enforce >= 16px on all RSVP and dynamically injected meal/dietary controls at all viewports. */
form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="number"],
form input[type="search"],
form textarea,
form select,
.guest-meals select,
.guest-meal select,
.guest-dietary textarea {
  font-size: max(16px, 1rem) !important;
}

@media (max-width: 48rem) {
  /* Keep anchored headings clear of sticky invitation headers. */
  html {
    scroll-padding-top: 6rem;
  }

  /* Shared marketing header: 40px+ hit areas without changing its look. */
  .ag-brand,
  .ag-header-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .ag-nav a:not(.ag-nav-hide-sm):not(.ag-nav-hide-md) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .ag-header-inner {
    gap: 0.75rem;
  }

  /* Homepage cinema reel. */
  .ag-reel-step {
    width: 44px;
    height: 44px;
  }

  .ag-reel-preview {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .ag-reel-bar {
    min-height: 56px;
  }

  /* Collection stage, filters and card actions. */
  .col-pill,
  .col-film-toggle,
  .col-filter-pill,
  .col-text-action,
  .col-card-link,
  .col-card-create {
    min-height: 44px;
  }

  .col-pill,
  .col-film-toggle,
  .col-filter-pill,
  .col-text-action,
  .col-card-create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .col-text-action {
    padding-inline: 0.25rem;
  }

  .col-film-toggle {
    padding-block: 0;
  }

  .col-card-link {
    display: inline-flex;
    align-items: center;
    padding-block: 0.5rem;
  }

  /*
   * Invitation template navigation uses small typographic links by design.
   * Expand their hit boxes without increasing header height or disturbing the
   * cover/hero framing.
   */
  .invite-header .invite-nav a,
  .bh-nav nav a,
  .vs-nav nav a,
  .rl-nav nav a,
  .af-nav a,
  .ch-nav a,
  .qn-nav a,
  .dr-nav a,
  .ma-nav a,
  .sb-nav a {
    position: relative;
    z-index: 1;
  }

  .invite-header .invite-nav a::after,
  .bh-nav nav a::after,
  .vs-nav nav a::after,
  .rl-nav nav a::after,
  .af-nav a::after,
  .ch-nav a::after,
  .qn-nav a::after,
  .dr-nav a::after,
  .ma-nav a::after,
  .sb-nav a::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -16px -6px;
  }

  .bh-nav-utilities .bh-music {
    position: relative;
  }

  .bh-nav-utilities .bh-music::after {
    content: "";
    position: absolute;
    inset: -6px -4px;
  }

  .rl-music,
  .vs-music,
  .bh-music,
  .af-music-btn,
  .ch-music-btn,
  .music-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  #edit-reply,
  #bb-edit-reply,
  #rl-edit-reply,
  #bh-edit-reply,
  #vs-edit-reply,
  #af-edit-reply,
  #ch-edit-reply,
  .bh-pill-link,
  .vs-pill-link,
  .rl-map-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  .venue-skip {
    min-height: 44px;
  }

  /* Studio tabs and dashboard controls. */
  .studio-bar [role="tab"],
  [data-workspace-choice],
  [data-dash-tab],
  .studio-btn,
  .wizard-chip,
  .dash-pill,
  .dash-act,
  .dash-search {
    min-height: 44px !important;
  }

  .dash-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Studio header/draft links: expand the touch area without reflowing. */
  .studio-bar a,
  .studio-drafts a,
  .studio-quiet {
    position: relative;
  }

  .studio-bar a::after,
  .studio-drafts a::after,
  .studio-quiet::after {
    content: "";
    position: absolute;
    inset: -12px -6px;
  }

  /* Organizer. */
  .sidebar nav a {
    min-height: 44px !important;
  }

  .filters button,
  .button,
  .nav-link {
    min-height: 44px;
  }

  .filters button {
    min-width: 40px;
  }

  .search-field input {
    min-height: 44px;
  }
}

@media (max-width: 24rem) {
  /* Keep the cinematic marketing header inside a 360–375px viewport. */
  .ag-header {
    padding-block: 0.7rem;
  }

  .ag-header-inner {
    gap: 0.35rem;
  }

  .ag-nav {
    gap: 0.25rem;
  }

  .ag-brand {
    font-size: 1.45rem;
  }

  .ag-nav a {
    font-size: 0.69rem;
  }

  .ag-header-cta {
    padding-inline: 0.72rem;
    font-size: 0.68rem;
  }
}

/* ==========================================================================
   Portrait Mobile Cinema Framing (Zero Video Cropping Across All 8 Suites)
   Displays 100% of every opening video frame edge-to-edge on portrait phones
   over a color-matched ambient blurred poster backdrop — zero harsh letterbox
   bars, zero horizontal zoom-crop, and unobstructed top/bottom cover copy.
   ========================================================================== */

@media (max-width: 52rem) and (max-aspect-ratio: 1 / 1) {
  /* ── 1. The Blue Hour (/i/baby-blue · 16:9 bb-opening.mp4) ─────────────── */
  .bb-cover {
    background: #cddbe5;
  }

  .bb-cover::before {
    content: "";
    position: absolute;
    inset: -12%;
    z-index: 0;
    background: url("/assets/bb-opening-poster.jpg") center / cover no-repeat;
    filter: blur(28px) brightness(1.05) saturate(0.92);
    opacity: 0.78;
    pointer-events: none;
  }

  .bb-cover-scene {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 2;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translateY(-50%);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
  }

  .bb-cover-scene > :is(img, video),
  .bb-opening-poster,
  .bb-opening-film {
    object-fit: contain;
    object-position: center center;
  }

  .bb-cover-veil {
    z-index: 2;
    background: linear-gradient(
      180deg,
      rgba(248, 245, 239, 0.84) 0%,
      rgba(248, 245, 239, 0.56) 24%,
      rgba(248, 245, 239, 0) 34%,
      rgba(248, 245, 239, 0) 66%,
      rgba(248, 245, 239, 0.58) 76%,
      rgba(248, 245, 239, 0.9) 100%
    );
  }

  .bb-cover-top {
    padding: 0.95rem var(--gutter) 0.5rem;
  }

  .bb-cover-content {
    z-index: 3;
    justify-content: flex-start;
    height: 100svh;
    min-height: 100svh;
    padding: clamp(3.35rem, 6.8svh, 4.6rem) var(--gutter) clamp(2.85rem, 6.2svh, 4.2rem);
  }

  .bb-cover-monogram {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0.45rem 0 0.45rem;
    font-size: 1rem;
  }

  .bb-cover-names {
    font-size: clamp(2.25rem, 9.8vw, 3.15rem);
    line-height: 1.08;
  }

  .bb-cover-date {
    margin-top: 0.85rem;
    font-size: 0.62rem;
  }

  .bb-enter-wrap {
    margin-top: auto;
    padding-bottom: 0.75rem;
  }

  .bb-cover-footer {
    bottom: clamp(0.85rem, 2.2svh, 1.35rem);
  }

  /* Blue Hour interior Lake Como dusk panorama video — full uncropped 16:9 */
  .bb-site .bh-hero {
    grid-template: auto auto / minmax(0, 1fr);
  }

  .bb-site .bh-hero-art {
    grid-area: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .bb-site .bh-hero-art .bb-panorama-scene {
    inset: 0;
    --lake-position: 50% 50%;
  }

  .bb-site .bh-hero-art .bb-panorama-scene > :is(img, video) {
    object-fit: contain;
    object-position: center center;
  }

  .bb-site .bh-hero-art .bb-panorama-view::after {
    background: linear-gradient(0deg, var(--bh-midnight) 0%, rgba(17, 31, 42, 0.34) 22%, transparent 48%);
  }

  .bb-site .bh-hero-copy {
    grid-area: auto;
    align-self: start;
    padding: 1.4rem var(--bh-gutter) 2.9rem;
  }

  /* ── 2. The Sunlit Arch (/i/sunlit-arch · 16:9 bh-opening.mp4) ─────────── */
  .bh-opening__stage {
    background: #e5d7c4;
  }

  .bh-opening__stage::before {
    content: "";
    position: absolute;
    inset: -12%;
    z-index: 0;
    background: url("/assets/bh-opening-poster.jpg") center / cover no-repeat;
    filter: blur(28px) brightness(1.03) saturate(0.9);
    opacity: 0.7;
    pointer-events: none;
  }

  .bh-opening__stage::after {
    z-index: 3;
    background: linear-gradient(
      to bottom,
      rgba(244, 236, 225, 0.74) 0%,
      rgba(244, 236, 225, 0.34) 26%,
      transparent 35%,
      transparent 65%,
      rgba(244, 236, 225, 0.44) 74%,
      rgba(244, 236, 225, 0.8) 100%
    );
  }

  .bh-opening__poster,
  .bh-opening__video {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translateY(-50%);
    object-fit: contain;
    object-position: center center;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
  }

  .bh-opening__video {
    z-index: 2;
  }

  .bh-opening__top {
    z-index: 5;
    top: clamp(4.15rem, 11svh, 6.8rem);
  }

  .bh-opening__monogram {
    z-index: 5;
    bottom: clamp(7.8rem, 18svh, 10.6rem);
  }

  .bh-opening__prompt {
    z-index: 6;
    bottom: clamp(3.4rem, 8svh, 4.8rem);
  }

  /* Sunlit Arch interior watercolor arch painting — full uncropped 768x1376 */
  .bh-hero-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 768 / 1376;
  }

  .bh-hero-stage::before {
    background-size: 100% 100%;
    background-position: center center;
  }

  .bh-hero-copy {
    top: 17%;
    width: min(74%, 19.5rem);
  }

  .bh-hero-message {
    max-width: 17rem;
    font-size: 0.88rem;
    line-height: 1.55;
  }

  /* ── 3. The Velvet Seal (/i/velvet-seal · 16:9 vs-opening.mp4) ─────────── */
  .vs-opening__stage {
    background: #1b0309;
  }

  .vs-opening__stage::before {
    content: "";
    position: absolute;
    inset: -12%;
    z-index: 0;
    background: url("/assets/vs-opening-poster.jpg?v=20261123c") center / cover no-repeat;
    filter: blur(28px) brightness(0.62) saturate(1.1);
    opacity: 0.88;
    pointer-events: none;
  }

  .vs-opening__poster,
  .vs-opening__video {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translateY(-50%);
    object-fit: contain;
    object-position: center center;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
  }

  .vs-opening__video {
    z-index: 2;
  }

  .vs-opening__top {
    z-index: 5;
    top: clamp(3.9rem, 10svh, 6.5rem);
    padding: 0.5rem 1.25rem;
    background: none;
  }

  .vs-opening__monogram {
    z-index: 5;
    bottom: clamp(8rem, 18.2svh, 10.8rem);
    padding: 0.5rem 1.25rem;
    background: none;
  }

  .vs-opening__prompt {
    z-index: 6;
    bottom: clamp(3.5rem, 8.2svh, 5rem);
  }

  /* Velvet Seal interior hero — preserve corner blush roses & velvet silk uncropped
     with a gentle centered velvet vignette so champagne typography stays crisp */
  .vs-hero-stage {
    min-height: calc(100vw * 1376 / 768);
    background-color: #21040b;
    background-size: 100% auto;
    background-position: center center;
    padding: clamp(3.5rem, 11vw, 5.2rem) 1.35rem clamp(3.5rem, 10vw, 5rem);
  }

  .vs-hero-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(
      ellipse 84% 72% at 50% 48%,
      rgba(26, 4, 10, 0.72) 0%,
      rgba(26, 4, 10, 0.44) 62%,
      rgba(26, 4, 10, 0.14) 100%
    );
  }

  .vs-hero-copy {
    position: relative;
    z-index: 2;
  }

  /* ── 4. The Amber Folio (/i/amber-folio · 16:9 af-opening.mp4) ─────────── */
  .af-film-stage {
    background: #170f0a;
  }

  .af-film-stage::before {
    content: "";
    position: absolute;
    inset: -12%;
    z-index: 0;
    background: url("/assets/af-opening-poster.jpg") center / cover no-repeat;
    filter: blur(28px) brightness(0.56) saturate(1.12);
    opacity: 0.92;
    pointer-events: none;
  }

  .af-opening-poster,
  .af-opening-video {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translateY(-50%);
    transform-origin: center center;
    object-fit: contain;
    object-position: center center;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
  }

  .af-opening-video {
    z-index: 2;
  }

  .af-cover.is-blooming .af-opening-video,
  .af-cover.is-blooming .af-opening-poster {
    transform: translateY(-50%) scale(1.06);
  }

  .af-cover-scrim {
    background: linear-gradient(
      180deg,
      rgba(16, 10, 6, 0.72) 0%,
      rgba(16, 10, 6, 0.34) 26%,
      transparent 35%,
      transparent 65%,
      rgba(16, 10, 6, 0.42) 74%,
      rgba(16, 10, 6, 0.8) 100%
    );
  }

  .af-cover-top {
    top: clamp(4.15rem, 11svh, 6.9rem);
  }

  .af-cover-names {
    font-size: clamp(2.15rem, 9.5vw, 3.1rem);
  }

  .af-cover-bottom {
    bottom: clamp(1.85rem, 6.2svh, 4.1rem);
  }

  .ah-orchard-image {
    object-position: 78% center;
  }

  /* ── 5. The Château (/i/chateau · 16:9 ch-opening.mp4) ─────────────────── */
  .ch-film-stage {
    background: #0d1624;
  }

  .ch-film-stage::before {
    content: "";
    position: absolute;
    inset: -12%;
    z-index: 0;
    background: url("/assets/ch-opening-poster.jpg") center / cover no-repeat;
    filter: blur(28px) brightness(0.58) saturate(1.12);
    opacity: 0.92;
    pointer-events: none;
  }

  .ch-opening-poster,
  .ch-opening-video {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translateY(-50%);
    transform-origin: center center;
    object-fit: contain;
    object-position: center center;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
  }

  .ch-opening-video {
    z-index: 2;
  }

  .ch-cover-scrim {
    background: linear-gradient(
      180deg,
      rgba(12, 20, 34, 0.72) 0%,
      rgba(12, 20, 34, 0.34) 26%,
      transparent 35%,
      transparent 65%,
      rgba(12, 20, 34, 0.42) 74%,
      rgba(12, 20, 34, 0.8) 100%
    );
  }

  .ch-cover-top {
    top: clamp(4.15rem, 11svh, 6.9rem);
  }

  .ch-cover-names {
    font-size: clamp(1.8rem, 8.2vw, 2.8rem);
  }

  .ch-cover-bottom {
    bottom: clamp(1.85rem, 6.2svh, 4.1rem);
  }

  /* ── 6. The Gilded Volume (/i/gilded-volume · 16:9 gv-opening.mp4) ─────── */
  .gv-film-stage {
    background: #091716;
  }

  .gv-film-stage::before {
    content: "";
    position: absolute;
    inset: -12%;
    z-index: 0;
    background: url("/assets/gv-opening-poster.jpg") center / cover no-repeat;
    filter: blur(28px) brightness(0.54) saturate(1.1);
    opacity: 0.92;
    pointer-events: none;
  }

  .gv-opening-poster,
  .gv-opening-video {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translateY(-50%);
    transform-origin: center center;
    object-fit: contain;
    object-position: center center;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 2.5%, #000 97.5%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 2.5%, #000 97.5%, transparent 100%);
  }

  .gv-opening-video {
    z-index: 2;
  }

  .gv-cover.is-blooming .gv-opening-video,
  .gv-cover.is-blooming .gv-opening-poster {
    transform: translateY(-50%) scale(1.06);
  }

  .gv-cover-scrim {
    background: linear-gradient(
      180deg,
      rgba(8, 20, 19, 0.72) 0%,
      rgba(8, 20, 19, 0.34) 26%,
      transparent 35%,
      transparent 65%,
      rgba(8, 20, 19, 0.42) 74%,
      rgba(8, 20, 19, 0.8) 100%
    );
  }

  .gv-cover-top {
    top: clamp(4.15rem, 11svh, 6.9rem);
  }

  .gv-cover-names {
    font-size: clamp(1.8rem, 8.2vw, 2.8rem);
  }

  .gv-cover-bottom {
    bottom: clamp(1.85rem, 6.2svh, 4.1rem);
  }

  /* ── 7. The Rose Letter (/i/rose-letter · 9:16 rl-opening-v5.mp4 + hero) ─ */
  .rl-hero-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 768 / 1376;
    background-size: 100% 100%;
  }

  .rl-hero-copy {
    top: 15.5%;
  }
}

/* Rose Letter narrow tall phones (aspect < 9:16, e.g. 390x844 / 430x932):
   Keep full 9:16 envelope & corner roses uncropped instead of side-cropping. */
@media (max-width: 52rem) and (max-aspect-ratio: 9 / 16) {
  .le-opening::before {
    content: "";
    position: absolute;
    inset: -10%;
    z-index: 0;
    background: url("/assets/rl-opening-poster-v5.jpg") center / cover no-repeat;
    filter: blur(28px) brightness(1.03);
    opacity: 0.72;
    pointer-events: none;
  }

  .le-opening__stage {
    z-index: 1;
    width: 100vw;
    height: auto;
    aspect-ratio: 9 / 16;
    max-height: 100svh;
    box-shadow: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 2.5%, #000 97.5%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 2.5%, #000 97.5%, transparent 100%);
  }

  .le-opening__poster,
  .le-opening__video {
    object-fit: contain;
    object-position: center center;
  }

  .le-opening__names {
    text-shadow:
      0 1px 10px rgba(250, 246, 240, 0.98),
      0 0 18px rgba(250, 246, 240, 0.92);
  }
}

/* Homepage interactive phone preview mockup — uncropped 16:9 cinema inside phone */
.ag-phone-screen::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: 0;
  background: url("/assets/vs-opening-poster.jpg") center / cover no-repeat;
  filter: blur(22px) brightness(0.55) saturate(1.1);
  pointer-events: none;
}

.ag-screen-video {
  top: 50%;
  left: 0;
  right: 0;
  bottom: auto;
  z-index: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  transform: translateY(-50%);
  object-fit: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 4%, #000 96%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 4%, #000 96%, transparent 100%);
}
