/* משרד עורכי דין אביב דהן: אתר הדגמה
   Design tokens: cool legal paper, pine ink, one wax-seal accent.
   Type: David Libre (the typeface of Israeli legal documents) + IBM Plex Sans Hebrew. */

:root {
  --paper: #F1F3F0;
  --paper-2: #E4E9E5;
  --white: #FFFFFF;
  --ink: #1B2622;
  --ink-soft: #46554F;
  --pine: #1F4B41;
  --pine-deep: #15352E;
  --seal: #8A2733;
  --seal-light: #F4E6D8;
  --line: #C6CFCA;
  --field: #6B7A74;
  --on-dark: #EDF2EE;
  --on-dark-soft: #B9C8C1;
  --error: #A1182B;
  --serif: 'David Libre', 'David', 'Times New Roman', serif;
  --sans: 'IBM Plex Sans Hebrew', 'Segoe UI', Arial, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; color: var(--pine-deep); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.45rem; font-weight: 500; }
p { max-width: 66ch; }
a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--pine-deep); }
ul { list-style: none; }
svg { display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.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;
}

/* Focus: always visible */
:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible { outline-color: var(--seal-light); }
#main:focus { outline: none; }

/* Skip link */
.skip-link {
  position: absolute; top: -100px; right: 1rem; z-index: 200;
  background: var(--pine-deep); color: var(--white); padding: .7rem 1.1rem;
  border-radius: 0 0 6px 6px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0; color: var(--white); }

/* Demo notice (top and footer) */
.demo-banner {
  background: var(--seal); color: var(--white);
  text-align: center; font-size: .95rem; font-weight: 500;
  padding: .55rem 1rem; line-height: 1.5;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1.4rem;
  font-family: var(--sans); font-size: 1.02rem; font-weight: 600; line-height: 1.2;
  border: 2px solid transparent; border-radius: 6px;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--pine); color: var(--white); border-color: var(--pine); }
.btn-primary:hover { background: var(--pine-deep); border-color: var(--pine-deep); color: var(--white); }
.btn-ghost { background: transparent; color: var(--pine); border-color: var(--pine); }
.btn-ghost:hover { background: var(--pine); color: var(--white); }
.on-dark .btn-ghost { color: var(--on-dark); border-color: var(--on-dark-soft); }
.on-dark .btn-ghost:hover { background: var(--on-dark); color: var(--pine-deep); border-color: var(--on-dark); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(241, 243, 240, .96);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.brand-seal { width: 42px; height: 42px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--pine-deep); }
.brand-sub { font-size: .9rem; color: var(--ink-soft); }

.nav-toggle {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; padding: .45rem .9rem;
  background: transparent; border: 1.5px solid var(--pine); border-radius: 6px;
  color: var(--pine); font: 600 .98rem var(--sans); cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }
.site-nav { display: none; }
.site-nav.open {
  display: block; position: absolute; top: 100%; right: 0; left: 0;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: .5rem 1.25rem 1.25rem;
}
.site-nav ul { display: flex; flex-direction: column; }
.site-nav a {
  display: block; padding: .8rem .25rem; color: var(--ink);
  text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line);
}
.site-nav a:hover { color: var(--pine); }
.header-call { display: none; }

.brand-name, .brand-sub, .site-nav a, .header-call span { white-space: nowrap; }
.header-end { display: flex; align-items: center; gap: 1.5rem; }
@media (max-width: 380px) { .brand-sub { display: none; } }
@media (min-width: 720px) {
  .header-call { display: inline-flex; min-height: 44px; padding: .5rem 1.1rem; }
}
@media (min-width: 1140px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open { display: block; position: static; padding: 0; border: 0; background: none; }
  .site-nav ul { flex-direction: row; gap: 1.5rem; }
  .site-nav a { padding: .4rem 0; border: 0; font-size: 1rem; }
}

