/* Site styles layered on top of Bootswatch Flatly. */

/* Lato, self-hosted (latin subset). Flatly asks for these three faces. */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/lato-400-normal.woff2?v=e1b3b590") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/lato-400-italic.woff2?v=efee2d08") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/lato-700-normal.woff2?v=de69cf9e") format("woff2");
}

:root {
  --navy: #2c3e50;        /* Flatly primary */
  --navy-deep: #1f2d3a;
  --brand-blue: #24457a;  /* from the lungs logo */
  --teal: #18bc9c;        /* Flatly success: accents, and text on dark backgrounds */
  --teal-text: #0d7864;   /* teal dark enough for text on white (WCAG AA, 5.4:1) */
  --bs-link-color: #0d7864;
  --bs-link-color-rgb: 13, 120, 100;
  --bs-link-hover-color: #095a4b;
  --bs-link-hover-color-rgb: 9, 90, 75;
  --tint: #f4f7f9;
  --ink: #34495e;
  --radius: 0.75rem;
  --shadow: 0 0.5rem 1.5rem rgba(44, 62, 80, 0.08);
  --shadow-lift: 0 1rem 2.25rem rgba(44, 62, 80, 0.16);
}

html { scroll-padding-top: 5.5rem; }

body {
  color: var(--ink);
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

/* Icons: build.py inlines the SVGs from src/icons. */
.bi {
  display: inline-flex;
  vertical-align: -0.125em;
}

.bi svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

picture { display: contents; }

/* Flatly's white-on-teal buttons are too faint to read (2.4:1); dark text
   on the same teal is 5.8:1. */
.btn-success {
  --bs-btn-color: var(--navy-deep);
  --bs-btn-hover-color: var(--navy-deep);
  --bs-btn-hover-bg: #3fd1b3;
  --bs-btn-hover-border-color: #3fd1b3;
  --bs-btn-active-color: var(--navy-deep);
  --bs-btn-active-bg: #3fd1b3;
  --bs-btn-active-border-color: #3fd1b3;
  font-weight: 700;
}

/* Likewise Flatly's white-on-colour alerts: use dark text on a pale tint. */
.alert-info,
.alert-warning {
  border: 0;
  border-left: 0.25rem solid #3498db;
  background: #eaf4fb;
  color: var(--navy-deep);
}

.alert-warning {
  border-left-color: #f39c12;
  background: #fef5e6;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  padding: 0.5rem 1rem;
  background: #fff;
  border-radius: 0.375rem;
}

/* ---------- Top bar ---------- */

.topbar {
  background: var(--navy-deep);
  padding: 0.4rem 0;
  font-size: 0.9375rem;
}

.topbar-phone {
  display: inline-block;
  padding: 0.25rem 0;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.topbar-phone:hover { color: var(--teal); }
.topbar-phone .bi { margin-right: 0.25rem; }

/* ---------- Navbar ---------- */

.site-nav {
  background: #fff;
  box-shadow: 0 1px 0 rgba(44, 62, 80, 0.08), 0 0.25rem 1rem rgba(44, 62, 80, 0.06);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.site-nav .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--navy);
  white-space: normal;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-blue);
}

.site-nav .nav-link {
  color: var(--navy);
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible { color: var(--teal-text); }

.site-nav .nav-link.active {
  color: var(--teal-text);
  box-shadow: inset 0 -0.1875rem 0 var(--teal);
  border-radius: 0;
}

.site-nav .dropdown-menu {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 0.5rem;
}

.site-nav .dropdown-item {
  border-radius: 0.5rem;
  padding: 0.5rem 0.9rem;
  color: var(--navy);
}

.site-nav .dropdown-item:hover,
.site-nav .dropdown-item:focus { background: var(--tint); color: var(--navy); }

.site-nav .dropdown-item.active { background: var(--navy); color: #fff; }

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(72vh, 40rem);
  overflow: hidden;
  background: var(--navy-deep) center / cover no-repeat;
  background-image: url("/images/hero-poster.jpg?v=a4e9dead");
  background-image: image-set(url("/images/hero-poster.avif?v=b78d136a") type("image/avif"), url("/images/hero-poster.jpg?v=a4e9dead") type("image/jpeg"));
  color: #fff;
  text-align: center;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Neutral scrim: keeps the footage's own colours, darkest behind the text. */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 85% at center, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.25) 100%);
}

.hero-toggle {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.25rem;
}

.hero-toggle:hover,
.hero-toggle:focus-visible { background: rgba(0, 0, 0, 0.7); }

.hero-toggle .icon-play-fill,
.hero-toggle.is-paused .icon-pause-fill { display: none; }
.hero-toggle.is-paused .icon-play-fill { display: inline-flex; }

.hero-content {
  position: relative;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero-logo {
  width: min(34rem, 88%);
  height: auto;
  filter: drop-shadow(0 0.125rem 0.75rem rgba(0, 0, 0, 0.45));
}

.hero-tagline {
  margin: 1.5rem 0 2rem;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0 0.0625rem 0.5rem rgba(0, 0, 0, 0.6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0;
}

/* ---------- Sections ---------- */

.section { padding: 4.5rem 0; }
.section-tint { background: var(--tint); }

.display-title {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 1.25rem;
}

.section-title {
  position: relative;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.5rem;
  height: 0.25rem;
  border-radius: 1rem;
  background: var(--teal);
}

.section-title.text-center::after,
.text-center > .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

.lead-block {
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.lead-block p:last-child { margin-bottom: 0; }

/* ---------- Inner page header ---------- */

.page-header {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--brand-blue) 100%);
  color: #fff;
  padding: 3.25rem 0;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  font-weight: 900;
}

.page-body { padding-top: 3.5rem; padding-bottom: 4.5rem; }

/* ---------- Long-form text ---------- */

.prose { line-height: 1.75; }
.prose p { margin-bottom: 1.15rem; }
.prose > :last-child { margin-bottom: 0; }

.prose h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--navy);
  margin: 2.25rem 0 0.75rem;
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2rem 0 0.6rem;
}

