:root {
  --ink: #102033;
  --muted: #667786;
  --line: #dce7e5;
  --paper: #ffffff;
  --soft: #f4f8f7;
  --brand: #7fad3f;
  --brand-dark: #1f6b58;
  --blue: #246fb3;
  --gold: #caa34e;
  --danger: #b42318;
  --shadow: 0 22px 70px rgba(16, 32, 51, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(244, 248, 247, .75), rgba(255,255,255,0) 360px),
    var(--paper);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  padding: 9px clamp(18px, 6vw, 120px);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  background: #fbfdfc;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 6vw, 120px);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: white;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.42), transparent 24px),
    linear-gradient(135deg, var(--brand), var(--brand-dark) 68%, #174d6f);
  border-radius: 16px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(31, 107, 88, .22);
}

.brand-mark span { transform: translateY(-1px); }

.brand small { display: block; color: var(--muted); }

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
  color: #244054;
}

.nav-links a:hover { background: #edf5f2; color: var(--brand-dark); }
.nav-toggle { display: none; }

.hero {
  min-height: 680px;
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #eaf4ef, #f8fafc);
}

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

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 28, 46, .93), rgba(16, 32, 51, .58) 48%, rgba(16, 32, 51, .02)),
    linear-gradient(180deg, rgba(0,0,0,.12), transparent 40%);
}

.hero-panel {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 36px));
  margin-left: clamp(18px, 6vw, 120px);
  color: white;
  padding-top: 24px;
}

.hero h1,
.page-hero h1,
.profile-hero h1 {
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.02;
  margin: 0 0 18px;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--brand-dark);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

.hero .eyebrow { color: #bfe68f; }

.hero-panel > p:not(.eyebrow) {
  max-width: 610px;
  color: #dbe8ee;
  font-size: 20px;
}

.doctor-search,
.filter-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 26px;
}

.doctor-search {
  width: min(680px, 100%);
  padding: 8px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  box-shadow: 0 22px 80px rgba(0,0,0,.2);
}

.doctor-search input {
  border-color: transparent;
  min-height: 56px;
}

.doctor-search button {
  min-width: 160px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.hero-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-metrics span {
  min-width: 150px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: #dfeaf0;
}

.hero-metrics strong {
  display: block;
  color: white;
  font-size: 24px;
  line-height: 1;
}

.filter-bar {
  grid-template-columns: 1.3fr 1fr 1fr auto;
  padding: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: white;
  font: inherit;
  outline-color: var(--brand);
}

button,
.admin-button,
.button-light {
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  background: var(--blue);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

button:hover,
.admin-button:hover,
.button-light:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(36, 111, 179, .22);
}

.button-light {
  background: white;
  color: var(--brand-dark);
}

.section {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 76px 0;
}

.split {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 80px;
  align-items: start;
}

.lead-copy {
  display: grid;
  gap: 18px;
  font-size: 19px;
}

.section h2,
.directory-band h2 {
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 14px;
}

.section-head,
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.text-link {
  color: var(--blue);
  font-weight: 800;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.specialty-grid .service-card:nth-child(4n + 2) { border-top-color: rgba(202, 163, 78, .65); }
.specialty-grid .service-card:nth-child(4n + 3) { border-top-color: rgba(36, 111, 179, .55); }
.specialty-grid .service-card:nth-child(4n + 4) { border-top-color: rgba(31, 107, 88, .55); }

.service-card,
.person-card,
.doctor-card,
.info-panel {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 28px;
}

.service-card {
  min-height: 246px;
  border-top: 4px solid rgba(127, 173, 63, .7);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.service-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-top-color: var(--brand-dark);
}

.icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--blue);
  background: #edf6fb;
  border-radius: 14px;
  font-size: 30px;
  font-weight: 900;
}
.service-card p, .section p, dd { color: var(--muted); }

.directory-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 62px clamp(18px, 6vw, 120px);
  background:
    linear-gradient(135deg, rgba(31, 107, 88, .96), rgba(35, 64, 95, .98)),
    url('../img/clinic-hero.png') center/cover;
  color: white;
}

.directory-band .eyebrow,
.directory-band p { color: #d7eddf; }

.directory-inline-search {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.12);
}

.directory-inline-search input {
  border-color: transparent;
}

