/* ד״ר איתמר פלדמן — mobile first, RTL. Logical properties only (inline-start = right in RTL). */
:root {
  --blue: #1a3a5c;
  --blue-dark: #12293f;
  --sage: #7a9e8a;
  --sage-light: #e8f0eb;
  --sage-text: #4d705e; /* sage dark enough for text: 4.8:1 or more on all light backgrounds (WCAG 1.4.3) */
  --bg: #ffffff;
  --bg-alt: #f5f8f7;
  --text: #1f2a33;
  --muted: #4a5763;
  --border: #dde5e2;
  --focus: #e0a526;
  --radius: 8px;
  --wrap: 1100px;
  --bar-h: 64px;
}

/* Rubik (SIL OFL), self-hosted so no visitor request goes to Google. One variable file covers weights 400–500. */
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(fonts/rubik-hebrew.woff2) format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(fonts/rubik-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-block: 80px calc(var(--bar-h) + 76px); }
@media (min-width: 900px) { html { scroll-padding-block: 80px 84px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  font-family: "Rubik", "Arial Hebrew", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  padding-block-end: var(--bar-h);
}
@media (min-width: 900px) { body { padding-block-end: 0; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { color: var(--blue); line-height: 1.25; font-weight: 500; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
@media (min-width: 900px) { h1 { font-size: 2.6rem; } h2 { font-size: 1.9rem; } }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-inline-start: 1.25em; }
li { margin-block-end: .35em; }

.skip-link { position: absolute; inset-inline-start: 1rem; inset-block-start: -100px; background: var(--blue); color: #fff; padding: .6rem 1rem; z-index: 100; border-radius: var(--radius); }
.skip-link:focus { inset-block-start: 1rem; color: #fff; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 900px) { .wrap { padding-inline: 32px; } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-block-end: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.logo { text-decoration: none; color: var(--blue); display: flex; flex-direction: column; line-height: 1.2; }
.logo-name { font-size: 1.3rem; font-weight: 500; letter-spacing: .01em; }
.logo-sub { font-size: .8rem; color: var(--muted); font-weight: 400; }
.menu-toggle { background: none; border: 1px solid var(--border); border-radius: var(--radius); min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--blue); font: inherit; gap: .4rem; padding-inline: .7rem; }
.menu-toggle svg { width: 22px; height: 22px; }
.main-nav { display: none; }
.main-nav.open { display: block; position: absolute; inset-inline: 0; top: 100%; background: #fff; border-block-end: 1px solid var(--border); box-shadow: 0 8px 24px rgba(26,58,92,.08); }
.main-nav ul { list-style: none; margin: 0; padding: .5rem 16px 1rem; }
.main-nav li { margin: 0; }
.main-nav a { display: block; padding: .75rem .25rem; text-decoration: none; color: var(--text); border-block-end: 1px solid var(--bg-alt); min-height: 48px; }
.main-nav a[aria-current="page"] { color: var(--blue); font-weight: 500; border-inline-start: 3px solid var(--sage); padding-inline-start: .6rem; }
@media (min-width: 1100px) {
  .menu-toggle { display: none; }
  .logo { white-space: nowrap; }
  .main-nav, .main-nav.open { display: block; position: static; box-shadow: none; border: 0; background: none; flex: 1; }
  .main-nav ul { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 0 1rem; padding: 0; white-space: nowrap; }
  .main-nav a { border: 0; padding: .4rem 0; font-size: .95rem; min-height: 0; }
  .main-nav a[aria-current="page"] { padding-inline-start: 0; border-inline-start: 0; border-block-end: 2px solid var(--sage); }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: .7rem 1.4rem; border-radius: var(--radius); font: inherit; font-weight: 500; text-decoration: none; border: 2px solid var(--blue); cursor: pointer; transition: background .2s, color .2s; text-align: center; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--blue); }
.btn-outline:hover { background: var(--bg-alt); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-stack { display: grid; gap: .75rem; margin-block: 1.5rem; }
@media (min-width: 700px) { .btn-stack { display: flex; flex-wrap: wrap; } }

/* Sections */
.section { padding-block: 56px; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 46rem; margin-block-end: 2rem; }
.eyebrow { display: inline-block; color: var(--sage-text); font-weight: 500; font-size: .95rem; margin-block-end: .3rem; }
.accent-line { display: block; width: 48px; height: 3px; background: var(--sage); border-radius: 2px; margin-block-end: 1rem; }
.lead { font-size: 1.12rem; color: var(--muted); }

/* Hero */
.hero { padding-block: 40px 56px; background: linear-gradient(180deg, var(--bg-alt) 0%, #fff 100%); }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero h1 { margin-block-end: .2em; }
.hero-spec { font-size: 1.15rem; color: var(--text); margin-block-end: 1rem; }
.hero-tagline { font-size: 1.3rem; color: var(--blue); font-weight: 500; border-inline-start: 3px solid var(--sage); padding-inline-start: .8rem; margin-block-end: 1rem; }
.portrait { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 6px 24px rgba(26,58,92,.12); margin-inline: auto; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr 320px; }
  .portrait { width: 260px; height: 260px; }
}

/* Cards */
.cards { display: grid; gap: 1rem; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards-4 { grid-template-columns: repeat(4, 1fr); } .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; }
.card h3 { margin-block-end: .4rem; }
.card p { color: var(--muted); flex: 1; }
.card .more { font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; }
.card .more::after { content: "←"; }
.card-quiet { border-style: dashed; }
.card-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--sage-light); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; margin-block-end: .8rem; }
.card-icon svg { width: 22px; height: 22px; }

/* Two column content */
.split { display: grid; gap: 2rem; }
@media (min-width: 900px) { .split { grid-template-columns: 1.3fr 1fr; align-items: start; } }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-inline-start: 1.6rem; }
.checklist li::before { content: ""; position: absolute; inset-inline-start: 0; top: .65em; width: 10px; height: 10px; border-radius: 50%; background: var(--sage); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.chips li { margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: .3rem .9rem; font-size: .95rem; }

.note { background: var(--sage-light); border-inline-start: 4px solid var(--sage); padding: 1rem 1.2rem; border-radius: var(--radius); }
.draft-note { background: #fff8e6; border: 1px dashed #d9a400; padding: 1rem 1.2rem; border-radius: var(--radius); }

.ordered { counter-reset: n; list-style: none; padding: 0; }
.ordered > li { counter-increment: n; position: relative; padding-inline-start: 3rem; margin-block-end: 1.5rem; }
.ordered > li::before { content: counter(n); position: absolute; inset-inline-start: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 500; }

/* Page header */
.page-head { background: var(--bg-alt); padding-block: 40px; border-block-end: 1px solid var(--border); }
.page-head p { max-width: 46rem; }
.breadcrumb { font-size: .9rem; color: var(--muted); margin-block-end: .5rem; }
.breadcrumb a { color: var(--muted); }

/* FAQ / guides */
details { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-block-end: .75rem; }
summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 500; color: var(--blue); list-style: none; min-height: 48px; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--sage-text); }
details[open] summary::after { content: "−"; }
details > div { padding: 0 1.2rem 1rem; }

/* Contact */
.contact-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
.contact-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.contact-card h3 { display: flex; align-items: center; gap: .5rem; }
.contact-line { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.contact-line svg { width: 20px; height: 20px; color: var(--sage); flex: none; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* Form */
form { display: grid; gap: 1rem; }
label { display: block; font-weight: 500; margin-block-end: .3rem; }
.req { color: #a33; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); padding: .75rem .9rem; border: 1px solid #7d8d88; border-radius: var(--radius); background: #fff; min-height: 52px; }
input:focus, select:focus, textarea:focus { outline: none; border: 2px solid var(--blue); padding: calc(.75rem - 1px) calc(.9rem - 1px); }
input[type="tel"], input[type="email"] { text-align: right; }
textarea { min-height: 120px; resize: vertical; }
.field-error { color: #a33; font-size: .95rem; margin-block-start: .3rem; }
.hint { font-size: .95rem; color: var(--muted); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: 1rem; border-radius: var(--radius); background: var(--sage-light); }

/* Footer */
.site-footer { background: var(--blue); color: #e6edf3; padding-block: 48px 24px; margin-block-start: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h2 { color: #fff; font-size: 1.15rem; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-block-end: .4rem; }
.footer-brand { font-size: 1.3rem; color: #fff; font-weight: 500; margin: 0; }
.footer-bottom { border-block-start: 1px solid rgba(255,255,255,.2); margin-block-start: 2rem; padding-block-start: 1rem; font-size: .9rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* Mobile action bar */
.action-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #fff; border-block-start: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(26,58,92,.08); padding-bottom: env(safe-area-inset-bottom); }
.action-bar a, .action-bar button { font: inherit; background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--bar-h); text-decoration: none; color: var(--blue); font-size: .85rem; font-weight: 500; }
.action-bar > * + * { border-inline-start: 1px solid var(--border) !important; }
.action-bar svg { width: 22px; height: 22px; }
@media (min-width: 900px) { .action-bar { display: none; } }

.portrait-block { display: flex; flex-direction: column; align-items: center; gap: .9rem; text-align: center; }
.reviews-link { white-space: nowrap; font-size: .95rem; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.mt-0 { margin-block-start: 0; }

/* long-form reading pages */
.prose > * { max-width: 760px; }
.prose p, .prose li { line-height: 1.85; }
.prose h2 { margin-block-end: .6rem; }
.prose .checklist { margin-block: .4rem 1rem; }
.prose .checklist li { margin-block-end: .35rem; }
.prose .note { margin-block: 1.2rem; }
.summary h2 { margin-block: 0 .5rem; font-size: 1.2rem; }
.toc { margin-block-start: 1.5rem; }
.toc li { padding: 0; }
.toc a { display: block; padding: .45rem 1rem; text-decoration: none; color: var(--blue); }
.toc a:hover, .toc a:focus-visible { background: var(--sage-light); border-radius: 999px; }
/* anchor offset under the sticky header comes from scroll-padding on html */

/* mobile choice sheets (call / WhatsApp) */
.sheet { position: fixed; inset-inline: 0; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); z-index: 70; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 32px rgba(26,58,92,.18); padding: 1.2rem 16px 1rem; display: grid; gap: .7rem; }
.sheet[hidden] { display: none; }
.sheet-title { margin: 0 0 .2rem; font-weight: 600; color: var(--blue); font-size: 1.1rem; }
.sheet .btn { margin: 0; }
.sheet-close { font: inherit; background: none; border: 0; color: var(--muted); padding: .6rem; cursor: pointer; text-decoration: underline; }
@media (min-width: 900px) { .sheet { display: none !important; } }
.map-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-block-start: .8rem; }
.btn-sm { padding: .5rem 1rem; min-height: 0; font-size: .95rem; }
.footer-clinic { margin-block-end: .9rem; }

@media print {
  .site-header, .site-footer, .action-bar, .sheet, .no-print, .map-links, .breadcrumb { display: none !important; }
  body { padding: 0 !important; }
  .section, .page-head { padding-block: .6rem !important; background: none !important; }
}

/* about: education timeline */
.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--sage); }
.timeline li { display: block; padding-inline-start: 1.1rem; margin-block-end: 1.1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: .45em; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--sage); }
.tl-years { font-size: .9rem; color: var(--muted); direction: ltr; text-align: end; justify-self: start; }

/* accessibility button + panel */
.a11y-toggle { position: fixed; z-index: 65; inset-inline-end: 12px; bottom: calc(var(--bar-h) + var(--consent-h, 0px) + 12px + env(safe-area-inset-bottom)); width: 48px; height: 48px; border-radius: 50%; border: 2px solid #fff; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 14px rgba(26,58,92,.25); padding: 0; }
.a11y-toggle svg { width: 26px; height: 26px; }
.a11y-panel { position: fixed; z-index: 75; inset-inline-end: 12px; bottom: calc(var(--bar-h) + var(--consent-h, 0px) + 70px + env(safe-area-inset-bottom)); width: min(280px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 32px rgba(26,58,92,.2); padding: 1rem; display: grid; gap: .5rem; }
.a11y-panel[hidden] { display: none; }
.a11y-opt, .a11y-reset { font: inherit; text-align: start; min-height: 44px; padding: .5rem .9rem; border: 2px solid var(--blue); border-radius: var(--radius); background: #fff; color: var(--blue); cursor: pointer; }
.a11y-opt[aria-pressed="true"] { background: var(--blue); color: #fff; }
.a11y-opt[aria-pressed="true"]::after { content: " ✓"; }
.a11y-reset { border-color: var(--border); color: var(--muted); }
.a11y-panel a { padding: .3rem .2rem; }
@media (min-width: 900px) {
  .a11y-toggle { bottom: calc(var(--consent-h, 0px) + 20px); }
  .a11y-panel { bottom: calc(var(--consent-h, 0px) + 80px); }
}
@media print { .a11y-toggle, .a11y-panel { display: none !important; } }

/* analytics consent banner (only rendered when GA is configured); sits above the mobile action bar */
.consent { position: fixed; z-index: 68; inset-inline: 0; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); background: #fff; border-block-start: 1px solid var(--border); box-shadow: 0 -8px 32px rgba(26,58,92,.18); padding: 1rem 16px; font-size: 1rem; }
.consent[hidden] { display: none; }
.consent-actions { display: flex; gap: .75rem; margin-block-start: .75rem; }
.consent-actions .btn { flex: 1; }
@media (min-width: 900px) {
  .consent { bottom: 0; display: flex; align-items: center; gap: 1.5rem; padding-inline: max(16px, calc((100vw - var(--wrap)) / 2)); }
  .consent p { margin: 0; }
  .consent-actions { margin: 0; flex: none; }
  .consent-actions .btn { flex: none; min-width: 7rem; white-space: nowrap; }
}
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }
.site-footer .link-btn { color: #fff; }
@media print { .consent { display: none !important; } }

/* larger text */
html.a11y-text { font-size: 120%; }

/* link highlighting (also part of high contrast) */
html.a11y-links a:not(.btn), html.a11y-contrast a:not(.btn) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px; }
html.a11y-links a:not(.btn) { background: #fff3a8; color: #000 !important; }

/* high contrast: black background, white text, yellow links and buttons (works for low vision and colour blindness) */
html.a11y-contrast { --blue: #ffd400; --blue-dark: #ffd400; --sage: #ffd400; --sage-text: #ffd400; --sage-light: #000; --bg: #000; --bg-alt: #000; --text: #fff; --muted: #fff; --border: #fff; --focus: #00e5ff; }
html.a11y-contrast body, html.a11y-contrast .site-header, html.a11y-contrast .site-footer, html.a11y-contrast .hero,
html.a11y-contrast .page-head, html.a11y-contrast .section, html.a11y-contrast .card, html.a11y-contrast details,
html.a11y-contrast .note, html.a11y-contrast .sheet, html.a11y-contrast .a11y-panel, html.a11y-contrast .action-bar, html.a11y-contrast .consent,
html.a11y-contrast .main-nav, html.a11y-contrast .contact-card, html.a11y-contrast input, html.a11y-contrast select,
html.a11y-contrast textarea, html.a11y-contrast .chips li, html.a11y-contrast .a11y-opt, html.a11y-contrast .a11y-reset,
html.a11y-contrast .menu-toggle { background: #000 !important; color: #fff !important; border-color: #fff !important; box-shadow: none !important; }
html.a11y-contrast a:not(.btn), html.a11y-contrast summary, html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3,
html.a11y-contrast .action-bar a, html.a11y-contrast .action-bar button, html.a11y-contrast .link-btn { color: #ffd400 !important; }
html.a11y-contrast.a11y-links a:not(.btn) { background: none; color: #ffd400 !important; }
html.a11y-contrast .btn-primary, html.a11y-contrast .a11y-opt[aria-pressed="true"], html.a11y-contrast .a11y-toggle { background: #ffd400 !important; color: #000 !important; border-color: #ffd400 !important; }
html.a11y-contrast .btn-outline { background: #000 !important; color: #ffd400 !important; border-color: #ffd400 !important; }
html.a11y-contrast .field-error { color: #ff8a8a !important; }
html.a11y-text .main-nav ul { flex-wrap: wrap; white-space: normal; row-gap: .2rem; }
html.a11y-text .action-bar a, html.a11y-text .action-bar button { font-size: .8rem; }
.action-bar { overflow: hidden; }
.action-bar > * { min-width: 0; padding-inline: 2px; }
.contact-grid > * { min-width: 0; }
.contact-card a[href^="mailto:"], .site-footer a[href^="mailto:"] { overflow-wrap: anywhere; }
.menu-toggle svg, .btn svg, .action-bar svg, .a11y-toggle svg { flex-shrink: 0; }
html[class*="a11y-"] *, html[class*="a11y-"] *::before, html[class*="a11y-"] *::after { transition: none !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* large browser font settings (WCAG 1.4.4): let long words and rows wrap instead of overflowing */
.reviews-link { white-space: normal; }
.prose a[href^="mailto:"], .chips li, .btn, .action-bar span { overflow-wrap: anywhere; }
.btn-stack > *, .hero-grid > *, .split > * { min-width: 0; max-width: 100%; }
@media (max-width: 1099px) { .header-row { flex-wrap: wrap; } }
@media (min-width: 1100px) { .main-nav ul { flex-wrap: wrap; } }
.cards > * { min-width: 0; }
h1, h2, h3, summary, .card, .prose li { overflow-wrap: anywhere; }
