/* ===== פורטל פטריגיום — design system =====
   Mobile-first, RTL Hebrew. Edit CSS variables below to re-theme. */

@font-face {
  font-family: 'Heebo';
  src: url('/assets/fonts/heebo-hebrew.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Heebo';
  src: url('/assets/fonts/heebo-latin.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}

:root {
  --c-primary: #0d5c8c;
  --c-primary-dark: #083e60;
  --c-primary-light: #e8f2f8;
  --c-accent: #0aa06e;
  --c-wa: #25d366;
  --c-wa-dark: #128c4a;
  --c-text: #1c2b33;
  --c-text-soft: #48606c;
  --c-bg: #ffffff;
  --c-bg-alt: #f4f8fb;
  --c-border: #d8e4ec;
  --font-scale: 1;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(13, 92, 140, 0.10);
  --maxw: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: calc(100% * var(--font-scale));
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: 'Heebo', 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
  text-align: start;
  /* room for the fixed mobile CTA bar */
  padding-bottom: 64px;
}

img { max-width: 100%; height: auto; }
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-dark); }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -48px; inset-inline-end: 8px; z-index: 300;
  background: var(--c-primary); color: #fff; padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius); transition: top 0.15s;
}
.skip-link:focus { top: 0; color: #fff; }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; text-decoration: none; border: 0; cursor: pointer;
  font-size: 1rem; font-family: inherit; transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-wa { background: var(--c-wa); color: #fff; }
.btn-wa:hover { background: var(--c-wa-dark); color: #fff; }
.btn-lg { padding: 0.85rem 1.8rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--c-bg); border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 6px rgba(13, 92, 140, 0.06);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem; min-height: 60px;
}
.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.15rem; font-weight: 700; color: var(--c-primary-dark);
  text-decoration: none; margin-inline-end: auto;
}
.logo-eye { color: var(--c-primary); flex-shrink: 0; }
.header-phone {
  display: none; align-items: center; gap: 0.4rem;
  background: var(--c-primary); color: #fff; font-weight: 600;
  padding: 0.45rem 1rem; border-radius: 999px; text-decoration: none;
  white-space: nowrap;
}
.header-phone:hover { background: var(--c-primary-dark); color: #fff; }
.nav-toggle {
  background: none; border: 0; color: var(--c-primary-dark);
  padding: 0.4rem; cursor: pointer; border-radius: 6px;
}
.lang-switch {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.85rem; white-space: nowrap;
}
.lang-switch a { text-decoration: none; color: var(--c-text-soft); font-weight: 600; }
.lang-switch a:hover { color: var(--c-primary); }
.lang-switch a.active { color: var(--c-primary-dark); text-decoration: underline; }
.lang-switch span { color: var(--c-border); }
.site-nav { display: none; }
.site-nav.open {
  display: block; position: absolute; top: 100%; inset-inline: 0;
  background: var(--c-bg); border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow);
}
.site-nav ul { list-style: none; margin: 0; padding: 0.5rem 0; }
.site-nav a {
  display: block; padding: 0.6rem 1.25rem; text-decoration: none;
  color: var(--c-text); font-weight: 500;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--c-primary); background: var(--c-primary-light); }

@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .nav-toggle { display: none; }
  .header-phone { display: inline-flex; }
  .site-nav { display: block; }
  .site-nav.open { position: static; border: 0; box-shadow: none; }
  .site-nav ul { display: flex; gap: 0.1rem; padding: 0; }
  .site-nav a { padding: 0.5rem 0.7rem; border-radius: 6px; font-size: 0.95rem; }
  .mobile-cta { display: none; }
}

