/* ===========================================================================
   gamos-events-tabs.css — סוגי אירועים: TABS + PHOTO MOSAIC (2026-10-28)
   Tab row on top; one panel per event type: a large 3:2 photo with up to
   three 3:2 thumbnails under it, and the copy + CTA beside it (below on
   phones). Frames carry the photos' own 3:2 ratio, so nothing is cropped.
   Static-first: before gamos-events-tabs.js adds .is-ready, every panel is
   shown in order. Motion is opacity/transform only; reduced-motion safe.
   ========================================================================= */

.evt {
  padding-block: var(--section-pad, clamp(64px, 9vw, 140px));
  padding-inline: var(--gutter, clamp(20px, 5vw, 72px));
  background: var(--bg, #f5efe6);
  overflow: clip;
}
.evt .section-header {
  max-inline-size: var(--container-narrow, 760px);
  margin-inline: auto;
  text-align: center;
  margin-block-end: clamp(24px, 3.2vw, 44px);
}

/* TABS -------------------------------------------------------------------- */
.evt__tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px clamp(4px, 1vw, 10px);
  max-inline-size: var(--container-wide, 1280px);
  margin: 0 auto clamp(28px, 3.6vw, 52px);
  padding-block-end: 2px;
}
.evt__tab {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border, rgba(26, 20, 16, 0.12));
  border-radius: 999px;
  padding: 0.62em 1.25em;
  font: inherit;
  font-size: clamp(0.95rem, 1.05vw, 1.05rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--cocoa, #534133);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.evt__tab:hover { border-color: var(--brass, #CFAE83); }
.evt__tab[aria-selected="true"] {
  background: var(--cocoa, #534133);
  border-color: var(--cocoa, #534133);
  color: var(--ivory, #F5EFE6);
}
.evt__tab:focus-visible { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px #CFAE83); }
/* Before JS: the tab row is only a table of contents. */
.evt:not(.is-ready) .evt__tabs { display: none; }

/* PANEL ------------------------------------------------------------------- */
.evt__panels { max-inline-size: var(--container-wide, 1280px); margin-inline: auto; }
.evt__panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 2.6vw, 48px);
  align-items: center;
}
.evt:not(.is-ready) .evt__panel + .evt__panel { margin-block-start: clamp(48px, 6vw, 88px); }
.evt.is-ready .evt__panel[hidden] { display: none; }
.evt.is-ready .evt__panel.is-entering { animation: evt-in 0.5s var(--ease-out-cinema, cubic-bezier(0.2, 0.8, 0.2, 1)) both; }
@keyframes evt-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (min-width: 900px) {
  /* Mosaic on the visual left (second in RTL source order), copy on the right. */
  .evt__panel { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.45fr); }
  .evt__copy { grid-column: 1; grid-row: 1; }
  .evt__mosaic { grid-column: 2; grid-row: 1; }
}

/* MOSAIC: one large 3:2 frame + a row of up to three 3:2 thumbnails --------- */
.evt__mosaic { display: grid; gap: clamp(8px, 0.9vw, 12px); }
.evt__main {
  margin: 0;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  background: var(--bg-cocoa, #241a12);
  box-shadow: var(--shadow-soft, 0 8px 24px rgba(26, 20, 16, 0.06));
}
.evt .evt__main img,
.evt .evt__thumb img {
  display: block;
  inline-size: 100% !important;
  block-size: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  border-radius: 0;
}
.evt__main img { transition: opacity 0.35s ease; }
.evt__main img.is-swapping { opacity: 0; }
.evt__thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: inherit; }
.evt__thumb {
  appearance: none;
  padding: 0;
  border: 0;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  background: var(--bg-cocoa, #241a12);
  color: var(--ivory, #F5EFE6); /* image-only button: keep its text colour legible on the frame */
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.evt__thumb:hover { opacity: 1; transform: translateY(-2px); }
.evt__thumb:focus-visible { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px #CFAE83); opacity: 1; }

/* COPY -------------------------------------------------------------------- */
.evt__copy { text-align: start; }
.evt__num {
  display: block;
  font-family: var(--font-display-he, "Frank Ruhl Libre", serif);
  font-weight: 700;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  color: var(--brass-deep, #8B6F46);
  margin-block-end: 0.5em;
}
.evt__title {
  margin: 0 0 0.45em;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  line-height: 1.15;
  color: var(--ink-deep, #1A1410);
}
.evt__text {
  margin: 0 0 1.5em;
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.7;
  color: var(--fg-muted, #6B6B68);
  max-inline-size: 42ch;
}

/* PHONES ------------------------------------------------------------------ */
@media (max-width: 899px) {
  /* The tab row scrolls sideways instead of wrapping into a block. */
  .evt__tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter, 20px) * -1);
    padding-inline: 0;
  }
  /* Edge spacers: padding at the scroll start is dropped in RTL overflow rows. */
  .evt__tabs::before,
  .evt__tabs::after { content: ""; flex: 0 0 calc(var(--gutter, 20px) - 6px); }
  .evt__tabs::-webkit-scrollbar { display: none; }
  .evt__tab { scroll-snap-align: start; }
  .evt__copy { text-align: center; }
  .evt__text { margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .evt.is-ready .evt__panel.is-entering { animation: none; }
  .evt__tab, .evt__thumb, .evt__main img { transition: none; }
}

/* ============================================================================
   2026-10-28 · v2.6.26 — client round
   (1) ZERO PINK: the theme paints every <button> with its magenta accent on
       hover / focus / active. Pin the tab and thumbnail colours on every state.
   (2) The event title + text stay pinned to the top of the panel (desktop:
       sticky column below the fixed header; phones: copy above the photos).
   (3) Phones: the tab row sticks under the header, so the chosen event type
       is always in view; 44px tap targets.
   ========================================================================== */
.evt .evt__tab,
.evt .evt__tab:hover,
.evt .evt__tab:focus,
.evt .evt__tab:active {
  background: transparent !important;
  background-color: transparent !important;
  border-color: var(--border-strong, rgba(26, 20, 16, 0.24)) !important;
  color: var(--cocoa, #534133) !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
.evt .evt__tab:hover { border-color: var(--brass, #CFAE83) !important; }
.evt .evt__tab[aria-selected="true"],
.evt .evt__tab[aria-selected="true"]:hover,
.evt .evt__tab[aria-selected="true"]:focus,
.evt .evt__tab[aria-selected="true"]:active {
  background: var(--cocoa, #534133) !important;
  background-color: var(--cocoa, #534133) !important;
  border-color: var(--cocoa, #534133) !important;
  color: var(--ivory, #F5EFE6) !important;
}
.evt .evt__tab:focus-visible { box-shadow: var(--focus-ring, 0 0 0 3px #CFAE83) !important; outline: none; }
.evt .evt__thumb,
.evt .evt__thumb:hover,
.evt .evt__thumb:focus,
.evt .evt__thumb:active {
  background: var(--bg-cocoa, #241a12) !important;
  background-color: var(--bg-cocoa, #241a12) !important;
  border: 0 !important;
  box-shadow: none !important;
}
.evt .evt__thumb:focus-visible { box-shadow: var(--focus-ring, 0 0 0 3px #CFAE83) !important; }

@media (min-width: 900px) {
  .evt__panel { align-items: start; }
  .evt__copy {
    position: sticky;
    top: calc(var(--evt-sticky-top, 0px) + 24px);
    align-self: start;
    padding-block-start: clamp(8px, 1.5vw, 24px);
  }
}

@media (max-width: 899px) {
  .evt { overflow: visible; }
  .evt.is-ready .evt__tabs {
    position: sticky;
    top: var(--evt-sticky-top, 0px);
    z-index: 3;
    background: var(--bg, #f5efe6);
    padding-block: 10px;
    margin-block-end: 18px;
    box-shadow: 0 10px 14px -14px rgba(26, 20, 16, 0.35);
  }
  .evt__tab { min-block-size: 44px; padding: 0.6em 1.1em; font-size: 0.98rem; }
  /* copy first, so the type and its text sit above the photos */
  .evt__copy { order: -1; }
  .evt__panel { gap: 16px; }
  .evt__num { display: none; }
  .evt__title { font-size: 1.75rem; margin-block-end: 0.3em; }
  .evt__text { font-size: 1rem; line-height: 1.65; margin-block-end: 0.9em; max-inline-size: 36ch; }
  .evt__cta { margin-block-end: 2px; }
  .evt__main { border-radius: var(--radius-md, 12px); }
  .evt__thumbs { gap: 8px; }
  .evt__thumb { border-radius: 10px; opacity: 1; }
  .evt__thumb:hover { transform: none; }
}

/* v2.6.28 — phones: the tab row stays inside the page gutter (the edge-bleed
   spacers were swallowed by the RTL overflow row, so the first tab touched the
   screen edge). */
@media (max-width: 899px) {
  .evt .evt__tabs { margin-inline: 0; padding-inline: 0; }
  .evt .evt__tabs::before, .evt .evt__tabs::after { content: none; }
}