.faq-list details {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 800;
}

.page-hero,
.profile-hero {
  padding: 90px clamp(18px, 6vw, 120px);
  background: var(--soft);
}

.page-hero:not(.compact) {
  min-height: 440px;
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  color: white;
}

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

.page-hero > div { position: relative; z-index: 1; max-width: 760px; }
.page-hero:not(.compact)::after { content: ""; position: absolute; inset: 0; background: rgba(21, 34, 56, .62); }

.doctor-grid {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.doctor-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.doctor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.doctor-card img,
.profile-hero img,
.person-card img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.doctor-card h2 { margin: 0; }
dl { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; }
dt { font-weight: 800; }
dd { margin: 0; }

.profile-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 34px;
  align-items: center;
}

.profile-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 34px;
}

.mini-link { display: block; padding: 10px 0; color: var(--blue); font-weight: 800; }
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.rich-content { color: var(--muted); font-size: 18px; }

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  padding: 60px clamp(18px, 6vw, 120px);
  color: #d5dde8;
  background: linear-gradient(135deg, #172033, #102a3a);
}

.site-footer a { display: block; margin: 8px 0; color: white; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--soft);
}

.login-card {
  width: min(420px, calc(100% - 32px));
  padding: 34px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card label,
.admin-form label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-weight: 800;
}

.admin-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--soft);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #172033;
  color: white;
}

.admin-sidebar a,
.link-button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  color: #d8e2f1;
  background: transparent;
  border-radius: 8px;
  text-align: left;
}

