/*---------------------------------------
     MOBILE EXPERIENCE LAYER
     Responsive polish + drawer nav +
     floating back-to-top
  -----------------------------------------*/

/* Smooth mobile scrolling + tap highlight cleanup */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.menu-open {
  overflow: hidden;
}

/*---------------------------------------
     MOBILE DRAWER NAVIGATION
  -----------------------------------------*/

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 30, 12, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1090;
}

.drawer-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 84vw;
  background: #ffffff;
  z-index: 1100;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  visibility: hidden;
}

.mobile-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #0c3e07;
  color: #ffffff;
}

.drawer-header .drawer-brand {
  color: #ffffff;
  font-weight: 600;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.drawer-header .drawer-brand i {
  font-size: 22px;
}

.drawer-header .drawer-brand .brand-n {
  font-weight: 700;
}

.drawer-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}

.drawer-nav {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  overflow-y: auto;
  flex: 1;
}

.drawer-nav li {
  list-style: none;
}

.drawer-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 24px;
  color: #2b2b2b;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid #f6f6f6;
  transition: background 0.25s ease, color 0.25s ease, padding-left 0.25s ease;
}

.drawer-nav li a i {
  color: #0c3e07;
  font-size: 17px;
  width: 22px;
  text-align: center;
}

.drawer-nav li a:hover,
.drawer-nav li a:focus {
  background: #eef6ee;
  color: #0c3e07;
  padding-left: 30px;
}

.drawer-nav li.drawer-appointment a {
  margin: 16px;
  border-bottom: none;
  border-radius: 6px;
  background: #0c3e07;
  color: #ffffff;
  font-weight: 600;
  justify-content: center;
  padding: 14px 24px;
}

.drawer-nav li.drawer-appointment a i {
  color: #ffffff;
  width: auto;
}

.drawer-nav li.drawer-appointment a:hover,
.drawer-nav li.drawer-appointment a:focus {
  background: #4267b2;
  color: #ffffff;
  padding-left: 24px;
}

.drawer-footer {
  padding: 16px 24px 22px;
  border-top: 1px solid #f0f0f0;
  font-size: 12px;
  color: #858585;
}

.drawer-footer a {
  color: #0c3e07;
  text-decoration: none;
  font-weight: 500;
}

/*---------------------------------------
     FLOATING BACK-TO-TOP BUTTON
  -----------------------------------------*/

.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #0c3e07;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.25s ease;
  z-index: 1040;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: #4267b2;
}

.back-to-top:active {
  transform: scale(0.92);
}

/*---------------------------------------
     RESPONSIVE OVERRIDES
  -----------------------------------------*/

