/* ============================================================
   HEADER — treatments dropdown + Figma / cross-page alignment

   1) The "טיפולים" menu item drops a panel of four cards (below).
   2) Mobile header alignment to the Figma mobile frame
      (file iH7lrJTBwzkWNpYS9tpofV, header nodes 460:67356/67357/67360/67370,
      bar rect 1182:2557) — see the ≤767 block.
   3) Header top-gap: unified to 30px for tablet + desktop (≥768) — see the
      min-width:768 block at the end. Mobile (≤767) keeps 25px.

   Loaded globally (header shows on every page); handle
   `dmc-treatments-menu` is in the dmc_cleanup_styles_completely()
   allow-list.
   ============================================================ */

/* ---- Panel: one centred row of four, with a clear gap up top ---- */
#dmc-header .dmc-nav-list li .sub-menu.dmc-treat-submenu {
  direction: rtl !important;
  width: 1214px !important;
  padding: 128px 20px 44px !important;
  gap: 18px !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
}

#dmc-header .dmc-nav-list li .sub-menu.dmc-treat-submenu > li.dmc-treat-item {
  flex: 0 0 280px !important;
  max-width: 280px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* ---- Card wrapper — outer white card, the homepage hero card exactly:
        280 x 199 (.dmc-hero__card, measured). It was 176 tall here, and
        because the bubble below is an SVG drawn with
        preserveAspectRatio="none", 23px less height squashed the whole shape
        vertically — the notch around the arrow came out shallower and the
        dotted frame round the bubble read differently from the hero.
        Same 199 now, even without a description line, so the notch, the
        14 / 13.5px frame and the dots are the hero's own values. ---- */
.dmc-tmc {
  position: relative;
  display: block;
  width: 280px;
  height: 199px;
  background: #FFF;
  border-radius: 30px;
  box-shadow: 0 7px 30px 0 rgba(8, 76, 153, 0.10);
  overflow: hidden;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.dmc-tmc:hover {
  transform: translateY(-5px);
}

/* Layer 1 — dashed dots, top-right, full card height (like the hero) */
.dmc-tmc__dots {
  position: absolute;
  top: 0;
  right: 0;
  width: 140px;
  height: 199px;
  z-index: 0;
  pointer-events: none;
}

.dmc-tmc__dots img {
  display: block;
  width: 140px;
  height: 199px;
}

/* Layer 2 — white speech bubble, centred. 253x171 in a 280x199 card leaves
   13.5px at the sides and 14px top and bottom — the hero's frame. */
.dmc-tmc__bubble {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 253px;
  height: 171px;
  z-index: 1;
}

.dmc-tmc__bubble-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 253px;
  height: 171px;
  z-index: 0;
  fill: #FFF;
  filter: drop-shadow(0 7px 30px rgba(8, 76, 153, 0.10));
}

/* Content overlay inside the bubble */
.dmc-tmc__content {
  position: absolute;
  top: 0;
  left: 0;
  width: 253px;
  height: 171px;
  z-index: 2;
}

/* Title — top-right of bubble (no description line). line-height: normal
   as on .dmc-hero__card-title. */
.dmc-tmc__title {
  position: absolute;
  top: 20px;
  right: 16px;
  left: 56px;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  line-height: normal;
  color: #283565;
  text-align: right;
  margin: 0;
}

.dmc-tmc__title .dmc-hero__card-sub {
  font-weight: 600;
}

/* Arrow circle — bottom-left corner, sitting in the bubble notch */
.dmc-tmc__arrow {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #087CF5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dmc-tmc__arrow svg {
  width: 17px;
  height: 16px;
}

/* Reuse the hero card's arrow flourish (keyframes in home-v2.css) */
.dmc-tmc:hover .dmc-tmc__arrow svg {
  animation: dmcCardArrowOutIn .5s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .dmc-tmc,
  .dmc-tmc:hover {
    transition: none;
    transform: none;
  }
  .dmc-tmc:hover .dmc-tmc__arrow svg {
    animation: none;
  }
}

/* ---- Mobile / tablet: panel goes static & column (home-v2.css ≤1024).
        The fixed-size bubble and dots don't scale, so the card flattens
        into a full-width row: title on the right, arrow on the left. ---- */