.admin-sidebar a:hover,
.link-button:hover { background: rgba(255,255,255,.08); }
.admin-brand { color: white !important; font-weight: 900; margin-bottom: 16px; }
.admin-main { padding: 34px; }
.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.admin-card, .table-wrap, .admin-form { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.admin-card span { display: block; font-size: 34px; color: var(--blue); font-weight: 900; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.actions { display: flex; gap: 10px; align-items: center; }
.actions button { background: var(--danger); padding: 8px 10px; }
.admin-form { max-width: 920px; }
.thumb { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; }
.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash-success { background: #e8f6ed; color: #14532d; }
.flash-error { background: #fee4e2; color: #7a271a; }
.debug-trace { white-space: pre-wrap; padding: 16px; background: #111827; color: white; overflow: auto; }

@media (max-width: 980px) {
  .topbar { display: none; }
  .nav-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; background: var(--soft); color: var(--ink); }
  .nav-links { display: none; position: absolute; left: 18px; right: 18px; top: 86px; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
  .nav-links.is-open { display: grid; }
  .hero { min-height: 560px; }
  .split, .profile-layout, .profile-hero, .site-footer { grid-template-columns: 1fr; }
  .card-grid, .people-grid, .admin-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: 1fr; }
  .directory-inline-search { grid-template-columns: 1fr; margin-top: 24px; }
  .admin-body { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
}

@media (max-width: 640px) {
  .card-grid, .people-grid, .doctor-card { grid-template-columns: 1fr; }
  .doctor-search { grid-template-columns: 1fr; }
  .directory-band { display: block; }
  .section { padding: 48px 0; }
}

/* Editorial clinic design pass */
:root {
  --ink: #102033;
  --muted: #667786;
  --line: #dce7e5;
  --soft: #f4f8f7;
  --brand: #7fad3f;
  --brand-dark: #1f6b58;
  --blue: #246fb3;
  --gold: #caa34e;
  --shadow: 0 22px 70px rgba(16, 32, 51, .14);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

body {
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(244, 248, 247, .82), rgba(255,255,255,0) 360px),
    #fff;
}

.topbar {
  justify-content: space-between;
  background: #fbfdfc;
}

.brand {
  min-width: 275px;
}

.brand strong,
.hero h1,
.page-hero h1,
.profile-hero h1,
.section h2,
.directory-band h2 {
  font-family: "Libre Baskerville", Georgia, serif;
}

.brand strong {
  font-size: 18px;
}

.brand-mark {
  border-radius: 16px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.42), transparent 24px),
    linear-gradient(135deg, var(--brand), var(--brand-dark) 68%, #174d6f);
  box-shadow: 0 12px 30px rgba(31, 107, 88, .22);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  color: white;
  background: var(--ink);
  border-radius: 999px;
  font-weight: 800;
  transition: transform 160ms var(--ease-out), background 160ms var(--ease-out);
}

.nav-cta:active,
button:active,
.admin-button:active,
.button-light:active {
  transform: scale(.97);
}

.hero {
  min-height: 710px;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: clamp(18px, 6vw, 120px);
  bottom: 54px;
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.62), transparent);
}

.hero::after {
  background:
    linear-gradient(90deg, rgba(8, 24, 38, .95), rgba(16, 32, 51, .72) 44%, rgba(16, 32, 51, .08) 76%),
    radial-gradient(circle at 18% 78%, rgba(127, 173, 63, .28), transparent 310px),
    linear-gradient(180deg, rgba(0,0,0,.1), transparent 38%);
}

.hero-panel {
  width: min(780px, calc(100% - 36px));
}

.hero h1,
.page-hero h1,
.profile-hero h1 {
  font-size: 72px;
  line-height: 1.02;
}

.hero-panel > p:not(.eyebrow) {
  max-width: 610px;
  color: #dbe8ee;
  font-size: 20px;
  line-height: 1.72;
}

.doctor-search {
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0,0,0,.24);
}

.doctor-search input {
  padding-left: 4px;
  background: transparent;
}

.search-kicker {
  padding-left: 16px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-access {
  width: min(1220px, calc(100% - 36px));
  margin: -52px auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quick-access a {
  display: grid;
  gap: 6px;
  padding: 26px 28px;
  border-right: 1px solid var(--line);
  transition: background 180ms var(--ease-out), transform 160ms var(--ease-out);
}

.quick-access a:last-child {
  border-right: 0;
}

.quick-access a:active {
  transform: scale(.99);
}

.quick-access span {
  color: var(--gold);
  font-weight: 900;
}

.quick-access strong {
  font-size: 20px;
}

.quick-access small {
  color: var(--muted);
  font-size: 14px;
}

.section-alt {
  width: 100%;
  padding: 86px clamp(18px, 6vw, 120px);
  background: linear-gradient(180deg, #f7faf9, #fff);
}

.section h2,
.directory-band h2 {
  font-size: 42px;
  line-height: 1.15;
}

.directory-stage {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 32px;
  align-items: stretch;
  padding: 24px;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(16, 32, 51, .96), rgba(31, 107, 88, .92)),
    url('../img/clinic-hero.png') center/cover;
  color: white;
  box-shadow: var(--shadow);
}

.directory-copy {
  padding: 38px 24px;
}

.directory-copy .eyebrow {
  color: #cfe994;
}

.directory-copy p {
  max-width: 58ch;
  color: #dce9e7;
  font-size: 18px;
}

.directory-console {
  display: grid;
  gap: 18px;
  align-content: center;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 18px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
}

.directory-console label {
  display: grid;
  gap: 10px;
  color: white;
  font-weight: 900;
}

.directory-console input {
  min-height: 62px;
  border: 0;
  border-radius: 14px;
  font-size: 16px;
}

.directory-console button {
  min-height: 56px;
  background: white;
  color: var(--ink);
}

.console-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.console-tags a {
  padding: 9px 12px;
  border-radius: 999px;
  color: #e8f3f1;
  border: 1px solid rgba(255,255,255,.2);
  transition: background 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.console-tags a:active {
  transform: scale(.97);
}

.lead-copy {
  max-width: 66ch;
}

button,
.admin-button,
.button-light,
.service-card,
.doctor-card {
  transition-duration: 160ms;
  transition-timing-function: var(--ease-out);
}

.directory-band {
  position: relative;
  overflow: hidden;
}

.directory-band::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .quick-access a:hover {
    background: #f0f7f4;
  }

  .console-tags a:hover {
    background: rgba(255,255,255,.14);
  }
}

@media (max-width: 980px) {
  .brand {
    min-width: 0;
  }

  .nav-cta {
    display: none;
  }

  .hero {
    min-height: 640px;
  }

  .hero h1,
  .page-hero h1,
  .profile-hero h1 {
    font-size: 48px;
  }

  .doctor-search,
  .quick-access,
  .directory-stage {
    grid-template-columns: 1fr;
  }

  .search-kicker {
    padding-left: 8px;
  }

  .quick-access a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quick-access a:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 720px;
    align-items: end;
    padding-bottom: 78px;
  }

  .hero h1,
  .page-hero h1,
  .profile-hero h1 {
    font-size: 38px;
  }

  .hero-panel > p:not(.eyebrow) {
    font-size: 17px;
  }

  .hero-metrics span {
    flex: 1 1 130px;
    min-width: 130px;
  }

  .directory-console,
  .directory-stage {
    padding: 18px;
  }

  .section h2,
  .directory-band h2 {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Institutional navigation refinement */
:root {
  --brand: #99B75D;
  --brand-dark: #547336;
  --gold: #FAD037;
  --nav-ink: #173044;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(16, 32, 51, .08);
}

.topbar {
  position: relative;
  padding-block: 8px;
  color: #506574;
  background:
    linear-gradient(90deg, rgba(153, 183, 93, .12), rgba(250, 208, 55, .08)),
    #fbfdf8;
  border-bottom: 1px solid rgba(153, 183, 93, .24);
}

.topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--gold), transparent 72%);
  opacity: .85;
}

.navbar {
  position: relative;
  top: auto;
  padding-block: 14px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  box-shadow: none;
}

.navbar::after {
  content: "";
  position: absolute;
  left: clamp(18px, 6vw, 120px);
  right: clamp(18px, 6vw, 120px);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(153, 183, 93, .32), rgba(23, 48, 68, .08), rgba(250, 208, 55, .28));
}

