/**
 * Bridgeview Medical Practice — consolidated responsive overrides
 * Mobile-first fixes for public site (excludes mysiteadmin)
 */

/* ── Base / overflow ───────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}
#map iframe{ height: 65%;}
/* ── Mobile navigation overlay & panel ─────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 992px) {
  /* Override nav.css rules that hide the mobile panel */
  .nav .nav-links {
    display: flex !important;
    position: static;
    width: 100%;
    box-shadow: none;
    padding: 0;
    gap: 0;
  }

  .nav-links li {
    width: 100%;
    border-top: 1px solid #e8ece9;
    padding: 0;
  }

  .nav-links li:first-child {
    border-top: none;
  }

  .nav-links a {
    display: block;
    padding: 14px 8px;
    font-size: 15px;
    min-height: 44px;
    line-height: 1.4;
  }

  .bookbtn .btn {
    display: block;
    width: 100%;
    text-align: center;
    min-height: 44px;
    padding: 12px 16px;
  }

  .header-inner {
    height: auto;
    min-height: 72px;
    padding: 10px 0;
    flex-wrap: nowrap;
    gap: 12px;
  }

  .brandlogo img {
    width: 100%;
    max-width: 180px;
    height: auto;
  }

  .hamburger {
    display: flex;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    z-index: 10002;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .hamburger span {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .dropdown:hover > .dropdown-menu,
  .mega-dropdown:hover > .mega-menu {
    display: none !important;
  }

  /* Hide CSS pseudo + ; use real toggle buttons */
  .dropdown > a::after,
  .mega-dropdown > a::after {
    content: none !important;
  }

  .nav-item-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .nav-item-row > a {
    flex: 1;
    min-width: 0;
  }

  .submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid #d4e8de;
    background: #eef6f3;
    color: #2b8c5a;
    font-size: 22px;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .submenu-toggle .submenu-icon {
    pointer-events: none;
  }

  .nav li.dropdown > .dropdown-menu,
  .nav li.mega-dropdown > .dropdown-menu,
  .nav li.mega-dropdown > .mega-menu {
    display: none !important;
    opacity: 1 !important;
    visibility: hidden !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    box-shadow: none !important;
    border: none !important;
  }

  .nav li.dropdown.is-open > .dropdown-menu,
  .nav li.mega-dropdown.is-open > .dropdown-menu {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
    margin-top: 8px !important;
    padding: 8px 0 8px 12px !important;
  }

  .nav li.mega-dropdown.is-open > .mega-menu {
    display: grid !important;
    grid-template-columns: 1fr;
    max-height: 55vh;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Top bar ───────────────────────────────────────────── */
@media (max-width: 767px) {
  .top-bar .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 16px;
    font-size: 12px;
  }

  .top-bar span,
  .top-bar a {
    word-break: break-word;
  }
}

/* ── Hero ──────────────────────────────────────────────── */
@media (max-width: 992px) {
  .hero {
    height: 420px;
  }

  .hero-content h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .hero-content p {
    font-size: 0.95rem;
  }

  .hero .arrow {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 575px) {
  .hero {
    height: 340px;
  }

  .hero-content {
    padding: 16px;
  }

  .hero-content h1 {
    font-size: 1.25rem;
  }
}

/* ── Sections & typography ───────────────────────────── */
@media (max-width: 992px) {
  .section {
    padding: 48px 20px; text-align:left;
  }

  .page-header {
    padding: 40px 0 36px;
  }

  .page-header h1 {
    font-size: 2rem;
    line-height: 1.2;
    word-wrap: break-word;
  }

  .preventative-content,
  .paediatrics-content,
  .patients-content,
  .staff-content,
  .about-content,
  .feedback-section {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .preventative-content > .container,
  .staff-content > .container,
  .feedback-section > .container {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .preventative-content p:not(.cms-content p) {
    font-size: 1.125rem;
    line-height: 1.6;
  }
}

@media (max-width: 767px) {
  p {
    font-size: 20px !important;
    line-height: 1.6 !important;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }
}

/* ── Two-column inner layout ─────────────────────────── */
@media (max-width: 992px) {
  .innercontent .col-sm-8,
  .innercontent .col-sm-4 {
    width: 100%;
    float: none;
    margin-left: 0;
  }

  .innercontent .pull-left {
    float: none;
  }

  .leftSidebar {
    margin-top: 32px;
  }

  .inner-sidebar {
    position: static;
  }
}

/* ── Contact page ────────────────────────────────────── */
@media (max-width: 992px) {
  .contact-content {
    padding: 48px 0;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-intro {
    font-size: 16px;
    margin-bottom: 32px;
    padding: 0 16px;
  }

  .contact-content .hours-row {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
  }

  #map {
    min-height: 280px;
  }
}

/* ── Forms & buttons (44px touch targets) ────────────── */
@media (max-width: 767px) {
  .feedback-form input,
  .feedback-form textarea,
  .contact-form input,
  .contact-form textarea,
  .form-container input,
  .form-container textarea,
  .btn-submit,
  .btn-primary,
  .btn,
  .btn-show-more,
  .btn-bookdoctor {
    min-height: 44px;
    font-size: 16px;
  }

  .feedback-form .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .form-container label {
    display: block;
    margin-bottom: 6px;
  }
}

/* ── Doctors page ────────────────────────────────────── */
@media (max-width: 992px) {
  .doctors-section.doctorspage {
    padding: 48px 0;
  }

  .doctors-section.doctorspage .doctor-card,
  .team-section .team-doctor-profiles .doctor-card {
    flex-direction: column;
    padding: 20px;
    gap: 24px;
  }

  .doctors-section.doctorspage .doctor-img,
  .team-section .team-doctor-profiles .doctor-img {
    width: 100%;
    max-width: 280px;
    flex: none;
    margin: 0 auto;
  }

  .team-section .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .team-section .grid {
    grid-template-columns: 1fr;
  }

  .doctor-card-half {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
  }
}

/* ── Staff page cards ────────────────────────────────── */
@media (max-width: 680px) {
  .doctor-card-half {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
  }
}

/* ── Services / home grids ───────────────────────────── */
/*@media (max-width: 992px) {
  .home-services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .home-services-grid {
    grid-template-columns: 1fr;
  }
}*/

/* ── News layout ─────────────────────────────────────── */
@media (max-width: 767px) {
  .news-layout {
    grid-template-columns: 1fr !important;
  }

  .small-news {
    flex-direction: column;
  }

  .small-news img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
  }
}

/* ── Footer ──────────────────────────────────────────── */
@media (max-width: 767px) {
  footer {
    padding: 40px 20px 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom .info-grid {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-bottom .text-right,
  .footer-bottom .xs-text-left {
    text-align: center !important;
  }
}

/* ── FAQ accordion ───────────────────────────────────── */
@media (max-width: 767px) {
  .faq-section {
    padding: 40px 16px;
    width: 100%;
  }

  .tab__label {
    font-size: 15px;
    padding: 14px 12px;
    min-height: 44px;
  }
}

/* ── CMS tables & embeds ─────────────────────────────── */
.cms-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cms-content iframe,
.cms-content video {
  width: 100%;
  max-width: 100%;
}

/* ── Modal (homepage) ────────────────────────────────── */
@media (max-width: 767px) {
  #modal-one .modal-dialog {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px);
    margin: 10px auto;
  }

  .bulk-billing-title {
    font-size: 1.35rem !important;
  }

  #modal-one .btn-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ── Press / news detail ─────────────────────────────── */
@media (max-width: 767px) {
  .presswrap .doctor-img,
  .latestnews_detail .doctor-img {
    flex: none;
    width: 100%;
    height: auto;
  }

  .presswrap .doctor-card,
  .latestnews_detail .doctor-card {
    flex-direction: column;
  }
}

/* ── Category show-more buttons ──────────────────────── */
@media (max-width: 575px) {
  #loadMore:not(.is-hidden),
  #showLess:not(.is-hidden) {
    display: block;
    width: 100%;
    margin: 8px 0;
    min-height: 44px;
  }
}

/* ── Intro video page ────────────────────────────────── */
@media (max-width: 575px) {
  .intro-skip {
    bottom: 16px;
    right: 16px;
    left: 16px;
    text-align: center;
    min-height: 44px;
    line-height: 44px;
    padding: 0 16px;
  }
}

/* ── Utility: prevent horizontal scroll ──────────────── */
@media (max-width: 992px) {
  .page-header,
  .doctors-section,
  .team-section,
  .preventative-content,
  .contact-content,
  .about-content,
  section {
    overflow-x: clip;
  }
}

/* Desktop: submenu toggle buttons hidden */
@media (min-width: 993px) {
  .submenu-toggle {
    display: none !important;
  }

  .nav-item-row {
    display: contents;
  }
}

/* ===========================
   Mobile event
=========================== */

@media (max-width:767px){

    .event-item{
        display:flex;
        align-items:center;
        gap:12px; flex-direction: inherit;
    }

    .event-date{
        display:flex !important;
        flex-direction:row !important;
        align-items:center;
        justify-content:center;
        gap:4px;
        width:auto;
        min-width:auto;
        white-space:nowrap;
        text-align:left;
        flex-shrink:0;
    }

    .event-date .day,
    .event-date .month{
        display:inline !important;
        margin:0;
        line-height:1;
    }

    .event-content{
        flex:1;
        min-width:0;
    }

    .event-content a{
        display:block;
        font-size:18px;
        line-height:1.4;         font-weight: bold;
    }
}