.prose > h2:first-child,
.prose > h3:first-child { margin-top: 0; }

.prose a { font-weight: 700; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }

/* ---------- Cards ---------- */

.card {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mission-card {
  background: var(--navy);
  color: #fff;
}

.mission-card .card-body { padding: 2rem; }
.mission-card h2 { color: #fff; font-weight: 900; }

.mission-icon {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--teal);
  margin-bottom: 1rem;
}

.service-card {
  color: var(--ink);
  text-decoration: none;
  border-top: 0.25rem solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card .card-body { padding: 1.75rem; }

.service-card .bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.1rem;
  border-radius: 0.75rem;
  background: rgba(24, 188, 156, 0.12);
  color: var(--teal);
  font-size: 1.5rem;
}

.service-card h3 { color: var(--navy); font-weight: 900; }
.service-card p { margin: 0; }

.service-card:hover,
.service-card:focus-visible {
  color: var(--ink);
  transform: translateY(-0.25rem);
  box-shadow: var(--shadow-lift);
  border-top-color: var(--teal);
}

.side-nav { overflow: hidden; }

.side-nav .card-header {
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8125rem;
  border: 0;
  padding: 0.85rem 1.25rem;
}

.side-nav .list-group-item {
  padding: 0.8rem 1.25rem;
  font-weight: 700;
  color: var(--navy);
}

.side-nav .list-group-item.active {
  background: var(--tint);
  border-color: rgba(0, 0, 0, 0.125);
  color: var(--navy);
  box-shadow: inset 0.25rem 0 0 var(--teal);
}

.call-card { background: var(--tint); box-shadow: none; }
.call-card h2 { color: var(--navy); font-weight: 900; }

.form-card h3,
.trial-card h3 { color: var(--navy); font-weight: 900; }

.form-card .card-body,
.trial-card .card-body { padding: 1.75rem; }

.trial-card { border-left: 0.25rem solid var(--teal); }
.trial-card:hover { box-shadow: var(--shadow-lift); }

/* ---------- Team ---------- */

.team-list { display: grid; gap: 1.5rem; max-width: 62rem; }
.team-card .card-body { padding: 2rem; }

.team-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.team-head img {
  flex: none;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 0.25rem #fff, 0 0 0 0.375rem var(--teal);
}

.team-head h3 { color: var(--navy); font-weight: 900; }

.team-role {
  color: var(--brand-blue);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Photos and gallery ---------- */

.photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.photo-round {
  width: 15rem;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto;
}

.gallery-item {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.06); }

#lightbox .modal-content {
  position: relative;
  background: transparent;
  border: 0;
}

#lightbox img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  margin: 0 auto;
  border-radius: var(--radius);
}

#lightbox .btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  padding: 0.75rem;
  background-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  opacity: 1;
}

/* ---------- Accordions ---------- */

.accordion {
  --bs-accordion-border-color: rgba(44, 62, 80, 0.12);
  --bs-accordion-btn-focus-box-shadow: inset 0 0 0 0.1875rem var(--teal-text);
  --bs-accordion-active-bg: var(--navy);
  --bs-accordion-active-color: #fff;
  --bs-accordion-border-radius: var(--radius);
  --bs-accordion-inner-border-radius: calc(var(--radius) - 1px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.accordion-button {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--navy);
}

.accordion-button:not(.collapsed)::after { filter: brightness(0) invert(1); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.85);
  padding-top: 4.5rem;
}

.footer-title {
  color: #fff;
  font-size: 1.625rem;
  font-weight: 900;
  margin-bottom: 1.25rem;
}

.footer-subtitle {
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.contact-list .bi { color: var(--teal); }

.site-footer a:not(.btn) {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 0.2em;
}

.site-footer a:not(.btn):hover { color: var(--teal); }

.footer-map {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.footer-map img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 22rem;
  object-fit: cover;
  object-position: center 40%;
}

.footer-bottom {
  margin-top: 4rem;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.875rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Small screens ---------- */

@media (max-width: 991.98px) {
  .site-nav .navbar-collapse { padding-top: 0.75rem; }
  .site-nav .dropdown-menu { box-shadow: none; background: var(--tint); }
  .section { padding: 3.25rem 0; }
  .page-header { padding: 2.25rem 0; }
  .page-body { padding-top: 2.5rem; padding-bottom: 3.25rem; }
}

@media (max-width: 575.98px) {
  .brand-name { font-size: 1rem; }
  .brand-sub { font-size: 0.625rem; }
  .team-head { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .service-card,
  .gallery-item img { transition: none; }
}