.brand {
  min-width: 286px;
  padding: 4px 0;
}

.brand-logo {
  width: min(270px, 38vw);
  height: auto;
  max-height: 76px;
  object-fit: contain;
}

.brand-mark {
  display: none;
}

.nav-links {
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(153, 183, 93, .18);
  border-radius: 999px;
  background: rgba(244, 248, 247, .72);
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--nav-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out), transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms var(--ease-out);
}

.nav-links a:hover {
  color: #26370f;
  background: rgba(153, 183, 93, .16);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.nav-links a.is-active {
  color: #25350f;
  background: white;
  box-shadow: 0 10px 26px rgba(84, 115, 54, .12);
}

.nav-links a:active {
  transform: scale(.97);
}

.nav-cta {
  min-height: 48px;
  padding: 12px 18px;
  color: #1c260d;
  background:
    linear-gradient(135deg, var(--gold), #ffe97b);
  border: 1px solid rgba(250, 208, 55, .68);
  box-shadow: 0 14px 32px rgba(250, 208, 55, .28);
}

.nav-cta:hover {
  background:
    linear-gradient(135deg, #ffe168, var(--gold));
  box-shadow: 0 18px 36px rgba(250, 208, 55, .34);
}

.nav-toggle {
  border: 1px solid rgba(153, 183, 93, .28);
  background: rgba(153, 183, 93, .12);
  color: var(--nav-ink);
}

.doctor-search button,
button,
.admin-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.hero .eyebrow,
.directory-copy .eyebrow {
  color: #d8ef99;
}

.search-kicker,
.eyebrow {
  color: var(--brand-dark);
}

.quick-access span {
  color: #b58b00;
}

.icon {
  color: var(--brand-dark);
  background: rgba(153, 183, 93, .14);
}

.service-card {
  border-top-color: var(--brand);
}

.specialty-grid .service-card:nth-child(4n + 2) {
  border-top-color: var(--gold);
}

@media (max-width: 1180px) {
  .brand {
    min-width: 220px;
  }

  .brand-logo {
    width: 220px;
  }

  .nav-links a {
    padding-inline: 11px;
    font-size: 13px;
  }
}

@media (max-width: 980px) {
  .site-header {
    position: sticky;
  }

  .navbar {
    padding-block: 10px;
  }

  .navbar::after {
    left: 18px;
    right: 18px;
  }

  .brand-logo {
    width: min(215px, 62vw);
    max-height: 62px;
  }

  .nav-links {
    gap: 4px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,.98);
  }

  .nav-links a {
    justify-content: flex-start;
    border-radius: 12px;
  }

  .nav-links a::after {
    left: 12px;
    right: auto;
    width: 28px;
    bottom: 6px;
    transform-origin: left;
  }
}

/* Inner page hero treatment */
.page-hero.compact {
  position: relative;
  min-height: 330px;
  display: grid;
  align-items: center;
  padding: 84px clamp(18px, 6vw, 120px);
  overflow: hidden;
  color: white;
  background:
    linear-gradient(90deg, rgba(12, 31, 47, .94), rgba(31, 107, 88, .78) 52%, rgba(153, 183, 93, .18)),
    url('../img/clinic-hero.png') center right / cover;
  isolation: isolate;
}

.page-hero.compact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 82% 24%, rgba(250, 208, 55, .22), transparent 260px),
    radial-gradient(circle at 14% 78%, rgba(153, 183, 93, .24), transparent 240px);
}

