/* ============================================================
   POST / CHILD-PAGE TEMPLATE STYLES (efrat-kedar v5)
   Used for any page child of a category, and for blog posts.
   ============================================================ */

/* ===== Hero (smaller variant, breadcrumbs + title) ===== */
.post-hero {
  position: relative;
  padding: 110px 56px 50px;
  background: var(--cream);
  overflow: hidden;
  isolation: isolate;
}
.post-hero::before {
  /* subtle gradient veil */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(212,115,94,0.10), transparent 60%),
    radial-gradient(55% 90% at 0% 100%, rgba(44,95,93,0.10), transparent 60%);
  z-index: -1;
}
.post-hero-bot {
  position: absolute;
  width: 180px;
  height: auto;
  opacity: .45;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
}
.post-hero-bot.bot-tl {
  bottom: 0; left: 0;
  transform: rotate(-8deg) translateY(8%);
  transform-origin: bottom left;
}
.post-hero-bot.bot-br {
  bottom: 0; right: 0;
  width: 200px;
  transform: rotate(8deg) translateY(8%);
  transform-origin: bottom right;
  opacity: .35;
}
.post-hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding-inline-end: 404px; /* reserve space for the sidebar column below (340 + 64 gap) */
  position: relative;
}
.post-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.post-crumbs a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .2s ease;
}
.post-crumbs a:hover { color: var(--terracotta); }
.post-crumbs .sep { color: rgba(44,95,93,0.4); margin: 0 2px; flex-shrink: 0; }
.post-crumbs .current { color: var(--teal); font-weight: 600; }

.post-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--teal);
  margin: 0;
  max-width: 22ch;
}
.post-hero h1 em {
  font-style: normal;
  color: var(--terracotta);
}
.post-hero .post-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 700;
  margin-bottom: 14px;
}
.post-hero .post-eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--terracotta);
}
.post-hero .post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--ink-mute);
  margin-top: 8px;
}
.post-hero .post-meta-sep {
  width: 4px; height: 4px; background: var(--ink-mute); border-radius: 50%;
}

/* ===== Main grid: content + sticky sidebar ===== */
.post-main {
  padding: 70px 56px 100px;
  background: #fff;
}
.post-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 64px;
  align-items: start;
}

/* ===== Article content typography ===== */
.post-article {
  min-width: 0;
  font-size: 17px;
  line-height: 1.85;
  color: #2A4847;
}
.post-article > *:first-child { margin-top: 0; }
.post-article p {
  margin: 0 0 22px;
}
.post-article strong { color: var(--teal); font-weight: 700; }
.post-article a {
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .2s ease;
}
.post-article a:hover { color: var(--terracotta-deep); }

.post-article h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--teal);
  margin: 50px 0 18px;
  position: relative;
  padding-right: 18px;
  scroll-margin-top: 180px;
}
.post-article h2::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 0;
  bottom: 8px;
  width: 4px;
  background: linear-gradient(180deg, var(--terracotta), var(--pink));
  border-radius: 2px;
}
/* Center-aligned H2 = callout/contact-card style (e.g., legacy "התקשרו אלי" CTAs) */
.post-article h2[style*="center"] {
  text-align: center;
  padding: 30px 28px;
  margin: 40px 0;
  background: linear-gradient(160deg, var(--cream) 0%, #fff 100%);
  border: 1px solid rgba(201,166,160,0.35);
  border-radius: var(--r-md);
  box-shadow: 0 14px 36px -22px rgba(44,95,93,0.28);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.45;
}
.post-article h2[style*="center"]::before { display: none; }
.post-article h2[style*="center"] a { color: var(--terracotta); }
.post-article h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.3;
  color: var(--teal-deep);
  margin: 36px 0 14px;
  scroll-margin-top: 180px;
}
.post-article h4 {
  font-size: 18px;
  color: var(--terracotta);
  margin: 28px 0 10px;
  font-weight: 700;
}
.post-article ul, .post-article ol {
  padding-right: 22px;
  margin: 0 0 22px;
}
.post-article li { margin-bottom: 8px; }
.post-article ul li::marker { color: var(--terracotta); }
.post-article ol li::marker { color: var(--terracotta); font-weight: 700; }

