/* Alhan Jeries-Ashqar — the public site.
 *
 * The look comes from the editor demos of 2026-07-24: warm paper, teal, a serif
 * for reading and a sans for the furniture, and her page set as a document on a
 * white sheet. A printed page, not a web layout.
 *
 * Three rules run through this file:
 *
 *   1. Every colour, font and measure is a variable set from site_settings
 *      (src/views/theme.js). Nothing here that a theme cannot change.
 *   2. Direction-neutral properties only — padding-inline, margin-inline,
 *      text-align: start, inset-inline. Hebrew and Arabic are the same
 *      stylesheet, not a mirrored copy of it.
 *   3. One look per text role. A paragraph looks like a paragraph on every page
 *      of this site; so does a quote, a label, a heading.
 */

/* --- base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* Every text size on this site is in rem, so one number moves all of them —
 * that number is the visitor's, set from the reading options at the foot of the
 * page, and it respects whatever size they already chose in their browser. */
html {
  -webkit-text-size-adjust: 100%;
  font-size: calc(100% * var(--text-scale, 1));
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

h1, h2, h3 { font-family: var(--font-reading); font-weight: 600; line-height: 1.15; margin: 0; color: var(--ink-strong); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 0.5rem;
  top: -3rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.9rem;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --- the mark ------------------------------------------------------------
 * Two kinds. `.brand-logo` is her wordmark — her own painting cut into the
 * letters of her name. `.mark` is the fallback initial, drawn when no logo is
 * set, so the engine still has a corner mark for a site that has no artwork. */

.brand-logo {
  width: 78px;
  aspect-ratio: 1.6;
  overflow: hidden;
  flex: none;
  display: block;
}

/* The file is a square with wide white margins around the wordmark, so the
 * frame crops to the letters rather than the canvas. */
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  display: block;

  /* The wordmark was drawn on white and has no transparency. Multiplying it
   * into the bar dissolves that white into whatever paper the look uses, so
   * her letters sit on the page instead of on a pale tile. */
  mix-blend-mode: multiply;
}

/* Multiply against a dark bar would erase her. In dark mode the wordmark keeps
 * its own white ground and becomes a small printed label, which is what a
 * gallery does with a paper card on a dark wall. */
@media (prefers-color-scheme: dark) {
  .brand-logo {
    background: #fff;
    border-radius: 5px;
    padding-inline: 3px;
  }
  .brand-logo img { mix-blend-mode: normal; }
}

:root[data-theme='dark'] .brand-logo {
  background: #fff;
  border-radius: 5px;
  padding-inline: 3px;
}
:root[data-theme='dark'] .brand-logo img { mix-blend-mode: normal; }

:root[data-theme='light'] .brand-logo {
  background: none;
  padding-inline: 0;
}
:root[data-theme='light'] .brand-logo img { mix-blend-mode: multiply; }

/* The footer has room the bar does not, so the wordmark is read there rather
 * than merely recognised. Scoped to the logo: the same class also lands on the
 * fallback initial, and a 26px square stretched to 116px is not a mark. */
.brand-logo.brand-logo-footer { width: 116px; }

.mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-reading);
  font-weight: 700;
  font-size: 0.875rem;
  flex: none;
}

/* --- top bar ------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}

.topbar-inner {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-inline-end: auto;
  padding-block: 0.5rem;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 600; font-size: 0.9375rem; }

.brand-tagline {
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.625rem;
}

.topbar-end { display: flex; align-items: center; gap: 1.25rem; }

/* --- navigation ---------------------------------------------------------- */

.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }

.nav-item { position: relative; display: flex; align-items: center; }

.nav-link {
  display: inline-block;
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-s);
}
.nav-link:hover { color: var(--accent); background: var(--accent-soft); }
.nav-link[aria-current] { color: var(--ink); }