/* ===== Hero (homepage) ===== */
.hero {
  background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary));
  color: #fff; padding: 2.5rem 0 2.75rem;
}
.hero h1 { font-size: 1.7rem; line-height: 1.35; margin: 0 0 0.75rem; font-weight: 700; }
.hero-sub { font-size: 1.1rem; margin: 0 0 1.5rem; opacity: 0.92; max-width: 42em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.hero-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; }
.hero-trust li {
  font-size: 0.9rem; opacity: 0.95; display: flex; align-items: center; gap: 0.4rem;
}
.hero-trust li::before { content: '✓'; font-weight: 700; color: #7fd6ac; }
@media (min-width: 700px) {
  .hero h1 { font-size: 2.2rem; }
}

/* ===== Article ===== */
.article-header {
  background: var(--c-bg-alt); border-bottom: 1px solid var(--c-border);
  padding: 1.75rem 0;
}
.article-header h1 { margin: 0; font-size: 1.65rem; line-height: 1.3; color: var(--c-primary-dark); }
.article-meta { margin: 0.5rem 0 0; color: var(--c-text-soft); font-size: 0.92rem; }
.article-layout { padding: 1.5rem 0 2.5rem; }
.article-body { max-width: 46em; margin-inline: auto; }
.article-body h2 { font-size: 1.4rem; color: var(--c-primary-dark); margin: 2em 0 0.5em; line-height: 1.35; }
.article-body h3 { font-size: 1.15rem; color: var(--c-primary-dark); margin: 1.75em 0 0.5em; }
.article-body figure { margin: 1.5em auto; text-align: center; }
.article-body figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
.article-body figcaption { font-size: 0.85rem; color: var(--c-text-soft); margin-top: 0.5em; }
.article-body table {
  border-collapse: collapse; width: 100%; margin: 1.5em 0; font-size: 0.95rem;
  display: block; overflow-x: auto;
}
.article-body th, .article-body td { border: 1px solid var(--c-border); padding: 0.5rem 0.75rem; }
.article-body th { background: var(--c-primary-light); }
.article-body blockquote {
  margin: 1.5em 0; padding: 0.75em 1.25em; border-inline-start: 4px solid var(--c-primary);
  background: var(--c-bg-alt); border-radius: 0 var(--radius) var(--radius) 0;
}

/* Table of contents */
.toc {
  background: var(--c-bg-alt); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.toc-title { font-weight: 700; margin: 0 0 0.5rem; color: var(--c-primary-dark); }
.toc ol { margin: 0; padding-inline-start: 1.25rem; columns: 1; }
.toc li { margin-bottom: 0.25rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (min-width: 700px) { .toc ol { columns: 2; column-gap: 2rem; } }

/* FAQ */
.faq { margin: 2.5rem 0 1rem; }
.faq h2 { font-size: 1.4rem; color: var(--c-primary-dark); margin-bottom: 1rem; }
.faq-item {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  margin-bottom: 0.6rem; background: var(--c-bg-alt); overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 600; color: var(--c-primary-dark);
  list-style: none; position: relative; padding-inline-end: 2.2rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; inset-inline-end: 1.1rem; top: 50%;
  transform: translateY(-50%); font-size: 1.3rem; color: var(--c-primary);
}
.faq-item[open] summary::after { content: '−'; }
.faq-answer { padding: 0 1.1rem 1rem; color: var(--c-text-soft); }
.faq-answer p:first-child { margin-top: 0; }

/* In-article CTA */
.article-cta {
  background: var(--c-primary-light); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 1.5rem; margin: 2.5rem 0 1.5rem;
  text-align: center;
}
.article-cta-title { font-weight: 700; font-size: 1.1rem; margin: 0 0 1rem; color: var(--c-primary-dark); }
.article-cta-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* Author block */
.author-block {
  display: flex; gap: 1rem; align-items: flex-start;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 1.25rem; margin: 1.5rem 0; background: var(--c-bg-alt);
}
.author-photo { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-photo-placeholder {
  width: 96px; height: 96px; display: flex; align-items: center; justify-content: center;
  background: var(--c-primary-light); color: var(--c-primary);
}
.author-reviewed { margin: 0; font-size: 0.85rem; color: var(--c-text-soft); }
.author-name { margin: 0.15rem 0; font-weight: 700; font-size: 1.1rem; color: var(--c-primary-dark); }
.author-creds { list-style: none; margin: 0.25rem 0 0.5rem; padding: 0; font-size: 0.9rem; color: var(--c-text-soft); }
.author-creds li { margin-bottom: 0.1rem; }
.author-more { font-size: 0.9rem; font-weight: 600; text-decoration: none; }

/* ===== Blog listing ===== */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.post-card {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; background: var(--c-bg); box-shadow: var(--shadow);
}
.post-card h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.post-card h2 a { text-decoration: none; color: var(--c-primary-dark); }
.post-card h2 a:hover { color: var(--c-primary); }
.post-card time { color: var(--c-text-soft); font-size: 0.85rem; }
.post-card p { margin: 0.5rem 0 0; color: var(--c-text-soft); }
@media (min-width: 700px) { .post-list { grid-template-columns: 1fr 1fr; } }

/* ===== Lead form section ===== */
.lead-section {
  background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary));
  color: #fff; padding: 2.5rem 0; margin-top: 2rem;
}
.lead-inner { display: grid; gap: 2rem; }
.lead-text h2 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.lead-text p { margin: 0 0 1rem; opacity: 0.92; }
.lead-trust { list-style: none; margin: 0; padding: 0; }
.lead-trust li { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.3rem; font-size: 0.95rem; }
.lead-trust li::before { content: '✓'; color: #7fd6ac; font-weight: 700; }
.lead-form {
  background: #fff; color: var(--c-text); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); max-width: 420px;
}
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.95rem; }
.form-field input {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--c-border);
  border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--c-text);
}
.form-field input:focus { border-color: var(--c-primary); outline: 2px solid var(--c-primary-light); }
/* Honeypot: hidden from humans but present for bots. Uses the visually-hidden
   clip technique — NOT off-screen offset, which extends the scroll region and
   caused horizontal overflow (leftward in RTL). */
