/* CONTUHIJO CORE 2.0 RC3 · shared presentation contract.
   Brand-neutral. No business state, price, availability or Marga controller
   is changed here. No declaration in this file uses priority overrides. */

@layer cth20.core {
  body.cth-core20-platform{
    font-family:var(--cth20-body-font,var(--cth20-body-fallback));
    overflow-wrap:break-word;
  }
  body.cth-core20-platform :where(h1,h2,h3,h4,h5,h6,.vmon-display){
    font-family:var(--cth20-display-font,var(--cth20-display-fallback));
    overflow-wrap:normal;
    word-break:normal;
    hyphens:none;
  }
  body.cth-core20-platform :where(.vmon-shell,.cth-shell){
    width:min(calc(100% - 40px),var(--cth20-shell));
    max-width:var(--cth20-shell);
    margin-inline:auto;
    box-sizing:border-box;
  }
  body.cth-core20-platform :where(img,video,iframe){max-width:100%;}
  body.cth-core20-platform img{height:auto;}

  /* A functional surface owns the page canvas. Builder geometry outside the
     surface may decorate the page, but can never squeeze the product itself. */
  body.cth-core20-platform:is(.vmon-marga-page,.vmon-search-route,.vmon-contact-route,.cth-marga-reservation,.cth-marga-trip-contact)
    :where(#page,#page-content,#content,main#main,.site-main,.content,.main-content){
    width:100%;max-width:none;min-width:0;float:none;box-sizing:border-box;
  }
  body.cth-core20-platform:is(.vmon-marga-page,.vmon-search-route,.vmon-contact-route,.cth-marga-reservation,.cth-marga-trip-contact)
    :where(.md-template,.cth-marga-island,.vmon-marga,.vmon380-functional,.vmon380-contact-form,.vmon381-search-results){
    width:100%;max-width:none;min-width:0;float:none;box-sizing:border-box;
  }

  /* Editorial contract inherited from the production golden behaviour. */
  body.cth-core20-platform :where(.cth-native-editorial,.vmon-editorial-body){
    width:100%;min-width:0;
  }
  body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content){
    width:100%;max-width:var(--cth20-reading);min-width:0;margin-inline:auto;
    font-size:clamp(1rem,.97rem + .15vw,1.08rem);line-height:1.76;
    overflow-wrap:anywhere;word-break:normal;
  }
  body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content) > *{
    max-width:100%;box-sizing:border-box;
  }
  body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content)
    :where(p,ul,ol,blockquote,table){width:100%;max-width:100%;}
  body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content) p{
    margin:.75em 0 1.08em;
  }
  body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content)
    :where(figure,.wp-caption,.wp-block-image,.gallery){
    width:100%;max-width:100%;margin:clamp(22px,3vw,38px) 0;
  }
  body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content)
    :where(img){display:block;width:100%;max-width:100%;height:auto;margin-inline:auto;object-fit:contain;border-radius:18px;}
  body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content)
    :where(video,iframe){display:block;width:100%;max-width:100%;margin:clamp(22px,3vw,38px) 0;}
  body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content) table{
    display:block;width:100%;max-width:100%;overflow-x:auto;border-collapse:collapse;
  }

  /* Legacy Colibri/Bootstrap columns are content artifacts inside editorial
     pages, never a current layout instruction. Functional Marga is excluded. */
  body.cth-core20-platform.vmon-editorial-route :where(.vmon-editorial__content--legacy-safe,.cth-native-editorial__content)
    :where(.h-section,.h-section-grid-container,.h-row-container,.h-row,.h-column,.h-column-container,.h-column__inner,.h-column__content,.h-y-container,.row,.container,.container-fluid,[class*="h-col-"],[class*="col-xs-"],[class*="col-sm-"],[class*="col-md-"],[class*="col-lg-"],[class*="col-xl-"]){
      width:100%;max-width:100%;min-width:0;float:none;margin-left:0;margin-right:0;box-sizing:border-box;flex:0 0 100%;flex-basis:100%;
  }
  body.cth-core20-platform.vmon-editorial-route :where(.vmon-editorial__content--legacy-safe,.cth-native-editorial__content)
    :where(.row,.h-row,.h-row-container){display:block;}

  body.cth-core20-platform .vmon-legal-layout{grid-template-columns:minmax(210px,250px) minmax(0,900px);gap:clamp(28px,4vw,56px);align-items:start;}
  body.cth-core20-platform .vmon-legal-layout > .vmon-editorial__content:only-child{grid-column:1/-1;max-width:1100px;justify-self:center;}
  body.cth-core20-platform .cth-editorial-closing{clear:both;width:100%;max-width:none;min-width:0;}

  .cth-core20-byline{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:14px;font-size:.9rem;opacity:.78;}

  @media (min-width:760px){
    body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content) :where(p,li){
      text-align:justify;text-justify:inter-word;text-wrap:pretty;
    }
  }
  @media (max-width:980px){body.cth-core20-platform .vmon-legal-layout{grid-template-columns:1fr;}}
  @media (max-width:759px){
    body.cth-core20-platform :where(.cth-native-editorial__content,.vmon-editorial__content,.vmon380-story__content,.vmon-story__content) :where(p,li){text-align:left;}
    body.cth-core20-platform :where(.vmon-shell,.cth-shell){width:min(calc(100% - 24px),var(--cth20-shell));}
  }
}

