
/* =========================================================
   IPC 54TH ANNUAL SESSION 2026
   FINAL MOBILE / RESPONSIVE QA OVERRIDES
   Safe presentation-layer overrides only.
   Does not change PHP, forms, database, payment or JS logic.
   ========================================================= */

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

/* ---------- Header / Navigation ---------- */
@media (max-width: 1199px) {
  #header .container-fluid.container-xxl {
    padding-left: 18px;
    padding-right: 18px;
  }

  #logo {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
  }

  #logo a {
    display: inline-flex;
    align-items: center;
  }

  #logo img {
    max-height: 34px;
    width: auto;
    object-fit: contain;
  }

  #header .buy-tickets {
    white-space: nowrap;
    margin-left: 10px;
  }
}

@media (max-width: 991px) {
  #header {
    min-height: 64px;
  }

  #header .container-fluid.container-xxl {
    min-height: 64px;
  }

  #logo img {
    max-height: 30px;
  }

  #header .buy-tickets {
    font-size: 11px;
    padding: 9px 13px;
    margin-right: 7px;
  }

  #navbar .mobile-nav-toggle {
    font-size: 29px;
    line-height: 1;
  }

  /* Make the existing BootstrapMade mobile menu easier to use. */
  #navbar.navbar-mobile ul {
    width: min(92vw, 360px);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding-bottom: 10px;
  }

  #navbar.navbar-mobile > ul > li > a,
  #navbar.navbar-mobile .dropdown > a {
    padding: 12px 20px;
    font-size: 14px;
  }

  #navbar.navbar-mobile .dropdown ul {
    position: static;
    display: block;
    margin: 0 15px 8px;
    padding: 5px 0;
    border-radius: 8px;
  }
}

@media (max-width: 575px) {
  #header .container-fluid.container-xxl {
    padding-left: 12px;
    padding-right: 12px;
  }

  #logo {
    gap: 2px;
  }

  #logo img {
    max-height: 25px;
  }

  #header .buy-tickets {
    font-size: 10px;
    padding: 8px 10px;
    margin-left: 5px;
    margin-right: 3px;
  }

  #navbar .mobile-nav-toggle {
    font-size: 27px;
  }
}

/* ---------- Global mobile typography / spacing ---------- */
@media (max-width: 767px) {
  .section-header {
    padding-bottom: 22px;
  }

  .section-header h2 {
    font-size: 28px;
    line-height: 1.2;
  }

  .section-header p {
    font-size: 13px;
    line-height: 1.55;
  }

  .container,
  .container-fluid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .row {
    --bs-gutter-x: 1rem;
  }

  .btn,
  .buy-tickets,
  button {
    min-height: 42px;
  }

  p {
    line-height: 1.65;
  }
}

/* ---------- Venue / maps ---------- */
.venue-map iframe,
#venue iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: 360px;
}

@media (max-width: 767px) {
  .venue-map iframe,
  #venue iframe {
    height: 300px;
  }

  .venue-info {
    padding: 35px 18px;
  }

  .venue-info .col-11 {
    width: 100%;
  }

  .venue-gallery-container .venue-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
}

/* ---------- Nearby hotels ---------- */
@media (max-width: 767px) {
  #hotels .hotel {
    margin-bottom: 28px;
  }

  #hotels .hotel-img img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
  }

  #hotels .hotel p {
    font-size: 13px;
    line-height: 1.65;
    word-break: normal;
  }
}

/* ---------- Legacy tables: prevent horizontal page overflow ---------- */
@media (max-width: 767px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #buy-tickets table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: normal;
    -webkit-overflow-scrolling: touch;
  }

  #buy-tickets table th,
  #buy-tickets table td {
    min-width: 105px;
    padding: 10px 8px;
    font-size: 11px;
    line-height: 1.35;
  }
}

/* ---------- Registration ---------- */
@media (max-width: 767px) {
  .registration-2026,
  #buy-tickets {
    overflow: hidden;
  }

  .registration-2026 .pricing-grid,
  .registration-2026 .registration-grid {
    grid-template-columns: 1fr !important;
  }

  .registration-2026 .price-card {
    width: 100%;
  }

  .registration-2026 h1,
  .registration-2026 h2 {
    font-size: 30px;
    line-height: 1.2;
  }
}

