/* ==========================================================================
   Dr. Rawandale's Aadhaar Hospital - shared stylesheet
   Mobile-first. Loaded after Bootstrap 5.3.

   1. Design tokens      5. Hero              9. Contact
   2. Base               6. Sections          10. Footer
   3. Buttons            7. Photos            11. Floating call button
   4. Header             8. Cards             12. Scroll reveal and motion
                                              13. Gallery
   ========================================================================== */

/* 1. Design tokens -------------------------------------------------------- */
/* Local fonts resized to match the web fonts, to limit layout shift while loading */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  font-weight: 400 500;
  size-adjust: 106%;
}

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 600;
  size-adjust: 100.6%;
}

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 700;
  size-adjust: 95.3%;
}

:root {
  /* Brand crimson, taken from the logo */
  --color-primary: #c41846;
  --color-primary-rgb: 196, 24, 70;
  --color-primary-dark: #9c1137;
  --color-primary-light: #ff8fae;
  --color-primary-soft: #fdecf1;

  /* Supporting blue, a deeper shade of the blue on the previous site */
  --color-secondary: #1565b0;
  --color-secondary-rgb: 21, 101, 176;
  --color-secondary-dark: #0e4a85;
  --color-secondary-soft: #e8f2fc;

  /* Teal, used on the General Medicine card */
  --color-teal: #0c6670;
  --color-teal-soft: #d6f1f2;

  /* Neutrals */
  --color-dark: #171a26;
  --color-dark-rgb: 23, 26, 38;
  --color-heading: #1a1a1a;
  --color-text: #4a4d55;
  --color-border: #e5e8ef;
  --color-field-border: #848b99;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f8fd;
  --color-bg-blush: #fcf5f7;
  --color-white: #ffffff;
  --color-on-dark: #d9dbe3;

  /* Form messages */
  --color-success: #12663a;
  --color-success-soft: #e6f5ec;
  --color-error: #a4121f;
  --color-error-soft: #fdecee;

  /* Type */
  --font-heading: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: var(--font-heading);

  /* Shape and depth */
  --radius-sm: 0.75rem;
  --radius: 1.25rem;
  --radius-lg: 1.75rem;
  --shadow-sm: 0 2px 10px rgba(23, 26, 38, 0.06);
  --shadow-md: 0 14px 34px rgba(23, 26, 38, 0.12);

  /* Layout */
  --header-height: 4.5rem;
  --header-height-small: 4rem;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--color-text);
  --bs-body-line-height: 1.65;
  --bs-heading-color: var(--color-heading);
  --bs-link-color: var(--color-secondary);
  --bs-link-color-rgb: var(--color-secondary-rgb);
  --bs-link-hover-color: var(--color-secondary-dark);
  --bs-link-hover-color-rgb: 14, 74, 133;
  --bs-border-color: var(--color-border);
}

@media (min-width: 992px) {
  :root { --header-height: 5.5rem; }
}

/* 2. Base ----------------------------------------------------------------- */
html { scroll-padding-top: var(--header-height); }

body {
  padding-top: var(--header-height);
  font-size: 1rem;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
  text-wrap: balance;
}

strong { font-weight: 600; }

address { margin-bottom: 0; }

main:focus { outline: none; }

.bi { flex-shrink: 0; }

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

.site-header a:focus-visible,
.site-header button:focus-visible,
.hero a:focus-visible,
.contact-info a:focus-visible {
  outline-color: var(--color-white);
}

.site-header .dropdown-item:focus-visible { outline-color: var(--color-secondary); outline-offset: -3px; }

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1100;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-heading);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

/* 3. Buttons -------------------------------------------------------------- */
.btn {
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-padding-y: 0.625rem;
  --bs-btn-font-weight: 600;
  --bs-btn-font-size: 1rem;
  --bs-btn-border-radius: 50rem;
  --bs-btn-border-width: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
}

.btn-lg {
  --bs-btn-padding-x: 1.75rem;
  --bs-btn-font-size: 1.0625rem;
  --bs-btn-border-radius: 50rem;
  min-height: 3.25rem;
}

.btn-brand {
  --bs-btn-color: var(--color-white);
  --bs-btn-bg: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-color: var(--color-white);
  --bs-btn-hover-bg: var(--color-primary-dark);
  --bs-btn-hover-border-color: var(--color-primary-dark);
  --bs-btn-active-color: var(--color-white);
  --bs-btn-active-bg: var(--color-primary-dark);
  --bs-btn-active-border-color: var(--color-primary-dark);
  --bs-btn-disabled-color: var(--color-white);
  --bs-btn-disabled-bg: var(--color-primary-dark);
  --bs-btn-disabled-border-color: var(--color-primary-dark);
}

