/* ==========================================================================
   BAC Clinic - visual theme layer
   Styling only: overrides Bootstrap / Creative classes, no markup changes.
   Palette: medical navy + rose accent + warm cream surfaces.
   ========================================================================== */

:root {
  /* Brand */
  --bac-navy-950: #082238;
  --bac-navy-900: #0a2e4a;
  --bac-navy-800: #0d4c7a;
  --bac-navy-700: #14608f;

  --bac-rose-700: #1561a3;
  --bac-rose-600: #c2185b;
  --bac-rose-500: #d9548a;
  --bac-rose-200: #f6c9db;
  --bac-rose-100: #fce9f1;

  /* Surfaces */
  --bac-cream: #fbf7f3;
  --bac-paper: #ffffff;
  --bac-ink: #1b2733;
  --bac-muted: #576774;
  --bac-line: #e8e1d8;

  /* Elevation */
  --bac-shadow-sm:
    0 1px 2px rgba(8, 34, 56, 0.06), 0 4px 14px rgba(8, 34, 56, 0.06);
  --bac-shadow-md: 0 10px 34px rgba(8, 34, 56, 0.12);
  --bac-radius: 18px;
  --bac-radius-lg: 26px;

  /* Type */
  --bac-font-head:
    "Kanit", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bac-font-body:
    "Noto Sans Thai", "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* --------------------------------------------------------------------------
   1. Base
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  padding-top: 45px; /* clears the fixed promo bar */
  font-family: var(--bac-font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--bac-ink);
  background-color: var(--bac-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--bac-font-head);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: var(--bac-navy-900);
}

h3 {
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 2rem);
}
h4 {
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.7rem);
}
h5 {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
}
h6 {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.12rem);
}

p {
  margin-bottom: 1.15rem;
  line-height: 1.9;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
  color: var(--bac-navy-900);
}

a {
  color: var(--bac-navy-800);
  text-decoration-color: rgba(13, 76, 122, 0.35);
  text-underline-offset: 3px;
  transition:
    color 0.18s ease,
    text-decoration-color 0.18s ease;
}

a:hover {
  color: var(--bac-rose-600);
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(194, 24, 91, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  color: #fff;
  background: var(--bac-rose-600);
}

hr {
  max-width: 56px;
  border-width: 3px;
  border-radius: 999px;
  border-color: var(--bac-rose-600);
  opacity: 1;
}

hr.light {
  border-color: rgba(255, 255, 255, 0.6);
}

img {
  max-width: 100%;
  height: auto;
}

/* Headings inherit colour on dark surfaces */
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6,
.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6,
.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary h4,
.bg-primary h5,
.bg-primary h6 {
  color: inherit;
}

.text-white strong,
.bg-dark strong,
.bg-primary strong {
  color: inherit;
}

/* --------------------------------------------------------------------------
   2. Layout rhythm
   -------------------------------------------------------------------------- */

section {
  padding: clamp(2.75rem, 1.75rem + 4vw, 5.25rem) 0;
}

/* --------------------------------------------------------------------------
   3. Promo bar + navbar
   -------------------------------------------------------------------------- */

.fixed-top2 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1035;
  background-image: linear-gradient(
    90deg,
    var(--bac-navy-900) 0%,
    var(--bac-navy-800) 55%,
    var(--bac-rose-700) 100%
  ) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.top-text {
  font-family: var(--bac-font-head);
  font-size: clamp(0.72rem, 0.62rem + 0.25vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: #fff;
}

#mainNav {
  top: 45px; /* sit below the fixed promo bar */
  font-family: var(--bac-font-head);
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(8, 34, 56, 0.1);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}

/* Solid fallback where backdrop-filter is unsupported */
@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  #mainNav {
    background-color: var(--bac-paper) !important;
  }
}

#mainNav .navbar-nav > li.nav-item > a.nav-link,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus {
  color: var(--bac-ink) !important;
}

#mainNav .navbar-nav > li.nav-item > a.nav-link:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link:focus:hover,
#mainNav .navbar-nav > li.nav-item > a.nav-link.active {
  color: var(--bac-navy-800) !important;
}

header.pad {
  margin-top: 0 !important; /* body padding already clears the promo bar */
}

#mainNav .navbar-brand img {
  border-radius: 0;
}

#mainNav .navbar-nav > li.nav-item > a.nav-link {
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

#mainNav.navbar-shrink {
  background-color: rgba(255, 255, 255, 0.82) !important;
  border-bottom-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 36px rgba(8, 34, 56, 0.14);
}

#mainNav .dropdown-menu {
  max-height: min(70vh, 520px);
  margin-top: 0.5rem;
  padding: 0.5rem;
  overflow-y: auto;
  background-color: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 16px 40px rgba(8, 34, 56, 0.16);
  font-family: var(--bac-font-body);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}

@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  #mainNav .dropdown-menu {
    background-color: var(--bac-paper) !important;
  }
}

@media (min-width: 992px) {
  #mainNav .dropdown-menu {
    width: 26rem;
  }
}

#mainNav .dropdown-item {
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  font-size: 0.83rem;
  line-height: 1.45;
  white-space: normal;
}

#mainNav .dropdown-item:hover,
#mainNav .dropdown-item:focus {
  color: var(--bac-navy-800);
  background-color: var(--bac-rose-100);
}

/* --------------------------------------------------------------------------
   4. Surfaces
   -------------------------------------------------------------------------- */

.bg-light {
  background-color: var(--bac-cream) !important;
}

