/* ===== Design tokens (working draft palette — see plan file) ===== */
:root {
  --color-bg: #F7F2E9;
  --color-surface: #FFFFFF;
  --color-text: #3A362E;
  --color-text-muted: #6F685A; /* darkened from #8A8272 (3.8:1) to ~5.5:1 on white for AA text contrast */
  --color-border: rgba(58, 54, 46, 0.12);

  /* Sampled directly from the category logo marks — richer/more saturated
     than the earlier pastel placeholder palette. */
  --color-forest: #3A5420;
  --color-forest-tile: #C8D4AC;
  --color-plum: #642C74;
  --color-plum-tile: #DECAE6;
  --color-ochre: #B8650A;
  --color-ochre-tile: #F5CE8A;
  --color-teal: #1C6B6B;

  --font-heading: 'Suez One', 'Frank Ruhl Libre', 'Times New Roman', serif;
  --font-body: 'Assistant', 'Segoe UI', sans-serif;

  /* 15% cream wash over every page-background image (approved 16.10.2026) */
  --bg-wash: linear-gradient(rgba(247, 242, 233, 0.15), rgba(247, 242, 233, 0.15));

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 6px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html {
  direction: rtl;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  background-image: var(--bg-wash), url('../assets/site-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
}
/* Each page carries its own category-colored background (the same image
   used for its hero) as a single full-bleed image — the new square
   compositions spread color to every edge, so a plain cover crop no
   longer loses anything meaningful. */
body.page-home { background-image: var(--bg-wash), url('../assets/hero-banner.jpg'); }
body.page-academia { background-image: var(--bg-wash), url('../assets/hero-academia.jpg'); }
body.page-content { background-image: var(--bg-wash), url('../assets/hero-content.jpg'); }
body.page-art { background-image: var(--bg-wash), url('../assets/hero-art.jpg'); }

img, video { max-width: 100%; display: block; }

a { color: inherit; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

/* Skip link for keyboard/screen-reader users */
.skip-link {
  position: absolute;
  right: 12px;
  top: -48px;
  background: var(--color-forest);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* ===== Site header ===== */
.site-header {
  padding: 20px 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}
.site-header nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 1.3rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover,
.site-header nav a:focus-visible,
.site-header nav a[aria-current="page"] {
  border-bottom-color: var(--color-teal);
}
/* Underline matches each section's own category color instead of one
   fixed teal for every link. */
.site-header nav a[href="academia.html"]:hover,
.site-header nav a[href="academia.html"]:focus-visible,
.site-header nav a[href="academia.html"][aria-current="page"] {
  border-bottom-color: var(--color-forest);
}
.site-header nav a[href="content-development.html"]:hover,
.site-header nav a[href="content-development.html"]:focus-visible,
.site-header nav a[href="content-development.html"][aria-current="page"] {
  border-bottom-color: var(--color-plum);
}
.site-header nav a[href="art.html"]:hover,
.site-header nav a[href="art.html"]:focus-visible,
.site-header nav a[href="art.html"][aria-current="page"] {
  border-bottom-color: var(--color-ochre);
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
}
/* Homepage already shows the name once in the intro card below —
   the header keeps just the nav, right-aligned. */
.site-header--home .container { justify-content: flex-end; }
/* Homepage content runs wider than other pages so the category squares
   have real room on large screens instead of sitting in a narrow column. */
body.page-home .container { max-width: 1400px; }

/* ===== About intro band (homepage only) ===== */
.about-intro {
  padding: 8px 0 32px;
}
.about-intro .card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.about-intro .text { flex: 1; }
.about-intro h2 {
  margin-bottom: 8px;
  font-size: 3rem;
  letter-spacing: 0.02em;
  color: #5C5648;
}
.about-intro h2 a {
  color: inherit;
  text-decoration: none;
}
.about-intro p { margin: 0; color: var(--color-text-muted); font-size: 1.2rem; }
.about-intro .accent-line {
  width: 48px;
  height: 2px;
  background: var(--color-teal);
  border: none;
  margin: 10px 0 0;
}

/* ===== Homepage intro band ===== */
/* No boxed banner — the whole page background (body.page-home) already
   carries this artwork, so the intro just sits directly on it. */
.hero-banner {
  margin: 8px 0 32px;
}
.hero-banner .about-intro { padding: 0; }
/* No boxed card over the artwork — just the text itself, with a soft
   light halo behind it for legibility. See [[feedback-preserve-her-visual-design]]. */
.hero-banner .about-intro .card {
  background: none;
  border: none;
  border-radius: 0;
  padding: 20px 16px;
}
.hero-banner .about-intro h2,
.hero-banner .about-intro p {
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 1px 14px rgba(255, 255, 255, 0.8);
}

/* ===== Category tiles (equal-weight row) ===== */
.category-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px;
  padding: 8px 0 56px;
}
.category-tile {
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
  aspect-ratio: 1 / 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  /* Lifted "card" depth so each tile reads as a distinct object floating
     over the busy full-page background, instead of blending into it. */
  box-shadow: 0 18px 40px rgba(20, 18, 14, 0.3), 0 4px 10px rgba(20, 18, 14, 0.2);
}
/* No color wash over the artwork — only the text block behind it gets a
   small translucent card, so the watercolor stays fully vivid everywhere
   else. See [[feedback-preserve-her-visual-design]]. */
.category-tile:hover,
.category-tile:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(20, 18, 14, 0.35), 0 6px 14px rgba(20, 18, 14, 0.22);
}
.icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
/* Soft translucent glow (not a hard opaque disc) so the logo keeps enough
   contrast even where the watercolor behind it runs close to its own color. */
.category-tile .icon-badge {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.68) 0%, rgba(255, 255, 255, 0.68) 52%, rgba(255, 255, 255, 0) 78%);
  padding: 16px;
}
.category-tile .icon {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(20, 18, 14, 0.35));
}
.category-tile .tile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(3px);
  padding: 12px 22px;
  border-radius: var(--radius-md);
}
.category-tile h2 {
  margin: 0;
  font-size: 2.8rem;
}
.category-tile p {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.95;
}
.category-tile .tile-link {
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.category-tile--academia {
  background-image: url('../assets/hero-academia.jpg');
  color: var(--color-forest);
}
.category-tile--content {
  background-image: url('../assets/hero-content.jpg');
  color: var(--color-plum);
}
.category-tile--art {
  background-image: url('../assets/hero-art.jpg');
  color: var(--color-ochre);
}

@media (max-width: 640px) {
  .category-row { grid-template-columns: 1fr; gap: 32px; }
  .about-intro .card { flex-direction: column; align-items: flex-start; text-align: right; }
}

/* ===== Category page header band ===== */
/* No boxed banner — the whole page background (body.page-academia/content/art)
   already carries this artwork, so the heading just sits directly on it. */
.page-hero {
  padding: 12px 4px 28px;
  margin: 8px 0 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
}
/* No boxed card behind the heading — just the text, with a soft light
   halo for legibility. See [[feedback-preserve-her-visual-design]]. */
.page-hero .hero-text {
  flex: 1;
  min-width: 0;
  padding: 4px 4px;
}
.page-hero .hero-text h1,
.page-hero .hero-text p {
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 1px 14px rgba(255, 255, 255, 0.8);
}
.page-hero .icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transform: translateX(3cm);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.68) 0%, rgba(255, 255, 255, 0.68) 52%, rgba(255, 255, 255, 0) 78%);
  padding: 20px;
}
.page-hero .icon {
  width: 240px;
  height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 5px 12px rgba(20, 18, 14, 0.35));
}
.page-hero .eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.75);
}
.page-hero--academia .eyebrow { color: var(--color-forest); }
.page-hero--content .eyebrow { color: var(--color-plum); }
.page-hero--art .eyebrow { color: var(--color-ochre); }
/* The art page's heading ("עבודות אמנות") is shorter than the other two
   pages', so the shared translateX(3cm) leaves it looking far from the
   text — shifted further right here so it sits just as close as on the
   academia/content pages. */
