/**
 * Press article inline media — Figma sizes for landscape (598×291) and portrait (362×504).
 * Alignment + resize classes are set from the press admin TinyMCE toolbar.
 */

.press-media {
  display: block;
  margin: 24px 0;
  max-width: 100%;
}

.press-media--align-start {
  margin-inline-end: auto;
  margin-inline-start: 0;
}

.press-media--align-center {
  margin-inline: auto;
}

.press-media--align-end {
  margin-inline-start: auto;
  margin-inline-end: 0;
}

/* Videos are always centered on their line. */
.press-media--video {
  margin-inline: auto !important;
}

.press-media--landscape {
  width: min(598px, 100%);
}

.press-media--portrait {
  width: min(362px, 100%);
}

.press-media--square,
.press-media--circle {
  width: min(504px, 100%);
}

.press-media--wide,
.press-media--standard,
.press-media--original {
  width: min(598px, 100%);
}

.press-media--w-50 {
  width: 50% !important;
}

.press-media--w-75 {
  width: 75% !important;
}

.press-media img,
.press-media video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  object-fit: cover;
}

.press-media--landscape img,
.press-media--landscape video {
  aspect-ratio: 598 / 291;
}

.press-media--portrait img {
  aspect-ratio: 362 / 504;
}

.press-media--square img {
  aspect-ratio: 1;
}

.press-media--circle img {
  aspect-ratio: 1;
  border-radius: 50%;
}

.press-media--wide img {
  aspect-ratio: 16 / 9;
}

.press-media--standard img {
  aspect-ratio: 4 / 3;
}

.press-media--original img {
  aspect-ratio: auto;
  object-fit: contain;
}

.press-media iframe {
  width: 100%;
  aspect-ratio: 598 / 291;
  border: 0;
  border-radius: 16px;
  display: block;
}

@media (max-width: 768px) {
  .press-media {
    margin: 20px 0;
  }

  .press-media--landscape,
  .press-media--portrait,
  .press-media--square,
  .press-media--circle,
  .press-media--wide,
  .press-media--standard,
  .press-media--original {
    width: 100%;
  }
}

/* Multi-image gallery (Classic editor toolbar — like WP Gallery block) */
.press-gallery {
  display: block;
  margin: 24px 0;
  max-width: 100%;
}

.press-gallery__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(var(--press-gallery-cols, 3), minmax(0, 1fr));
}

.press-gallery--cols-1 { --press-gallery-cols: 1; }
.press-gallery--cols-2 { --press-gallery-cols: 2; }
.press-gallery--cols-3 { --press-gallery-cols: 3; }
.press-gallery--cols-4 { --press-gallery-cols: 4; }
.press-gallery--cols-5 { --press-gallery-cols: 5; }
.press-gallery--cols-6 { --press-gallery-cols: 6; }
.press-gallery--cols-7 { --press-gallery-cols: 7; }
.press-gallery--cols-8 { --press-gallery-cols: 8; }

.press-gallery__item {
  margin: 0;
  position: relative;
  z-index: 0;
}

.press-gallery__item img,
.press-gallery__item video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg, 16px);
  object-fit: cover;
  aspect-ratio: 1;
  cursor: zoom-in;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  transform-origin: center center;
  will-change: transform;
}

.press-gallery__item--video {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-lg, 16px);
  background: #111;
  cursor: pointer;
}

.press-gallery__item--video .press-gallery__poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.press-gallery__item--video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: #111;
  pointer-events: none;
}

.press-gallery__item--video::after {
  content: "";
  position: absolute;
  inset-inline-end: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(19, 51, 54, 0.86)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polygon fill='white' points='9,6 9,18 19,12'/></svg>")
    center / 14px 14px no-repeat;
  pointer-events: none;
}

.press-gallery__link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.press-gallery__item--link img {
  cursor: pointer;
}

.press-gallery__item--link::after {
  content: "";
  position: absolute;
  inset-inline-end: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full, 50%);
  background: var(--color-primary)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='white' d='M14 3h7v7h-2V6.41l-9.29 9.3-1.42-1.42 9.3-9.29H14V3zM5 5h6v2H7v10h10v-4h2v6H5V5z'/></svg>")
    center / 14px 14px no-repeat;
  pointer-events: none;
}