@layer cth20.components {
  /* Navigation is click-first. Hover may style a label but never opens a panel. */
  @media (min-width:901px){
    body.cth-core20-platform #vmon-nav li.menu-item-has-children > ul,
    body.cth-core20-platform #vmon-nav li.has-sub > .vmon-submenu,
    body.cth-core20-platform #vmon-nav li.menu-item-has-children:hover > ul,
    body.cth-core20-platform #vmon-nav li.menu-item-has-children:focus-within > ul,
    body.cth-core20-platform #vmon-nav li.has-sub:hover > .vmon-submenu,
    body.cth-core20-platform #vmon-nav li.has-sub:focus-within > .vmon-submenu{
      opacity:0;visibility:hidden;pointer-events:none;transform:translateY(8px);
    }
    body.cth-core20-platform #vmon-nav li.menu-item-has-children.is-open > ul,
    body.cth-core20-platform #vmon-nav li.has-sub.is-open > .vmon-submenu{
      opacity:1;visibility:visible;pointer-events:auto;transform:none;
    }
  }
  body.cth-core20-platform #vmon-nav .vmon-submenu{max-height:min(72vh,620px);overflow:auto;overscroll-behavior:contain;}
  body.cth-core20-platform #vmon-nav .sub-toggle{cursor:pointer;touch-action:manipulation;}
  body.cth-core20-platform .cth-cookie-placeholder-hidden{display:none;}

  /* Editorial hero must not dominate several mobile screens. */
  body.cth-core20-platform .vmon-editorial-hero{overflow:hidden;}
  body.cth-core20-platform .vmon-editorial-hero__grid{min-width:0;}
  body.cth-core20-platform .vmon-editorial-hero h1{overflow-wrap:normal;word-break:normal;hyphens:none;text-wrap:balance;}
  body.cth-core20-platform .vmon-editorial-hero__lead{max-width:760px;line-height:1.65;}

  /* Blog cards shared by Brand Packs. */
  body.cth-core20-platform :where(.cth-core20-blog-grid,.tit-blog__grid){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;margin-block:28px;}
  body.cth-core20-platform :where(.cth-core20-blog-card,.tit-blog-card){min-width:0;background:#fff;border:1px solid rgba(20,30,40,.12);border-radius:20px;overflow:hidden;display:flex;flex-direction:column;}
  body.cth-core20-platform :where(.cth-core20-blog-card__media,.tit-blog-card__media){display:block;aspect-ratio:16/10;overflow:hidden;background:#eee;}
  body.cth-core20-platform :where(.cth-core20-blog-card__media,.tit-blog-card__media) img{width:100%;height:100%;object-fit:cover;}
  body.cth-core20-platform :where(.cth-core20-blog-card__body,.tit-blog-card__body){padding:22px;display:flex;flex-direction:column;flex:1;}
  body.cth-core20-platform :where(.cth-core20-blog-pagination,.tit-blog__pagination){display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin:34px 0;}
  @media(max-width:900px){body.cth-core20-platform :where(.cth-core20-blog-grid,.tit-blog__grid){grid-template-columns:repeat(2,minmax(0,1fr));}}
  @media(max-width:620px){body.cth-core20-platform :where(.cth-core20-blog-grid,.tit-blog__grid){grid-template-columns:1fr;}}
}

@layer cth20.integrations {
  /* Marga trip: all tabs use one full product canvas. */
  body.cth-core20-platform.vmon-marga-page .md-template{
    width:min(calc(100% - 40px),var(--cth20-shell));max-width:var(--cth20-shell);margin-inline:auto;box-sizing:border-box;
  }
  body.cth-core20-platform.vmon-marga-page .md-template
    :where(.h-row-container,.h-row,.h-column,.h-column-container,.h-column__inner,.h-column__content):has(:is(#itinerario,#imagenes,#alojamiento,#precioIncluye,.h-tabs)){
    width:100%;max-width:none;min-width:0;float:none;box-sizing:border-box;
  }
  body.cth-core20-platform.vmon-marga-page .md-template :where(.h-column,.h-column-container):has(:is(#itinerario,#imagenes,#alojamiento,#precioIncluye,.h-tabs)){
    flex:0 0 100%;flex-basis:100%;
  }
  body.cth-core20-platform.vmon-marga-page .md-template .h-row:has(:is(#itinerario,#imagenes,#alojamiento,#precioIncluye,.h-tabs)){
    display:block;margin-left:0;margin-right:0;
  }
  body.cth-core20-platform.vmon-marga-page .md-template :where(.h-tabs,.h-tabs-navigation,.h-tabs-content,.h-tabs-item-content,#itinerario,#imagenes,#alojamiento,#precioIncluye,.cth-trip-tabs-shell,.cth-trip-tabs,.cth-trip-tab-panel){
    width:100%;max-width:none;min-width:0;box-sizing:border-box;
  }
  body.cth-core20-platform.vmon-marga-page .h-tabs-navigation{display:flex;flex-wrap:wrap;gap:6px;align-items:stretch;}
  body.cth-core20-platform.vmon-marga-page .h-tabs-navigation-item{min-height:46px;display:inline-flex;align-items:center;justify-content:center;}
  body.cth-core20-platform.vmon-marga-page #imagenes :where(img,picture img){display:block;width:100%;max-width:100%;height:auto;object-fit:cover;}
  body.cth-core20-platform.vmon-marga-page #alojamiento :where(.h-row,.row,.h-column,.h-column-container){max-width:100%;min-width:0;box-sizing:border-box;}
  body.cth-core20-platform.vmon-marga-page #precioIncluye :where(table,.table){width:100%;max-width:none;float:none;margin-inline:0;}
  body.cth-core20-platform.vmon-marga-page #precioIncluye{overflow-x:auto;}

  /* Search: controls and result cards share the full centred canvas. */
  body.cth-core20-platform.vmon-search-route :where(.vmon381-search-results,.vmon381-marga-search,#buscador.md-template,.cth-marga-island--search){width:100%;max-width:none;min-width:0;box-sizing:border-box;}
  body.cth-core20-platform.vmon-search-route :where(.vmon381-search-results>.vmon-shell,.vmon381-marga-search,#buscador.md-template){width:min(calc(100% - 40px),var(--cth20-shell));max-width:var(--cth20-shell);margin-inline:auto;}
  body.cth-core20-platform.vmon-search-route #buscador :where(form,.h-row,.row){width:100%;max-width:none;min-width:0;box-sizing:border-box;}
  body.cth-core20-platform.vmon-search-route #buscador :where(input,select,button){min-height:46px;}

  /* General contact / trip information / reservation. Outer shell is wide;
     Marga may still choose sensible two-column field grids inside it. */
  body.cth-core20-platform.vmon-contact-route :where(.vmon380-contact-form__surface,.tit-contact-page__surface),
  body.cth-core20-platform.cth-marga-trip-contact .md-template,
  body.cth-core20-platform.cth-marga-reservation .md-template{
    width:min(calc(100% - 40px),var(--cth20-shell));max-width:var(--cth20-shell);min-width:0;margin-inline:auto;box-sizing:border-box;
  }
  body.cth-core20-platform:is(.vmon-contact-route,.cth-marga-trip-contact,.cth-marga-reservation)
    :where(form,#contacto-form,.md-template){width:100%;max-width:none;min-width:0;box-sizing:border-box;}
  body.cth-core20-platform:is(.vmon-contact-route,.cth-marga-trip-contact,.cth-marga-reservation)
    :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea){width:100%;max-width:100%;box-sizing:border-box;}
  body.cth-core20-platform:is(.vmon-contact-route,.cth-marga-trip-contact,.cth-marga-reservation) textarea{min-height:120px;}

  /* GEO is a first-class closing component, never a narrow leftover column. */
  body.cth-core20-platform .cth-editorial-closing :where(.cth-closing-geo,.cth-closing-geo__grid,.cth-shell){min-width:0;}
  body.cth-core20-platform .cth-closing-geo__grid{width:100%;}

  @media(max-width:900px){
    body.cth-core20-platform.vmon-marga-page .md-template,
    body.cth-core20-platform.vmon-search-route :where(.vmon381-search-results>.vmon-shell,.vmon381-marga-search,#buscador.md-template),
    body.cth-core20-platform.vmon-contact-route :where(.vmon380-contact-form__surface,.tit-contact-page__surface),
    body.cth-core20-platform.cth-marga-trip-contact .md-template,
    body.cth-core20-platform.cth-marga-reservation .md-template{width:min(calc(100% - 20px),var(--cth20-shell));}
    body.cth-core20-platform.vmon-marga-page .h-tabs-navigation{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;}
    body.cth-core20-platform.vmon-marga-page .h-tabs-navigation-item{flex:0 0 auto;white-space:nowrap;}
  }
}

@layer cth20.utilities {
  @media(max-width:900px){
    body.cth-core20-platform #vmon-nav .vmon-header__actions.cth-nav-actions--mobile{
      display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:24px 0 8px;padding-top:20px;border-top:1px solid rgba(20,30,40,.15);
    }
    body.cth-core20-platform #vmon-nav .vmon-header__actions.cth-nav-actions--mobile > *{display:inline-flex;}
  }
}