.page-hero--art .icon-badge { transform: translateX(clamp(0px, calc(50vw - 395px), 5cm)); }
/* clamp(): identical to the fixed 12cm on desktop (>= ~1030px wide); on
   narrower screens the shift shrinks with the viewport so the logo no
   longer lands on top of the heading (it did at tablet width). */

@media (max-width: 640px) {
  .page-hero { flex-direction: column-reverse; align-items: flex-start; padding: 12px 4px 20px; }
  .page-hero .icon { width: 90px; height: 90px; }
  /* On phones the logo stacks above the text; the desktop sideways shift
     pushed it partly/fully off-screen. */
  .page-hero .icon-badge,
  .page-hero--art .icon-badge { transform: none; }
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 1px 14px rgba(255, 255, 255, 0.8);
}
.back-link:hover { text-decoration: underline; }

/* ===== About page (no boxed banner — same treatment as the other pages) ===== */
.about-content h1,
.about-content h2,
.about-content p,
.about-content blockquote,
.about-content a:not(.doc-link) {
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 1px 14px rgba(255, 255, 255, 0.8);
}

/* ===== Work items ===== */
.work-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding-bottom: 48px;
}
.work-card {
  background: linear-gradient(180deg, #FFFFFF, #FFFBF3);
  border: 0.5px solid var(--color-border);
  border-top: 3px solid var(--accent, var(--color-border));
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: 0 1px 3px rgba(58, 54, 46, 0.05);
}
.work-card h3 { margin-bottom: 8px; }
/* Year(s) line directly under a project title, in the category color
   (slightly darkened so the ochre one still passes text contrast). */
.work-card .work-meta {
  margin: -4px 0 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--accent, #3A362E) 82%, #000);
}
.sub-item .work-meta { font-size: 0.8rem; margin: -2px 0 6px; }
.work-card p { color: #4F493F; font-size: 1.0625rem; }
.work-card .tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 0.5px solid var(--color-border);
}
.tag--flagship {
  background: var(--color-ochre-tile);
  color: var(--color-ochre);
  border-color: transparent;
  font-weight: 500;
}
.tag--soon {
  font-style: italic;
}

.media-embed {
  margin: 14px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
}
.sub-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.sub-item {
  background: var(--color-bg);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.sub-item h4 { margin: 0 0 6px; font-size: 1rem; font-weight: 500; }
.sub-item p { margin: 0 0 10px; font-size: 1rem; color: #4F493F; }

/* Account-sites thumbnails: bigger, evenly centered regardless of how many
   fit per row (auto-fit collapses empty tracks instead of leaving them
   blank on one side, so 3 items stay symmetric). */
.sub-items--accounts {
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.sub-items--accounts .title-card {
  display: block;
  cursor: pointer;
}
@media (max-width: 640px) {
  .sub-items--accounts { grid-template-columns: 1fr; }
}

/* All מערך tiles in this group are the same size regardless of how many
   links each one has, instead of the grid's default per-row auto-stretch. */
.sub-items--uniform .sub-item {
  display: flex;
  flex-direction: column;
  min-height: 520px;
}
.sub-items--uniform .sub-item .tags { margin-top: auto; padding-top: 10px; }

.card-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.card-thumbs img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 4px;
}

.title-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 14px 0;
  aspect-ratio: 16 / 9;
  background: #000;
}
.title-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.title-card-caption {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: -8px 0 12px;
}

.media-embed iframe {
  width: 100%;
  display: block;
}
/* Fixed aspect ratio so every video renders at the same size regardless of
   its native resolution — a few source files render huge otherwise. */
.media-embed--video {
  aspect-ratio: 16 / 9;
  background: #000;
}
.media-embed--video iframe {
  height: 100%;
  border: 0;
}
.media-embed--video video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Two smaller videos side by side instead of each taking the full card
   width, for cards with multiple clips (e.g. the escape-room project). */
.media-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 640px) {
  .media-row { grid-template-columns: 1fr; }
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 500;
  text-decoration: none;
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.9rem;
}
.doc-link:hover { border-color: var(--color-teal); }
.doc-link span[aria-hidden="true"] { font-size: 1.25em; }
a.doc-link { background: var(--color-surface); }

/* Row of doc-link buttons instead of stacked full-width. */
.doc-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}
.doc-links-row .doc-link { margin-top: 0; }