.btn-outline-brand {
  --bs-btn-color: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-color: var(--color-white);
  --bs-btn-hover-bg: var(--color-primary);
  --bs-btn-hover-border-color: var(--color-primary);
  --bs-btn-active-color: var(--color-white);
  --bs-btn-active-bg: var(--color-primary-dark);
  --bs-btn-active-border-color: var(--color-primary-dark);
}

.btn-ghost {
  --bs-btn-color: var(--color-white);
  --bs-btn-border-color: rgba(255, 255, 255, 0.6);
  --bs-btn-hover-color: var(--color-dark);
  --bs-btn-hover-bg: var(--color-white);
  --bs-btn-hover-border-color: var(--color-white);
  --bs-btn-active-color: var(--color-dark);
  --bs-btn-active-bg: var(--color-white);
  --bs-btn-active-border-color: var(--color-white);
}

/* 4. Header --------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1040;
  background: var(--color-dark);
  transition: box-shadow 0.25s ease;
}

.site-header.is-scrolled { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28); }

.site-header .navbar {
  --bs-navbar-padding-y: 0;
  --bs-navbar-color: var(--color-on-dark);
  --bs-navbar-hover-color: var(--color-white);
  --bs-navbar-active-color: var(--color-white);
  --bs-navbar-toggler-border-color: rgba(255, 255, 255, 0.35);
  --bs-navbar-toggler-focus-width: 0.15rem;
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-brand {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  padding: 0;
  transition: min-height 0.25s ease;
}

.site-logo {
  width: auto;
  height: 2.75rem;
  transition: height 0.25s ease;
}

.is-scrolled .navbar-brand { min-height: var(--header-height-small); }
.is-scrolled .site-logo { height: 2.5rem; }

@media (min-width: 992px) {
  .site-logo { height: 3.25rem; }
  .is-scrolled .site-logo { height: 2.75rem; }
}

.navbar-toggler {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 2.75rem;
  padding: 0;
  color: var(--color-white);
}

.navbar-toggler:focus { box-shadow: none; }

.site-header .nav-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 3rem;
  font-weight: 500;
  text-align: left;
}

.site-header .nav-link.active { color: var(--color-primary-light); }
.site-header .nav-link.show { color: var(--color-white); }

.site-header .dropdown-menu {
  --bs-dropdown-padding-y: 0.5rem;
  --bs-dropdown-border-radius: var(--radius-sm);
  --bs-dropdown-link-color: var(--color-heading);
  --bs-dropdown-link-hover-color: var(--color-primary);
  --bs-dropdown-link-hover-bg: var(--color-primary-soft);
  --bs-dropdown-link-active-color: var(--color-white);
  --bs-dropdown-link-active-bg: var(--color-primary);
  --bs-dropdown-font-size: 1rem;
  box-shadow: var(--shadow-md);
}

.site-header .dropdown-item {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
}

/* Collapsed (mobile and tablet) menu */
@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    max-height: calc(100vh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
  }

  .site-header .navbar-nav {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .site-header .navbar-collapse { padding-bottom: 0; }
  .site-header .navbar-collapse > :last-child { margin-bottom: 1rem; }

  .site-header .dropdown-menu {
    --bs-dropdown-bg: rgba(255, 255, 255, 0.07);
    --bs-dropdown-border-width: 0;
    --bs-dropdown-link-color: var(--color-white);
    --bs-dropdown-link-hover-color: var(--color-white);
    --bs-dropdown-link-hover-bg: rgba(255, 255, 255, 0.12);
    box-shadow: none;
  }

  .site-header .dropdown-item:focus-visible { outline-color: var(--color-white); }
}

@media (min-width: 992px) {
  .site-header .navbar-nav .nav-link { padding-inline: 0.7rem; }
  .site-header .nav-link.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.5rem;
  }
}

@media (min-width: 1200px) {
  .site-header .navbar-nav .nav-link { padding-inline: 1rem; }
}

/* Menu items and the call button never break onto two lines */
.site-header .nav-link,
.site-header .header-call { white-space: nowrap; }

/* Narrow desktops: tighten the header so all menu items fit */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-header .navbar-nav .nav-link { padding-inline: 0.5rem; }
  .site-header .header-call { --bs-btn-padding-x: 1rem; }
  .site-logo { height: 3rem; }
}