.post-article blockquote {
  margin: 32px 0;
  padding: 26px 32px 26px 32px;
  background: var(--cream);
  border-radius: var(--r-md);
  border-right: 4px solid var(--terracotta);
  font-size: 17.5px;
  font-style: italic;
  color: var(--teal);
  line-height: 1.7;
}
.post-article blockquote p:last-child { margin-bottom: 0; }

.post-article img,
.post-article figure img,
.post-article .wp-block-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: 26px 0;
  box-shadow: 0 14px 40px -22px rgba(44,95,93,0.30);
}
.post-article figure { margin: 26px 0; }
.post-article figure figcaption {
  font-size: 13.5px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

.post-article hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,166,160,0.5), transparent);
  margin: 40px 0;
}

.post-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15.5px;
}
.post-article table th,
.post-article table td {
  padding: 12px 14px;
  border: 1px solid rgba(201,166,160,0.3);
  text-align: right;
}
.post-article table thead th {
  background: var(--cream);
  color: var(--teal);
  font-weight: 700;
}

/* ===== Sidebar (sticky) ===== */
.post-aside {
  position: sticky;
  top: 116px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-aside-card {
  background: #fff;
  border: 1px solid rgba(201,166,160,0.25);
  border-radius: var(--r-md);
  padding: 22px 24px;
  box-shadow: 0 8px 30px -18px rgba(44,95,93,0.25);
}

/* TOC */
.post-toc-card {
  position: relative;
  overflow: hidden;
}
.post-toc-card .post-aside-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--teal);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(201,166,160,0.25);
}
.post-toc-card .post-aside-head::before {
  content: '';
  width: 4px; height: 18px;
  background: var(--terracotta);
  border-radius: 2px;
}
.post-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14.5px;
  max-height: 360px;
  overflow-y: auto;
}
.post-toc-list li { margin-bottom: 4px; }
.post-toc-list li.is-h3 { padding-right: 14px; font-size: 13.5px; }
.post-toc-list a {
  display: block;
  padding: 7px 12px 7px 10px;
  border-right: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 0 6px 6px 0;
  transition: all .2s ease;
  line-height: 1.4;
}
.post-toc-list a:hover {
  background: var(--cream);
  color: var(--teal);
}
.post-toc-list a.is-active {
  background: var(--cream);
  color: var(--terracotta);
  border-right-color: var(--terracotta);
  font-weight: 600;
}

/* Author card */
.post-author-card {
  background: linear-gradient(160deg, var(--cream) 0%, #fff 60%);
  border: 1px solid rgba(201,166,160,0.3);
  border-radius: var(--r-md);
  padding: 24px 22px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.post-author-card .author-bot {
  position: absolute;
  top: 6px; left: 6px;
  width: 78px;
  opacity: .28;
  transform: rotate(-12deg);
  pointer-events: none;
}
.post-author-card .author-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  margin: 0 auto 14px;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px -8px rgba(44,95,93,0.4);
  position: relative;
  z-index: 1;
}
.post-author-card .author-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--teal);
  margin: 0 0 4px;
}
.post-author-card .author-role {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0 0 16px;
}
.post-author-card .author-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--terracotta);
  font-weight: 700;
  text-decoration: none;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  direction: ltr;
}
.post-author-card .author-phone:hover { color: var(--terracotta-deep); }
.post-author-card .author-phone svg { flex-shrink: 0; }
.post-author-card .author-hours {
  font-size: 13px;
  color: var(--ink-mute);
  border-top: 1px solid rgba(201,166,160,0.25);
  padding-top: 12px;
  margin-top: 4px;
  line-height: 1.5;
}
.post-author-card .author-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 11px 20px;
  background: var(--terracotta);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  transition: background .2s ease, transform .2s ease;
  width: 100%;
}
.post-author-card .author-cta:hover {
  background: var(--terracotta-deep);
  transform: translateY(-1px);
}