.press-gallery__link:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-lg, 16px);
}

.press-gallery__item:hover {
  z-index: 2;
}

.press-gallery__item:hover img,
.press-gallery__item:hover video,
.press-gallery__item:hover .press-gallery__poster {
  transform: scale(1.08);
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.14));
}

/* Lightbox — enlarged image floating above the page */
.press-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.82);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.press-gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.press-gallery-lightbox__stage {
  position: relative;
  max-width: min(920px, 92vw);
  max-height: min(82vh, 920px);
  transform: scale(0.94);
  transition: transform 0.28s ease;
}

.press-gallery-lightbox.is-open .press-gallery-lightbox__stage {
  transform: scale(1);
}

.press-gallery-lightbox__img,
.press-gallery-lightbox__video {
  display: none;
  max-width: min(920px, 92vw);
  max-height: min(82vh, 920px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sheet, 0 12px 40px rgba(0, 0, 0, 0.18));
  object-fit: contain;
  background: #000;
}

.press-gallery-lightbox__img.is-active,
.press-gallery-lightbox__video.is-active {
  display: block;
}

.press-gallery-lightbox__close,
.press-gallery-lightbox__prev,
.press-gallery-lightbox__next {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s ease;
}

.press-gallery-lightbox__close:hover,
.press-gallery-lightbox__prev:hover,
.press-gallery-lightbox__next:hover {
  background: rgba(255, 255, 255, 0.24);
}

.press-gallery-lightbox__close {
  top: 16px;
  inset-inline-end: 16px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full, 50%);
  font-size: 28px;
}

.press-gallery-lightbox__prev,
.press-gallery-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full, 50%);
  font-size: 32px;
}

.press-gallery-lightbox__prev {
  inset-inline-start: 16px;
}

.press-gallery-lightbox__next {
  inset-inline-end: 16px;
}

body.press-gallery-lightbox-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .press-gallery {
    margin: 20px 0;
  }

  .press-gallery__grid {
    gap: 12px;
  }

  .press-gallery--cols-3,
  .press-gallery--cols-4,
  .press-gallery--cols-5,
  .press-gallery--cols-6,
  .press-gallery--cols-7,
  .press-gallery--cols-8 {
    --press-gallery-cols: 2;
  }

  .press-gallery__item:hover img,
  .press-gallery__item:hover video {
    transform: scale(1.04);
  }

  .press-gallery-lightbox__prev,
  .press-gallery-lightbox__next {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

/* Content tables — match .branches-table on לשכות / inner pages */
.press-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
}

.press-table,
.press-table-scroll .branches-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  direction: rtl;
  text-align: right;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #c1c8c8);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
}