/* 5. Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 3.5rem 0 5.5rem;
  background:
    linear-gradient(180deg, var(--color-dark) 0, rgba(var(--color-dark-rgb), 0) 22%),
    radial-gradient(ellipse at 90% 35%, rgba(var(--color-primary-rgb), 0.55), transparent 55%),
    radial-gradient(ellipse at 5% 95%, rgba(var(--color-secondary-rgb), 0.55), transparent 55%),
    var(--color-dark);
  color: var(--color-on-dark);
}

/* Decorative soft shapes */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  top: 2rem;
  right: -13rem;
  width: 22rem;
  height: 22rem;
  border: 3rem solid rgba(255, 255, 255, 0.04);
}

.hero::after {
  bottom: -9rem;
  left: 38%;
  width: 18rem;
  height: 18rem;
  background: rgba(255, 255, 255, 0.035);
}

.hero h1 {
  margin-bottom: 1.25rem;
  color: var(--color-white);
  font-size: clamp(2.125rem, 1.55rem + 2.5vw, 3.375rem);
  line-height: 1.15;
}

.hero-lead {
  max-width: 40rem;
  margin-bottom: 2rem;
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
}

@media (min-width: 576px) {
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
}

@media (min-width: 992px) {
  .hero { padding: 6rem 0 8rem; }
}

/* Homepage: the banner fills the first screen, with its content centred */
.hero--full {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Screen height below the fixed header, plus the 2rem that the next section overlaps */
  min-height: calc(100vh - var(--header-height) + 2rem);
  min-height: calc(100svh - var(--header-height) + 2rem);
  padding: 3rem 0 5rem;
}

/* Inner pages: shorter, centred hero */
.hero--page { text-align: center; }

.hero-eyebrow {
  margin-bottom: 0.5rem;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
}

.hero--page h1 { margin-bottom: 1rem; }
.hero--page h1:last-child { margin-bottom: 0; }

.hero-tagline {
  margin-bottom: 2rem;
  color: var(--color-primary-light);
  font-size: 1.25rem;
  font-weight: 500;
}

.hero--page .hero-actions {
  align-items: center;
  justify-content: center;
}

@media (min-width: 992px) {
  .hero--page { padding: 5rem 0 7rem; }
}

.hero--page .hero-lead { margin-inline: auto; }

/* 6. Sections ------------------------------------------------------------- */
.section { padding: 4rem 0; }

.section-about {
  position: relative;
  margin-top: -2rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-bg);
}

.section-alt { background: var(--color-bg-alt); }
.section-blush { background: var(--color-bg-blush); }

.section-title {
  margin-bottom: 2rem;
  font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
}

.section-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 0.25rem;
  margin-top: 0.875rem;
  border-radius: 50rem;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
}

.section-title.text-center::after { margin-inline: auto; }

@media (min-width: 992px) {
  .section { padding: 6rem 0; }
  .section-title { margin-bottom: 3rem; }
}

/* Long text with a photo: stacked on small screens, photo stays in view on large ones */
.story { display: grid; }

.story-media {
  justify-self: center;
  width: 100%;
  max-width: 26rem;
  margin: 1rem 0 2rem;
}

.story-text > p:last-child { margin-bottom: 1rem; }
.story-text--rest > p:last-child { margin-bottom: 0; }

@media (min-width: 992px) {
  .story {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: auto 1fr;
    column-gap: 3.5rem;
    align-items: start;
  }

  .story-text--first { grid-area: 1 / 1; }
  .story-text--rest { grid-area: 2 / 1; }

  .story-media {
    position: sticky;
    top: calc(var(--header-height-small) + 2rem);
    grid-area: 1 / 2 / span 2;
    justify-self: end;
    margin: 0;
  }
}

/* Same layout with the photo first (on the left on large screens) */
.story--media-first .story-media { margin-top: 0; }

@media (min-width: 992px) {
  .story--media-first { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .story--media-first .story-media { grid-area: 1 / 1 / span 2; justify-self: start; }
  .story--media-first .story-text--first { grid-area: 1 / 2; }
  .story--media-first .story-text--rest { grid-area: 2 / 2; }
}

/* 7. Photos --------------------------------------------------------------- */
.media-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero-photo {
  width: min(100%, 26rem);
  margin-inline: auto;
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
}

/* Beside the text, the vertical photo is never taller than the first screen (width is 3/4 of height) */
@media (min-width: 992px) {
  .hero-photo {
    width: min(100%, calc((100vh - var(--header-height) - 6rem) * 0.75));
    width: min(100%, calc((100svh - var(--header-height) - 6rem) * 0.75));
  }
}

.about-photo {
  max-width: 26rem;
  margin-inline: auto;
}

/* 8. Cards ---------------------------------------------------------------- */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 1.75rem;
}