/* ---------- Speakers ---------- */
@media (max-width: 767px) {
  .speakers-2026 {
    overflow: hidden;
  }

  .speakers-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .speaker-card-2026 {
    width: 100%;
  }

  .speaker-card-2026 img {
    width: 100%;
    height: auto;
    max-height: 330px;
    object-fit: cover;
  }
}

/* ---------- Speaker detail ---------- */
@media (max-width: 767px) {
  .speaker-detail-2026,
  .speaker-profile-2026 {
    overflow: hidden;
  }

  .speaker-detail-2026 .row,
  .speaker-profile-2026 .row {
    margin-left: 0;
    margin-right: 0;
  }

  .speaker-detail-2026 img,
  .speaker-profile-2026 img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
  }
}

/* ---------- Exhibition ---------- */
@media (max-width: 767px) {
  .exhibition-2026 {
    overflow: hidden;
  }

  .exhibition-2026 .exh-hero {
    min-height: auto !important;
    padding: 95px 0 55px !important;
  }

  .exhibition-2026 .exh-hero h1 {
    font-size: clamp(38px, 12vw, 62px) !important;
    line-height: .98 !important;
    word-break: normal;
  }

  .exhibition-2026 .exh-hero .exh-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .exhibition-2026 .exh-hero .exh-actions,
  .exhibition-2026 .exh-actions {
    flex-wrap: wrap;
  }

  .exhibition-2026 .exh-floor-plan img,
  .exhibition-2026 .floor-plan img,
  .exhibition-2026 img {
    max-width: 100%;
    height: auto;
  }

  .exhibition-2026 .exh-fee-grid,
  .exhibition-2026 .fee-grid,
  .exhibition-2026 .booth-grid {
    grid-template-columns: 1fr !important;
  }

  .exhibition-2026 .exh-spec-grid,
  .exhibition-2026 .spec-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- Gallery ---------- */
@media (max-width: 767px) {
  #gallery {
    overflow: hidden;
  }

  #gallery .swiper {
    width: 100%;
  }

  #gallery .swiper-slide {
    height: auto;
  }

  #gallery .swiper-slide img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 12px;
  }

  #gallery .swiper-pagination {
    position: relative;
    margin-top: 16px;
  }
}

/* ---------- Sponsorship ---------- */
@media (max-width: 767px) {
  .sponsorship-2026,
  .sponsors-2026 {
    overflow: hidden;
  }

  .sponsorship-2026 .sponsor-grid,
  .sponsors-2026 .sponsor-grid,
  .sponsorship-2026 .tier-grid,
  .sponsors-2026 .tier-grid {
    grid-template-columns: 1fr !important;
  }

  .sponsorship-2026 .sponsor-card,
  .sponsors-2026 .sponsor-card {
    width: 100%;
  }

  .sponsorship-2026 table,
  .sponsors-2026 table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- Contact / footer ---------- */
@media (max-width: 767px) {
  #contact .contact-info > div {
    margin-bottom: 22px;
  }

  #footer .footer-top {
    padding-top: 40px;
    padding-bottom: 30px;
  }

  #footer .footer-info,
  #footer .footer-links,
  #footer .footer-contact {
    margin-bottom: 28px;
  }
}

/* ---------- Touch targets ---------- */
@media (hover: none) and (pointer: coarse) {
  a,
  button,
  .programme-day-btn,
  .swiper-button-prev,
  .swiper-button-next {
    -webkit-tap-highlight-color: transparent;
  }

  .programme-day-btn,
  button,
  .buy-tickets {
    touch-action: manipulation;
  }
}


/* =========================================================
   V2 MOBILE FIX — BASED ON MOBILE SCREENSHOT QA
   Targets the existing venue/accommodation page structure
   without changing PHP, content, database or JavaScript.
   ========================================================= */

/* Keep Bootstrap rows from creating unexpected horizontal width. */
@media (max-width: 991px) {
  .row {
    max-width: 100%;
  }

  .container-fluid,
  .container {
    max-width: 100%;
  }
}

