/* Klinik IRBA Jimbaran — site styles
   Palette: deep saline teal on white, action green for WhatsApp,
   clinical red reserved for red-flag (emergency) information only. */
:root {
  --ink: #12292E;
  --ink-soft: #3E565B;
  --paper: #FFFFFF;
  --wash: #EAF3F1;
  --line: #C9DCD8;
  --teal: #0B5F5A;
  --teal-dark: #08403D;
  --wa: #157A42;
  --wa-dark: #0F5E32;
  --alert: #A1251B;
  --alert-wash: #FBECEA;
  --mark: #FFE58A;
  --radius-s: 6px;
  --radius-l: 14px;
  --font: "Atkinson Hyperlegible", "Segoe UI", Roboto, Arial, sans-serif;
  --step-0: 1.125rem;   /* 18px body */
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: 2.25rem;
  --step-4: 2.875rem;
  --measure: 68ch;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: var(--step-0); line-height: 1.6;
  padding-bottom: 76px; /* room for mobile sticky bar */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid #F2B705; outline-offset: 2px; border-radius: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

h1, h2, h3 { line-height: 1.2; font-weight: 700; color: var(--ink); }
h1 { font-size: var(--step-3); letter-spacing: -0.015em; margin: 0 0 0.5em; }
h2 { font-size: var(--step-2); margin: 2em 0 0.5em; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); margin: 1.6em 0 0.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
mark.todo { background: var(--mark); color: #000; padding: 0 0.2em; border-radius: 3px; font-size: 0.85em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand-name { display: block; font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand-sub { display: block; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.2; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav-desktop { display: none; gap: 4px; }
.nav-desktop a, .nav-mobile a { text-decoration: none; color: var(--ink); padding: 8px 10px; border-radius: var(--radius-s); display: block; font-size: 1rem; }
.nav-desktop a:hover, .nav-mobile a:hover { background: var(--wash); }
.nav a[aria-current="page"] { color: var(--teal); box-shadow: inset 0 -3px 0 var(--teal); border-radius: 0; }
.nav-mobile { position: relative; }
.nav-mobile summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 1rem; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile[open] ul { position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px; min-width: 220px; box-shadow: 0 10px 30px rgba(18, 41, 46, 0.15); }
.header-wa { display: none; }

/* ---------- buttons */
.btn { display: inline-block; text-decoration: none; font-weight: 700; border-radius: var(--radius-s); padding: 14px 20px; line-height: 1.2; font-size: 1.05rem; border: 2px solid transparent; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); color: #fff; }
.btn-ghost { border-color: var(--teal); color: var(--teal); background: transparent; }
.btn-ghost:hover { background: var(--wash); }
.btn-call { background: var(--teal); color: #fff; }
.btn-small { padding: 9px 14px; font-size: 0.95rem; }

/* ---------- hero (home) */
.hero { background: var(--wash); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; gap: 28px; padding-top: 36px; padding-bottom: 40px; }
.hero h1 { font-size: clamp(2rem, 5.2vw, var(--step-4)); max-width: 18ch; }
.hero .lead { max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.4em 0; }
.hero-facts { font-size: 0.95rem; color: var(--ink-soft); max-width: 56ch; }
.triage { background: var(--paper); border-radius: var(--radius-l); border: 1px solid var(--line); overflow: hidden; align-self: start; }
.triage h2 { font-size: 1.1rem; margin: 0 0 0.6em; }
.triage ul { margin: 0; padding-left: 1.2em; font-size: 1rem; }
.triage-home { padding: 20px 22px; }
.triage-er { padding: 20px 22px; background: var(--alert-wash); border-top: 4px solid var(--alert); }
.triage-er h2 { color: var(--alert); }

/* ---------- page head and prose */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 14px 0 0; margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--line); }
.crumbs a { color: var(--ink-soft); }
.page-head { padding-top: 18px; padding-bottom: 8px; }
.page-head h1 { max-width: 24ch; }
.page-head.narrow h1 { max-width: none; }
.lead { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.45; max-width: 60ch; }
.byline { font-size: 0.95rem; color: var(--ink-soft); border-left: 3px solid var(--teal); padding-left: 12px; max-width: 70ch; }
.byline .dates { display: block; }
.prose { padding-bottom: 40px; }
.prose > p, .prose > ul, .prose > ol, .prose > h2, .prose > h3 { max-width: var(--measure); }
.prose h2 { padding-top: 0.6em; border-top: 1px solid var(--line); }
.prose > h2:first-child, .quick + h2, .toc + h2 { border-top: 0; }

.quick { background: var(--wash); border-radius: var(--radius-l); padding: 18px 22px; margin: 18px 0 8px; max-width: var(--measure); }
.quick-title { font-size: 1rem; margin: 0 0 0.3em; border: 0; padding: 0; color: var(--teal); }
.quick p:last-child { margin-bottom: 0; }
.toc { margin: 18px 0; padding: 0; max-width: var(--measure); }
.toc-title { font-size: 1rem; margin: 0 0 0.4em; border: 0; padding: 0; }
.toc ol { padding-left: 1.3em; font-size: 1rem; margin: 0; }

.redflags { background: var(--alert-wash); border-left: 6px solid var(--alert); border-radius: 0 var(--radius-l) var(--radius-l) 0; padding: 18px 22px; margin: 28px 0; max-width: var(--measure); }
.redflags-title { color: var(--alert); font-size: 1.15rem; margin: 0 0 0.6em; border: 0; padding: 0; }
.redflags p:last-child { margin-bottom: 0; }
.seedoctor { border: 2px solid var(--teal); border-radius: var(--radius-l); padding: 16px 22px; margin: 24px 0; max-width: var(--measure); }
.seedoctor h3 { margin-top: 0; font-size: 1.1rem; color: var(--teal); }
.seedoctor ul { margin-bottom: 0; }

.cta-inline { margin: 24px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cta-alt { font-size: 1rem; color: var(--ink-soft); }

.table-wrap { overflow-x: auto; margin: 20px 0 28px; max-width: 100%; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 1rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
thead th { background: var(--wash); }
caption { text-align: left; font-size: 0.95rem; color: var(--ink-soft); padding-bottom: 8px; caption-side: top; }
td.price { white-space: nowrap; font-weight: 700; }

.photo { margin: 28px 0; max-width: 720px; }
.photo img { border-radius: var(--radius-l); width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
figcaption { font-size: 0.9rem; color: var(--ink-soft); margin-top: 6px; }

.team { list-style: none; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 20px 0 32px; }
.person { display: flex; gap: 14px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin: 0; }
.person img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; background: var(--wash); }
.person p { margin: 0; font-size: 0.95rem; }
.person-name { font-weight: 700; font-size: 1.05rem !important; }
.person-role, .person-lang { color: var(--ink-soft); }
.person-reg { font-variant-numeric: tabular-nums; }

.licence { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 20px 0 28px; max-width: var(--measure); font-size: 1rem; }
.licence dt { font-weight: 700; }
.licence dd { margin: 0; }

.guide-list { list-style: none; padding: 0; max-width: var(--measure); }
.guide-list li { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.guide-list a { font-weight: 700; font-size: 1.1rem; }
.guide-list p { margin: 4px 0 0; color: var(--ink-soft); font-size: 1rem; }

.partners { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 24px; }
.partners li { display: flex; gap: 12px; align-items: center; }
.partners img { width: 120px; height: 60px; object-fit: contain; }
.partners p { margin: 0; font-size: 1rem; }

.steps { counter-reset: step; list-style: none; padding: 0; max-width: var(--measure); }
.steps > li { counter-increment: step; position: relative; padding-left: 52px; margin-bottom: 18px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; display: grid; place-items: center; }

.faq { max-width: var(--measure); margin-top: 32px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details div { padding-top: 8px; }
.faq details p:last-child { margin-bottom: 0; }
.refs, .related { max-width: var(--measure); }
.refs ol { font-size: 0.95rem; }
.related ul { padding-left: 1.2em; }
.reviews-link { background: var(--wash); padding: 14px 18px; border-radius: var(--radius-s); max-width: var(--measure); }

.closing { background: var(--teal-dark); color: #fff; padding: 36px 0; }
.closing h2 { color: #fff; margin-top: 0; }
.closing p { max-width: 58ch; }
.closing-inner { display: grid; gap: 12px; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.closing .btn-ghost { border-color: #fff; color: #fff; }
.closing .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.site-footer { background: #0C2226; color: #D7E6E3; padding: 40px 0 20px; font-size: 0.95rem; }
.site-footer a { color: #FFFFFF; }
.site-footer h2 { color: #fff; font-size: 1rem; margin: 0 0 0.6em; }
.site-footer ul { list-style: none; padding: 0; }
.footer-cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.footer-legal { border-top: 1px solid #2A4348; margin-top: 24px; padding-top: 18px; }
.footer-legal p { max-width: 90ch; }

.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 2fr 1fr; gap: 8px; padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line); z-index: 30; }
.sticky-bar .btn { text-align: center; padding: 13px 10px; }

@media (min-width: 760px) {
  h1 { font-size: var(--step-4); }
  .hero-inner { grid-template-columns: 1.15fr 1fr; align-items: center; padding-top: 56px; padding-bottom: 60px; gap: 48px; }
  .closing-inner { grid-template-columns: 1.4fr 1fr; align-items: center; }
  .closing-actions { justify-content: flex-end; }
}
@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .sticky-bar { display: none; }
  .nav-mobile { display: none; }
  .nav-desktop { display: flex; }
  .header-wa { display: inline-block; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .site-header, .sticky-bar, .closing, .site-footer { display: none; } body { padding: 0; } }
.profile { display: grid; gap: 20px; align-items: start; margin: 20px 0; }
.profile img { width: 200px; height: 200px; border-radius: var(--radius-l); object-fit: cover; background: var(--wash); }
.profile .licence { margin: 0; }
@media (min-width: 760px) { .profile { grid-template-columns: 200px 1fr; } }

/* fixes: header WhatsApp only on desktop; stacked price table on phones */
.btn.header-wa { display: none; }
@media (min-width: 1000px) { .btn.header-wa { display: inline-block; } }
@media (max-width: 640px) {
  table.prices { min-width: 0; }
  table.prices thead { position: absolute; left: -9999px; }
  table.prices tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.prices th, table.prices td { display: block; border: 0; padding: 2px 0; }
  table.prices td.price { font-size: 1.1rem; }
  table.prices td:last-child { color: var(--ink-soft); font-size: 0.95rem; }
}

/* portrait photos (patients on home visits) */
.photo.portrait { max-width: 420px; }
.photo.portrait img { aspect-ratio: auto; height: auto; }


/* floating WhatsApp button (all screen sizes) — replaces the old bottom bar */
.sticky-bar { display: none !important; }
body { padding-bottom: 0; }
.site-footer { padding-bottom: 96px; }
.float-contact { position: fixed; z-index: 40; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.float-wa, .float-call { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: #fff; box-shadow: 0 6px 20px rgba(12, 34, 38, 0.28), 0 2px 6px rgba(12, 34, 38, 0.18); }
.float-wa { gap: 10px; background: var(--wa); border-radius: 999px; padding: 14px 22px 14px 18px; font-weight: 700; font-size: 1.05rem; line-height: 1; }
.float-wa:hover, .float-wa:focus-visible { background: var(--wa-dark); color: #fff; }
.float-call { width: 48px; height: 48px; border-radius: 50%; background: var(--teal); }
.float-call:hover { background: var(--teal-dark); color: #fff; }
@media (min-width: 1000px) { .float-call { display: none; } }
@media (max-width: 360px) { .float-wa span { display: none; } .float-wa { padding: 15px; } }
@media print { .float-contact { display: none; } }

/* ---------- simplified landing page (Nov 2026) */
.btn-big { padding: 16px 24px; font-size: 1.1rem; }
.hero-inner { align-items: center; }
.hero h1 { max-width: 16ch; }
.trust { list-style: none; padding: 0; margin: 1.4em 0 0; display: grid; gap: 8px; font-size: 1rem; }
.trust li { margin: 0; padding-left: 14px; border-left: 3px solid var(--teal); }
.trust a { color: var(--ink); text-decoration: none; }
.trust a:hover strong { text-decoration: underline; }
.stars { color: #E2A400; letter-spacing: 1px; }
.hero-photo { margin: 0; justify-self: center; max-width: 380px; width: 100%; }
.hero-photo img { border-radius: var(--radius-l); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 70%; box-shadow: 0 12px 30px rgba(12, 34, 38, 0.18); }
.emergency-line { font-size: 0.95rem; color: var(--alert); padding-bottom: 20px; margin: 0 auto; }
@media (max-width: 759px) { .hero-photo { max-width: 100%; } .hero-photo img { aspect-ratio: 4 / 3; } }

.services { list-style: none; padding: 0; margin: 18px 0 8px; border-top: 2px solid var(--ink); }
.svc { display: grid; grid-template-columns: 1fr; gap: 6px 20px; padding: 18px 0; border-bottom: 1px solid var(--line); margin: 0; align-items: center; }
.svc h3 { margin: 0 0 4px; font-size: 1.2rem; }
.svc h3 a { color: var(--ink); text-decoration: none; }
.svc h3 a:hover { text-decoration: underline; }
.svc p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.svc-text { min-width: 0; }
.svc-price { font-weight: 700; font-size: 1.2rem; color: var(--ink) !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.svc-book { justify-self: start; }
.svc-note { font-size: 0.95rem; color: var(--ink-soft); }
@media (min-width: 760px) { .svc { grid-template-columns: 1fr auto auto; } .svc-price { text-align: right; } }

.reviews { display: grid; gap: 24px; margin: 18px 0; align-items: center; }
.rating-score { font-size: 2.4rem; line-height: 1; margin: 0 0 8px; }
.rating-score strong { font-size: 2.8rem; }
.rating p { max-width: 36ch; }
.review-photos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.review-photos li { margin: 0; }
.review-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-s); }
@media (min-width: 760px) { .reviews { grid-template-columns: 1fr 1.6fr; } }

.steps-compact > li { margin-bottom: 12px; }
.kind-home .prose > h2 { margin-top: 1.6em; }

/* prices: approximate foreign currency, inclusions, compact team list */
.approx { display: block; font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; }
.svc-price { text-align: left; }
@media (min-width: 760px) { .svc-price .approx { text-align: right; } }
.includes { background: var(--wash); border-radius: var(--radius-s); padding: 14px 18px; max-width: var(--measure); font-size: 1rem; }
table.prices td:nth-child(2) { color: var(--ink-soft); }
table.surcharges { min-width: 0; max-width: 520px; }
.team-list { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 16px 0 20px; font-size: 1rem; }
.team-list li { margin: 0; padding-left: 14px; border-left: 3px solid var(--teal); }
.team-list .person-reg { color: var(--ink-soft); font-size: 0.95rem; }
.profile-plain { margin: 20px 0; }

/* ================= Mobile optimisation (phones, < 760px) ================= */
@media (max-width: 759px) {
  :root { --step-0: 1.0625rem; --step-1: 1.125rem; --step-2: 1.5rem; --step-3: 1.85rem; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: 28px; }

  /* WhatsApp: a bar fixed to the bottom edge, so it never covers text mid-screen */
  .float-contact {
    left: 0; right: 0; bottom: 0; flex-direction: row; align-items: stretch; gap: 8px;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(12, 34, 38, 0.10);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  .float-wa { order: 1; flex: 1; justify-content: center; border-radius: var(--radius-s); padding: 13px 14px; box-shadow: none; }
  .float-wa span { display: inline !important; }
  .float-call { order: 2; display: inline-flex; width: auto; height: auto; padding: 0 18px; border-radius: var(--radius-s); box-shadow: none; }
  .float-call::after { content: "Call"; margin-left: 8px; font-weight: 700; }

  /* header */
  .header-inner { min-height: 60px; gap: 10px; }
  .brand img { width: 34px; height: 34px; }
  .brand-name { font-size: 1rem; }
  .brand-sub { font-size: 0.75rem; }
  .nav-mobile summary { padding: 10px 14px; font-weight: 700; }
  .nav-mobile[open] ul { width: min(280px, calc(100vw - 32px)); }
  .nav-mobile a { padding: 12px 12px; font-size: 1.05rem; }

  /* hero */
  .hero-inner { padding-top: 22px; padding-bottom: 18px; gap: 18px; }
  .hero h1 { font-size: 2rem; line-height: 1.15; max-width: none; }
  .hero .lead { font-size: 1.1rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 1.1em 0; }
  .hero-actions .btn { text-align: center; }
  .trust { gap: 10px; font-size: 0.98rem; }
  .hero-photo img { aspect-ratio: 16 / 10; object-position: center 62%; box-shadow: none; }
  .emergency-line { font-size: 0.92rem; }

  /* page heads */
  .page-head { padding-top: 10px; }
  .page-head h1 { font-size: 1.95rem; line-height: 1.15; }
  .lead { font-size: 1.12rem; }
  h2 { margin-top: 1.6em; }
  .prose h2 { font-size: 1.45rem; }

  /* services: price and button share one row */
  .svc { grid-template-columns: 1fr auto; padding: 16px 0; gap: 10px 12px; }
  .svc-text { grid-column: 1 / -1; }
  .svc h3 { font-size: 1.12rem; }
  .svc-price { font-size: 1.1rem; }
  .svc-book { justify-self: end; align-self: center; padding: 11px 14px; }

  /* reviews */
  .rating-score { font-size: 1.8rem; }
  .rating-score strong { font-size: 2.2rem; }
  .review-photos { gap: 6px; }

  /* tables in articles wrap instead of being cut off */
  .table-wrap table:not(.prices) { min-width: 0; font-size: 0.95rem; }
  .table-wrap table:not(.prices) th, .table-wrap table:not(.prices) td { padding: 9px 8px; }
  table.prices th[scope="row"] a { font-size: 1.05rem; }

  /* comfortable tap targets */
  .cta-inline { display: grid; gap: 8px; }
  .cta-inline .btn { text-align: center; }
  .closing-actions { display: grid; grid-template-columns: 1fr; }
  .closing-actions .btn { text-align: center; }
  .faq summary { padding: 6px 0; }
  .site-footer li { margin-bottom: 0; }
  .site-footer li a { display: inline-block; padding: 7px 0; }
  .footer-cols { gap: 22px; }
  .toc ol li { margin-bottom: 0.5em; }
  .crumbs ol { font-size: 0.85rem; }
  .team-list { grid-template-columns: 1fr; }
  .person img { width: 80px; height: 80px; }
}
@media (max-width: 759px) {
  .prose h2.quick-title, .prose h2.toc-title { font-size: 1rem; margin-top: 0; }
  .prose .redflags h2.redflags-title { font-size: 1.08rem; }
  .prose h2#faq-h, .prose h2#rel-h, .prose h2#refs-h { font-size: 1.3rem; }
}
