/*
  Oloropa Phase 1 Structure Stabilizer
  Canonical one-shot layer for global footer whitespace removal, phone overflow
  control, public nav containment, admin shell consistency, and safe route/assets.
  Visual identity remains Oloropa; this only stabilizes structure.
*/
:root{
  --ol-p1-viewport-w:100vw;
  --ol-p1-safe-bottom:env(safe-area-inset-bottom,0px);
  --ol-p1-mobile-nav-h:5.95rem;
  --ol-p1-admin-nav-h:6.75rem;
  --ol-p1-edge:clamp(.75rem,3.8vw,1.25rem);
  --ol-p1-max:1440px;
  --ol-p1-gold:#C6A24A;
  --ol-p1-green:#1F3A2D;
  --ol-p1-deep:#10251B;
  --ol-p1-ivory:#FFF8E7;
  --ol-p1-parchment:#F7F1E6;
}
*,*::before,*::after{box-sizing:border-box;}
html{width:100%;min-height:100%;margin:0;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:88px;background:#F7F1E6;}
body{width:100%;min-width:0;min-height:100dvh;margin:0;overflow-x:hidden;background:#F7F1E6;color:#17231D;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;}
body.ol-phase1-structure-ready{display:flex;flex-direction:column;}
body.ol-phase1-structure-ready > main,
body.ol-phase1-structure-ready > #main-content,
body.ol-phase1-structure-ready > .ol-main-content,
body.ol-phase1-structure-ready > .ol-public-page,
body.ol-phase1-structure-ready > .ol-admin-shell,
body.ol-phase1-structure-ready > .ol-user-portal-shell,
body.ol-phase1-structure-ready > .portal-shell{flex:1 0 auto;min-width:0;}
body.ol-phase1-structure-ready > footer,
body.ol-phase1-structure-ready .ol-public-footer,
body.ol-phase1-structure-ready .site-footer{flex-shrink:0;}
#main-content,.ol-main-content,main,.ol-public-page,.ol-admin-shell,.ol-user-portal-shell,.portal-shell,.ol-page-shell{min-width:0;max-width:100%;}
img,picture,video,canvas,svg,iframe,embed,object{max-width:100%;}
img,picture,video,canvas,svg{height:auto;}
iframe{border:0;}
table{max-width:100%;}
pre,code{white-space:pre-wrap;overflow-wrap:anywhere;}
[data-ol-phase1-overflow-guard]{max-width:100%!important;min-width:0!important;}
body > audio:not(.ol-es-audio):not([data-ol-allowed-raw]),
body > video[controls]:not([data-ol-allowed-raw]),
footer ~ audio:not(.ol-es-audio):not([data-ol-allowed-raw]),
footer ~ video[controls]:not([data-ol-allowed-raw]){display:none!important;visibility:hidden!important;width:0!important;height:0!important;position:absolute!important;inset:auto!important;overflow:hidden!important;}
body > script,body > style,body > template{flex:0 0 auto;}
.ol-phase1-hidden-raw-media{display:none!important;visibility:hidden!important;width:0!important;height:0!important;position:absolute!important;overflow:hidden!important;}

/* Public navigation: keep rich header, but prevent wide nav/action collisions. */
.ol-cc-header,[data-oloropa-concierge-header],.p8-nav,.ol-public-nav{max-width:calc(100vw - 24px)!important;min-width:0!important;}
.ol-cc-header *,[data-oloropa-concierge-header] *,.p8-nav *,.ol-public-nav *{min-width:0;}
.ol-cc-header .ol-cc-brand,.p8-brand{min-width:0!important;}
.ol-cc-header .ol-cc-nav,.p8-nav nav{min-width:0!important;overflow:visible;}
.ol-cc-header .ol-cc-actions,.p8-nav .ol-cc-actions{min-width:0!important;}
.ol-cc-header a,.ol-cc-header button,.p8-nav a,.p8-nav button{touch-action:manipulation;}

/* Admin shell: canonical IDs/classes stay stable even on older pages. */
.ol-admin-shell,.ol-admin-shell-phase1{min-height:100dvh;background:#fbf6ea;}
#sidebar{max-width:min(86vw,320px);}
#global-search,#profile-dropdown,#profile-menu,#mobile-more-sheet,#mobile-more-panel,#toast{min-width:0;}
#main-content.sidebar-transition,.ol-phase-k-main{transition:margin .22s ease, padding .22s ease;}
.ol-command-hero,.ol-admin-hero,.ol-kpi-card,.ol-table-row,.ol-admin-glass{min-width:0;overflow-wrap:anywhere;}
.ol-responsive-scroll,.table-wrap,.ol-table-wrap,#destination-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}

/* Generic cards and media blocks cannot push the page wider than the viewport. */
.destination-card,.package-card,.story-card,.gallery-card,.media-card,.mobile-card-pad,.ol-kpi-card,.ol-table-row,.ix-card,.ix-card-media,.ol-media-cluster,.ol-stay-canvas,.ol-package-drawer,.ol-serenity-addons,.ol-chat-shell,.ol-chat-thread,.ol-brief-builder,.ol-brief-slider,.ol-brief-step,.ol-brief-route-card,.ol-route-panel,.ol-calendar-day{min-width:0;max-width:100%;overflow-wrap:anywhere;}
.destination-card img,.package-card img,.story-card img,.gallery-card img,.media-card img,.ix-card-media img,.ix-card-media video,.ol-media-cluster img,.ol-media-cluster video{display:block;width:100%;max-width:100%;object-fit:cover;}

/* Map/media embeds: reserve height to avoid empty visual panels and CLS. */
#route-logic-map iframe,.route-map-iframe,.ol-map-embed-shell iframe,#map-embed-preview iframe,iframe[src*="google.com/maps"],iframe[src*="maps.google"]{width:100%;min-height:clamp(320px,58svh,640px);border-radius:inherit;background:#10251B;}
#youtube-embed-preview,.ol-embed-youtube,.video-embed{aspect-ratio:16/9;max-width:100%;overflow:hidden;}

@media (max-width:1023px){
  html,body{max-width:100%;overflow-x:hidden;}
  body.ol-phase1-admin-page{padding-bottom:calc(var(--ol-p1-admin-nav-h) + var(--ol-p1-safe-bottom));}
  body.ol-phase1-public-page.ol-has-phone-fixed-control{padding-bottom:calc(1rem + var(--ol-p1-safe-bottom));}
  #sidebar{position:fixed!important;top:0!important;left:0!important;bottom:0!important;z-index:9100!important;transform:translateX(-105%);transition:transform .24s ease;border-radius:0 1.5rem 1.5rem 0;}
  #sidebar.is-open,#sidebar[data-open="true"]{transform:translateX(0)!important;}
  #main-content,.ol-phase-k-main,main[role="main"]{width:100%;max-width:100%;}
  .ol-admin-shell #main-content,.ol-admin-shell .ol-phase-k-main{padding-left:var(--ol-p1-edge)!important;padding-right:var(--ol-p1-edge)!important;}
  #mobile-nav,.ol-admin-mobile-bottom-nav,.ol-user-bottom-nav{position:fixed!important;left:0!important;right:0!important;bottom:0!important;z-index:9000!important;max-width:100vw!important;padding-bottom:calc(.55rem + var(--ol-p1-safe-bottom))!important;}
  #mobile-more-sheet,#ol-mobile-more-sheet{position:fixed!important;inset:0!important;z-index:9300!important;}
  #mobile-more-panel,#ol-mobile-more-panel{position:absolute!important;left:0!important;right:0!important;bottom:0!important;max-height:min(86svh,720px)!important;overflow:auto!important;border-radius:1.75rem 1.75rem 0 0!important;padding-bottom:calc(1rem + var(--ol-p1-safe-bottom))!important;}
  #toast{max-width:calc(100vw - 2rem)!important;}
  .ol-cc-header,[data-oloropa-concierge-header],.p8-nav,.ol-public-nav{left:50%!important;right:auto!important;width:min(calc(100vw - 18px),var(--ol-p1-max))!important;max-width:calc(100vw - 18px)!important;transform:translateX(-50%)!important;}
  .ol-cc-header .ol-cc-nav,.p8-nav nav{display:none!important;}
  .ol-cc-header .ol-cc-menu-button,.p8-menu-button,[data-open-mobile-more]{display:inline-flex!important;}
  .ol-cc-header .ol-cc-actions{flex:0 0 auto!important;}
  .ol-cc-header .ol-cc-cta:not([data-ol-mobile-keep]),.p8-nav .p8-cta:not([data-ol-mobile-keep]){display:none!important;}
  .ol-command-hero,.ol-admin-hero,.hero,.ol-public-hero{border-radius:clamp(1.25rem,6vw,1.8rem)!important;}
  .ol-command-hero h1,.ol-admin-hero h1,.hero h1,.ol-public-hero h1{font-size:clamp(2rem,10.5vw,3.4rem)!important;line-height:.98!important;text-wrap:balance;}
  .grid,[class*="grid-cols-"]{min-width:0;}
  .ol-phase1-force-one-col,.ol-admin-builder-grid,.ol-create-workspace,.ol-user-hub-grid,.ol-detail-cinema-grid{grid-template-columns:minmax(0,1fr)!important;}
  table{min-width:680px;}
  .ol-phone-card-table{min-width:0!important;}
  .phone-sticky-actions,.ol-phone-sticky-actions{bottom:calc(var(--ol-p1-mobile-nav-h) + var(--ol-p1-safe-bottom) + .65rem)!important;max-width:calc(100vw - 1.25rem)!important;}
  .ol-es-sound-dock{max-width:calc(100vw - 24px)!important;}
  #oloropa-chat-widget-root,#chat-widget{max-width:calc(100vw - 24px)!important;}
}

@media (max-width:430px){
  :root{--ol-p1-edge:.75rem;--ol-p1-mobile-nav-h:5.55rem;}
  .mobile-card-pad{padding:.72rem!important;border-radius:1.15rem!important;}
  [data-ol-phone-two-up],.ol-phone-two-up{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.62rem!important;}
  [data-ol-phone-two-up] > *,.ol-phone-two-up > *{min-width:0!important;}
  .ol-cc-header,[data-oloropa-concierge-header],.p8-nav{top:max(.55rem,env(safe-area-inset-top,0px))!important;width:calc(100vw - 14px)!important;max-width:calc(100vw - 14px)!important;padding:.55rem!important;}
  .ol-cc-header img,.p8-brand img{width:44px!important;height:44px!important;}
  .ol-cc-header .ol-cc-brand strong,.p8-brand strong{font-size:.82rem!important;letter-spacing:.12em!important;}
  .ol-cc-header .ol-cc-brand small,.p8-brand small{font-size:.56rem!important;letter-spacing:.18em!important;}
  #route-logic-map iframe,.route-map-iframe,.ol-map-embed-shell iframe,#map-embed-preview iframe,iframe[src*="google.com/maps"],iframe[src*="maps.google"]{min-height:clamp(300px,56svh,520px)!important;}
  .ol-es-sound-dock{left:.65rem!important;right:auto!important;bottom:calc(var(--ol-p1-mobile-nav-h) + var(--ol-p1-safe-bottom) + .55rem)!important;}
  #oloropa-chat-widget-root,#chat-widget{right:.65rem!important;bottom:calc(var(--ol-p1-mobile-nav-h) + var(--ol-p1-safe-bottom) + .55rem)!important;}
}

@media (min-width:768px) and (max-width:1199px){
  #destination-grid,.ol-destination-grid,.ol-package-grid,.ol-story-grid,.ol-media-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .ol-admin-builder-grid,.ol-create-workspace,.ol-user-hub-grid,.ol-detail-cinema-grid{grid-template-columns:minmax(0,1fr) minmax(280px,.78fr)!important;}
}

@media (min-width:1200px){
  body.ol-phase1-structure-ready{overflow-x:clip;}
  #main-content,.ol-phase-k-main{min-width:0;}
  .ol-admin-shell #sidebar{transform:none;}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;}
}