.icon-badge--blue {
  background: var(--color-secondary-soft);
  color: var(--color-secondary);
}

.icon-badge--solid {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
}

.treatment-card,
.facility-card,
.feature-card {
  height: 100%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.treatment-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.treatment-card--pink { --card-ink: var(--color-primary); --card-tint: var(--color-primary-soft); }
.treatment-card--teal { --card-ink: var(--color-teal); --card-tint: var(--color-teal-soft); }

.treatment-image {
  display: block;
  width: 100%;
  height: auto;
}

.treatment-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
}

.treatment-body h3 { margin: 0; font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.005em; }

.treatment-body a { color: var(--color-heading); text-decoration: none; }
.treatment-body a:focus-visible { outline: none; }
.treatment-card:focus-within { outline: 3px solid var(--color-secondary); outline-offset: 3px; }

.treatment-arrow {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--card-tint);
  color: var(--card-ink);
  font-size: 1.25rem;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.treatment-card:hover .treatment-arrow { background: var(--card-ink); color: var(--color-white); }

.facility-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0.75rem;
  border-radius: var(--radius);
  text-align: center;
}

.facility-card p {
  margin: 0;
  color: var(--color-heading);
  font-weight: 500;
  line-height: 1.45;
}

/* Larger facility cards for the Facilities page */
.facility-grid-large .facility-card { padding: 2rem 0.75rem; }
.facility-grid-large .icon-badge { width: 5rem; height: 5rem; font-size: 2.25rem; }

@media (min-width: 992px) {
  .facility-grid-large .facility-card { padding-block: 2.75rem; }
}

@media (min-width: 1200px) {
  .facility-grid-large .facility-card p { font-size: 1.125rem; }
}

.feature-card {
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
}

.feature-card h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: 0; }
.feature-card p { margin: 0; }

/* Minimal "What Sets Us Apart?" on inner pages: icon and title only */
.section-compact { padding: 3rem 0; }
.section-compact .section-title { margin-bottom: 2rem; }

.apart-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.apart-item .icon-badge {
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.apart-item h3 { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: 0; }

@media (min-width: 992px) {
  .section-compact { padding: 4rem 0; }
}

@media (hover: hover) {
  .treatment-card:hover,
  .facility-card:hover,
  .feature-card:hover {
    border-color: rgba(var(--color-primary-rgb), 0.25);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
  }
}

/* 9. Contact -------------------------------------------------------------- */
.contact-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-md);
}

