/* ==========================================================================
   Dr Ravi Dissanayake — Orthopaedic Surgeon
   Shared stylesheet — mobile-first
   ========================================================================== */

:root {
  /* Warm neutral palette — no blue */
  --ink: #241f1a;
  --ink-soft: #5a5048;
  --cream: #faf6f1;
  --cream-deep: #f1e9df;
  --surface: #ffffff;
  --line: #e6dcce;

  --accent: #a8691f;       /* warm amber/gold, from logo dot — darkened for AA contrast on white text */
  --accent-dark: #8f5e22;
  --accent-soft: #f3e2c8;

  --ok: #4d7c4d;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;

  --container: 1180px;
  --radius: 14px;
  --shadow: 0 12px 32px -16px rgba(36, 31, 26, 0.28);

  --header-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 4.5vw + 1rem, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw + 1rem, 2.3rem); }
h3 { font-size: clamp(1.1rem, 1vw + 1rem, 1.35rem); }

p { margin: 0 0 1em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 380px) {
  .container { padding: 0 16px; }
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 0.6em;
}

.lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- Accessibility helpers ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible {
  border-radius: 6px;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  min-height: 44px;
  line-height: 1;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-dark); }

.btn-ghost-invert {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.btn-ghost-invert:hover { background: rgba(255,255,255,0.2); }

.btn-block { width: 100%; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 10px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-mark {
  height: 30px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.brand-text {
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
}
.brand-text .name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text .role {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.brand-mobile-role {
  display: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.15;
  color: var(--ink);
}

.main-nav {
  display: none;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 12px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--accent);
}

.call-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0.6em 0.9em;
  min-height: 44px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
}
.call-pill svg { width: 16px; height: 16px; flex-shrink: 0; }
.call-text-short { display: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: -10px;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle:hover { color: var(--accent-dark); }

/* Condensed header: swap full name+role for stacked "Orthopaedic / Surgeon",
   and shorten the call pill to "Call" so everything fits without wrapping.
   Deliberately wider than the 900px nav breakpoint below — the full brand
   name + full desktop nav + full phone number don't all fit until ~960px,
   so this stays condensed through that gap even though the nav itself has
   already switched to the inline desktop menu. */
@media (max-width: 959px) {
  .brand-text { display: none; }
  .brand-mobile-role { display: block; }
  .call-text-full { display: none; }
  .call-text-short { display: inline; }
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--cream);
  z-index: 99;
  overflow-y: auto;
  padding: 24px 20px calc(100px + var(--safe-bottom));
}
.mobile-nav.open { display: block; }

.mobile-nav ul {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  border-top: 1px solid var(--line);
}
.mobile-nav li { border-bottom: 1px solid var(--line); }
.mobile-nav a {
  display: block;
  padding: 16px 4px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.mobile-nav a[aria-current="page"] { color: var(--accent-dark); }

.mobile-nav .contact-block { margin-top: 8px; }
.mobile-nav .contact-block .btn {
  display: flex;
  padding-top: 0.85em;
  padding-bottom: 0.85em;
}
.mobile-nav .contact-block .btn-primary { color: #fff; }

body.nav-open { overflow: hidden; }

@media (min-width: 900px) {
  .main-nav { display: block; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ==========================================================================
   Persistent mobile contact bar
   ========================================================================== */

.mobile-contact-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -12px rgba(36,31,26,0.35);
  padding-bottom: var(--safe-bottom);
}
.mobile-contact-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  background: var(--surface);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  min-height: 56px;
}
.mobile-contact-bar a svg { width: 18px; height: 18px; flex-shrink: 0; }
.mobile-contact-bar .cta-call { background: var(--accent); color: #fff; }

body { padding-bottom: calc(70px + var(--safe-bottom)); }

@media (min-width: 900px) {
  .mobile-contact-bar { display: none; }
  body { padding-bottom: 0; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  color: #fff;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36,31,26,0.50) 0%, rgba(36,31,26,0.66) 65%, rgba(36,31,26,0.80) 100%);
}
.hero .container {
  position: relative;
  padding-top: 64px;
  padding-bottom: 64px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero .eyebrow { color: var(--accent-soft); }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lede { color: rgba(255,255,255,0.9); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.6em;
}

.page-hero .container {
  min-height: 280px;
  padding-top: 48px;
  padding-bottom: 48px;
}
.page-hero .lede { color: rgba(255,255,255,0.88); }

@media (min-width: 700px) {
  .hero .container { padding-top: 110px; padding-bottom: 110px; min-height: 520px; }
  .page-hero .container { padding-top: 90px; padding-bottom: 90px; min-height: 460px; }
}

/* ==========================================================================
   Sections
   ========================================================================== */

section { padding: 48px 0; }
@media (min-width: 640px) { section { padding: 64px 0; } }
@media (min-width: 900px) { section { padding: 88px 0; } }

.section-alt { background: var(--cream-deep); }
.section-dark { background: var(--ink); color: #fff; }
.section-dark .ink-soft-on-dark { color: rgba(255,255,255,0.72); }

.section-head {
  max-width: 68ch;
  margin-bottom: 2em;
}
@media (min-width: 640px) { .section-head { margin-bottom: 2.4em; } }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
/* .lede keeps its own max-width for readable line-length, so when the
   heading block is centered, the lede needs its own auto margins to stay
   centered under it rather than hugging the left edge. */
.section-head.center .lede { margin-left: auto; margin-right: auto; }

/* Grids */
.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 640px) { .grid { gap: 24px; } }
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* In the 2-column range, an odd number of .grid-3 items (e.g. 3 or 5 cards)
   leaves a single half-width orphan stranded on the left with a large gap
   beside it. Centre that trailing item at column width instead. */
@media (min-width: 560px) and (max-width: 959px) {
  .grid-3 > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 10px);
    margin-left: auto;
    margin-right: auto;
  }
}
@media (min-width: 640px) and (max-width: 959px) {
  .grid-3 > :last-child:nth-child(odd) { width: calc(50% - 12px); }
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
@media (min-width: 640px) { .card { padding: 28px; } }

.specialty-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
@media (min-width: 640px) { .specialty-card { padding: 28px; } }
.specialty-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.specialty-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1em;
}
.specialty-icon svg { width: 22px; height: 22px; }

.location-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.location-card .tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.location-card address { font-style: normal; color: var(--ink-soft); }
.location-card .card-actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* Two-column media/text */
.split {
  display: grid;
  gap: 28px;
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 56px; }
  .split.reverse .split-media { order: 2; }
}
.split-media img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: center 15%;
}

/* Location chips */
.location-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.location-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.6em 1.15em;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

/* CTA band */
.cta-band {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
}
@media (min-width: 640px) { .cta-band { padding: 44px 32px; } }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.78); }
.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 1.4em;
}