.press-table caption {
  caption-side: bottom;
  padding: 10px 4px 0;
  font-size: var(--fs-label, 14px);
  color: var(--color-text-muted, #5d5f5f);
  text-align: right;
}

.press-table th,
.press-table td,
.press-table-scroll .branches-table th,
.press-table-scroll .branches-table td {
  padding: 14px 20px;
  vertical-align: middle;
  font-size: var(--fs-body, 16px);
  color: var(--color-text, #133336);
  text-align: right;
  direction: rtl;
  unicode-bidi: isolate;
  line-height: 1.5;
  min-width: 0;
  max-width: 0;
  min-height: 2.2em;
  border: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  hyphens: none;
}

.press-table tr[style*="height"] > th,
.press-table tr[style*="height"] > td,
.press-table-scroll .branches-table tr[style*="height"] > th,
.press-table-scroll .branches-table tr[style*="height"] > td {
  height: inherit;
  min-height: 0;
}

.press-table thead th,
.press-table-scroll .branches-table thead th {
  background: var(--color-primary-dark, #133336);
  color: var(--color-white, #fff);
  font-weight: var(--fw-bold, 700);
  padding: 16px 20px;
  letter-spacing: 0.02em;
}

.press-table tbody tr:nth-child(even),
.press-table-scroll .branches-table tbody tr:nth-child(even) {
  background: var(--color-bg-light, #fafaf8);
}

.press-table tbody tr:hover,
.press-table-scroll .branches-table tbody tr:hover {
  background: var(--color-bg, #fff);
}

.press-table tfoot td {
  font-weight: var(--fw-bold, 700);
  background: var(--color-bg-light, #fafaf8);
}

.press-table td[data-cell-href],
.press-table th[data-cell-href],
.press-table-scroll .branches-table td[data-cell-href],
.press-table-scroll .branches-table th[data-cell-href] {
  cursor: pointer;
  padding-inline-end: 36px;
  position: relative;
}

.press-table td[data-cell-href]::after,
.press-table th[data-cell-href]::after,
.press-table-scroll .branches-table td[data-cell-href]::after,
.press-table-scroll .branches-table th[data-cell-href]::after {
  content: "";
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background-color: var(--color-primary, #133336);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M14 3h7v7h-2V6.41l-9.29 9.3-1.42-1.42 9.3-9.29H14V3zM5 5h6v2H7v10h10v-4h2v6H5V5z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M14 3h7v7h-2V6.41l-9.29 9.3-1.42-1.42 9.3-9.29H14V3zM5 5h6v2H7v10h10v-4h2v6H5V5z'/></svg>") center / contain no-repeat;
}

.press-table td.press-table-cell--file::after,
.press-table th.press-table-cell--file::after,
.press-table-scroll .branches-table td.press-table-cell--file::after,
.press-table-scroll .branches-table th.press-table-cell--file::after {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16.5 6.75v8.25a4.5 4.5 0 1 1-9 0V6a3 3 0 1 1 6 0v8.25a1.5 1.5 0 1 1-3 0V7.5h1.5v6.75a.75.75 0 0 0 1.5 0V6a4.5 4.5 0 1 0-9 0v9a6 6 0 0 0 12 0V6.75H16.5z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16.5 6.75v8.25a4.5 4.5 0 1 1-9 0V6a3 3 0 1 1 6 0v8.25a1.5 1.5 0 1 1-3 0V7.5h1.5v6.75a.75.75 0 0 0 1.5 0V6a4.5 4.5 0 1 0-9 0v9a6 6 0 0 0 12 0V6.75H16.5z'/></svg>") center / contain no-repeat;
}

.press-table td[data-cell-href],
.press-table th[data-cell-href],
.press-table-scroll .branches-table td[data-cell-href],
.press-table-scroll .branches-table th[data-cell-href] {
  color: var(--color-primary-blue, #0048ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.press-table a,
.press-table-scroll .branches-table a {
  color: var(--color-primary-blue, #0048ff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.press-table td[data-cell-href]::after,
.press-table th[data-cell-href]::after,
.press-table-scroll .branches-table td[data-cell-href]::after,
.press-table-scroll .branches-table th[data-cell-href]::after {
  background-color: var(--color-primary-blue, #0048ff);
}

.press-table td.press-table-cell--split,
.press-table th.press-table-cell--split,
.press-table-scroll .branches-table td.press-table-cell--split,
.press-table-scroll .branches-table th.press-table-cell--split {
  padding: 0;
  vertical-align: top;
}

.press-table-split {
  width: 100%;
  height: auto;
  table-layout: fixed;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  border-collapse: collapse;
  direction: rtl;
}

.press-table-split tbody tr,
.press-table-split tbody tr:nth-child(even),
.press-table-split tbody tr:hover {
  background: transparent;
}

.press-table-split td,
.press-table-split th {
  padding: 14px 20px;
  border: 0;
  border-inline-start: 1px solid var(--color-border, #c1c8c8);
  border-top: 1px solid var(--color-border, #c1c8c8);
  background: transparent;
  vertical-align: middle;
  text-align: right;
  min-width: 0;
  max-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
}

.press-table-split tr[style*="height"] > td,
.press-table-split tr[style*="height"] > th {
  height: inherit;
  min-height: 0;
}

.press-table-split tr > :first-child {
  border-inline-start: 0;
}

.press-table-split tr:first-child > * {
  border-top: 0;
}

@media (max-width: 768px) {
  .press-table-scroll {
    margin: 20px 0;
    overflow-x: auto;
  }

  .press-table-scroll > table.press-table {
    width: 100%;
  }
}