@media only screen and (max-width: 767px) {
  /* ---- Header bar: hide desktop contact spans, keep it slim ---- */
  header {
    padding: 8px 0;
  }

  header p {
    font-size: 11px;
    line-height: 1.6;
  }

  header span.date-icon,
  header span.email-icon {
    display: none;
  }

  header .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* ---- Navbar: shrink brand, reserve hamburger space ---- */
  .navbar.navbar-default.navbar-static-top {
    padding: 6px 0;
  }

  .navbar-default .navbar-brand {
    font-size: 20px;
    min-height: 56px;
    max-width: calc(100% - 70px);
    white-space: normal;
    line-height: 1.2;
    align-items: center;
  }

  .navbar-brand .brand-n {
    font-size: 26px;
  }

  .navbar-default .navbar-brand .fa-stethoscope {
    font-size: 38px;
    margin-right: 6px;
  }

  /* Hide the legacy bootstrap toggle; React drawer replaces it */
  .navbar-toggle {
    display: none !important;
  }

  .navbar-toggle.drawer-toggle {
    display: block !important;
    position: absolute;
    right: 15px;
    top: 12px;
    border: none;
    background: #0c3e07;
    border-radius: 6px;
    width: 44px;
    height: 42px;
    padding: 10px 11px;
    cursor: pointer;
  }

  .navbar-toggle.drawer-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background: #ffffff !important;
    margin: 4px 0;
  }

  /* The desktop collapse menu is replaced by the drawer on phones */
  .navbar-collapse.collapse {
    display: none !important;
  }

  /* ---- Hero slider: shorter, full-bleed, readable captions ---- */
  .slider .item {
    height: 520px;
    background-attachment: scroll;
    background-position: center;
  }

  .slider .caption {
    cursor: default;
  }

  .slider .caption .col-md-offset-1 {
    padding-left: 0;
  }

  .slider .owl-dots {
    top: auto;
    bottom: 18px;
  }

  /* ---- About: stack everything, full-width media ---- */
  #about {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  .about-info {
    flex-direction: column;
    gap: 20px;
  }

  .about-info h2 {
    font-size: 26px;
  }

  .about-message h3 {
    max-width: 100%;
    font-size: 15px;
  }

  .about-message .leaf,
  .about-message .comment {
    display: none;
  }

  .profile {
    max-width: 100%;
    padding: 20px;
    flex-direction: column;
    text-align: center;
  }

  .profile img {
    width: 130px;
    height: 130px;
    border-width: 4px;
  }

  .profile figcaption h3 {
    font-size: 20px;
    border-left: none;
    padding-left: 0;
  }

  /* ---- Global image fix: never overflow a phone screen ---- */
  .img-responsive {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  /* ---- Team / Skills cards stack ---- */
  #team {
    padding-top: 50px;
    padding-bottom: 40px;
  }

  .team-thumb {
    margin-bottom: 22px;
  }

  .team-info {
    padding: 16px 20px 0 20px;
  }

  /* ---- News cards stack ---- */
  #news {
    padding-top: 50px;
    padding-bottom: 40px;
  }

  .news-thumb {
    margin-bottom: 22px;
  }

  .news-info {
    padding: 20px;
  }

  /* ---- Appointment: single-column form, tap-friendly ---- */
  #appointment {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  .appointment-imgs {
    margin-top: 0;
    margin-bottom: 28px;
  }

  .appointment-imgs img {
    width: 88%;
    max-width: 340px;
    transform: none;
    filter: none;
  }

  .appointment-imgs img.appointment-img-1,
  .appointment-imgs img.appointment-img-2 {
    transform: none;
  }

  #appointment-form {
    padding: 24px 18px !important;
  }

  #appointment-form .wow.fadeInUp {
    grid-template-columns: 1fr !important;
  }

  #appointment label {
    font-size: 14px;
  }

  #appointment .form-control {
    font-size: 16px; /* >=16px prevents iOS zoom-on-focus */
    min-height: 50px;
  }

  #appointment #cf-submit {
    font-size: 16px;
    letter-spacing: 0.5px;
  }

  /* ---- Map ---- */
  #google-map iframe {
    min-height: 320px;
    height: 320px;
  }

  /* ---- News detail page ---- */
  #news-detail {
    padding-top: 40px;
  }

  .news-detail-thumb {
    margin-bottom: 30px;
  }

  .news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .news-social-share {
    margin-top: 26px;
  }

  .news-social-share .btn {
    font-size: 12px;
    padding: 10px 18px;
    margin: 3px 4px;
  }

  .news-sidebar {
    margin-top: 10px;
  }

  .news-ads {
    padding: 26px 18px;
  }

  /* ---- Footer stacks cleanly ---- */
  footer {
    padding-top: 50px;
  }

  /* Keep the postpartum publication image round, not oval.
     Pin the wrapper div's size so flex can't squeeze it,
     then let the img fill the wrapper. */
  .latest-stories {
    align-items: center;
  }

  .stories-image {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    border-radius: 100%;
    overflow: hidden;
  }

  .stories-image img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    object-position: center top;
    display: block;
  }

  .stories-info {
    flex: 1;
    min-width: 0;
    margin-left: 15px;
  }

  .footer-thumb {
    margin-bottom: 26px;
  }

  .footer-link {
    text-align: center;
  }

  .footer-link a {
    display: inline-block;
    padding: 6px 10px;
  }

  .angle-up-btn {
    display: none; /* replaced by floating back-to-top */
  }

  .copyright-text {
    text-align: center;
  }

  .border-top {
    text-align: center;
  }

  .social-icon {
    margin-top: 4px;
  }

  .contact-info p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    word-break: break-word;
  }

  .opening-hours p {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .opening-hours span {
    padding-left: 0;
  }
}

/* Very small phones */
@media only screen and (max-width: 400px) {
  .navbar-default .navbar-brand {
    font-size: 17px;
  }

  .navbar-brand .brand-n {
    font-size: 22px;
  }

  .slider .item {
    height: 460px;
  }

  .about-info h2 {
    font-size: 23px;
  }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .mobile-drawer,
  .drawer-overlay,
  .back-to-top {
    transition: none;
  }
}