.bg-dark {
  background-color: var(--bac-navy-950) !important;
  background-image: linear-gradient(
    150deg,
    var(--bac-navy-950) 0%,
    #0c3552 55%,
    var(--bac-navy-900) 100%
  );
}

.bg-primary {
  background-color: var(--bac-navy-800) !important;
  background-image: linear-gradient(
    135deg,
    var(--bac-navy-800) 0%,
    var(--bac-navy-950) 100%
  );
}

/* Tint whatever background image each page sets for itself */
.bg-fixed {
  background-color: rgba(8, 34, 56, 0.86) !important;
  background-blend-mode: multiply;
  background-size: cover !important;
  background-position: center center !important;
  background-attachment: fixed !important;
}

/* Glass panel used in the "symptoms" band (previously unstyled) */
.black-tran {
  padding: clamp(1.25rem, 1rem + 1.5vw, 2.5rem);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--bac-radius-lg);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.black-tran .black-tran {
  padding: 0;
  background: transparent;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.bg-primary .alert-primary {
  margin-bottom: 1rem;
  padding: 1.15rem 1.3rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.bg-primary .alert-primary strong {
  color: var(--bac-rose-200);
}

#contact {
  background-image: linear-gradient(
    180deg,
    var(--bac-paper) 0%,
    var(--bac-cream) 100%
  );
}

/* --------------------------------------------------------------------------
   5. Hero carousel
   -------------------------------------------------------------------------- */

.carousel.intro {
  overflow: hidden;
  background: var(--bac-navy-900);
  box-shadow: var(--bac-shadow-md);
}

.carousel-inner img {
  display: block;
  width: 100%;
}

.carousel-indicators {
  bottom: 16px;
}

.carousel-indicators li {
  width: 26px;
  height: 4px;
  margin: 0 4px;
  border: 0;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.6);
  opacity: 1;
  transition:
    width 0.2s ease,
    background-color 0.2s ease;
}

.carousel-indicators .active {
  width: 42px;
  background-color: #fff;
}

.carousel-control-prev,
.carousel-control-next {
  width: 8%;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(8, 34, 56, 0.5);
  background-size: 16px 16px;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Lead paragraph on the intro section */
#about > .container > p:first-of-type {
  font-size: 1.05rem;
  color: var(--bac-navy-900);
}

/* --------------------------------------------------------------------------
   6. Media cards
   -------------------------------------------------------------------------- */

section img.img-fluid {
  display: block;
  border-radius: var(--bac-radius);
  box-shadow: var(--bac-shadow-sm);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

@media (hover: hover) {
  section img.img-fluid:hover {
    transform: translateY(-3px);
    box-shadow: var(--bac-shadow-md);
  }
}

.mapouter iframe {
  box-shadow: var(--bac-shadow-sm);
}

/* --------------------------------------------------------------------------
   7. Tables (protocol tables are dark by markup; render them as light cards)
   -------------------------------------------------------------------------- */

.table {
  margin-bottom: 1.75rem;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  color: var(--bac-ink);
  background-color: var(--bac-paper);
  border-radius: var(--bac-radius);
  box-shadow: var(--bac-shadow-sm);
}

.table-dark,
.table-dark > td,
.table-dark > th {
  color: var(--bac-ink);
  background-color: var(--bac-paper);
}

.table-dark thead th {
  padding: 1rem;
  font-family: var(--bac-font-head);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fff;
  background-color: var(--bac-navy-800) !important;
  border-color: var(--bac-navy-800) !important;
  vertical-align: middle;
}

.table-dark td {
  padding: 1.1rem 1rem;
  font-size: 0.95rem;
  line-height: 1.75;
  vertical-align: top;
  border-color: var(--bac-line) !important;
}

.table-dark.table-striped tbody tr:nth-of-type(odd) {
  background-color: #fdf8fa !important;
}

.table-dark i.fas.fa-check {
  margin-right: 0.25rem;
  color: var(--bac-rose-600);
}

/* --------------------------------------------------------------------------
   8. Modal + utilities
   -------------------------------------------------------------------------- */

.modal-content {
  border: 0;
  border-radius: var(--bac-radius-lg);
  box-shadow: var(--bac-shadow-md);
}

.modal-header {
  border-bottom-color: var(--bac-line);
}

.text-danger {
  color: var(--bac-rose-700) !important;
}

.text-primary {
  color: var(--bac-navy-800) !important;
}

#services ul li a {
  text-decoration: underline;
  text-decoration-color: rgba(194, 24, 91, 0.4);
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
  body {
    font-size: 15.5px;
  }

  section {
    padding: 2.25rem 0;
  }

  header.pad {
    padding-top: 40px;
  }

  .table {
    display: block;
    overflow-x: auto;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
  }

  .table-dark th:nth-child(1),
  .table-dark td:nth-child(1) {
    min-width: 130px;
  }

  .table-dark th:nth-child(2),
  .table-dark td:nth-child(2) {
    min-width: 160px;
  }

  .table-dark th:nth-child(3),
  .table-dark td:nth-child(3) {
    min-width: 230px;
  }

  .table-dark th:nth-child(4),
  .table-dark td:nth-child(4) {
    min-width: 130px;
  }

  .table-dark td,
  .table-dark thead th {
    font-size: 0.875rem;
  }

  .carousel-indicators {
    bottom: 10px;
  }
}

@media (max-width: 575.98px) {
  .black-tran {
    padding: 1.15rem;
    border-radius: 18px;
  }
}

/* --------------------------------------------------------------------------
   10. Motion preferences
   -------------------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