.page-hero.compact::after {
  content: "";
  position: absolute;
  right: clamp(18px, 6vw, 120px);
  bottom: 42px;
  width: min(360px, 28vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(250, 208, 55, .95));
}

.page-hero.compact .eyebrow,
.page-hero.compact p {
  color: #eaf6d1;
}

.page-hero.compact h1 {
  max-width: 960px;
  color: white;
  text-shadow: 0 18px 50px rgba(0,0,0,.22);
}

.page-hero.compact p {
  max-width: 760px;
  font-size: 20px;
}

.route-directorio-medico .page-hero.compact {
  background:
    linear-gradient(90deg, rgba(9, 25, 40, .96), rgba(27, 83, 93, .82) 48%, rgba(153, 183, 93, .12)),
    url('../img/clinic-hero.png') center right / cover;
}

.route-especialidades .page-hero.compact {
  background:
    linear-gradient(90deg, rgba(16, 32, 51, .94), rgba(84, 115, 54, .82) 52%, rgba(250, 208, 55, .14)),
    url('../img/clinic-hero.png') center / cover;
}

.route-departamentos .page-hero.compact {
  background:
    linear-gradient(90deg, rgba(17, 47, 58, .94), rgba(31, 107, 88, .82) 54%, rgba(153, 183, 93, .16)),
    url('../img/clinic-hero.png') center right / cover;
}

.route-equipo-gerencial .page-hero.compact {
  background:
    linear-gradient(90deg, rgba(16, 32, 51, .94), rgba(39, 64, 78, .8) 52%, rgba(250, 208, 55, .16)),
    url('../img/clinic-hero.png') center / cover;
}

@media (max-width: 980px) {
  .page-hero.compact {
    min-height: 280px;
    padding-block: 62px;
  }

  .page-hero.compact::after {
    width: 160px;
    bottom: 28px;
  }
}

@media (max-width: 640px) {
  .page-hero.compact {
    min-height: 250px;
    padding-block: 52px;
  }

  .page-hero.compact p {
    font-size: 16px;
  }
}

/* Department and medical directory cards */
.departments-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.department-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  min-height: 210px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(153, 183, 93, .28);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248, 251, 242, .94)),
    radial-gradient(circle at 92% 8%, rgba(250, 208, 55, .22), transparent 130px);
  box-shadow: 0 16px 50px rgba(16, 32, 51, .08);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.department-card::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -38px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(153, 183, 93, .1);
}

.department-card:hover {
  transform: translateY(-3px);
  border-color: rgba(153, 183, 93, .56);
  box-shadow: 0 24px 70px rgba(16, 32, 51, .13);
}

.department-icon {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: #314a16;
  background:
    linear-gradient(135deg, rgba(153, 183, 93, .22), rgba(250, 208, 55, .28));
  border: 1px solid rgba(153, 183, 93, .28);
  border-radius: 18px;
  font-size: 26px;
}

.department-content {
  position: relative;
  z-index: 1;
}

.department-content h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.department-content p {
  margin: 0 0 18px;
  color: var(--muted);
}

.department-meta,
.doctor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.department-meta span,
.doctor-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  color: #435262;
  background: #f4f8f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.department-meta i,
.doctor-meta i {
  color: var(--brand-dark);
}

.doctor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.doctor-list .doctor-card {
  grid-template-columns: 72px 1fr;
  gap: 16px;
  padding: 18px;
  min-height: auto;
  border-radius: 14px;
  border-color: rgba(153, 183, 93, .22);
  background:
    linear-gradient(135deg, #fff, #fbfdf8);
}

.doctor-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--brand-dark);
  background: rgba(153, 183, 93, .14);
  border: 1px solid rgba(153, 183, 93, .24);
  border-radius: 18px;
  font-size: 28px;
}