.nav-arrow {
  background: none;
  border: 0;
  padding: 8px 2px;
  color: var(--faint);
  line-height: 0;
  border-radius: var(--radius-s);
}
.nav-arrow svg { width: 9px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.nav-arrow[aria-expanded='true'] svg { transform: rotate(180deg); }
.nav-arrow:hover { color: var(--accent); }

.nav-menu {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 2px);
  min-width: 15rem;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.13s ease, transform 0.13s ease, visibility 0.13s;
}

.nav-item:hover > .nav-menu,
.nav-item:focus-within > .nav-menu,
.nav-item.is-open > .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav-sublink {
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--ink);
  border-radius: var(--radius-s);
}
.nav-sublink:hover { background: var(--accent-soft); color: var(--accent); }
.nav-sublink[aria-current] { color: var(--accent); }

.langtabs {
  display: inline-flex;
  gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  flex: none;
}

.langtab {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.langtab:hover { color: var(--accent); }
.langtab.is-active { background: var(--accent); color: var(--accent-ink); }

/* --- preview another look -------------------------------------------------
 * TEMPORARY review furniture for step 2. Deliberately dashed and ink-coloured
 * so it never reads as part of her site, and so it is obvious what to delete
 * when the admin gets a real theme picker at step 7. */

.presettabs {
  display: inline-flex;
  gap: 3px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 3px;
  flex: none;
}

.presettab {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.presettab:hover { color: var(--ink); border-color: var(--ink); }
.presettab.is-active { background: var(--ink); color: var(--bg); }

.burger { display: none; background: none; border: 0; padding: 10px 6px; }

.burger-bars,
.burger-bars::before,
.burger-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.burger-bars::before, .burger-bars::after { content: ''; position: relative; }
.burger-bars::before { top: -6px; }
.burger-bars::after { top: 4.5px; }

.burger[aria-expanded='true'] .burger-bars { background: transparent; }
.burger[aria-expanded='true'] .burger-bars::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded='true'] .burger-bars::after { transform: translateY(-4.5px) rotate(-45deg); }

/* --- main areas ---------------------------------------------------------- */

main { display: block; padding-block: clamp(1.25rem, 3vw, 2rem) clamp(3rem, 7vw, 5rem); }

/* Her page, printed on a sheet. */
.sheet {
  width: min(100% - 1.5rem, var(--sheet));
  margin: 0 auto 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.75rem) clamp(0.5rem, 2vw, 1rem);
}

.sheet-wide { width: min(100% - 1.5rem, var(--wide)); }

.doc {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 5vw, 3rem);
  font-family: var(--font-reading);
}

/* Grids of cards and photographs need the room a sheet does not give. */
.board { width: min(100% - 2rem, var(--wide)); margin-inline: auto; }

/* --- the head of a page -------------------------------------------------- */

.doc-head { text-align: center; margin-block-end: clamp(1.5rem, 4vw, 2.25rem); }

.doc-title {
  font-size: clamp(1.65rem, 4.2vw, 2.1rem);
  line-height: 1.15;
  text-wrap: balance;
}

.rule {
  width: 56px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  margin: 14px auto 0;
}

.doc-lead,
.doc-meta {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 14px 0 0;
}

.doc-meta { text-align: center; }

.breadcrumbs {
  width: min(100% - 2rem, var(--wide));
  margin: 0 auto 1rem;
  font-family: var(--font-ui);
  font-size: 0.7813rem;
  color: var(--faint);
}
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: '/'; margin-inline-end: 0.4rem; color: var(--line); }
.breadcrumbs a { text-decoration: none; color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

/* --- text roles ----------------------------------------------------------
 *
 * The whole point of the role pass: one look per kind of text, on every page.
 */

.doc .lead {
  font-size: 1.1875rem;
  line-height: calc(var(--reading-line) - 0.02);
  color: var(--ink);
  margin: 0 0 1.1rem;
}

.doc .body {
  font-size: 1.0625rem;
  line-height: var(--reading-line);
  margin: 0 0 1.1rem;
}

.doc .heading {
  font-size: 1.3125rem;
  margin: 2.2rem 0 0.7rem;
}

.doc .subheading {
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 2rem 0 0.6rem;
  color: var(--ink);
}

.doc .label {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 1.6rem 0 0.35rem;
}

.doc blockquote {
  margin: 1.4rem 0;
  padding-inline-start: 1rem;
  border-inline-start: 3px solid var(--accent);
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--muted);
}