/* ---------- VENUE / ACCOMMODATION PAGE ---------- */
@media (max-width: 991px) {
  /* Venue map + information must stack. */
  #venue .venue-map,
  #venue .venue-info,
  #transport .transport-map,
  #transport .transport-info {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  #venue .venue-map iframe,
  #transport .transport-map iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: 340px !important;
  }

  #venue .venue-info {
    min-height: auto !important;
    padding: 36px 24px !important;
  }

  #venue .venue-info .row {
    width: 100%;
  }

  #venue .venue-info .col-11,
  #venue .venue-info .col-lg-8 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* 4-column desktop venue gallery -> 2 columns on tablet/mobile. */
  #venue .venue-gallery-container .row > [class*="col-"] {
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
  }

  #venue .venue-gallery {
    padding: 3px;
  }

  #venue .venue-gallery img {
    display: block;
    width: 100% !important;
    height: 190px !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
}

/* ---------- HOTELS ---------- */
@media (max-width: 991px) {
  #hotels .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  #hotels .hotel {
    width: 100%;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 28px;
    padding-bottom: 22px;
  }

  #hotels .hotel-img {
    overflow: hidden;
    border-radius: 10px;
  }

  #hotels .hotel-img img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  #hotels .hotel h3 {
    font-size: 20px;
    line-height: 1.25;
  }

  #hotels .hotel p {
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }
}

/* ---------- TRANSPORTATION ---------- */
@media (max-width: 991px) {
  #transport {
    overflow: hidden;
  }

  #transport .transport-map iframe {
    height: 300px !important;
  }

  #transport .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  #transport .transport-info {
    padding: 30px 16px !important;
  }

  #transport .transport-card,
  #transport .transport-item,
  #transport .card {
    width: 100%;
    margin-bottom: 16px;
  }
}

/* ---------- MOBILE SECTION HEADERS ---------- */
@media (max-width: 767px) {
  #venue .section-header,
  #hotels .section-header,
  #transport .section-header,
  #gallery .section-header {
    padding: 34px 16px 22px;
  }

  #venue .section-header h2,
  #hotels .section-header h2,
  #transport .section-header h2,
  #gallery .section-header h2 {
    font-size: 27px;
    line-height: 1.15;
  }

  #venue .section-header p,
  #hotels .section-header p,
  #transport .section-header p,
  #gallery .section-header p {
    font-size: 12px;
    line-height: 1.55;
  }
}

/* ---------- VERY SMALL PHONES ---------- */
@media (max-width: 430px) {
  body {
    font-size: 14px;
  }

  .container,
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Keep two gallery columns, but make each image compact. */
  #venue .venue-gallery-container .row > [class*="col-"] {
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
  }

  #venue .venue-gallery img {
    height: 125px !important;
    border-radius: 6px;
  }

  #venue .venue-info {
    padding: 28px 18px !important;
  }

  #venue .venue-info h3 {
    font-size: 22px;
    line-height: 1.25;
  }

  #venue .venue-info p {
    font-size: 13px;
    line-height: 1.6;
  }

  #venue .venue-info .buy-tickets {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
  }

  #hotels .hotel {
    max-width: 100%;
  }

  #hotels .hotel h3 {
    font-size: 19px;
  }

  #hotels .hotel p {
    font-size: 12.5px;
  }

  #transport .section-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  #transport .section-header h2 {
    font-size: 25px;
  }

  #transport .section-header p {
    font-size: 12px;
  }

  #transport .transport-map iframe {
    height: 270px !important;
  }
}

/* ---------- HEADER: compact mobile presentation ---------- */
@media (max-width: 767px) {
  #header {
    min-height: 58px;
  }

  #header .container-fluid.container-xxl {
    min-height: 58px;
    padding-left: 10px;
    padding-right: 10px;
  }

  #logo {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  #logo img {
    max-height: 27px !important;
  }

  #header .buy-tickets {
    font-size: 9px;
    line-height: 1.1;
    padding: 8px 9px;
    min-height: 34px;
  }

  #navbar .mobile-nav-toggle {
    font-size: 27px;
    margin-left: 3px;
  }
}

/* ---------- PREVENT LONG TEXT FROM BREAKING MOBILE LAYOUT ---------- */
@media (max-width: 767px) {
  #venue a,
  #hotels a,
  #transport a,
  #contact a,
  #footer a {
    overflow-wrap: anywhere;
  }

  #venue p,
  #hotels p,
  #transport p,
  #contact p {
    overflow-wrap: anywhere;
  }
}