/* Hero */
.hero { padding: clamp(2.75rem, 7vw, 5.5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero-office { font-size: 1.05rem; font-weight: 500; color: var(--ink-soft); margin-bottom: 1rem; }
.hero h1 {
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  line-height: 1.15; letter-spacing: -.005em;
  max-width: 17ch;
}
.hero-lead { margin-top: 1.5rem; font-size: 1.15rem; color: var(--ink); max-width: 52ch; }
.hero-areas { margin-top: 1rem; color: var(--ink-soft); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero-figure { max-width: 320px; width: 100%; justify-self: center; }
@media (min-width: 900px) { .hero-figure { max-width: 460px; } }
.envelope { width: 100%; height: auto; overflow: visible; pointer-events: none; margin-top: -22%; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.2fr .8fr; gap: 3rem; }
}

/* Envelope: the one orchestrated moment (flap closes, seal presses). Static when motion is reduced. */
.env-flap { transform-box: fill-box; transform-origin: 50% 0; }
.env-seal { transform-box: fill-box; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: no-preference) {
  .env-flap { animation: flap-close .9s .35s cubic-bezier(.55, .05, .25, 1) both; }
  .env-seal { animation: seal-press .45s 1.2s cubic-bezier(.3, 1.4, .5, 1) both; }
  .env-stamp { animation: stamp-in .5s 1.6s ease-out both; }
}
@keyframes flap-close {
  from { transform: scaleY(-1); }
  to { transform: scaleY(1); }
}
@keyframes seal-press {
  from { transform: scale(1.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes stamp-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-head { max-width: 62ch; margin-bottom: 2.5rem; }
.section-head p { margin-top: .9rem; color: var(--ink-soft); font-size: 1.1rem; }
.section-alt { background: var(--paper-2); }
.section-white { background: var(--white); }

/* Practice areas: a quiet index */
.areas { border-top: 1px solid var(--line); }
.area {
  display: grid; gap: .5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.area h3 { color: var(--pine); }
.area p { color: var(--ink); }
@media (min-width: 800px) {
  .area { grid-template-columns: 17rem 1fr; gap: 2.5rem; padding: 2rem 0; }
}
.note {
  margin-top: 1.5rem; font-size: .95rem; color: var(--ink-soft);
  padding-inline-start: .9rem; border-inline-start: 3px solid var(--line);
}

/* Lasting power of attorney (dark) */
.on-dark { background: var(--pine-deep); color: var(--on-dark); }
.on-dark h2, .on-dark h3 { color: var(--white); }
.on-dark a { color: var(--on-dark); }
.lpa-grid { display: grid; gap: 2.5rem; }
.lpa-intro p { margin-top: 1rem; color: var(--on-dark); font-size: 1.1rem; }
.lpa-points { display: grid; gap: 1.25rem; align-content: start; }
.lpa-point { padding: 1.25rem 1.4rem; border: 1px solid rgba(237, 242, 238, .28); border-radius: 8px; }
.lpa-point h3 { font-size: 1.3rem; margin-bottom: .35rem; }
.lpa-point p { color: var(--on-dark-soft); }
.lpa-credential {
  display: flex; gap: .9rem; align-items: center;
  margin-top: 1.75rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(237, 242, 238, .28);
  font-weight: 500;
}
.lpa-credential svg { width: 40px; height: 40px; flex: none; }
.lpa-actions { margin-top: 1.75rem; }
.source-line { margin-top: 1rem; font-size: .9rem; color: var(--on-dark-soft); }
@media (min-width: 900px) {
  .lpa-grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

/* Process: a real sequence, so it is numbered */
.steps { display: grid; gap: 1.5rem; counter-reset: step; list-style: none; }
.step { position: relative; padding-top: 3.4rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; right: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.3rem; font-weight: 700;
  color: var(--pine); border: 1.5px solid var(--pine);
}
.step h3 { font-size: 1.3rem; margin-bottom: .35rem; color: var(--pine-deep); }
.step p { color: var(--ink-soft); }
@media (min-width: 700px) { .steps { grid-template-columns: 1fr 1fr; gap: 2rem 2.5rem; } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); } }

/* About */
.about-grid { display: grid; gap: 2.5rem; align-items: start; }
.portrait {
  aspect-ratio: 3 / 2; width: 100%; max-width: 420px;
  border: 2px dashed var(--field); border-radius: 8px;
  display: grid; place-items: center; text-align: center;
  padding: 1.5rem; color: var(--ink-soft); background: var(--paper);
}
.portrait svg { width: 64px; height: 64px; margin: 0 auto .75rem; color: var(--field); }
.about-text p + p { margin-top: 1rem; }
.about-text h2 { margin-bottom: 1.25rem; }
.facts { margin-top: 2rem; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; color: var(--pine-deep); }
.facts dd { color: var(--ink); }
.placeholder {
  color: var(--ink-soft);
  background: rgba(107, 122, 116, .13);
  padding: .05rem .45rem; border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
p.placeholder { display: inline-block; padding: .3rem .6rem; }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: 360px 1fr; gap: 4rem; }
  .portrait { aspect-ratio: 4 / 5; max-width: 360px; }
}
@media (max-width: 520px) { .facts div { grid-template-columns: 1fr; gap: .1rem; } }

/* FAQ */
.faq { max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.25rem 0; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; color: var(--pine-deep);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 22px; height: 22px; flex: none; color: var(--pine); transition: transform .2s; }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq .answer { padding: 0 0 1.4rem; color: var(--ink); }
.faq .answer p + p { margin-top: .6rem; }
@media (prefers-reduced-motion: reduce) { .faq summary svg { transition: none; } }

/* Contact */
.contact-grid { display: grid; gap: 2.5rem; }
.contact-direct h2 { margin-bottom: 1rem; }
.contact-direct > p { color: var(--ink-soft); font-size: 1.1rem; }
.contact-list { margin-top: 1.75rem; display: grid; gap: 1.1rem; }
.contact-list li { display: flex; gap: .9rem; align-items: flex-start; }
.contact-list svg { width: 24px; height: 24px; flex: none; margin-top: .2rem; color: var(--pine); }
.contact-list strong { display: block; font-weight: 600; color: var(--pine-deep); }
.contact-list a { font-weight: 500; }
.map-frame {
  margin-top: 2rem; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--paper-2);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.form-card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: clamp(1.4rem, 4vw, 2.25rem); }
.form-card h3 { font-size: 1.55rem; margin-bottom: .4rem; }
.form-intro { color: var(--ink-soft); margin-bottom: 1.5rem; }
.field { display: grid; gap: .35rem; margin-bottom: 1.15rem; }
.field label, .field .label { font-weight: 600; color: var(--ink); }
.req { font-weight: 400; color: var(--ink-soft); font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--field); border-radius: 6px;
  padding: .7rem .85rem; min-height: 48px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--seal); outline-offset: 1px; border-color: var(--pine); }
.field [aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.hint { font-size: .92rem; color: var(--ink-soft); }
.error-msg { font-size: .95rem; color: var(--error); font-weight: 600; }
.error-msg:empty { display: none; }
.check { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; }
.check input { width: 22px; height: 22px; min-height: 0; margin-top: .25rem; accent-color: var(--pine); }
.check label { font-weight: 400; }
.form-card .btn { width: 100%; margin-top: .4rem; }
.form-success {
  margin-top: 1.25rem; padding: 1rem 1.15rem; border-radius: 6px;
  background: #E7F0EB; border: 1.5px solid var(--pine); color: var(--pine-deep);
}
.form-success:empty { display: none; }
.form-success strong { display: block; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }

/* Footer */
.site-footer { background: var(--pine-deep); color: var(--on-dark); padding: 3rem 0 0; }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2.25rem; }
.footer-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--white); }
.site-footer p, .site-footer li { color: var(--on-dark-soft); }
.site-footer a { color: var(--on-dark); }
.site-footer h2 { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--white); margin-bottom: .6rem; }
.footer-links li + li { margin-top: .35rem; }
.disclaimer { font-size: .92rem; max-width: 60ch; margin-top: .75rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }

/* Mobile contact bar */
.mobile-bar { display: none; }
@media (max-width: 719px) {
  body { padding-bottom: 72px; }
  .mobile-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: .6rem;
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 60;
    padding: .6rem .9rem calc(.6rem + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--line);
  }
  .mobile-bar .btn { width: 100%; padding: .6rem .8rem; }
}

/* Accessibility statement page */
.doc { max-width: 760px; padding: clamp(2.5rem, 6vw, 4rem) 0; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 1.25rem; }
.doc h2 { font-size: 1.5rem; margin: 2rem 0 .6rem; }
.doc p + p { margin-top: .8rem; }
.doc ul { list-style: disc; padding-inline-start: 1.4rem; }
.doc li + li { margin-top: .3rem; }
.back-link { display: inline-block; margin-top: 2.5rem; font-weight: 600; }

@media print {
  .site-header, .mobile-bar, .map-frame { display: none; }
}