.doc .divider {
  border: 0;
  border-block-start: 1px solid var(--line);
  margin: 1.8rem auto;
  width: 40%;
}

.doc a { color: var(--accent); text-underline-offset: 2px; }

.doc > *:first-child { margin-block-start: 0; }

.block-row {
  display: grid;
  gap: clamp(1rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  align-items: start;
  margin: 1.4rem 0;
}

/* --- photographs ---------------------------------------------------------
 *
 * One frame everywhere: a rounded edge, a hairline, a soft shadow. A single
 * photograph keeps its own proportions and is capped so a tall one cannot
 * swallow the screen; photographs standing together are cropped to a shared
 * shape, because a row of mismatched rectangles is what makes a page look
 * accidental.
 */

.figure { margin: 1.6rem 0; text-align: center; }

.frame {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: var(--surface-2);
  cursor: zoom-in;
}

.figure img { display: block; width: 100%; height: auto; }

.figure-single .frame { display: inline-block; max-width: 100%; }
.figure-single img { max-height: 74vh; width: auto; max-width: 100%; }

.figure figcaption {
  font-family: var(--font-ui);
  font-size: 0.7813rem;
  color: var(--muted);
  margin-block-start: 0.6rem;
}

.figure-grid {
  display: grid;
  gap: clamp(0.5rem, 1.4vw, 0.9rem);
  margin: 1.8rem 0;
}

.figure-grid-2 { grid-template-columns: repeat(2, 1fr); }
.figure-grid-3 { grid-template-columns: repeat(3, 1fr); }
.figure-grid-auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.figure-grid-gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }

.figure-tile { margin: 0; }
.figure-tile .frame { aspect-ratio: 4 / 3; }

.figure-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.figure-tile:hover img { transform: scale(1.04); }

/* --- home ---------------------------------------------------------------- */

.opening {
  width: min(100% - 2rem, var(--wide));
  margin: 0 auto clamp(2rem, 5vw, 3.5rem);
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 60rem) {
  .opening { grid-template-columns: 1.05fr 1fr; }
  .opening-text { text-align: start; }
  .opening .rule { margin-inline: 0; }
}

.opening-figure .frame { display: block; }
.opening-figure img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

.opening-text { text-align: center; font-family: var(--font-reading); }

.opening-name {
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.1;
  text-wrap: balance;
}

.opening-tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--muted);
  font-style: italic;
  margin: 1rem 0 1.25rem;
}

.opening-text .lead,
.opening-text .body { font-size: 1.0313rem; line-height: 1.6; margin: 0 0 0.9rem; }

.strip { width: min(100% - 2rem, var(--wide)); margin: 0 auto clamp(2.5rem, 6vw, 4rem); }

.strip-title {
  font-size: 1.35rem;
  margin-block-end: 1.1rem;
  padding-block-end: 0.7rem;
  border-block-end: 1px solid var(--line);
}

.strip-more { font-family: var(--font-ui); font-size: 0.8125rem; margin-block-start: 1rem; }
.strip-more a { color: var(--accent); }

/* --- cards --------------------------------------------------------------- */