.contact-info {
  padding: 1.75rem 1rem;
  background: linear-gradient(135deg, var(--color-secondary-dark), var(--color-secondary));
  color: var(--color-white);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.contact-item > div { min-width: 0; }

.contact-item :is(h2, h3) {
  margin-bottom: 0.5rem;
  color: var(--color-white);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.contact-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.25rem;
}

.contact-link {
  display: inline-block;
  min-height: 2.75rem;
  padding-block: 0.55rem;
  color: var(--color-white);
  overflow-wrap: anywhere;
  text-underline-offset: 0.2em;
}

.contact-link:hover { color: var(--color-white); text-decoration-thickness: 2px; }

.contact-form-wrap { padding: 2rem 1.25rem; }
.contact-form-wrap :is(h2, h3) { margin-bottom: 1.5rem; font-size: 1.5rem; }

.form-label {
  margin-bottom: 0.35rem;
  color: var(--color-heading);
  font-weight: 500;
}

.required-mark { color: var(--color-error); }

.form-control {
  min-height: 3rem;
  border-color: var(--color-field-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.form-control::placeholder { color: #646a76; }

.form-control:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 0.25rem rgba(var(--color-secondary-rgb), 0.22);
}

.form-control.is-invalid { border-color: var(--color-error); }
.invalid-feedback { color: var(--color-error); font-size: 1rem; }

.form-status:not(:empty) {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.form-status.is-success { background: var(--color-success-soft); color: var(--color-success); }
.form-status.is-error { background: var(--color-error-soft); color: var(--color-error); }

.map-wrap {
  height: 100%;
  min-height: 22rem;
  background: var(--color-secondary-soft);
}

.map-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 22rem;
  border: 0;
}

@media (min-width: 768px) {
  .contact-info { padding: 2.5rem; }
  .contact-item { gap: 1rem; }
  .contact-icon { width: 3rem; height: 3rem; }
  .contact-form-wrap { padding: 2.5rem; }
}

/* 10. Footer -------------------------------------------------------------- */
.site-footer {
  /* Extra space below on phones, so the floating call button does not cover the text */
  padding: 1.5rem 0 5.5rem;
  background: var(--color-dark);
  color: var(--color-on-dark);
  text-align: center;
}

.site-footer p { margin: 0; }

@media (min-width: 768px) {
  .site-footer { padding-bottom: 1.5rem; }
}

/* 11. Floating call button ------------------------------------------------ */
.floating-call {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid var(--color-white);
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  color: var(--color-white);
  font-size: 1.375rem;
}

.floating-call:hover,
.floating-call:focus-visible { background: var(--color-primary-dark); color: var(--color-white); }

/* 12. Scroll reveal and motion -------------------------------------------- */
/* main.js adds .reveal-init only to elements that start below the screen */
.reveal-init {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-init.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal-init { opacity: 1; transform: none; }

  .treatment-card:hover,
  .facility-card:hover,
  .feature-card:hover { transform: none; }
}

@media print {
  .reveal-init { opacity: 1; transform: none; }
  .site-header { position: static; }
  body { padding-top: 0; }
  .floating-call { display: none !important; }
}

/* 13. Gallery ------------------------------------------------------------- */
/* Columns without JavaScript; main.js switches to a left-to-right masonry grid */
.gallery {
  --gallery-gap: 0.75rem;
  --gallery-columns: 2;
  columns: var(--gallery-columns);
  column-gap: var(--gallery-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--gallery-gap);
}

.gallery.is-masonry {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
  grid-auto-rows: 2px;
}

.gallery.is-masonry .gallery-item {
  align-self: start;
  margin: 0;
}

.gallery-link {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-sm);
}

.gallery-link img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.gallery-link:focus-visible { outline-offset: 3px; }

/* Captions would cover too much of the small photos on phones; the popup shows them there */
.gallery-caption {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  display: none;
  max-width: calc(100% - 1rem);
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  background: rgba(var(--color-dark-rgb), 0.78);
  color: var(--color-white);
  font-weight: 500;
  line-height: 1.35;
}

@media (min-width: 576px) {
  .gallery-caption { display: block; }
}

@media (min-width: 768px) {
  .gallery {
    --gallery-gap: 1rem;
    --gallery-columns: 3;
  }
}

@media (min-width: 1200px) {
  .gallery { --gallery-columns: 4; }
}

@media (hover: hover) {
  .gallery-link:hover img { transform: scale(1.04); }
}

/* Small preview on the homepage: even tiles, one row on wide screens */
.gallery-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-preview img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@media (min-width: 576px) {
  .gallery-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .gallery-preview { gap: 1rem; }
}

@media (min-width: 1200px) {
  .gallery-preview { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Popup viewer */
.gallery-modal .modal-content {
  border: 0;
  background: var(--color-dark);
  color: var(--color-white);
}

.gallery-modal .modal-header {
  gap: 1rem;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  border: 0;
}

.gallery-modal .modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.gallery-modal .btn-close {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 0 0 auto;
  opacity: 0.85; /* easier to see on the dark popup */
  padding: 0;
}

.gallery-modal :focus-visible { outline: 3px solid var(--color-white); outline-offset: -3px; }

/* Sideways swipes change the photo instead of making the browser go back a page */
.gallery-modal {
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
}

.gallery-stage {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 0.5rem;
}

.gallery-image {
  position: absolute;
  max-width: calc(100% - 1rem);
  max-height: 100%;
  border-radius: var(--radius-sm);
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(var(--color-dark-rgb), 0.75);
  color: var(--color-white);
  font-size: 1.25rem;
  transform: translateY(-50%);
}

.gallery-arrow:hover { background: var(--color-primary); }
.gallery-previous { left: 0.75rem; }
.gallery-next { right: 0.75rem; }

.gallery-count {
  margin: 0;
  padding: 0.5rem 0 0.75rem;
  color: var(--color-on-dark);
  text-align: center;
}

/* From tablet width the popup is a window, so the photo area needs its own height */
@media (min-width: 768px) {
  .gallery-stage {
    flex: none;
    height: calc(100vh - 11rem);
    height: calc(100dvh - 11rem);
  }
}
