/*
 * TicketsFest.EU — Responsive Device Layer
 * v10.0.3
 * Target: iPhone SE/mini/standard/Pro/Pro Max, Android narrow/standard/large, tablets.
 * This file is intentionally loaded last and only corrects layout/viewport behavior.
 */

:root{
  --tfe-mobile-gutter: clamp(14px, 4.4vw, 22px);
  --tfe-touch: 44px;
  --tfe-safe-top: env(safe-area-inset-top, 0px);
  --tfe-safe-right: env(safe-area-inset-right, 0px);
  --tfe-safe-bottom: env(safe-area-inset-bottom, 0px);
  --tfe-safe-left: env(safe-area-inset-left, 0px);
}

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
body{
  overflow-x: hidden;
  min-width: 320px;
}
*,*::before,*::after{box-sizing:border-box;}
img,video,svg,canvas,iframe{max-width:100%;height:auto;}

/* Prevent long PL/UA/EN titles, venues, URLs and chips from breaking mobile width. */
.tfe-page-wrapper,
.tfe-events-page,
.tfe-container,
.tfe-events-archive-section,
.tfe-events-featured-section,
.tfe-events-seo-block,
.tfe-events-faq,
.tfe-card,
.tfe-core-card,
.tfe-events-seo-block__inner,
.tfe-events-faq__inner,
.tfe-event-card,
.tfe-card-item,
.tfe-card-caption,
.tfe-card-caption-title,
.tfe-card-caption-meta,
.tfe-events-seo-links__list a,
.tfe-events-filter-chip,
.tfe-filter-pill,
.tfe-filter-input,
.tfe-select-chip{
  min-width:0;
  overflow-wrap:anywhere;
}

/* iOS prevents zooming inputs only when font-size is 16px+. */
input,select,textarea,button{
  font-size:16px;
}

@media (max-width: 1024px){
  .tfe-container,
  .tfe-events-archive-section,
  .tfe-events-featured-section,
  .tfe-events-seo-block,
  .tfe-events-faq,
  .tfe-page-wrapper .tfe-wrap,
  .site-main,
  .content-area{
    width:100% !important;
    max-width:100% !important;
    padding-left:calc(var(--tfe-mobile-gutter) + var(--tfe-safe-left)) !important;
    padding-right:calc(var(--tfe-mobile-gutter) + var(--tfe-safe-right)) !important;
  }

  .tfe-header-wrap{
    width:calc(100% - (var(--tfe-mobile-gutter) * 2) - var(--tfe-safe-left) - var(--tfe-safe-right)) !important;
    left:calc(var(--tfe-mobile-gutter) + var(--tfe-safe-left)) !important;
    right:auto !important;
    top:calc(10px + var(--tfe-safe-top)) !important;
  }

  .tfe-mobile-drawer,
  .tfe-mobile-menu,
  .tfe-mobile-nav{
    max-height:calc(100dvh - 86px - var(--tfe-safe-top) - var(--tfe-safe-bottom)) !important;
    padding-bottom:calc(18px + var(--tfe-safe-bottom)) !important;
  }

  @supports not (height: 100dvh){
    .tfe-mobile-drawer,
    .tfe-mobile-menu,
    .tfe-mobile-nav{max-height:calc(100vh - 86px) !important;}
  }
}