@media (max-width: 1024px) {
  #dmc-header .dmc-nav-list li .sub-menu.dmc-treat-submenu {
    direction: rtl !important;
    width: 100% !important;
    padding: 12px 16px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    flex-direction: column !important;
  }

  #dmc-header .dmc-nav-list li .sub-menu.dmc-treat-submenu > li.dmc-treat-item {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  .dmc-tmc {
    width: 100%;
    height: auto;
    min-height: 60px;
    border-radius: 14px;
    background: #F4F9FF;
    box-shadow: none;
  }

  .dmc-tmc:hover {
    transform: none;
  }

  .dmc-tmc__dots,
  .dmc-tmc__bubble-bg {
    display: none;
  }

  .dmc-tmc__bubble {
    position: static;
    transform: none;
    width: 100%;
    height: auto;
  }

  .dmc-tmc__content {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    box-sizing: border-box;
  }

  .dmc-tmc__title {
    position: static;
    inset: auto;
    font-size: 16px;
    line-height: 1.3;
    text-align: right;
  }

  .dmc-tmc__arrow {
    position: static;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }
}

/* ============================================================
   MOBILE HEADER — 100% match to the Figma mobile frame (390px)

   Figma redlines (frame 390 wide):
     bar (Rectangle 1684)      360 x 71, x15 y19  -> 15px side margins
     logo lockup (Group 290)   203 wide (text 151), right edge x345 -> 30px from bar right
     triangle icon (Group 288) 45.05 x 36.83
     hamburger (Group 412)     25 x 20, x44 -> 29px from bar left, vertically centred

   The logo is one SVG (logo.svg, viewBox 277x51: text x0-206, triangle
   x215.5-277 = 61.47 wide). Rendering it 203px wide makes the triangle
   exactly 45.05 x 36.83 and the text 151 wide.

   `body`-prefixed + !important so these beat the homepage's inline
   `#dmc-header.dmc-header` rules and style.css's
   `#dmc-header .dmc-header__logo img` (which otherwise pins the logo 170px).
   `top` is set to 25px per client request (mobile only; tablet+desktop = 30px).
   ============================================================ */
@media (max-width: 767px) {
  body #dmc-header.dmc-header {
    height: 71px !important;
    top: 25px !important;
    left: 15px !important;
    right: 15px !important;
    padding: 0 30px 0 29px !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  /* Logo lockup — 203px makes the triangle 45.05 x 36.83 (Figma) */
  body #dmc-header .dmc-header__logo img {
    width: 203px !important;
    height: auto !important;
  }

  /* Hamburger — bare 25x20 icon, no button container/padding/background */
  body #dmc-header .dmc-header__hamburger {
    width: 25px !important;
    min-width: 0 !important;
    height: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: stretch !important;
  }

  body #dmc-header .dmc-header__hamburger span {
    width: 25px !important;
    height: 2px !important;
    margin: 0 !important;
  }
}

/* ============================================================
   HEADER TOP-GAP — uniform across tablet + desktop (≥768)

   The header's distance from the top of the screen differed by page/width:
   the homepage sat at top:80px (inline style in
   template-parts/global-header.php) while inner pages sat at 30px (>1200),
   a style.css `#dmc-header.dmc-header{top:80}` @≤1200 pushed all pages to 80
   in the 1026-1200 band, and tablet (768-1025) sat at ~14px. This forces a
   single 30px gap for every page/template from 768px up, matching the
   "המרפאות שלנו" (clinics) page. Specificity `body #dmc-header.dmc-header`
   (1,1,1) + !important beats the element inline style and the class-only
   !important rules. Mobile (≤767) keeps its own 25px above.
   ============================================================ */
@media (min-width: 768px) {
  body #dmc-header.dmc-header {
    top: 30px !important;
  }
}

/* ============================================================
   CARD LINK WRAPPER (treatments-menu-links.php)

   Each dropdown card is wrapped in <a class="dmc-tmc-link"> so the whole card
   links to its department page. display:contents makes the anchor a
   layout-transparent pass-through: it generates no box, so it does NOT inherit
   the generic submenu <a> styles (padding/background/flex) that otherwise broke
   the card. The card's own visuals and hover, and the link's clickability, are
   unchanged. High specificity + !important so it wins over the menu-link rules.
   ============================================================ */
#dmc-header .dmc-nav-list li .sub-menu.dmc-treat-submenu > li.dmc-treat-item > a.dmc-tmc-link {
  display: contents !important;
}
