/* One editorial cover, using the existing heroImage state and markup. */
.cover-fit-content { display: contents; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 85svh;
  padding: 0 1.25rem 3rem;
  color: var(--ink);
  background: var(--paper);
  isolation: isolate;
}
.topbar {
  display: flex;
  grid-column: 1 / -1;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.topbar .brand { padding: 0; background: transparent; }
.topbar .brand__logo { width: 8rem; }
.logout-button {
  min-height: 44px;
  padding: 0.6rem 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.8rem;
}
.logout-button:hover { color: var(--ink); background: transparent; text-decoration: underline; }
.hero__content {
  width: 100%;
  max-width: var(--container-wide);
  margin: auto;
  padding: 4rem 0 2rem;
}
.hero .eyebrow { color: var(--accent); }
.hero h1 { max-width: 15ch; letter-spacing: -0.025em; }
.hero__subtitle { max-width: 34rem; margin: 1.5rem 0 0; color: var(--muted); font-size: 1.125rem; }
.trip-facts {
  display: grid;
  grid-template-columns: 1fr;
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trip-facts > div { padding: 1rem 0; }
.trip-facts > div + div { border-top: 1px solid var(--line); }
.trip-facts dt { margin-bottom: 0.35rem; color: var(--muted); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.13em; text-transform: uppercase; }
.trip-facts dd { margin: 0; font-size: 1rem; line-height: 1.5; font-weight: 500; }
.cover-cta {
  justify-self: start;
  min-width: 11rem;
  padding: 1rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  justify-content: space-between;
  gap: 3rem;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}
.cover-cta:hover { color: var(--accent); background: transparent; border-color: var(--accent); }
/* Photo is on its own plane, with no branding wash or text overlay. */
.hero[data-hero-state="image"]::before {
  content: "";
  display: block;
  grid-row: 2;
  width: 100%;
  margin-top: 1.5rem;
  aspect-ratio: 4 / 3;
  background: var(--hero-image) center / cover no-repeat;
}
@media (min-width: 768px) {
  .hero { padding: 0 clamp(2.5rem, 6vw, 7rem) 4rem; }
  .hero__content { padding-top: 5rem; }
  .hero h1 { font-size: clamp(3rem, 5vw, 4.5rem); }
  .trip-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trip-facts > div { padding: 1.25rem; }
  .trip-facts > div:first-child { padding-left: 0; }
  .trip-facts > div + div { border-top: 0; border-left: 1px solid var(--line); }
  .hero[data-hero-state="image"] { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 3.5rem; }
  .hero[data-hero-state="image"]::before { grid-column: 1; grid-row: 2 / 4; min-height: 34rem; height: calc(100% - 3rem); margin-top: 3rem; aspect-ratio: auto; }
  .hero[data-hero-state="image"] .hero__content { grid-column: 2; grid-row: 2; }
  .hero[data-hero-state="image"] .cover-cta { grid-column: 2; grid-row: 3; align-self: start; }
  .hero[data-hero-state="image"] .trip-facts { grid-template-columns: 1fr; }
  .hero[data-hero-state="image"] .trip-facts > div { padding: 0.85rem 0; }
  .hero[data-hero-state="image"] .trip-facts > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

/* One complete phone cover. All content is identical at every phone height. */
@media (width < 768px) {
  #cover-view {
    --cover-gap: clamp(3px, calc((100dvh - 560px) * 0.025), 12px);
    --cover-pad: clamp(6px, calc(2dvh - 6px), 12px);
    --cover-title-size: clamp(1.875rem, min(9dvw, 6dvh), 2.625rem);
    --cover-body-size: clamp(0.875rem, min(4dvw, 2.2dvh), 1rem);
    --cover-label-size: clamp(0.75rem, 3.4dvw, 0.875rem);
    display: block;
    height: var(--cover-visible-height, 100dvh);
    width: 100%;
    min-height: 0;
    padding: max(var(--cover-pad), env(safe-area-inset-top)) max(clamp(12px, 4dvw, 20px), env(safe-area-inset-right)) max(var(--cover-pad), env(safe-area-inset-bottom)) max(clamp(12px, 4dvw, 20px), env(safe-area-inset-left));
  }
  #cover-view[hidden] { display: none; }
  #cover-view .cover-fit-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    transform: scale(var(--cover-fit, 1));
    transform-origin: top left;
  }
  /* Set only after measuring the full composition; never used to conceal overflow. */
  #cover-view[data-cover-fit-ready="true"] { overflow-y: hidden; }
  body:has(#trip-view:not([hidden]) #cover-view:not([hidden])[data-cover-fit-ready="true"]) { overflow-y: hidden; }
  #cover-view .cover-terms-shortcut { display: none; }
  #cover-view .topbar { flex: 0 0 auto; min-height: 44px; padding: 0 0 var(--cover-gap); }
  #cover-view .topbar .brand__logo { width: clamp(80px, min(25dvw, 13dvh), 112px); height: auto; }
  #cover-view .logout-button { min-height: 44px; padding-block: 0; }
  #cover-view .hero__content {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--cover-gap);
    margin: 0;
    padding: var(--cover-gap) 0;
  }
  #cover-view #trip-kicker { margin: 0; font-size: clamp(0.6875rem, 2.9dvw, 0.75rem); line-height: 1.35; }
  #cover-view h1 { max-width: none; font-size: var(--cover-title-size); line-height: 1.05; }
  #cover-view .hero__subtitle { margin: 0; font-size: var(--cover-body-size); line-height: 1.35; }
  #cover-view .trip-facts { margin: 0; border-top: 0; padding-bottom: var(--cover-gap); gap: var(--cover-gap); }
  #cover-view .trip-facts > div { padding: 0; }
  #cover-view .trip-facts > div + div { border-top: 0; }
  #cover-view .trip-facts dt { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  #cover-view .trip-facts dd { font-size: var(--cover-body-size); line-height: 1.4; }
  #cover-view #trip-dates { font-weight: 600; }
  #cover-view .cover-terms { margin: 0; }
  #cover-view .cover-terms h2 { margin: 0 0 var(--cover-gap); font-size: clamp(0.9375rem, 3.8dvw, 1rem); line-height: 1.3; }
  #cover-view .cover-terms > p { margin: 0; font-size: var(--cover-body-size); line-height: 1.35; }
  #cover-view .terms-check-label { margin-top: var(--cover-gap); min-height: 44px; gap: 0.6rem; font-size: var(--cover-label-size); line-height: 1.35; }
  #cover-view .terms-check-label input { width: 22px; height: 22px; margin-top: 0.35rem; }
  #cover-view .terms-check-label > span { padding-block: 0.25rem; }
  #cover-view .cover-cta { flex: 0 0 auto; width: 100%; min-height: 44px; gap: 0.6rem; padding: 0.35rem 0; font-size: clamp(0.875rem, 3.8dvw, 1rem); }
  #trip-view > .site-footer { display: none; }
}
