/* Portrait layout: the landscape desktop composition remains untouched. */
@media (max-width: 700px) and (orientation: portrait) {
  html, body { min-height: 100%; }
  body { min-height: 100svh; overflow-x: hidden; overflow-y: auto; }

  .menu-switcher { top: 10px; right: 68px; }
  .language-switcher { top: 10px; right: 10px; }

  /* Landing page: keep the video full-width and let the page scroll naturally. */
  body:has(.video-frame video) {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
  }
  body:has(.video-frame video) main {
    flex: 1 0 auto;
    width: calc(100% - 24px);
    padding: 64px 0 34px;
  }
  body:has(.video-frame video) .brand,
  body:has(.film-frame) .masthead {
    width: min(264px, 86vw);
    height: 82px;
    margin-bottom: 14px;
  }
  body:has(.video-frame video) .video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
  body:has(.video-frame video) .discover {
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-top: 16px;
    font-size: clamp(16px, 4.5vw, 20px);
  }
  body:has(.video-frame video) .copyright-notice {
    position: static;
    transform: none;
    margin: auto auto 8px;
  }

  /* Cabin tour: stack the video above two compact rows of photo choices. */
  body:has(.film-frame) {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
  }
  body:has(.film-frame) main {
    flex: 1 0 auto;
    width: calc(100% - 24px);
    padding: 64px 0 30px;
  }
  body:has(.film-frame) .showcase {
    left: auto;
    width: 100%;
    transform: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    gap: 9px;
  }
  body:has(.film-frame) .film-frame {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    aspect-ratio: 4 / 3;
  }
  body:has(.film-frame) .feature-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    gap: 8px;
  }
  body:has(.film-frame) .feature-list:first-of-type { grid-column: 1; grid-row: 2; }
  body:has(.film-frame) .feature-list:last-of-type { grid-column: 2; grid-row: 2; }
  body:has(.film-frame) .bed-feature { order: 1; }
  body:has(.film-frame) .bath-feature { order: 2; }
  body:has(.film-frame) .location-feature { order: 3; }
  body:has(.film-frame) .feature {
    height: auto;
    min-height: 58px;
    flex: 1 1 0;
  }
  body:has(.film-frame) .feature {
    min-height: 58px;
    padding: 9px 6px;
    font-size: 14px;
  }
  body:has(.film-frame) .request {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0 .35em;
    white-space: normal;
    margin-top: 16px;
  }
  body:has(.film-frame) .request-link,
  body:has(.film-frame) .request p { font-size: 14px; }
  body:has(.film-frame) .request-link { padding-bottom: 0; }
  body:has(.film-frame) .request p { text-align: center; }
  body:has(.film-frame) .request-forward {
    display: inline-block;
    margin-left: 2px;
    color: #24577d;
    font: 18px/1 Arial, Helvetica, sans-serif;
    text-decoration: none;
  }
  body:has(.film-frame) .copyright-notice {
    position: static;
    transform: none;
    margin: auto auto 8px;
  }

  /* Interior pages use a photo-led header and a readable white content sheet. */
  body:has(.panel) {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  body:has(.panel) .backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100svh;
    object-fit: cover;
  }
  body:has(.panel) .panel {
    position: relative;
    inset: auto;
    width: min(560px, calc(100% - 24px));
    min-width: 0;
    min-height: 68svh;
    height: auto;
    margin: 27svh auto 0;
    padding: 12px 18px 22px;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 10px 34px rgba(15, 33, 42, .22);
  }
  body:has(.panel) .brand {
    width: min(273px, 82vw);
    height: 80px;
    flex: 0 0 80px;
    margin-bottom: 4px;
  }
  body:has(.panel) .page-nav {
    flex: 0 0 auto;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #e4e9e8;
  }
  body:has(.panel) .page-nav a {
    font-size: 10px;
    line-height: 1.4;
  }
  body:has(.panel) .copyright-notice {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: max-content;
    max-width: calc(100% - 24px);
    margin: 10px auto 0;
    padding: 3px 7px;
    border-radius: 3px;
    background: rgba(22, 37, 43, .5);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
  }

  body:is(:has(.contact-content), :has(.map-frame)) {
    /* Crop the contact photo just below the boat and match both panel edges. */
    --contact-photo-height: 46vw;
    --contact-panel-height: calc(64svh + clamp(190px, 33svh, 310px) - var(--contact-photo-height));
  }

  /* Contact page: photo first, then the white form card, then copyright. */
  body:has(.contact-content) {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  body:has(.contact-content) .backdrop {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    height: var(--contact-photo-height);
    flex: 0 0 var(--contact-photo-height);
    object-fit: cover;
    object-position: 78% 29%;
  }
  body:has(.contact-content) .panel {
    position: relative;
    inset: auto;
    box-sizing: border-box;
    width: min(560px, calc(100% - 20px));
    min-width: 0;
    min-height: 0;
    height: var(--contact-panel-height);
    flex: 0 0 var(--contact-panel-height);
    margin: 0 auto;
    padding: 8px 16px 12px;
    border-radius: 0 0 14px 14px;
    overflow: visible;
  }
  body:has(.contact-content) .brand {
    width: min(264px, 86vw);
    height: 82px;
    flex: 0 0 82px;
    margin-bottom: 8px;
  }
  body:has(.contact-content) .contact-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    justify-content: safe center;
    gap: 8px;
    padding: 2px 0 6px;
  }
  body:has(.contact-content) .contact-intro { font-size: 14px; }
  body:has(.contact-content) .contact-note { font-size: 13px; }
  body:has(.contact-content) .contact-form { gap: 7px; }
  body:has(.contact-content) .contact-form input { height: 38px; }
  body:has(.contact-content) .phone-control select { min-height: 38px; }
  body:has(.contact-content) .contact-form textarea { min-height: 58px; }
  body:has(.contact-content) .contact-privacy { font-size: 10px; }
  body:has(.contact-content) .contact-submit { min-height: 38px; }
  body:has(.contact-content) .page-nav {
    padding-top: 16px;
    border-top: 1px solid #e4e9e8;
  }
  body:has(.contact-content) .copyright-notice {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: max-content;
    max-width: calc(100% - 20px);
    margin: 4px auto 0;
    padding: 0;
    background: transparent;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  }

  /* Legal/map page follows the same photo, white card, copyright order. */
  body:has(.map-frame) {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  body:has(.map-frame) .backdrop {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    height: var(--contact-photo-height);
    flex: 0 0 var(--contact-photo-height);
    object-fit: cover;
    object-position: 60% 75%;
  }
  body:has(.map-frame) .panel {
    position: relative;
    inset: auto;
    box-sizing: border-box;
    width: min(560px, calc(100% - 20px));
    min-width: 0;
    min-height: 0;
    height: var(--contact-panel-height);
    flex: 0 0 var(--contact-panel-height);
    margin: 0 auto;
    padding: 8px 16px 12px;
    border-radius: 0 0 14px 14px;
    overflow: visible;
  }
  body:has(.map-frame) .brand {
    width: min(264px, 86vw);
    height: 82px;
    flex: 0 0 82px;
    margin-bottom: 8px;
  }
  body:has(.map-frame) .map-frame {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: 1.15 / 1;
    margin: 4px 0 10px;
  }
  body:has(.map-frame) .map-info-card {
    top: 8px;
    left: 8px;
    width: min(64%, 270px);
    padding: 10px;
  }
  body:has(.map-frame) .map-info-title { font-size: 15px; }
  body:has(.map-frame) .map-info-address,
  body:has(.map-frame) .map-info-email { font-size: 11px; }
  body:has(.map-frame) .open-maps { min-height: 34px; padding: 0 11px; font-size: 11px; }
  body:has(.map-frame) .map-links-space { flex: 0 0 auto; min-height: 72px; }
  body:has(.map-frame) .page-nav {
    padding-top: 16px;
    border-top: 1px solid #e4e9e8;
  }
  body:has(.map-frame) .copyright-notice {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: max-content;
    max-width: calc(100% - 20px);
    margin: 4px auto 0;
    padding: 0;
    background: transparent;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  body:has(.panel) .panel { width: calc(100% - 18px); padding-inline: 14px; }
  body:has(.map-frame) .map-info-card { width: 68%; }
}

/* Anchor the contact and legal navigation to the same panel edge. */
body:is(:has(.contact-content), :has(.map-links-space)) .page-nav {
  flex: 0 0 auto;
  margin-top: auto;
  align-items: last baseline;
}

body:has(.map-links-space) .map-frame {
  min-height: 0;
}

body:has(.map-links-space) .map-links-space {
  flex-shrink: 0;
  min-height: max-content;
}
    
@media (orientation: landscape) {
  .menu-switcher .site-menu {
    width: 202px;
    height: 184px;
  }

  .menu-switcher .site-menu-link {
    line-height: 18px;
  }
}