/* Lists */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
/* Extra breathing room when a check-list follows a heading directly inside a card. */
.card > .check-list { margin-top: 1.2em; }
/* Contact details inside a check-list (tel:/mailto:) get a larger tap
   target the same invisible-padding way as the footer links. */
.check-list a { display: inline-block; padding: 9px 0; margin: -9px 0; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent-dark); margin-top: 2px; }

/* ==========================================================================
   Testimonials
   ========================================================================== */

.testimonials-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .testimonials-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.testimonial-stars {
  display: flex;
  gap: 3px;
  color: var(--accent-dark);
}
.testimonial-stars svg { width: 16px; height: 16px; }
.testimonial-quote {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}
.testimonial-attribution {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding-top: 6px;
}
.testimonial-attribution .who {
  font-weight: 700;
  font-size: 0.92rem;
}
.testimonial-attribution .context {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 560px) {
  .form-grid.two-col { grid-template-columns: 1fr 1fr; }
}
/* A field (e.g. the message textarea) following the main field grid gets
   the same rhythm as the grid's own row gap. */
.form-grid + .field { margin-top: 18px; }
/* Submit button following the last field. */
.field + .btn { margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 0.9rem; }
.field .req { color: var(--accent-dark); font-weight: 400; font-size: 0.8rem; }
.field input,
.field textarea {
  font: inherit;
  padding: 0.85em 1em;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 48px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 1px;
  border-color: var(--accent);
}
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 10px; }
.form-status {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}
.form-status.visible { display: block; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.82);
  padding: 48px 0 24px;
}
@media (min-width: 640px) { .site-footer { padding: 56px 0 28px; } }
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 780px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
}
/* Between 560-779px the grid is 2-up, so the 3rd column (Site links)
   drops to its own row as a stranded orphan — centre it like the
   .grid-3 fix above rather than leaving it flush left. */
@media (min-width: 560px) and (max-width: 779px) {
  .footer-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 16px);
    margin-left: auto;
    margin-right: auto;
  }
}
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand .brand-mark { height: 26px; }
.footer-brand .name { color: #fff; font-family: var(--font-display); font-weight: 700; }
.footer-heading { color: #fff; font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 1em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* Expand the tap target beyond the visible text (padding balanced by a
   matching negative margin) without changing the visual line spacing. */
.site-footer a {
  display: inline-block;
  text-decoration: none;
  color: rgba(255,255,255,0.82);
  padding: 9px 0;
  margin: -9px 0;
}
.site-footer a:hover { color: var(--accent-soft); }
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}

/* Utility */
.mt-0 { margin-top: 0; }
.mt-lg { margin-top: 1.6em; }
.text-center { text-align: center; }
.lede-wide { max-width: none; }

/* Vertical stack of siblings (e.g. two cards in a sidebar column) with
   consistent gap, in place of one-off margin-top on the second item. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
