/* ===== The works stage (11-orx-stage; was the works strip of 10-orx-works): the two home pages only =====
   A band of its own, the site's section heading, and one work at a time on a stage. The row is still the browser's own
   horizontal scrolling with scroll snapping (10-orx-works): it works without scripts, and nothing moves by itself.
   works.js adds the thumbnails, the counter, the arrows and the dots, only when there is more than one work. */

/* §3.1 the band: the site's light grey with a hairline at its top edge. Q4: the gap above it is the "why Ornexi" section's
   bottom padding (index.njk: <section class="why">), 56 px, and the band's own 72 / 76 px inside. */
.works { background: var(--gray-50); border-top: 1px solid var(--gray-200); padding-block: 72px 76px; }
.why { padding-block-end: 56px; }
@media (max-width: 768px) {
  .works { padding-block: 52px 56px; }
  .why { padding-block-end: 44px; }
}
.works .section-head { margin-bottom: 48px; }
@media (max-width: 880px) { .works .section-head { margin-bottom: 32px; } }

/* §3.3 the row: one work at a time on wide screens; on narrow ones the next card shows 40 px at the edge */
.works-list {
  display: flex;
  gap: 64px;                         /* wider than the card's 40 px shadow, so the next card's shadow never shows at the edge */
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  margin-inline: -24px;              /* into the container's padding: room for the card's shadow and the focus ring */
  padding: 8px 24px 48px;
  scroll-padding-inline: 24px;       /* a card snaps where the content edge is */
  margin-block-end: -48px;           /* the shadow's room takes no space below the stage */
}
.works-row.has-nav .works-list { scrollbar-width: none; }   /* with the thumbnails and arrows; without scripts it shows */
.works-row.has-nav .works-list::-webkit-scrollbar { display: none; }

/* §3.2 a work as a stage (desktop): one wide white card, the text column on the start side, the visual on the end side */
.work-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  min-height: 420px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.work-text { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-block: 40px; padding-inline: 48px 40px; }
.work-card:only-child .work-text { padding-block-start: 48px; }
.work-num {
  display: flex; align-items: center; gap: 14px; margin-bottom: 6px;
  font-size: 3.5rem; line-height: 1; font-weight: 700; letter-spacing: -0.03em; color: var(--gray-200);
  font-variant-numeric: tabular-nums;
}
/* the ordinal is decoration (WCAG 1.4.3 exempts it): drawn by CSS from data-num, inside an aria-hidden span */
.work-num::before { content: attr(data-num); }
.work-num::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.work-text h3 { font-size: 2.125rem; line-height: 1.2; margin: 0 0 12px; }
.work-card:only-child .work-text h3 { font-size: 2.25rem; margin-bottom: 14px; }
.work-desc { font-size: 1.0625rem; line-height: 1.75; color: var(--gray-600); margin: 0 0 18px; }
.work-card:only-child .work-desc { margin-bottom: 20px; }
.work-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.work-facts li {
  border: 1px solid var(--gray-200); background: var(--gray-50); color: var(--gray-700);
  font-size: 0.875rem; font-weight: 500; line-height: 1.5; padding: 5px 14px; border-radius: 999px;
}
.work-foot { margin-top: auto; padding-top: 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.work-link svg { width: 18px; height: 18px; }
html[dir="ltr"] .work-link svg { transform: scaleX(-1); }     /* the arrow points forward: left in Hebrew, right in English */
.work-credit { font-size: 0.875rem; color: var(--gray-500); margin: 0; }

.work-visual {
  flex: 0 0 53%;                     /* 600 of 1132 px */
  display: flex; align-items: flex-end; justify-content: center;
  padding-inline: 30px;
  background: var(--grad-brand-soft);
  border-start-end-radius: 21px; border-end-end-radius: 21px;
  overflow: hidden;
}
.work-browser {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--gray-200); border-bottom: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  box-shadow: var(--shadow-brand);
}
.work-bar {
  height: 40px; display: flex; align-items: center; gap: 14px; padding-inline: 14px;
  background: var(--gray-100); border-bottom: 1px solid var(--gray-200);
}
.work-bar::after { content: ''; width: 42px; flex: none; }   /* balances the dots, so the address sits in the middle */
.work-dots { display: flex; gap: 6px; width: 42px; flex: none; }
.work-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-300); }
.work-host {
  margin-inline: auto; display: inline-flex; align-items: center; gap: 6px;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 999px;
  padding: 3px 16px; font-size: 0.75rem; line-height: 1.5; color: var(--gray-600);
}
.work-host svg { width: 11px; height: 11px; }
.work-browser img { display: block; width: 100%; height: auto; background: var(--gray-50); }