.card-grid {
  display: grid;
  gap: clamp(0.9rem, 2vw, 1.4rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.card-media { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.card:hover .card-media img { transform: scale(1.04); }

.card-media-empty { aspect-ratio: 6 / 1; background: var(--accent-soft); }

.card-body { display: flex; flex-direction: column; gap: 0.4rem; padding: 1rem 1.1rem 1.2rem; }

.card-meta {
  font-family: var(--font-ui);
  font-size: 0.6563rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

.card-label { font-family: var(--font-reading); font-size: 1.2rem; font-weight: 600; line-height: 1.25; color: var(--ink-strong); }
.card-text { font-size: 0.8438rem; line-height: 1.55; color: var(--muted); }

/* --- gallery filters ----------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  margin-block-end: 1.75rem;
  padding-block-end: 1.1rem;
  border-block-end: 1px solid var(--line);
}

.filter-group { display: flex; flex-direction: column; gap: 0.4rem; }

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 100px;
  padding: 6px 13px;
  font-size: 0.7813rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-small { padding: 3px 9px; font-size: 0.7188rem; }
.chip-children { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.figure-tile[hidden] { display: none; }

.empty { font-family: var(--font-ui); color: var(--muted); }

/* --- footer -------------------------------------------------------------- */

.site-footer {
  border-block-start: 1px solid var(--line);
  background: var(--surface);
  padding-block: 2rem;
}

.footer-inner {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.footer-identity { display: flex; align-items: center; gap: 0.7rem; margin-inline-end: auto; }
.footer-name { font-family: var(--font-reading); font-weight: 600; font-size: 0.9375rem; margin: 0; }
.footer-tagline { margin: 0; color: var(--faint); font-size: 0.7813rem; }

.footer-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin: 0;
  padding: 0;
}
.footer-nav a { color: var(--muted); text-decoration: none; font-size: 0.8125rem; }
.footer-nav a:hover { color: var(--accent); }

/* Her accounts, drawn from the `social_links` setting — real links, where the
 * old site had pictures of links. */
.socials { display: flex; gap: 0.4rem; }

.social {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.social svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }
.social:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* --- the tools that follow the page --------------------------------------
 *
 * Back to top, and her visitors' own reading settings. Larger text and stronger
 * contrast are not decoration: without them, someone who needs them has to
 * leave and find their browser's settings.
 */

.tools {
  position: fixed;
  inset-inline-end: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 50;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.5rem;
}

.tool {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.tool svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool svg circle { fill: currentColor; stroke: none; }
.tool:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); }
.tool[hidden] { display: none; }

.a11y-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 0.5rem);
  width: 15rem;
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.4rem;
}
.a11y-panel[hidden] { display: none; }

.a11y-title {
  margin: 0 0 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.a11y-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.8125rem; }
.a11y-buttons { display: flex; gap: 3px; }

.a11y-buttons button {
  min-width: 2rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 600;
}
.a11y-buttons button:hover { border-color: var(--accent); color: var(--accent); }

.a11y-toggle,
.a11y-reset {
  text-align: start;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  font-size: 0.8125rem;
}
.a11y-toggle:hover, .a11y-reset:hover { border-color: var(--accent); color: var(--accent); }
.a11y-toggle[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.a11y-reset { color: var(--muted); font-size: 0.75rem; text-align: center; }

/* --- what the reading options do ----------------------------------------- */

:root[data-contrast='on'] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --ink: #000000;
  --muted: #2b2b2b;
  --faint: #444444;
  --line: #767676;
  --accent: #05514c;
  --accent-soft: rgba(5, 81, 76, 0.12);
  --accent-ink: #ffffff;
  --shadow: 0 0 0 1px #767676;
  --shadow-soft: 0 0 0 1px #767676;
}

:root[data-underline='on'] .doc a,
:root[data-underline='on'] .footer-nav a,
:root[data-underline='on'] .nav-link,
:root[data-underline='on'] .nav-sublink,
:root[data-underline='on'] .card-label { text-decoration: underline; }

:root[data-stillness='on'] { scroll-behavior: auto; }

:root[data-stillness='on'] *,
:root[data-stillness='on'] *::before,
:root[data-stillness='on'] *::after {
  animation: none !important;
  transition: none !important;
}

:root[data-stillness='on'] .card:hover,
:root[data-stillness='on'] .tool:hover { transform: none; }
:root[data-stillness='on'] .figure-tile:hover img,
:root[data-stillness='on'] .card:hover .card-media img { transform: none; }

/* --- lightbox ------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgb(10 8 6 / 0.94);
  padding: clamp(1rem, 4vw, 3rem);
}

.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; display: grid; gap: 0.8rem; justify-items: center; }
.lightbox-image { max-width: 100%; max-height: 85vh; object-fit: contain; border-radius: var(--radius-s); }
.lightbox-caption { color: rgb(255 255 255 / 0.75); font-family: var(--font-ui); font-size: 0.7813rem; }

.lightbox button {
  position: absolute;
  background: rgb(255 255 255 / 0.1);
  border: 0;
  border-radius: 50%;
  width: 2.75rem;
  height: 2.75rem;
}
.lightbox button:hover { background: rgb(255 255 255 / 0.2); }

.lightbox-close { top: 1rem; inset-inline-end: 1rem; }

.lightbox-close::before,
.lightbox-close::after {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  top: 50%;
  width: 0.85rem;
  height: 1.5px;
  background: #fff;
  translate: -50% -50%;
}
.lightbox-close::before { rotate: 45deg; }
.lightbox-close::after { rotate: -45deg; }

.lightbox-prev { inset-inline-start: 1rem; top: 50%; translate: 0 -50%; }
.lightbox-next { inset-inline-end: 1rem; top: 50%; translate: 0 -50%; }

/* Chevrons drawn with logical borders, so they turn around by themselves when
 * the page reads right-to-left. */
.lightbox-prev::before,
.lightbox-next::before {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  border-inline-start: 1.5px solid #fff;
  border-block-start: 1.5px solid #fff;
  translate: -40% -50%;
}
.lightbox-prev::before { rotate: -45deg; }
.lightbox-next::before { rotate: 135deg; translate: -60% -50%; }

body.lightbox-open { overflow: hidden; }

/* --- phone ---------------------------------------------------------------
 *
 * Most of her visitors arrive on one. The navigation becomes a panel, the grids
 * become one or two columns, and nothing scrolls sideways.
 */

@media (max-width: 62rem) {
  .figure-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 54rem) {
  .burger { display: block; order: 3; }
  .topbar-inner { flex-wrap: wrap; gap: 0.5rem; }

  .topbar-end {
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .topbar-inner.is-open .topbar-end { max-height: 80vh; overflow-y: auto; padding-block-end: 0.9rem; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }

  .nav-item { border-block-start: 1px solid var(--line); flex-wrap: wrap; }
  .nav-link { flex: 1; padding: 13px 4px; font-size: 1rem; color: var(--ink); }
  .nav-arrow { padding: 13px 10px; }

  .nav-menu {
    position: static;
    flex-basis: 100%;
    box-shadow: none;
    border: 0;
    background: none;
    padding: 0 0 0.5rem 0.75rem;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-item:hover > .nav-menu,
  .nav-item:focus-within > .nav-menu { display: none; }
  .nav-item.is-open > .nav-menu { display: block; }

  .langtabs { align-self: flex-start; margin-block-start: 0.5rem; }
  .presettabs { align-self: flex-start; margin-block-start: 0.5rem; }

  /* On a phone the bar is one line or it is a wall. The wordmark and her name
   * earn their place; the tagline wraps to three lines and pushes the bar past
   * 100px, and it is already read on the home page and in the footer. */
  .topbar .brand-tagline { display: none; }
  .topbar .brand-logo { width: 62px; }

  .doc .lead { font-size: 1.0938rem; }
  .doc .body { font-size: 1.0313rem; }

  .figure-grid-2, .figure-grid-3 { grid-template-columns: 1fr; }
  .figure-grid-auto, .figure-grid-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