.hp-field {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
}
.form-status { min-height: 1.5em; margin: 0.5rem 0 0; font-weight: 600; }
.form-status.ok { color: var(--c-accent); }
.form-status.err { color: #c0392b; }
.form-alt { font-size: 0.9rem; margin: 0.5rem 0 0; color: var(--c-text-soft); }
@media (min-width: 800px) {
  .lead-inner { grid-template-columns: 1fr 1fr; align-items: center; }
}

/* ===== Footer ===== */
.site-footer { background: #0b2a3d; color: #cfe2ee; padding: 2.5rem 0 1rem; }
.site-footer a { color: #9fc9e3; }
.footer-grid { display: grid; gap: 2rem; }
.footer-title { font-size: 1.05rem; color: #fff; margin: 0 0 0.6rem; }
.footer-nav, .footer-contact { list-style: none; margin: 0; padding: 0; }
.footer-nav li, .footer-contact li { margin-bottom: 0.35rem; }
.footer-nav a, .footer-contact a { text-decoration: none; }
.footer-nav a:hover, .footer-contact a:hover { text-decoration: underline; }
.footer-disclaimer { font-size: 0.85rem; opacity: 0.75; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 2rem; padding-top: 1rem; font-size: 0.85rem; opacity: 0.8; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

/* ===== Mobile CTA bar ===== */
.mobile-cta {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 250;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  background: #fff; border-top: 1px solid var(--c-border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
}
.mcta {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 10px; text-decoration: none; font-size: 0.78rem; font-weight: 600;
}
.mcta-call { color: var(--c-primary); }
.mcta-wa { color: var(--c-wa-dark); }
.mcta-form { color: var(--c-accent); }
@media (min-width: 1000px) { .mobile-cta { display: none; } }

/* ===== Accessibility widget ===== */
/* z-index below .mobile-cta (250) so the call/WhatsApp bar always stays on top */
.a11y { position: fixed; top: 40%; inset-inline-start: 0; z-index: 240; }
.a11y-toggle {
  background: var(--c-primary); color: #fff; border: 0; cursor: pointer;
  padding: 0.6rem; border-radius: 0 8px 8px 0; display: flex;
}
.a11y-panel {
  position: absolute; top: 0; inset-inline-start: 100%; margin-inline-start: 4px;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 0.75rem; width: 190px;
  display: flex; flex-direction: column; gap: 0.25rem;
  /* never reach the bottom CTA bar: widget starts at 40vh, bar is ~64px,
     so cap at the remaining space minus a margin; scroll inside */
  max-height: calc(60vh - 80px); overflow-y: auto;
}
/* the hidden attribute must always win over display:flex above */
.a11y-panel[hidden] { display: none; }
.a11y-title { font-weight: 700; margin: 0 0 0.25rem; font-size: 0.95rem; }
.a11y-panel button {
  background: var(--c-bg-alt); border: 1px solid var(--c-border); border-radius: 6px;
  padding: 0.4rem 0.6rem; font-family: inherit; font-size: 0.88rem; cursor: pointer;
  text-align: start; color: var(--c-text);
}
.a11y-panel button:hover { background: var(--c-primary-light); }
.a11y-panel button[aria-pressed="true"] { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.a11y-panel a { font-size: 0.85rem; margin-top: 0.25rem; }

/* Accessibility modes (classes set on <html>) */
.a11y-grayscale body { filter: grayscale(1); }
.a11y-negative body { filter: invert(1) hue-rotate(180deg); }
.a11y-negative body img, .a11y-negative body video { filter: invert(1) hue-rotate(180deg); }
.a11y-high-contrast { --c-text: #000; --c-text-soft: #1a1a1a; --c-primary: #003a63; --c-primary-dark: #002540; --c-border: #555; }
.a11y-light-bg { --c-bg: #fff; --c-bg-alt: #fff; --c-primary-light: #fff; }
.a11y-light-bg .hero, .a11y-light-bg .lead-section { background: #fff; color: var(--c-text); }
.a11y-light-bg .hero a.btn, .a11y-light-bg .lead-section a { color: var(--c-primary); }
.a11y-underline a { text-decoration: underline !important; }
.a11y-readable body, .a11y-readable body * { font-family: Arial, 'Segoe UI', sans-serif !important; letter-spacing: 0.02em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== 404 ===== */
.page-404 { text-align: center; padding: 4rem 1rem; }
.page-404 h1 { color: var(--c-primary-dark); }