.doctor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-summary {
  min-width: 0;
}

.doctor-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.doctor-title-row .eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
}

.doctor-title-row h2 {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.2;
}

.doctor-credentials {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.doctor-profile-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  color: #26370f;
  background: rgba(250, 208, 55, .22);
  border: 1px solid rgba(250, 208, 55, .5);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  transition: transform 160ms var(--ease-out), background 160ms var(--ease-out);
}

.doctor-profile-link:hover {
  background: rgba(250, 208, 55, .36);
}

.doctor-profile-link:active {
  transform: scale(.97);
}

@media (max-width: 980px) {
  .departments-grid,
  .doctor-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .department-card {
    grid-template-columns: 1fr;
  }

  .doctor-list .doctor-card {
    grid-template-columns: 56px 1fr;
    padding: 14px;
  }

  .doctor-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 22px;
  }

  .doctor-title-row {
    display: grid;
  }

  .doctor-profile-link {
    width: max-content;
  }
}

/* Epic institutional about page */
.about-hero {
  position: relative;
  min-height: 680px;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: white;
  isolation: isolate;
}

.about-hero > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 24, 38, .96), rgba(16, 32, 51, .76) 48%, rgba(16, 32, 51, .16)),
    radial-gradient(circle at 22% 70%, rgba(153, 183, 93, .3), transparent 330px),
    radial-gradient(circle at 78% 20%, rgba(250, 208, 55, .16), transparent 290px);
}

.about-hero-content {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 92px 0 72px;
}

.about-hero-content .eyebrow {
  color: #d8ef99;
}

.about-hero h1 {
  max-width: 980px;
  margin: 0 0 18px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(52px, 7vw, 96px);
  line-height: 1.02;
  color: white;
}

.about-hero-content > p {
  max-width: 760px;
  margin: 0;
  color: #e2edf2;
  font-size: 22px;
  line-height: 1.7;
}

.about-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 900px;
  margin-top: 34px;
}

.about-hero-stats span {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(14px);
  color: #dfeaf0;
}

.about-hero-stats strong {
  display: block;
  color: white;
  font-size: 34px;
  line-height: 1;
}

.about-shell {
  width: min(1180px, calc(100% - 36px));
}

.about-shell h2,
.about-shell h3 {
  font-family: "Libre Baskerville", Georgia, serif;
  color: var(--ink);
}

.about-intro {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 70px;
  align-items: start;
  padding: 24px 0 78px;
}

.about-intro h2 {
  margin: 0;
  font-size: 46px;
  line-height: 1.1;
}

.about-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.8;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 22px;
}

.mission-card,
.values-card,
.philosophy-card,
.goals-card,
.infrastructure-card,
.services-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(153, 183, 93, .24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, #fff, #fbfdf8);
  box-shadow: 0 18px 54px rgba(16, 32, 51, .08);
}

.mission-card::after,
.values-card::after,
.philosophy-card::after,
.infrastructure-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -46px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(250, 208, 55, .14);
}

.mission-card .about-icon,
.values-card .about-icon,
.philosophy-card .about-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: #314a16;
  background: linear-gradient(135deg, rgba(153, 183, 93, .2), rgba(250, 208, 55, .28));
  border-radius: 16px;
  font-size: 24px;
}

.mission-card h2,
.values-card h2,
.philosophy-card h2,
.goals-card h2,
.infrastructure-card h2,
.services-card h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  font-size: 30px;
}

.mission-card p,
.values-card p,
.philosophy-card p,
.infrastructure-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.values-card,
.philosophy-card {
  margin-top: 22px;
}

.values-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.values-list span {
  padding: 10px 14px;
  color: #26370f;
  background: rgba(250, 208, 55, .24);
  border: 1px solid rgba(250, 208, 55, .46);
  border-radius: 999px;
  font-weight: 900;
}

.goals-card {
  margin-top: 22px;
  background:
    linear-gradient(135deg, rgba(16, 32, 51, .96), rgba(31, 107, 88, .92)),
    url('../img/clinic-hero.png') center / cover;
  color: white;
}