/* the nav under the stage (works.js, more than one work): thumbnails at the start, the counter and the arrows at the end */
.works-nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; }
.works-thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.works-thumb {
  display: flex; align-items: center; gap: 12px; width: 232px; height: 72px; padding: 8px;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  text-align: start; font-size: 0.875rem; font-weight: 600; color: var(--gray-900); line-height: 1.3;
}
.works-thumb img { width: 92px; height: 52px; object-fit: cover; object-position: top; border-radius: var(--radius-sm); flex: none; }
.works-thumb[aria-current="true"] { border-color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-600); }
.works-pager { display: flex; align-items: center; gap: 14px; }
.works-count { font-size: 0.94rem; font-weight: 600; color: var(--gray-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.works-count span { font-weight: 400; color: var(--gray-500); }
.works-arrow {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: var(--white); border: 1px solid var(--blue-100); color: var(--blue-700);
}
.works-arrow svg { width: 18px; height: 18px; }
.works-arrow[aria-disabled="true"] { border-color: var(--gray-200); color: var(--gray-300); cursor: default; }
.works-next svg, html[dir="rtl"] .works-prev svg { transform: scaleX(-1); }
html[dir="rtl"] .works-next svg { transform: none; }
.works-dots { display: none; align-items: center; gap: 7px; }
.works-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--gray-300); }
.works-dots span.on { width: 22px; background: var(--blue-600); }

/* Q2 a: up to 880 px the phone's card: the picture panel on top, the text under it, the button at full width */
@media (max-width: 880px) {
  .works-list { gap: 14px; }
  .work-card { flex-basis: calc(100% - 30px); flex-direction: column; min-height: 0; border-radius: 18px; box-shadow: var(--shadow-md); }
  .work-card:only-child { flex-basis: 100%; }
  .work-visual { order: -1; flex: none; padding: 20px 18px 0; border-radius: 17px 17px 0 0; }
  .work-browser { border-radius: 10px 10px 0 0; box-shadow: 0 12px 28px rgba(79, 70, 229, 0.18); }
  .work-bar { height: 28px; gap: 8px; padding-inline: 10px; }
  .work-bar::after { width: 29px; }
  .work-dots { gap: 4px; width: 29px; }
  .work-dots i { width: 7px; height: 7px; }
  .work-host { padding: 1px 12px; font-size: 0.6875rem; }
  .work-host svg { display: none; }
  .work-text, .work-card:only-child .work-text { padding: 20px 22px 24px; }
  .work-num { font-size: 2.25rem; gap: 12px; margin-bottom: 4px; }
  .work-text h3, .work-card:only-child .work-text h3 { font-size: 1.5625rem; line-height: 1.25; margin-bottom: 8px; }
  .work-desc, .work-card:only-child .work-desc { font-size: 0.97rem; line-height: 1.7; margin-bottom: 16px; }
  .work-facts li { font-size: 0.8125rem; padding: 4px 12px; }
  .work-foot { flex-direction: column-reverse; align-items: stretch; gap: 18px; padding-top: 18px; }
  .work-link { width: 100%; min-height: 50px; padding: 12px 20px; }
  .work-credit { font-size: 0.84rem; }
  .works-nav { justify-content: center; gap: 16px; margin-top: 22px; }
  .works-thumbs { display: none; }
  .works-dots { display: flex; }
  .works-count { font-size: 0.8125rem; }
}
/* on a narrow touch screen: no arrows (as 10-orx-works' Q3 a); the next card shows at the edge */
@media (max-width: 600px) and (pointer: coarse) { .works-arrow { display: none; } }

/* high contrast (the site's rule: every new surface gets its lines) */
html.a11y-contrast .works { border-top-color: #fff !important; }
html.a11y-contrast .work-card { background: #000 !important; border-color: #fff !important; box-shadow: none !important; }
html.a11y-contrast .work-visual { background: #000 !important; border-inline-start: 1px solid #fff; }
html.a11y-contrast .work-browser { background: #000 !important; border-color: #fff !important; box-shadow: none !important; }
html.a11y-contrast .work-bar { background: #000 !important; border-color: #fff !important; }
html.a11y-contrast .work-dots i, html.a11y-contrast .works-dots span { background: #fff !important; }
html.a11y-contrast .works-dots span.on { background: #ffff00 !important; }
html.a11y-contrast .work-host { background: #000 !important; color: #fff !important; border-color: #fff !important; }
html.a11y-contrast .work-num { color: #fff !important; }
html.a11y-contrast .work-num::after { background: #fff !important; }
html.a11y-contrast .work-facts li { background: #000 !important; color: #fff !important; border-color: #fff !important; }
html.a11y-contrast .work-credit, html.a11y-contrast .work-desc { color: #fff !important; }
html.a11y-contrast .works-thumb { background: #000 !important; color: #fff !important; border-color: #fff !important; }
html.a11y-contrast .works-thumb[aria-current="true"] { border-color: #ffff00 !important; box-shadow: inset 0 0 0 1px #ffff00 !important; }
html.a11y-contrast .works-count, html.a11y-contrast .works-count span { color: #fff !important; }
html.a11y-contrast .works-arrow { background: #000 !important; color: #ffff00 !important; border-color: #fff !important; }
html.a11y-contrast .works-arrow[aria-disabled="true"] { color: #fff !important; opacity: 0.5; }
