/*
 * TicketsFest Ukraine — Responsive Foundation v2
 * v9.9.111
 * Final geometry layer, loaded at wp_enqueue_scripts priority 999.
 * Purpose: every public page must reflow inside the actual device viewport.
 */

:root{
  --tfe-rf-gutter: clamp(12px, 3.6vw, 28px);
  --tfe-rf-max: 1240px;
}

html{
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
*,*::before,*::after{box-sizing:inherit}

body{
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  overflow-x:clip;
}

#page,.site,.site-content,#content,main,.site-main,
.tfe-page-wrapper,.tfe-events-page,.tfv-page,.tfs-page,.tf-single,.tf-author-page{
  width:100%;
  max-width:100%;
  min-width:0;
  margin-left:auto;
  margin-right:auto;
}

/* Media can shrink with the device. */
img,picture,video,canvas,svg,iframe,embed,object{
  max-width:100%;
}
img,picture img,video{height:auto}
iframe,embed,object{width:100%}

/* Long values must wrap instead of widening the document. */
:where(
  p,li,dd,dt,blockquote,figcaption,
  .entry-content,.tfe-content,.tfe-content-box,.tfe-single-content,
  .tfe-hero-info,.tfe-hero-desc,.tfe-bio-content,.tfe-card-title,
  .tfe-event-title,.tfe-tour-card__title,.tf-single-content,.tf-c-body
){overflow-wrap:anywhere}

/* Fixed header: use the outer padding as the gutter, and make the pill itself
   100% of the available content box. No calc(100% - X) stacking. */
.tfe-header-outer{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  left:0!important;
  right:0!important;
  padding-top:max(10px, env(safe-area-inset-top))!important;
  padding-right:max(10px, env(safe-area-inset-right))!important;
  padding-left:max(10px, env(safe-area-inset-left))!important;
}
.tfe-header-wrap{
  width:100%!important;
  max-width:var(--tfe-rf-max)!important;
  min-width:0!important;
  margin:0 auto!important;
}
.tfe-header-inner{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  padding-left:clamp(12px,3vw,28px)!important;
  padding-right:clamp(12px,3vw,28px)!important;
  gap:clamp(8px,2vw,16px)!important;
}
.tfe-logo{
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:calc(100% - 56px)!important;
  overflow:hidden;
}
.tfe-logo img{
  display:block;
  width:auto!important;
  max-width:100%!important;
  height:clamp(28px,5vw,36px)!important;
  object-fit:contain;
}
.tfe-logo-text{
  display:block;
  max-width:100%!important;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tfe-burger{
  flex:0 0 44px!important;
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  height:44px!important;
  margin-left:auto!important;
}
.tfe-mobile-overlay{
  width:min(380px,100%)!important;
  max-width:100%!important;
}

/* Standard public containers: fluid until desktop max-width. */
:where(
  .tfe-container,.tfe-wrap,.tfe-page-wrap,.tfe-page-container,.tfe-narrow-container,
  .tfe-layout,.tfe-events-featured-section,.tfe-events-archive-section,
  .tfe-events-seo-block,.tfe-growth-section,.tfv-container,.tfs-wrap,.tf-container,
  .footer-wrapper
){
  width:100%!important;
  min-width:0!important;
  max-width:var(--tfe-rf-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Children of flex/grid shells are allowed to shrink. */
:where(
  .tfe-header-inner,.tfe-container,.tfe-wrap,.tfe-layout,.tfe-grid,.tfe-page-grid,
  .tfe-hero-grid,.tfe-hero__content,.tfe-single-wrap,.tfe-performer-wrap,
  .tfe-tour-wrap,.tfe-contact-grid,.tfe-contact-panel,.tfe-author-grid,
  .tfe-premium-hero__grid,.tfe-premium-grid,.tf-container,.tf-single-wrap,
  .tf-author-wrap,.tf-sp-grid,.tfs-wrap,.tfs-grid,.tfs-hero-grid,.tfv-container,
  .tfv-hero__grid,.tfv-form-shell,.footer-grid,.footer-grid-v994,.tfe-footer-grid
)>*{min-width:0;max-width:100%}

/* Forms cannot create horizontal overflow. */
:where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,textarea,.select2-container,.select2-selection,.tfe-input,
  .tfe-search-input,.tfe-sub-input,.tfe-bk-input
){max-width:100%;min-width:0}

pre{max-width:100%;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
code{overflow-wrap:anywhere}

/* Swipers/carousels stay inside their parent. Event-card styling remains owned
   by mobile-event-cards-sitewide.css. */
:where(.swiper,.swiper-container,.tfe-slider-wrap,.tfe-slider-shell,.slider-container,
.tfe-banners-wrap,.tfe-hero-banner-section,.tftb-banners,.tftb-track){
  max-width:100%!important;
  min-width:0!important;
}
.swiper-wrapper,.swiper-slide{min-width:0}

/* ---------- Tablets / compact laptops ---------- */
@media (max-width:1024px){
  :root{--tfe-rf-gutter:clamp(14px,3.2vw,24px)}

  .tfe-header-wrap{max-width:100%!important}
  .tfe-nav-container,.tfe-desktop-nav,.tfe-more-menu,.tfe-header-cta{display:none!important}
  .tfe-burger{display:flex!important}

  /* Theme containers receive one predictable viewport gutter. */
  :where(
    .tfe-container,.tfe-wrap,.tfe-page-wrap,.tfe-page-container,.tfe-narrow-container,
    .tfe-layout,.tfe-events-featured-section,.tfe-events-archive-section,
    .tfe-events-seo-block,.tfe-growth-section,.tfv-container,.tfs-wrap,.tf-container,
    .footer-wrapper
  ){
    max-width:100%!important;
    padding-left:var(--tfe-rf-gutter)!important;
    padding-right:var(--tfe-rf-gutter)!important;
  }

  /* Two-column hero/detail shells become one fluid column before they squeeze. */
  :where(
    .tfe-hero-grid,.tfe-hero__content,.tfe-single-layout,.tfe-premium-hero__grid,
    .tfv-hero__grid,.tfv-form-shell,.tfs-hero-grid,.tfe-contact-panel,
    .tfe-single-wrap,.tf-single-wrap,.tf-author-wrap,.tf-sp-grid,.tfe-author-grid
  ){
    grid-template-columns:minmax(0,1fr)!important;
  }

  /* Generic non-event grids. */
  :where(.tfe-core-grid-2,.tfe-core-grid-3,.tfe-page-grid,.tfs-grid-2,.tfs-grid-3,
  .tfv-grid-3,.tfv-grid-4,.tfe-contact-grid,.tfe-gallery-grid,.tfe-details-grid,
  .tfe-info-grid,.tfe-stats-grid){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  /* Performer / event / tour hero geometry. */
  :where(.single-performer,.single-event,.single-tour) .tfe-hero{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:hidden!important;
  }
  :where(.single-performer,.single-event,.single-tour) .tfe-hero__content{
    width:100%!important;
    max-width:100%!important;
    margin:0 auto!important;
    gap:clamp(20px,4vw,34px)!important;
  }
  :where(.single-performer,.single-event,.single-tour) .tfe-hero-info{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  :where(.single-performer,.single-event,.single-tour) .tfe-hero .tfe-poster{
    width:min(100%,340px)!important;
    max-width:min(100%,340px)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  .tfe-hero-title,.tfe-events-hero h1,.tfe-page-hero h1,
  .tfe-premium-hero__content h1,.tfv-hero h1,.tfs-hero h1{
    max-width:100%!important;
    font-size:clamp(30px,6vw,54px)!important;
    line-height:1.04!important;
  }

  :where(.tfe-sub-form,.tfe-search-form,.tfe-search-wrap,.tfe-login-wrap,
  .tfe-track-box,.tf-search-form){width:100%!important;max-width:100%!important;min-width:0!important}
}

/* ---------- Phones ---------- */
@media (max-width:767px){
  :root{--tfe-rf-gutter:clamp(12px,4vw,18px)}

  .tfe-header-outer{
    padding-top:max(8px,env(safe-area-inset-top))!important;
    padding-left:max(8px,env(safe-area-inset-left))!important;
    padding-right:max(8px,env(safe-area-inset-right))!important;
  }
  .tfe-header-wrap{
    width:100%!important;
    max-width:100%!important;
    height:58px!important;
    border-radius:22px!important;
  }
  .tfe-header-inner{padding-left:12px!important;padding-right:10px!important}
  .tfe-logo{max-width:calc(100% - 54px)!important}
  .tfe-logo img{height:28px!important}
  .tfe-logo-text{font-size:clamp(16px,4.5vw,19px)!important}
  .tfe-burger{flex-basis:42px!important;width:42px!important;min-width:42px!important;max-width:42px!important;height:42px!important}

  .tfe-mobile-overlay{
    width:min(92%,360px)!important;
    max-width:calc(100% - max(8px,env(safe-area-inset-left)) - max(8px,env(safe-area-inset-right)))!important;
    max-height:100dvh!important;
  }

  /* Mobile page typography. */
  :where(.entry-content h1,.tfe-page-hero h1,.tfe-hero-title,.tfe-events-hero h1,
  .tfe-premium-hero__content h1,.tfv-hero h1,.tfs-hero h1,.tf-single h1,.tf-author-page h1){
    font-size:clamp(28px,8.5vw,42px)!important;
    line-height:1.05!important;
    letter-spacing:-.03em!important;
  }
  :where(.entry-content h2,.tfe-section-title,.tfe-section-heading,
  .tfe-premium-section-heading,.tfe-events-section-head h2,.tfv-section-head h2,.tfs-section-title){
    font-size:clamp(21px,6.2vw,30px)!important;
    line-height:1.12!important;
  }

  /* Structural grids collapse. Event cards are deliberately excluded. */
  :where(.tfe-core-grid-2,.tfe-core-grid-3,.tfe-page-grid,.tfs-grid-2,.tfs-grid-3,
  .tfv-grid-3,.tfv-grid-4,.tfe-contact-grid,.tfe-details-grid,.tfe-info-grid,.tfe-stats-grid){
    grid-template-columns:minmax(0,1fr)!important;
  }

  /* Performer hero: poster and content scale from viewport, never from desktop width. */
  .single-performer .tfe-hero{
    padding-top:clamp(82px,20vw,104px)!important;
  }
  .single-performer .tfe-hero__content{
    text-align:center!important;
    justify-items:center!important;
    padding-bottom:clamp(24px,7vw,40px)!important;
  }
  .single-performer .tfe-hero .tfe-poster{
    width:min(82%,320px)!important;
    max-width:min(82%,320px)!important;
    transform:none!important;
  }
  .single-performer .tfe-hero-info{padding:0!important;text-align:center!important}
  .single-performer .tfe-hero-desc{max-width:100%!important;text-align:left!important}
  .single-performer .tfe-meta-row,.single-performer .tfe-actions{justify-content:center!important}

  /* Forms: 16px avoids iOS focus zoom. */
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea){
    width:100%;max-width:100%;min-width:0;font-size:16px!important
  }
  :where(.tfe-search-form,.tfe-sub-form,.tfe-toolbar,.tfe-actions,.tfe-hero-actions,
  .tfe-events-hero-actions,.tfe-secondary-actions,.tfv-actions,.tfv-form-shell,.tf-search-form){
    max-width:100%!important;min-width:0!important
  }

  /* Content tables scroll inside themselves, not the entire page. */
  :where(.entry-content,.tfe-content,.tfe-single-content,.tfe-legal-content,.tf-single-content) table{
    display:block;width:100%!important;max-width:100%!important;overflow-x:auto;-webkit-overflow-scrolling:touch
  }

  /* Dialogs fit safe viewport. */
  :where(.tfe-modal,.tfe-bk-modal,.tfv-modal){
    width:calc(100% - 20px)!important;
    max-width:calc(100% - 20px)!important;
    max-height:calc(100dvh - 20px)!important;
    margin:10px!important;
    overflow-y:auto!important;
  }

  .site-footer,.footer-wrapper,.footer-grid,.footer-grid-v994,.tfe-footer-grid{
    width:100%!important;max-width:100%!important;min-width:0!important
  }
}

/* ---------- Very small phones ---------- */
@media (max-width:390px){
  :root{--tfe-rf-gutter:12px}
  .tfe-header-outer{padding-left:6px!important;padding-right:6px!important}
  .tfe-header-inner{padding-left:10px!important;padding-right:8px!important;gap:6px!important}
  .tfe-logo{max-width:calc(100% - 48px)!important}
  .tfe-logo img{height:26px!important}
  .tfe-burger{flex-basis:40px!important;width:40px!important;min-width:40px!important;max-width:40px!important;height:40px!important}
  .single-performer .tfe-hero .tfe-poster{width:min(86%,300px)!important;max-width:min(86%,300px)!important}
}

/* Short landscape phones */
@media (max-width:900px) and (max-height:520px) and (orientation:landscape){
  .tfe-header-outer{padding-top:6px!important}
  .tfe-header-wrap{height:52px!important}
  .tfe-mobile-overlay{height:100dvh!important;max-height:100dvh!important}
  :where(.tfe-hero,.tfe-events-hero,.tfv-hero,.tfs-hero){padding-top:68px!important;min-height:auto!important}
}
