/* Bharat Pet Expo 2027: phone and tablet usability layer.
   This file is deliberately last so it fixes earlier desktop and theme rules. */
:root { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 115px; }
*,*::before,*::after { box-sizing: border-box; }
body { min-width: 0; max-width: 100%; overflow-x: clip; }
img,video,svg,canvas,iframe { max-width: 100%; }
video, img { height: auto; }
button,a,input,textarea,select { -webkit-tap-highlight-color: transparent; }
:where(a,button,input,textarea,select,[tabindex]):focus-visible { outline: 3px solid #c99e54; outline-offset: 3px; }
/* Hidden mobile menu must not be overridden by desktop/tablet display:flex rules. */
.mobile-nav[hidden], [hidden] { display: none !important; }
.site-header { z-index: 100; }
.mobile-nav { z-index: 101; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mobile-nav a { display:flex; align-items:center; gap:9px; min-height: 45px; }
.mobile-toggle { touch-action: manipulation; }
:where(.hero-content,.festival-editorial-copy,.festival-teaser-intro,.archive-story,.custom-copy,.attraction-copy,.section-heading) { min-width: 0; overflow-wrap: anywhere; }
:where(.festival-nav-grid,.featured-experience-layout,.festival-editorial-layout,.festival-teaser-layout,.split-story,.split-simple,.custom-image-split,.custom-tiles,.grid,.sponsor-catalogue) > * { min-width:0; }
/* Avoid accidental clipping or oversized media created by uploaded images. */
:where(.custom-image-split,.archive-photos,.ceremony-about,.archive-ceremony) img { max-width:100%; }
/* Website content is always readable, including user-added content. */
:where(.field,.editor-box,.module-record,.record,.custom-tiles,.sponsor-card,.attraction-card) { min-width:0; }
@media(max-width:1100px) {
  .desktop-nav { display:none !important; }
  .mobile-toggle { display:flex !important; justify-content:center; align-items:center; flex-direction:column; }
  .header-inner { justify-content:space-between; }
  .mobile-nav { left:auto; right:max(12px,env(safe-area-inset-right)); top:calc(100% + 8px); width:min(365px,calc(100vw - 24px)); max-height:min(70dvh,590px); overflow-y:auto; background:#fffbf2; border:1px solid #d6b780; box-shadow:0 18px 50px #09263170; padding:10px; border-radius:14px; }
  .mobile-nav a { color:#153c3d; border-bottom:1px solid #e6d7bc; padding:12px; font-size:13px; }
  .mobile-nav a:hover,.mobile-nav a:focus-visible { background:#eee1c9; color:#0d343c; }
  .mobile-nav a[aria-current] { color:#86612f; }
  .mobile-nav a:last-child { border-bottom:0; }
}
@media(max-width:850px) {
  .container { width:calc(100% - 38px); }
  .festival-editorial-layout,.festival-teaser-layout,.archive-ceremony { grid-template-columns:minmax(0,1fr) !important; }
  .archive-ceremony { gap:26px; margin-block:20px 55px; }
  .archive-ceremony .archive-cover { height:min(76vw,470px); max-height:470px; border-radius:12px 74px 12px 12px; box-shadow:10px 10px 0 #d8c19a; }
  .archive-ceremony .archive-story h2 { font-size:clamp(30px,6.5vw,46px); }
  .custom-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .featured-experience-layout.layout-editorial { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto; }
  .featured-experience-layout.layout-editorial .featured-experience-card.feature-lead { grid-column:1/-1; grid-row:auto; min-height:330px; }
  .admin-layout { grid-template-columns:minmax(0,1fr) !important; }
  .admin-sidebar { position:relative; height:auto; min-height:0; padding:14px 16px; }
  .admin-nav { display:flex; overflow-x:auto; max-width:100%; gap:7px; padding:10px 0; scrollbar-width:thin; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
  .admin-nav button { white-space:nowrap; min-height:44px; flex:none; }
  .admin-main,.admin-top,.admin-content,.admin-bottom { min-width:0; }
  .admin-content { padding:24px 17px 42px; }
  .admin-top { flex-wrap:wrap; gap:12px; }
  .admin-actions { display:flex; align-items:center; gap:8px; }
  .overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:600px) {
  html { scroll-padding-top:86px; }
  .container { width:calc(100% - 30px); }
  .site-header { top:8px; }
  .header-inner { width:calc(100% - 16px); min-height:66px; border-radius:15px; padding:6px 8px; gap:7px; }
  .brand-link { height:57px; width:54px; flex:0 0 54px; padding:2px; }
  .brand-established { padding:5px 6px; letter-spacing:.07em; font-size:8px; }
  .header-right { margin-left:auto; gap:6px; }
  .header-tickets { min-height:43px; padding:10px 12px !important; font-size:11px !important; }
  .mobile-toggle { width:43px; height:43px; flex:0 0 43px; border-radius:9px; }
  .mobile-nav { top:calc(100% + 7px); left:8px; right:8px; width:auto; max-height:min(75dvh,570px); padding-bottom:max(10px,env(safe-area-inset-bottom)); }
  .mobile-nav a { min-height:48px; }
  .home-hero { min-height:760px; min-height:max(735px,100svh); }
  .home-hero .hero-photo { inset:0; }
  .hero-content { padding-top:134px; padding-bottom:132px; }
  .hero-content h1 { font-size:clamp(40px,10.3vw,58px); line-height:1.09; max-width:95%; overflow-wrap:normal; }
  .hero-content>p { font-size:13px; line-height:1.6; max-width:95%; }
  .hero-buttons { gap:9px; display:flex; flex-wrap:wrap; }
  .hero-buttons .btn { min-height:45px; min-width:0; white-space:normal; font-size:11px; }
  .hero-meta { margin-top:14px; display:flex; flex-direction:column; align-items:flex-start; gap:7px; }
  .hero-stamp { width:85px; height:85px; bottom:18px; right:16px; font-size:7px; }
  .hero-stamp b { font-size:18px; }
  .home-hero .hero-countdown { margin-top:17px; padding:11px 12px; width:100%; max-width:370px; }
  .home-hero .hero-countdown-label { font-size:9px; letter-spacing:.1em; }
  .home-hero .hero-countdown-values { gap:4px; }
  .home-hero .hero-countdown-values strong { font-size:clamp(18px,5.3vw,24px); }
  .home-hero .hero-countdown-values small { font-size:8px; letter-spacing:0; margin-right:5px; }
  .festival-nav-grid { grid-template-columns:repeat(2,minmax(0,1fr)); transform:translateY(-18px); }
  .festival-nav-grid>a { min-height:125px; padding:15px 12px; }
  .festival-link-title { font-size:clamp(15px,4.4vw,19px); }
  .festival-nav-grid>a>span:last-child { font-size:10px; line-height:1.5; }
  .stats-content { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stats-content>div { min-width:0; }
  .stats-content .countdown-box { grid-column:1/-1; }
  .section-pad { padding-top:55px; padding-bottom:55px; }
  .inner-hero { min-height:290px; }
  .inner-hero-inner { padding-top:115px; padding-bottom:42px; }
  .inner-hero h1 { font-size:clamp(38px,9vw,52px); overflow-wrap:anywhere; }
  .inner-hero p { font-size:13px; line-height:1.6; }
  .festival-editorial,.festival-schedule-teaser { padding:55px 0; }
  .festival-editorial h2,.festival-teaser-intro h2 { font-size:clamp(36px,9vw,47px); }
  .festival-editorial-image { height:260px; max-width:100%; }
  .festival-teaser-row { grid-template-columns:66px minmax(0,1fr) 16px; gap:8px; }
  .festival-session-name strong { font-size:15px; }
  .speaker-grid,.attraction-grid,.home-link-grid,.value-grid,.sponsor-grid { grid-template-columns:minmax(0,1fr) !important; }
  .featured-experience-layout.layout-editorial { gap:11px; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .featured-experience-layout.layout-editorial .featured-experience-card.feature-lead { min-height:280px; }
  .featured-experience-layout.layout-editorial .featured-experience-card:not(.feature-lead) { min-height:195px; }
  .featured-experience-layout.layout-editorial .featured-experience-card:not(.feature-lead) .featured-experience-copy { padding:12px; }
  .featured-experience-layout.layout-editorial .featured-experience-card:not(.feature-lead) h3 { font-size:19px; line-height:1.2; }
  .featured-experience-layout.layout-grid { grid-template-columns:minmax(0,1fr); }
  .featured-experience-layout.layout-grid .featured-experience-card { min-height:250px; }
  .featured-experience-layout.layout-strip .featured-experience-card { flex-basis:min(83vw,360px); height:320px; }
  .experience-detail-dialog { width:calc(100vw - 24px); max-height:85dvh; }
  .experience-detail-inner { padding:20px; }
  .experience-detail-photo { height:205px; }
  .sponsor-catalogue { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .catalogue-card .sponsor-open { min-height:180px; padding:14px 7px; }
  .catalogue-card .sponsor-open strong { font-size:13px; }
  .catalogue-card .sponsor-logo-box { padding:7px; }
  .sponsor-detail-dialog { max-width:calc(100vw - 20px); max-height:86dvh; }
  .sponsor-detail-top h2 { font-size:clamp(28px,8vw,36px); }
  .sponsor-catalogue-header .container { flex-wrap:wrap; justify-content:center; gap:7px 11px; padding-block:11px; text-align:center; }
  .archive-ceremony { margin-bottom:35px; }
  .archive-ceremony .archive-cover { height:min(75vw,360px); box-shadow:7px 7px 0 #dac59f; }
  .archive-ceremony .archive-story h2 { font-size:clamp(30px,8vw,40px); }
  .custom-tiles { grid-template-columns:minmax(0,1fr); }
  .custom-image-split { grid-template-columns:minmax(0,1fr); }
  .custom-copy-photo img,.custom-banner img { max-height:320px; }
  .footer-top,.footer-bottom { flex-wrap:wrap; }
  .footer-links { gap:15px; }
  .footer-links a { padding:8px 0; }
  .admin-sidebar { padding:10px 12px 12px; }
  .admin-brand img { width:45px; height:49px; }
  .admin-nav { padding:10px 0; }
  .admin-nav button { padding:11px 13px; }
  .admin-top { padding:12px 14px; position:sticky; top:0; z-index:5; background:#fffcf7; }
  .admin-top>div:first-child { flex:1; min-width:125px; }
  .admin-actions { flex:0 0 auto; }
  .admin-actions .outline-small { display:none; }
  .admin-actions .gold-small { min-height:44px; padding:10px 13px; }
  .admin-alert { width:calc(100% - 26px); margin:12px auto; line-height:1.6; }
  .admin-content { padding:20px 13px 40px; }
  .admin-pagehead h1 { font-size:clamp(29px,8vw,40px); overflow-wrap:anywhere; }
  .fields { grid-template-columns:minmax(0,1fr); gap:13px; }
  .field.wide { grid-column:auto; }
  .field input,.field textarea,.field select, .auth-card input { font-size:16px; } /* prevents iOS focus zoom */
  .field label { font-size:12px; }
  .field textarea { min-height:130px; }
  .editor-box header,.editor-box .box-body,.record .box-body { padding:15px; }
  .record-head { flex-wrap:wrap; }
  .record-tools { width:100%; display:flex; flex-wrap:wrap; }
  .record-tools button { min-height:43px; min-width:43px; padding:10px; }
  .add-button,.media-upload-action,.media-remove-action,.gold-small { min-height:44px; }
  .media-uploader { grid-template-columns:minmax(0,1fr); }
  .media-photo-preview { width:100%; min-height:145px; height:180px; }
  .media-photo-controls { width:100%; align-items:stretch; }
  .media-photo-controls>* { max-width:100%; }
  .colour-palette-layout,.colour-demo-grid { grid-template-columns:minmax(0,1fr); }
  .colour-palette-row { grid-template-columns:minmax(0,1fr) 50px 90px; gap:6px; font-size:11px; }
  .colour-palette-row input[type=color] { width:49px; }
  .colour-palette-row input[type=text] { width:90px; font-size:12px; }
  .overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-bottom { width:calc(100% - 28px); display:flex; align-items:stretch; flex-direction:column; gap:10px; padding-bottom:max(20px,env(safe-area-inset-bottom)); }
  .admin-bottom button { width:100%; min-height:46px; }
  .admin-overview-actions { flex-direction:column; }
  .admin-overview-actions button,.admin-overview-actions label { width:100%; min-height:44px; }
  .auth-cover { padding:16px; }
  .auth-card { max-height:90dvh; overflow:auto; padding:22px; }
}
@media(max-width:370px) {
  .brand-established { font-size:7px; padding:5px 4px; }
  .header-tickets { font-size:10px!important; padding:8px!important; }
  .hero-content h1 { font-size:clamp(36px,10.6vw,45px); }
  .hero-buttons .btn { width:100%; justify-content:center; }
  .home-hero { min-height:820px; }
  .featured-experience-layout.layout-editorial { grid-template-columns:minmax(0,1fr); }
  .featured-experience-layout.layout-editorial .featured-experience-card.feature-lead { grid-column:auto; min-height:290px; }
  .featured-experience-layout.layout-editorial .featured-experience-card:not(.feature-lead) { min-height:220px; }
  .sponsor-catalogue { grid-template-columns:minmax(0,1fr); }
  .catalogue-card .sponsor-open { min-height:165px; }
}
@media(prefers-reduced-motion:reduce){.featured-experience-card,.attraction-card{transition:none!important}}
.admin-mobile-jump { display:none; }
@media(max-width:850px) {
 .admin-mobile-jump { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:4px; padding:6px 0; }
 .admin-mobile-jump label { color:#e6c998; font-size:12px; font-weight:700; }
 .admin-mobile-jump select { flex:1; min-width:165px; max-width:100%; min-height:44px; border:1px solid #c7a770; background:#fffcf3; color:#123d3c; border-radius:8px; padding:8px 10px; font-size:16px; }
}
/* Prevent light-on-light menu links after customised theme colours. */
@media(max-width:1100px){
 .site-header .mobile-nav a,.site-header .mobile-nav a:visited { color:#173c3b!important; background:transparent; }
 .site-header .mobile-nav a:hover,.site-header .mobile-nav a:focus-visible { color:#0e3037!important; background:#f0e4d0!important; }
 .site-header .mobile-nav a[aria-current] { color:#8b5c22!important; font-weight:900; }
 .site-header .mobile-nav .bpe-icon { color:#a77b3b!important; }
}
/* Higher specificity than the colour editor's dark-menu rule. */
@media(max-width:1100px){
 body:not(.admin-body) .site-header .mobile-nav a,
 body:not(.admin-body) .site-header .mobile-nav a:visited { color:#173c3b!important; }
 body:not(.admin-body) .site-header .mobile-nav a[aria-current] { color:#8b5c22!important; }
 body:not(.admin-body) .site-header .mobile-nav a:hover,
 body:not(.admin-body) .site-header .mobile-nav a:focus-visible { color:#0e3037!important; background:#f0e4d0!important; }
}