@media (max-width: 820px){
  .tfe-events-page .tfe-events-archive-section,
  .tfe-events-page .tfe-events-featured-section{
    padding-top:24px !important;
    padding-bottom:42px !important;
  }

  .tfe-advanced-filters,
  .tfe-filter-searchline,
  .tfe-filter-gridline{
    width:100% !important;
    max-width:100% !important;
  }

  .tfe-filter-searchline,
  .tfe-filter-gridline{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
  }

  .tfe-filter-input,
  .tfe-advanced-filters .tfe-select-chip,
  .tfe-btn-apply,
  .tfe-btn-reset--link,
  .tfe-search-btn,
  .tfe-clear-btn,
  .tfe-btn,
  .tfe-btn-book,
  .tfe-btn-view{
    width:100% !important;
    min-height:48px !important;
    border-radius:16px !important;
  }

  .tfe-filter-actions{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
  }

  .tfe-events-seo-links,
  .tfe-events-faq__grid{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  .tfe-events-seo-block__inner,
  .tfe-events-faq__inner{
    border-radius:24px !important;
    padding:22px !important;
  }
}

/* iPhone Pro Max / large Android: cards can breathe, without overflowing. */
@media (max-width: 540px){
  .tfe-events-hero,
  .tfe-hero{
    padding-top:calc(90px + var(--tfe-safe-top)) !important;
  }

  .tfe-events-hero h1,
  .tfe-hero-title{
    font-size:clamp(30px, 10.4vw, 44px) !important;
    line-height:1.02 !important;
    letter-spacing:-.045em !important;
  }

  .tfe-events-hero p,
  .tfe-hero-desc{
    font-size:15px !important;
    line-height:1.55 !important;
  }

  .tfe-events-popular-links,
  .tfe-events-active-filters,
  .tfe-filter-pills,
  .tfe-meta-row{
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:8px !important;
    width:calc(100% + var(--tfe-mobile-gutter)) !important;
    max-width:none !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    padding:0 var(--tfe-mobile-gutter) 8px 0 !important;
    margin-right:calc(-1 * var(--tfe-mobile-gutter)) !important;
    -webkit-overflow-scrolling:touch !important;
    scroll-snap-type:x proximity !important;
    scrollbar-width:none !important;
  }
  .tfe-events-popular-links::-webkit-scrollbar,
  .tfe-events-active-filters::-webkit-scrollbar,
  .tfe-filter-pills::-webkit-scrollbar,
  .tfe-meta-row::-webkit-scrollbar{display:none !important;}

  .tfe-events-popular-links span,
  .tfe-events-active-filters__title{
    flex:0 0 auto !important;
  }

  .tfe-events-filter-chip,
  .tfe-events-filter-clear,
  .tfe-events-popular-links a,
  .tfe-filter-pill,
  .tfe-meta-pill,
  .tfe-meta-item{
    flex:0 0 auto !important;
    white-space:nowrap !important;
    max-width:78vw !important;
    min-height:36px !important;
  }

  .tfe-events-seo-links__list{
    gap:8px !important;
  }
  .tfe-events-seo-links__list a{
    justify-content:flex-start !important;
    max-width:100% !important;
    min-height:38px !important;
    white-space:normal !important;
  }

  .site-footer,
  .tfe-footer{
    padding-bottom:calc(20px + var(--tfe-safe-bottom)) !important;
  }
}

/* Standard iPhone / Android widths: 390–430px. */
@media (max-width: 430px){
  :root{--tfe-mobile-gutter:16px;}

  .tfe-header-wrap{
    min-height:56px !important;
    border-radius:20px !important;
  }
  .tfe-logo-text{
    max-width:58vw !important;
    font-size:18px !important;
  }

  .tfe-events-seo-block__inner,
  .tfe-events-faq__inner,
  .tfe-core-card,
  .tfe-card{
    padding:18px !important;
    border-radius:22px !important;
  }

  .tfe-events-seo-block h2,
  .tfe-events-faq h2,
  .tfe-section-title,
  .tfe-section-heading{
    font-size:clamp(22px, 7.5vw, 30px) !important;
    line-height:1.08 !important;
  }

  .tfe-events-faq__item{
    padding:16px !important;
    border-radius:18px !important;
  }
}

/* iPhone SE / old Android 320–375px: no horizontal body overflow, smaller chrome. */
@media (max-width: 375px){
  :root{--tfe-mobile-gutter:14px;}

  .tfe-header-wrap{
    width:calc(100% - 18px - var(--tfe-safe-left) - var(--tfe-safe-right)) !important;
    left:calc(9px + var(--tfe-safe-left)) !important;
    min-height:54px !important;
  }
  .tfe-logo-text{font-size:16px !important;max-width:54vw !important;}
  .tfe-burger{min-width:42px !important;min-height:42px !important;}

  .tfe-events-hero h1,
  .tfe-hero-title{font-size:30px !important;}

  .tfe-events-seo-block__inner,
  .tfe-events-faq__inner,
  .tfe-core-card,
  .tfe-card{
    padding:16px !important;
    border-radius:20px !important;
  }

  .tfe-btn,
  .tfe-btn-book,
  .tfe-btn-view,
  .tfe-search-btn,
  .tfe-clear-btn{
    min-height:46px !important;
    font-size:14px !important;
  }
}

/* Landscape phones: reduce top space and keep content usable. */
@media (max-height: 520px) and (orientation: landscape){
  .tfe-events-hero,
  .tfe-hero{
    padding-top:calc(72px + var(--tfe-safe-top)) !important;
    padding-bottom:24px !important;
    min-height:auto !important;
  }
  .tfe-mobile-drawer,
  .tfe-mobile-menu,
  .tfe-mobile-nav{
    max-height:calc(100dvh - 72px - var(--tfe-safe-top)) !important;
  }
}


/* =====================================================
   v10.0.4 — Real mobile UX hotfix
   Goal: no cropped second card on phones, visible popular-search chips,
   cleaner iPhone/Android homepage and events archive.
   ===================================================== */
@media (max-width: 767px){
  html,body{width:100%;max-width:100%;overflow-x:hidden!important;}
  .tfe-page-wrapper,
  .tfe-events-page{max-width:100%;overflow-x:hidden!important;}

  /* Header: keep it inside every iPhone/Android viewport. */
  .tfe-header-wrap{
    width:calc(100% - 28px - var(--tfe-safe-left) - var(--tfe-safe-right))!important;
    left:calc(14px + var(--tfe-safe-left))!important;
    right:auto!important;
    min-height:58px!important;
    border-radius:22px!important;
  }
  .tfe-logo,
  .tfe-site-logo,
  .tfe-brand{min-width:0!important;}
  .tfe-logo-text,
  .tfe-site-title{
    max-width:58vw!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  /* Homepage hero banner: less dark frame, stable 16:9 banner, no side overflow. */
  body.home .tfe-hero-banner-section,
  body.page-template-page-home-dots .tfe-hero-banner-section{
    padding-top:calc(86px + var(--tfe-safe-top))!important;
    padding-bottom:24px!important;
    margin-bottom:34px!important;
  }
  body.home .tfe-hero-banner-section .tfe-container,
  body.page-template-page-home-dots .tfe-hero-banner-section .tfe-container{
    width:100%!important;
    max-width:100%!important;
    padding-left:16px!important;
    padding-right:16px!important;
  }
  body.home .tfe-hero-banner-section .tfe-banners-wrap,
  body.page-template-page-home-dots .tfe-hero-banner-section .tfe-banners-wrap{
    width:100%!important;
    max-width:100%!important;
    border-radius:22px!important;
    overflow:hidden!important;
  }
  body.home .tfe-hero-banner-section .tftb-banners,
  body.home .tfe-hero-banner-section .tftb-track,
  body.home .tfe-hero-banner-section .tftb-slide,
  body.page-template-page-home-dots .tfe-hero-banner-section .tftb-banners,
  body.page-template-page-home-dots .tfe-hero-banner-section .tftb-track,
  body.page-template-page-home-dots .tfe-hero-banner-section .tftb-slide{
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  body.home .tfe-hero-banner-section .tftb-slide-inner,
  body.page-template-page-home-dots .tfe-hero-banner-section .tftb-slide-inner{
    width:100%!important;
    max-width:100%!important;
    aspect-ratio:16/9!important;
    min-height:0!important;
    border-radius:20px!important;
    overflow:hidden!important;
  }
  body.home .tfe-hero-banner-section .tftb-slide-img,
  body.page-template-page-home-dots .tfe-hero-banner-section .tftb-slide-img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    object-position:center center!important;
  }
  body.home .tfe-hero-banner-section .tftb-nav,
  body.page-template-page-home-dots .tfe-hero-banner-section .tftb-nav{
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    min-height:42px!important;
  }
  body.home .tfe-hero-banner-section .tftb-prev,
  body.page-template-page-home-dots .tfe-hero-banner-section .tftb-prev{left:12px!important;}
  body.home .tfe-hero-banner-section .tftb-next,
  body.page-template-page-home-dots .tfe-hero-banner-section .tftb-next{right:12px!important;}

  /* Homepage sections: one clean card per row, not a half-cut horizontal slider. */
  body.home .tfe-section-gap,
  body.page-template-page-home-dots .tfe-section-gap{
    margin-top:44px!important;
    margin-bottom:44px!important;
  }
  body.home .tfe-section-header,
  body.page-template-page-home-dots .tfe-section-header{
    display:flex!important;
    justify-content:center!important;
    align-items:center!important;
    flex-wrap:wrap!important;
    gap:10px!important;
    margin-bottom:24px!important;
    padding:0 8px!important;
    text-align:center!important;
  }
  body.home .tfe-section-title,
  body.page-template-page-home-dots .tfe-section-title{
    font-size:clamp(28px,8.6vw,38px)!important;
    line-height:1.06!important;
    letter-spacing:-.035em!important;
    text-align:center!important;
  }
  body.home .tfe-slider-lock,
  body.page-template-page-home-dots .tfe-slider-lock{
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    padding:0!important;
  }

  /* Events page hero: chips visible; buttons full-width; no lonely "Popular searches" label. */
  .tfe-events-page .tfe-events-hero{
    padding-top:calc(96px + var(--tfe-safe-top))!important;
    padding-bottom:42px!important;
    border-radius:0 0 28px 28px!important;
  }
  .tfe-events-page .tfe-hero__content{
    width:100%!important;
    max-width:100%!important;
    padding-left:16px!important;
    padding-right:16px!important;
  }
  .tfe-events-page .tfe-hero-title{
    font-size:clamp(34px,10.4vw,48px)!important;
    line-height:1.03!important;
  }
  .tfe-events-page .tfe-hero-desc{
    font-size:16px!important;
    line-height:1.55!important;
  }
  .tfe-events-page .tfe-events-hero-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    width:100%!important;
    margin-top:24px!important;
  }
  .tfe-events-page .tfe-events-hero-actions .tfe-btn{
    width:100%!important;
    min-height:54px!important;
    border-radius:18px!important;
  }
  .tfe-events-page .tfe-events-popular-links{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:flex-start!important;
    gap:8px!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    padding:0!important;
    margin:20px 0 0!important;
  }
  .tfe-events-page .tfe-events-popular-links span{
    flex:1 0 100%!important;
    width:100%!important;
    color:rgba(255,255,255,.72)!important;
    font-weight:850!important;
  }
  .tfe-events-page .tfe-events-popular-links a{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:36px!important;
    max-width:100%!important;
    white-space:normal!important;
    line-height:1.15!important;
    padding:9px 12px!important;
    border-radius:999px!important;
  }

  .tfe-events-page .tfe-events-archive-section,
  .tfe-events-page .tfe-events-featured-section{
    width:100%!important;
    max-width:100%!important;
    padding-left:16px!important;
    padding-right:16px!important;
  }
  .tfe-events-page .tfe-events-archive-shell{
    width:100%!important;
    max-width:100%!important;
    border-radius:22px!important;
    padding:12px!important;
  }
}

@media (max-width: 430px){
  .tfe-header-wrap{
    width:calc(100% - 24px - var(--tfe-safe-left) - var(--tfe-safe-right))!important;
    left:calc(12px + var(--tfe-safe-left))!important;
  }
  .tfe-logo-text,.tfe-site-title{font-size:17px!important;max-width:56vw!important;}
  body.home .tfe-hero-banner-section .tfe-container,
  body.page-template-page-home-dots .tfe-hero-banner-section .tfe-container,
  .tfe-events-page .tfe-hero__content{
    padding-left:14px!important;
    padding-right:14px!important;
  }
}