/* ===== Placeholder page ===== */
.placeholder-block {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 56px;
}

/* ===== In-page document/media viewer (no navigation, no download) ===== */
button.doc-link {
  background: var(--color-surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.doc-link[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.viewer-overlay[hidden] { display: none; }

.viewer-box {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  width: min(880px, 100%);
  height: min(88vh, 960px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--color-surface);
  border-bottom: 0.5px solid var(--color-border);
  flex: none;
}
.viewer-title { font-weight: 500; font-size: 0.95rem; }
.viewer-close {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.viewer-close:hover, .viewer-close:focus-visible { background: var(--color-bg); color: var(--color-text); }

.viewer-body {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}
.viewer-body iframe { width: 100%; height: 100%; border: none; }
.viewer-loading { padding: 40px; color: var(--color-text-muted); }
.viewer-body canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 0 0 0.5px var(--color-border);
  margin: 0 auto;
}

.viewer-pager {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: var(--color-surface);
  border-top: 0.5px solid var(--color-border);
}
.viewer-pager[hidden] { display: none; }
.viewer-zoom, .viewer-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.viewer-zoom[hidden], .viewer-nav[hidden] { display: none; }
.viewer-nav { margin: 0 auto; }
.viewer-zoom-level { font-size: 0.8rem; color: var(--color-text-muted); min-width: 40px; text-align: center; }
.viewer-pager button {
  border: 0.5px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.viewer-zoom-in, .viewer-zoom-out {
  padding: 4px 12px;
  font-size: 1rem;
  line-height: 1;
}
.viewer-pager button:disabled { opacity: 0.4; cursor: default; }
.viewer-pager button:not(:disabled):hover { border-color: var(--color-teal); }
.viewer-page-indicator { font-size: 0.85rem; color: var(--color-text-muted); min-width: 90px; text-align: center; }

@media (max-width: 640px) {
  .viewer-overlay { padding: 0; }
  .viewer-box { width: 100%; height: 100%; border-radius: 0; }
}

/* ===== Footer ===== */
.site-footer {
  padding: 32px 0 48px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  border-top: 0.5px solid var(--color-border);
}

/* Cards whose sub-items hold large media: fixed column counts instead of
   the auto-fill grid (which made 2 items only ~1/5 of the card width). */
.sub-items--single { grid-template-columns: 1fr; }
.sub-items--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sub-items--trio { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
@media (max-width: 640px) {
  .sub-items--pair { grid-template-columns: 1fr; }
}
/* 16:9 video: as wide as the card, but never taller than the window. */
.media-embed--fit {
  width: min(100%, calc(72vh * 16 / 9));
  margin-inline: auto;
}
/* Portrait (9:16) video: sized by window height so it always fits the screen. */
.media-embed--portrait {
  aspect-ratio: 9 / 16;
  width: min(100%, calc(min(78vh, 820px) * 9 / 16));
  margin-inline: auto;
}

/* ===== Stage 1 additions (nav on phones, contact pill, jump links, captions) ===== */
.site-header nav ul { flex-wrap: wrap; align-items: center; }
.site-header nav a.nav-contact {
  font-size: 1.1rem;
  padding: 4px 16px;
  border: 1.5px solid rgba(58, 54, 46, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}
.site-header nav a.nav-contact:hover,
.site-header nav a.nav-contact:focus-visible {
  border-color: var(--color-teal);
  background: #fff;
}
@media (max-width: 640px) {
  .site-header .container { flex-wrap: wrap; row-gap: 8px; }
  .site-logo { flex: 1 0 100%; }
  .site-header--home .container { justify-content: flex-start; }
  .site-header nav ul { gap: 16px 16px; }
  .site-header nav a { font-size: 1.05rem; }
  .site-header nav a.nav-contact { font-size: 1rem; padding: 3px 12px; }
}

.jump-links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 28px;
  padding: 0;
}
.jump-links a {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent, #3A362E) 45%, transparent);
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.jump-links a:hover,
.jump-links a:focus-visible { border-color: var(--accent, var(--color-teal)); background: #fff; }
.work-card { scroll-margin-top: 16px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
#contact { scroll-margin-top: 20px; }

.work-card .media-caption {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}
.media-row .media-embed { margin-top: 0; }

/* ===== Viewer: actions (new tab / full screen) and the invisible text layer ===== */
.viewer-actions { display: flex; align-items: center; gap: 8px; }
.viewer-newtab,
.viewer-expand {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-bg);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: pointer;
}
.viewer-newtab[hidden], .viewer-expand[hidden] { display: none; }
.viewer-newtab:hover, .viewer-newtab:focus-visible,
.viewer-expand:hover, .viewer-expand:focus-visible { border-color: var(--color-teal); }

.viewer-overlay.is-expanded { padding: 0; background: var(--color-bg); }
.viewer-overlay.is-expanded .viewer-box { width: 100%; height: 100%; border-radius: 0; }

.textLayer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  line-height: 1;
  text-align: initial;
  transform-origin: 0 0;
}
.textLayer span, .textLayer br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}
.textLayer ::selection { background: rgba(28, 107, 107, 0.3); }
@media (max-width: 640px) {
  .viewer-newtab, .viewer-expand { font-size: 0.8rem; padding: 4px 8px; }
  .viewer-title { font-size: 0.85rem; }
}

/* Phones: the category logo sits at the top-left, beside the back link
   (position marked by Shelhevet, 16.10.2026) instead of above the heading. */
@media (max-width: 640px) {
  .page-hero { position: relative; }
  .page-hero .icon-badge,
  .page-hero--art .icon-badge {
    position: absolute;
    left: 26px;
    top: -106px;
    transform: none;
  }
}

/* ===== Links to the work itself (documents, apps, presentations): outlined in the
   page's category color with a tinted fill, so they stand out from the card
   (variant B, chosen 24.10.2026). ===== */
.doc-link,
button.doc-link,
a.doc-link {
  --doc-ink: color-mix(in srgb, var(--accent, var(--color-teal)) 76%, #000);
  background: color-mix(in srgb, var(--accent, var(--color-teal)) 16%, #fff);
  color: var(--doc-ink);
  border: 2px solid var(--doc-ink);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  padding: 9px 17px;
  transition: background 0.15s ease;
}
.doc-link:hover,
.doc-link:focus-visible {
  background: color-mix(in srgb, var(--accent, var(--color-teal)) 21%, #fff);
  border-color: var(--doc-ink);
}
.doc-link:focus-visible { outline: 3px solid var(--color-text); outline-offset: 2px; }
/* the secondary download link (CV) stays quiet */
a.doc-link[download] {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid rgba(58, 54, 46, 0.35);
  font-weight: 500;
}

/* ===== Art gallery ===== */
.category-row--art { gap: 32px; padding: 8px 0 56px; }
.category-tile--cover { justify-content: flex-end; }
.category-tile--cover .tile-body { width: 100%; }

/* uniform grid: every work sits in a square cell of the same size and is shown whole
   (object-fit: contain), so portrait and landscape works get the same visual size */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; align-items: start; margin: 0 0 56px; }
.gallery--wide { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
.gallery figure { margin: 0; min-width: 0; }
.gallery a {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 10px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 3px 10px rgba(20, 18, 14, 0.25);
}
.gallery--wide a { aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 0.3s ease; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.03); }
.gallery a:focus-visible { outline: 3px solid var(--color-text); outline-offset: 3px; }
.gallery figcaption {
  display: block;
  margin: 8px 0 0;
  padding: 4px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.gallery figcaption span { display: block; }
.gallery .cap-title { font-weight: 700; font-size: 0.98rem; }
.gallery .cap-meta { color: var(--color-text-muted); font-size: 0.85rem; }
.work-list--single { grid-template-columns: 1fr; margin-bottom: 16px; padding-bottom: 8px; }
@media (max-width: 640px) {
  .category-row--art { gap: 20px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .gallery--wide { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .gallery img { transition: none; } }

/* lightbox (viewer in gallery mode) */
.viewer-overlay.is-gallery .viewer-box { width: min(1100px, 100%); }
.viewer-overlay.is-gallery .viewer-body { background: #17150f; align-items: stretch; padding: 12px; }
.viewer-figure { margin: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

/* exhibitions page: section headings and full-width panoramas */
.gallery-heading { margin: 40px 0 18px; }
.gallery-heading:first-of-type { margin-top: 8px; }
.gallery-heading h2 { margin-bottom: 6px; }
.gallery-heading h2, .gallery-heading p {
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 1px 14px rgba(255, 255, 255, 0.8);
}
.gallery-heading p { margin: 0; color: var(--color-text); font-size: 1.05rem; max-width: 640px; }
.gallery .gallery-span { grid-column: 1 / -1; }
.gallery .gallery-span a { aspect-ratio: auto; padding: 6px; }
.gallery .gallery-span img { height: auto; }

.gallery-nav { margin: -6px 0 22px; }
.jump-links a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent, var(--color-teal)) 76%, #000);
  border-color: transparent;
  color: #fff;
}

/* lightbox caption */
.viewer-figure { flex-direction: column; gap: 10px; }
.viewer-figure img { flex: 1 1 auto; min-height: 0; }
.viewer-caption { flex: none; text-align: center; color: #f3efe6; font-size: 0.95rem; line-height: 1.45; }
.viewer-caption span { display: block; }
.viewer-caption .cap-title { font-weight: 700; font-size: 1.05rem; }
.viewer-caption .cap-meta { color: #cfc8b8; font-size: 0.88rem; }

.gallery-doc { margin: 0 0 22px; }