.goals-card h2,
.goals-card p {
  color: white;
}

.goals-list {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: goals;
}

.goals-list li {
  counter-increment: goals;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  color: #e2edf2;
}

.goals-list li::before {
  content: counter(goals, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #1c260d;
  background: var(--gold);
  border-radius: 50%;
  font-weight: 900;
}

.infrastructure-card,
.services-card {
  margin-top: 70px;
}

.infra-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.infra-stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7faf5;
}

.infra-stat strong {
  display: block;
  color: var(--brand-dark);
  font-size: 34px;
  line-height: 1;
}

.infra-stat span {
  color: var(--muted);
  font-weight: 800;
}

.areas-grid,
.services-list {
  columns: 3;
  column-gap: 34px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.areas-grid li,
.services-list li {
  break-inside: avoid;
  position: relative;
  margin: 0 0 10px;
  padding-left: 22px;
  color: #445466;
}

.areas-grid li::before,
.services-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(153, 183, 93, .16);
}

.services-card {
  background:
    linear-gradient(135deg, #fff, #fffdf0);
}

@media (max-width: 980px) {
  .about-intro,
  .mission-grid {
    grid-template-columns: 1fr;
  }

  .about-hero-stats,
  .infra-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .areas-grid,
  .services-list {
    columns: 2;
  }
}

@media (max-width: 640px) {
  .about-hero {
    min-height: 620px;
  }

  .about-hero-content {
    padding-block: 58px;
  }

  .about-hero h1 {
    font-size: 42px;
  }

  .about-hero-content > p {
    font-size: 17px;
  }

  .about-hero-stats,
  .infra-stats {
    grid-template-columns: 1fr 1fr;
  }

  .about-hero-stats span,
  .infra-stat {
    padding: 14px;
  }

  .about-hero-stats strong,
  .infra-stat strong {
    font-size: 26px;
  }

  .mission-card,
  .values-card,
  .philosophy-card,
  .goals-card,
  .infrastructure-card,
  .services-card {
    padding: 22px;
  }

  .areas-grid,
  .services-list {
    columns: 1;
  }
}

/* ── Scroll animations ─────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="left"] {
  transform: translateX(-28px);
}
[data-reveal="left"].is-visible {
  transform: translateX(0);
}

[data-reveal="right"] {
  transform: translateX(28px);
}
[data-reveal="right"].is-visible {
  transform: translateX(0);
}

[data-delay="1"] { transition-delay: 80ms; }
[data-delay="2"] { transition-delay: 160ms; }
[data-delay="3"] { transition-delay: 240ms; }
[data-delay="4"] { transition-delay: 320ms; }

/* ── FAQ animado ───────────────────────────────────── */
.faq-list details {
  overflow: hidden;
  transition: background 200ms var(--ease-out);
  border-radius: 8px;
  padding: 0;
  border-top: none;
  border-bottom: 1px solid var(--line);
}

.faq-list details:first-child {
  border-top: 1px solid var(--line);
}

.faq-list summary {
  padding: 20px 18px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
  transition: color 160ms var(--ease-out);
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  font-size: 18px;
  font-weight: 300;
  color: var(--brand-dark);
  transition: transform 280ms var(--ease-out), background 200ms var(--ease-out);
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
  background: var(--brand);
  color: white;
}

.faq-list details[open] summary {
  color: var(--brand-dark);
}

.faq-list details > p {
  margin: 0;
  padding: 0 18px 20px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  animation: faq-open 300ms var(--ease-out) both;
}

@keyframes faq-open {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hover cards reforzado ─────────────────────────── */
.service-card {
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .service-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 28px 56px rgba(16, 32, 51, .13);
    border-top-color: var(--brand-dark);
  }
  .quick-access a:hover strong {
    color: var(--brand-dark);
  }
}

/* ── Buscador con feedback visual ──────────────────── */
.doctor-search:focus-within {
  border-color: rgba(153, 183, 93, .6);
  box-shadow: 0 0 0 3px rgba(153, 183, 93, .18), 0 28px 90px rgba(0,0,0,.24);
  transition: box-shadow 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

/* ── Contador animado ──────────────────────────────── */
.hero-metrics strong[data-count] {
  display: block;
  font-variant-numeric: tabular-nums;
}