/* Mini-form on sidebar */
.post-form-card .post-aside-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--teal);
  margin: 0 0 6px;
}
.post-form-card .post-aside-head::before {
  content: '';
  width: 4px; height: 18px;
  background: var(--terracotta);
  border-radius: 2px;
}
.post-form-card p.lead {
  font-size: 13.5px;
  color: var(--ink-mute);
  margin: 0 0 14px;
  line-height: 1.55;
}
.post-form-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-form-card input,
.post-form-card textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(201,166,160,0.4);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14.5px;
  background: #fff;
  color: var(--teal);
  transition: border-color .2s ease;
  text-align: right;
  direction: rtl;
}
.post-form-card input[type="tel"],
.post-form-card input[type="email"] {
  /* still RTL placeholder, but actual input is LTR for proper digit/email rendering */
  direction: rtl;
  text-align: right;
}
.post-form-card input[type="tel"]:not(:placeholder-shown),
.post-form-card input[type="email"]:not(:placeholder-shown) {
  direction: ltr;
  text-align: right;
}
.post-form-card input::placeholder,
.post-form-card textarea::placeholder {
  text-align: right;
  direction: rtl;
  color: rgba(44,95,93,0.45);
}
.post-form-card input:focus,
.post-form-card textarea:focus {
  outline: none;
  border-color: var(--terracotta);
}
.post-form-card textarea {
  min-height: 80px;
  resize: vertical;
}
.post-form-card button {
  margin-top: 4px;
  padding: 12px 18px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease;
}
.post-form-card button:hover { background: var(--teal-deep); }

/* ===== Siblings carousel ===== */
.post-siblings {
  background: var(--cream);
  padding: 90px 56px 100px;
  position: relative;
  overflow: hidden;
}
.post-siblings::before {
  content: '';
  position: absolute;
  top: 30px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(closest-side, rgba(212,115,94,0.18), transparent 70%);
  pointer-events: none;
}
.post-siblings-bot {
  position: absolute;
  top: 24px; left: 32px;
  width: 130px;
  height: auto;
  opacity: .35;
  transform: rotate(-14deg);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
@media (max-width: 980px) {
  .post-siblings-bot { width: 90px; top: 14px; left: 16px; }
}
.post-siblings-inner {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
}
.post-siblings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}
.post-siblings-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
  margin: 8px 0 0;
  color: var(--teal);
  letter-spacing: -0.02em;
  max-width: 24ch;
}
.post-siblings-head h2 em { font-style: normal; color: var(--terracotta); }
.post-siblings-controls {
  display: flex;
  gap: 8px;
}
.post-siblings-controls button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(44,95,93,0.2);
  background: #fff;
  color: var(--teal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  /* Prevent the browser from interpreting rapid taps on the arrow as
     a double-tap-to-zoom gesture on mobile. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.post-siblings-controls button:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.post-siblings-controls button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.post-siblings-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 12px;
  scrollbar-width: none;
}
.post-siblings-track::-webkit-scrollbar { display: none; }

.post-sibling-card {
  flex: 0 0 calc((100% - 66px) / 4);
  min-width: 280px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid rgba(201,166,160,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  text-decoration: none;
  color: inherit;
}
.post-sibling-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(44,95,93,0.35);
  border-color: var(--pink);
}
.post-sibling-card .ph {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--pink-whisper), var(--cream-deep));
  background-size: cover;
  background-position: center;
}
.post-sibling-card .body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.post-sibling-card .cat-tag {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 700;
}
.post-sibling-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.3;
  color: var(--teal);
  margin: 0;
  letter-spacing: -0.01em;
}
.post-sibling-card .sub {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(44, 95, 93, 0.78);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-sibling-card .more {
  margin-top: auto;
  padding-top: 10px;
  font-size: 13.5px;
  color: var(--terracotta);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.post-sibling-card .more svg {
  transition: transform .2s ease;
}
.post-sibling-card:hover .more svg { transform: translateX(-3px); }

/* ===== Mobile ===== */
@media (max-width: 980px) {
  .post-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .post-aside {
    position: static;
    order: 2;
  }
  .post-toc-card { display: none; }
  .post-hero-inner { padding-inline-end: 0; }
  .post-hero { padding: 96px 22px 36px; }
  .post-main { padding: 50px 22px 70px; }
  .post-siblings { padding: 70px 22px 80px; }
  .post-siblings-track {
    margin-right: -22px;
    padding-right: 22px;
  }
  .post-sibling-card { flex-basis: 280px; }
  .post-hero h1 { font-size: clamp(26px, 6.6vw, 34px); }
  .post-hero-bot { width: 110px; opacity: .35; }
  .post-hero-bot.bot-br { width: 130px; }
}
