/* ------------------------------------------------------------------
   css/sections.css — what js/site.js adds to the public pages: sections
   from the admin's Pages tab, their style options, the header drop-downs
   and the footer menu from the Menus tab.

   Nothing in here changes a page that has no saved layout or menus: every
   rule hangs off a class or attribute that only js/site.js (or js/boot.js,
   for html.site-pending) puts there.

   Sections draw with the site's own tokens (--bg, --ink, --line, ...).
   A section with its own background redefines those tokens for itself, so
   whatever sits inside it, built-in or not, recolours with it.
   ------------------------------------------------------------------ */

/* Held back by js/boot.js until js/site.js has rearranged the page or
   rebuilt the menu, so the original never flashes first. The brand and the
   header buttons stay; boot.js lets go after 3s whatever happens. */
html.site-pending body > :not(.site-header),
html.site-pending #navLinks,
html.site-pending .nav-right .cta-btn { visibility: hidden; }

/* A built-in section switched off keeps its element (js/script.js still
   looks it up), it just is not shown. */
[data-section][hidden] { display: none !important; }
.nav-right .cta-btn[hidden] { display: none !important; }

/* The "Let's work together" paragraphs sit in their own slot so the admin
   can replace them, one level below where .collab-copy > p (style.css)
   reaches, so they carry the same rules here. */
.collab-copy > .collab-body > p {
    color: var(--ink-2);
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 2rem;
    max-width: 520px;
}
/* What the admin may write there besides paragraphs. */
.collab-copy > .collab-body :is(h2, h3, h4) { color: var(--ink); font-size: 1.25rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
.collab-copy > .collab-body :is(ul, ol) { color: var(--ink-2); padding-left: 1.25rem; margin: 0 0 2rem; max-width: 520px; line-height: 1.65; }
.collab-copy > .collab-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Theme colours as computed on the page itself, for the surfaces below. */
:root {
    --sx-page-bg: var(--bg);
    --sx-page-ink: var(--ink);
    --sx-subtle: var(--bg-3);
}
@supports (color: color-mix(in srgb, red, blue)) {
    :root { --sx-subtle: color-mix(in srgb, var(--ink) 6%, var(--bg)); }
}

/* ---------- Section surfaces ----------
   js/site.js sets data-sx-surface plus --sx-surface (the background) and
   --sx-fg (the text) for the kind of background chosen. */
.sx-styled[data-sx-surface] {
    --bg: var(--sx-surface);
    --ink: var(--sx-fg);
    --ink-2: var(--sx-fg);
    background-color: var(--sx-surface);
    color: var(--sx-fg);
}
.sx-styled[data-sx-surface="subtle"] { --sx-surface: var(--sx-subtle); --sx-fg: var(--sx-page-ink); }
.sx-styled[data-sx-surface="inverse"] { --sx-surface: var(--sx-page-ink); --sx-fg: var(--sx-page-bg); }
.sx-styled[data-sx-surface="page"] { --sx-surface: var(--sx-page-bg); }
.sx-styled[data-sx-surface="image"] {
    --sx-surface: #0b0b0b;
    --sx-fg: #fff;
    background-size: cover;
    background-repeat: no-repeat;
}
@supports (color: color-mix(in srgb, red, blue)) {
    .sx-styled[data-sx-surface] {
        --bg-2: color-mix(in srgb, var(--sx-fg) 5%, var(--sx-surface));
        --bg-3: color-mix(in srgb, var(--sx-fg) 9%, var(--sx-surface));
        --ink-2: color-mix(in srgb, var(--sx-fg) 80%, var(--sx-surface));
        --muted: color-mix(in srgb, var(--sx-fg) 60%, var(--sx-surface));
        --line: color-mix(in srgb, var(--sx-fg) 13%, var(--sx-surface));
        --line-2: color-mix(in srgb, var(--sx-fg) 22%, var(--sx-surface));
        --img-frame: color-mix(in srgb, var(--sx-fg) 7%, var(--sx-surface));
        --placeholder: color-mix(in srgb, var(--sx-fg) 48%, var(--sx-surface));
        --focus-border: color-mix(in srgb, var(--sx-fg) 45%, var(--sx-surface));
        --cta-bg: var(--sx-fg);
        --cta-text: var(--sx-surface);
        --cta-hover: color-mix(in srgb, var(--sx-fg) 86%, var(--sx-surface));
    }
    /* Over a photo the cards and lines are washes of white, not of #0b0b0b. */
    .sx-styled[data-sx-surface="image"] {
        --bg-2: rgba(255, 255, 255, 0.07);
        --bg-3: rgba(255, 255, 255, 0.12);
        --line: rgba(255, 255, 255, 0.18);
        --line-2: rgba(255, 255, 255, 0.3);
        --img-frame: rgba(255, 255, 255, 0.08);
        --cta-text: #000;
    }
}

/* ---------- Spacing, width, alignment, columns ---------- */
.sx-styled[data-sx-space="none"] { padding-top: 0; padding-bottom: 0; }
.sx-styled[data-sx-space="compact"] { padding-top: 3rem; padding-bottom: 3rem; }
.sx-styled[data-sx-space="roomy"] { padding-top: 9rem; padding-bottom: 9rem; }

.sx-styled[data-sx-width="narrow"] { --sx-max: 760px; }
.sx-styled[data-sx-width="wide"] { --sx-max: 1440px; }
.sx-styled[data-sx-width="full"] { --sx-max: none; }
/* Built-in sections each size their own inner box. */
.sx-styled[data-sx-width] > .section-inner,
.sx-styled[data-sx-width] > .collab-inner,
.sx-styled[data-sx-width] > .about-inner { max-width: var(--sx-max); }
.galleries.sx-styled[data-sx-width] { max-width: var(--sx-max); }
/* The projects listing is a centred box; a background should run edge to
   edge, so it widens and keeps its content where it was. */
.galleries.sx-styled[data-sx-surface] {
    max-width: none;
    padding-left: max(1.5rem, calc((100% - var(--sx-max, 1280px)) / 2 + 1.5rem));
    padding-right: max(1.5rem, calc((100% - var(--sx-max, 1280px)) / 2 + 1.5rem));
}

.sx-styled[data-sx-align="center"] .sx-inner { text-align: center; }
.sx-styled[data-sx-align="right"] .sx-inner { text-align: right; }
.sx-styled[data-sx-align="center"] :is(.sx-rich, .sx-lead, .sx-quote-figure, .sx-hero-title, .sx-hero-sub, .sx-figure) { margin-left: auto; margin-right: auto; }
.sx-styled[data-sx-align="right"] :is(.sx-rich, .sx-lead, .sx-quote-figure, .sx-hero-title, .sx-hero-sub, .sx-figure) { margin-left: auto; }
.sx-styled[data-sx-align="center"] .sx-rich :is(ul, ol),
.sx-styled[data-sx-align="right"] .sx-rich :is(ul, ol) { list-style-position: inside; padding-left: 0; }

.sx-styled[data-sx-cols="1"] :is(.gallery-grid, .blog-grid, .exh-grid, .sx-gallery-grid) { grid-template-columns: minmax(0, 1fr); }
.sx-styled[data-sx-cols="2"] :is(.gallery-grid, .blog-grid, .exh-grid, .sx-gallery-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sx-styled[data-sx-cols="3"] :is(.gallery-grid, .blog-grid, .exh-grid, .sx-gallery-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sx-styled[data-sx-cols="4"] :is(.gallery-grid, .blog-grid, .exh-grid, .sx-gallery-grid) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sx-styled[data-sx-cols="1"] .sx-gallery-masonry { columns: 1; }
.sx-styled[data-sx-cols="2"] .sx-gallery-masonry { columns: 2; }
.sx-styled[data-sx-cols="3"] .sx-gallery-masonry { columns: 3; }
.sx-styled[data-sx-cols="4"] .sx-gallery-masonry { columns: 4; }

/* ---------- The home slideshow's options ---------- */
.slideshow[data-sx-height="large"] { height: 75vh; min-height: 460px; }
.slideshow[data-sx-height="medium"] { height: 58vh; min-height: 380px; }
.slideshow[data-sx-captions="off"] .slide-caption { display: none; }

/* ---------- Sections added in the Pages tab ---------- */
.sx {
    position: relative;
    padding: 6rem 1.5rem;
    border-top: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
}
.sx[id] { scroll-margin-top: calc(var(--header-h) + 0.5rem); }
.sx-inner {
    max-width: var(--sx-max, var(--sx-default-max, 1280px));
    margin: 0 auto;
    position: relative;
}
.sx-t-video { --sx-default-max: 1040px; }

.sx-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-2);
    margin: 0 0 1rem;
    padding: 4px 10px;
    background: var(--bg-3);
    border: 1px solid var(--line-2);
    border-radius: 999px;
}
.sx-heading {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 1.5rem;
}
h1.sx-heading { font-size: clamp(2.1rem, 5vw, 3.25rem); letter-spacing: -0.04em; line-height: 1.08; }
.sx-lead {
    color: var(--ink-2);
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 56ch;
    margin: 0 0 1.75rem;
}
.sx-caption {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    margin: 0.6rem 0 0;
}
.sx-more { margin-top: 2rem; }

/* Rich text written in the admin's editor (sanitised on the server). */
.sx-rich {
    color: var(--ink-2);
    font-size: 1.15rem;
    line-height: 1.7;
    max-width: 68ch;
}
.sx-rich > :first-child { margin-top: 0; }
.sx-rich > :last-child { margin-bottom: 0; }
.sx-rich p { margin: 0 0 1rem; }
.sx-rich strong { color: var(--ink); font-weight: 600; }
.sx-rich a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.sx-rich :is(h1, h2, h3, h4) { color: var(--ink); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin: 1.75rem 0 0.75rem; }
.sx-rich h1 { font-size: 1.9rem; }
.sx-rich h2 { font-size: 1.55rem; }
.sx-rich h3 { font-size: 1.3rem; }
.sx-rich h4 { font-size: 1.1rem; }
.sx-rich :is(ul, ol) { padding-left: 1.5rem; margin: 0 0 1rem; }
.sx-rich li { margin-bottom: 0.35rem; }
.sx-rich blockquote { border-left: 3px solid var(--line-2); padding: 0.25rem 0 0.25rem 1rem; margin: 1.25rem 0; font-style: italic; }
.sx-rich img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1rem 0; }
.sx-rich hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.sx-rich table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.95em; }
.sx-rich :is(td, th) { border-bottom: 1px solid var(--line); padding: 0.5rem 0.6rem; text-align: left; }

.sx-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
    border-radius: var(--radius);
    background: var(--cta-bg);
    color: var(--cta-text);
    border: 1px solid var(--cta-bg);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sx-btn::after { content: '\2192'; transition: transform 0.15s ease; }
.sx-btn:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: var(--cta-text); }
.sx-btn:hover::after { transform: translateX(3px); }
.sx-btn-outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
.sx-btn-outline:hover { background: var(--bg-3); color: var(--ink); border-color: var(--ink-2); }
:is(.sx-btn, .sx-gallery-open, .nav-dd-toggle, .sx-lightbox button, .sx-figure-link):focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* Photo */
.sx-figure { margin: 0; }
.sx-figure img { width: 100%; height: auto; border-radius: var(--radius); background: var(--img-frame); }
.sx-figure-link { display: block; border-radius: var(--radius); }

/* Photo and text */
.sx-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}
.sx-split-right .sx-split-media { order: 2; }
.sx-split-solo { grid-template-columns: minmax(0, 1fr); }
.sx-split-media img { width: 100%; height: auto; border-radius: var(--radius); background: var(--img-frame); }
.sx-split-copy .sx-btn { margin-top: 0.75rem; }

/* Gallery */
.sx-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.sx-gallery-grid[data-auto-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sx-gallery-grid[data-auto-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sx-gallery-grid[data-auto-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sx-gallery-masonry { columns: 3 240px; column-gap: 0.75rem; }
.sx-gallery-masonry[data-auto-cols="2"] { columns: 2; }
.sx-gallery-masonry[data-auto-cols="4"] { columns: 4; }
.sx-gallery-stack { display: grid; gap: 2.5rem; max-width: 1040px; margin: 0 auto; }
.sx-gallery-item { margin: 0; }
.sx-gallery-masonry .sx-gallery-item { break-inside: avoid; margin-bottom: 0.75rem; }
.sx-gallery-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--img-frame);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: zoom-in;
}
.sx-gallery-open img { width: 100%; height: auto; transition: transform 0.6s var(--ease); }
.sx-gallery-grid .sx-gallery-open { aspect-ratio: 4 / 3; }
.sx-gallery-grid .sx-gallery-open img { height: 100%; object-fit: cover; }
.sx-gallery-open:hover img { transform: scale(1.03); }
.sx-gallery-stack .sx-gallery-open:hover img { transform: none; }

/* Big photo with headline */
.sx-t-hero {
    display: flex;
    align-items: center;
    min-height: 72vh;
    overflow: hidden;
    isolation: isolate;
    border-top: 0;
    background: var(--bg-3);
}
.sx-t-hero[data-sx-height="full"] { min-height: calc(100vh - var(--header-h)); }
.sx-t-hero[data-sx-height="medium"] { min-height: 52vh; }
.sx-t-hero > .sx-inner { width: 100%; }
.sx-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.sx-hero-shade { position: absolute; inset: 0; background: #000; opacity: var(--sx-shade, 0.4); z-index: -1; }
.sx-t-hero.sx-has-image {
    --ink: #fff;
    --ink-2: rgba(255, 255, 255, 0.86);
    --bg-3: rgba(255, 255, 255, 0.12);
    --line-2: rgba(255, 255, 255, 0.35);
    --cta-bg: #fff;
    --cta-text: #000;
    --cta-hover: #e5e5e5;
    color: #fff;
    background: #0b0b0b;
}
.sx-t-hero.sx-has-image :is(.sx-hero-title, .sx-hero-sub, .sx-eyebrow) { text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35); }
.sx-hero-title {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(2.25rem, 6vw, 4.5rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
    color: var(--ink);
    max-width: 18ch;
    margin: 0 0 1.1rem;
}
.sx-hero-sub {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.5;
    color: var(--ink-2);
    max-width: 46ch;
    margin: 0 0 2rem;
}

/* Quote */
.sx-quote-figure { margin: 0; max-width: 46rem; }
.sx-quote-figure blockquote {
    margin: 0;
    font-size: clamp(1.4rem, 2.8vw, 2.1rem);
    line-height: 1.35;
    letter-spacing: -0.02em;
    font-weight: 500;
    color: var(--ink);
}
.sx-quote-figure blockquote::before { content: '\201C'; display: block; font-size: 3.5rem; line-height: 0.9; color: var(--muted); }
.sx-quote-figure blockquote p { margin: 0 0 0.75rem; }
.sx-quote-figure blockquote p:last-child { margin-bottom: 0; }
.sx-quote-cite {
    margin-top: 1.4rem;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Space or line */
.sx-t-spacer { padding-top: 2rem; padding-bottom: 2rem; border-top: 0; }
.sx-t-spacer[data-sx-size="small"] { padding-top: 1rem; padding-bottom: 1rem; }
.sx-t-spacer[data-sx-size="large"] { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.sx-rule { border: 0; border-top: 1px solid var(--line-2); margin: 0; }
/* That line is the divider; the next section does not need its own. */
.sx-t-spacer.sx-has-line + .sx,
.sx-t-spacer.sx-has-line + [data-section] { border-top-color: transparent; }

/* Video */
.sx-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}
.sx-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* A page address that is not (or not yet) a page */
.sx-t-notfound { border-top: 0; min-height: 55vh; display: flex; align-items: center; padding-top: 7rem; padding-bottom: 7rem; }
.sx-t-notfound > .sx-inner { width: 100%; }

/* "Preview - not published yet", on a page opened with ?preview=draft */
.sx-preview-bar {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 3000;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    max-width: calc(100% - 2rem);
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: #f5b83d;
    color: #111;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}
.sx-preview-bar::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #111; flex: 0 0 auto; }

/* The admin's preview briefly outlines the section being edited. */
.sx-flash { animation: sx-flash 1.6s ease-out 1; }
@keyframes sx-flash {
    0%, 35% { box-shadow: inset 0 0 0 3px #f5b83d; }
    100% { box-shadow: inset 0 0 0 3px transparent; }
}

/* ---------- Gallery lightbox ---------- */
.sx-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 4.75rem;
    background: var(--overlay-lightbox);
    backdrop-filter: blur(8px);
}
.sx-lightbox[hidden], .sx-lightbox [hidden] { display: none !important; }
.sx-lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.85rem; max-width: 100%; max-height: 100%; }
.sx-lightbox img { max-width: 100%; max-height: calc(100vh - 10rem); object-fit: contain; border-radius: var(--radius); }
.sx-lightbox figcaption { color: rgba(255, 255, 255, 0.82); font-size: 14px; line-height: 1.5; text-align: center; max-width: 60ch; }
.sx-lightbox .lb-count { position: absolute; top: 1.4rem; left: 1.5rem; color: rgba(255, 255, 255, 0.7); font-family: var(--font-mono); font-size: 13px; }

/* ---------- Header drop-downs (Menus tab) ---------- */
.nav-links .nav-dd { gap: 0; }
.nav-dd-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 100%;
    padding: 0 10px 0 0;
    margin-left: -8px;
    /* A button's own font shorthand resets font-size-adjust, which the site
       relies on to size Dabir Latin; take the whole font from the menu. */
    font: inherit;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-2);
    background: transparent;
    border: 0;
    cursor: pointer;
}
.nav-dd-toggle.nav-dd-label { padding: 0 14px; margin-left: 0; }
.nav-dd-toggle:hover, .nav-dd.has-active > .nav-dd-label { color: var(--ink); }
.nav-dd-toggle svg { width: 14px; height: 14px; transition: transform 0.18s var(--ease); flex: 0 0 auto; }
.nav-dd.is-open > .nav-dd-toggle svg { transform: rotate(180deg); }
.nav-sub {
    display: none;
    position: absolute;
    top: calc(100% - 14px);
    left: 4px;
    z-index: 600;
    min-width: 220px;
    max-width: 320px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
:root[data-theme="light"] .nav-sub { box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12); }
.nav-dd.is-open > .nav-sub { display: block; }
@media (hover: hover) and (min-width: 1001px) {
    .nav-dd:hover > .nav-sub { display: block; }
}
.nav-links .nav-sub li { height: auto; display: block; }
.nav-links .nav-sub a {
    display: block;
    height: auto;
    padding: 9px 12px;
    font-size: 15px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-links .nav-sub a::after { display: none; }
.nav-links .nav-sub a:hover, .nav-links .nav-sub a.active { background: var(--bg-3); color: var(--ink); font-size: 15px; }

/* ---------- Footer menu ---------- */
.sx-footer-menu { margin: 0 auto 1rem; max-width: 1280px; }
.sx-footer-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1.4rem; }
.sx-footer-menu a {
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
}
.sx-footer-menu a:hover, .sx-footer-menu a[aria-current="page"] { color: var(--ink); }
.site-footer > .sx-footer-menu { margin-bottom: 1.25rem; }

/* ---------- Tablets and phones ---------- */
@media (max-width: 1000px) {
    .sx { padding: 4rem 1rem; }
    .sx-styled[data-sx-space="compact"] { padding-top: 2rem; padding-bottom: 2rem; }
    .sx-styled[data-sx-space="roomy"] { padding-top: 6rem; padding-bottom: 6rem; }
    .sx-t-spacer { padding-top: 1.5rem; padding-bottom: 1.5rem; }
    .sx-t-spacer[data-sx-size="small"] { padding-top: 0.75rem; padding-bottom: 0.75rem; }
    .sx-t-spacer[data-sx-size="large"] { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    .galleries.sx-styled[data-sx-surface] { padding-left: 1rem; padding-right: 1rem; }
    .slideshow[data-sx-height="large"] { height: 70vh; min-height: 380px; }
    .slideshow[data-sx-height="medium"] { height: 52vh; min-height: 320px; }
    .sx-t-hero[data-sx-height="full"] { min-height: calc(100vh - 60px); }
    .sx-styled[data-sx-cols="3"] :is(.gallery-grid, .blog-grid, .exh-grid, .sx-gallery-grid),
    .sx-styled[data-sx-cols="4"] :is(.gallery-grid, .blog-grid, .exh-grid, .sx-gallery-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sx-styled[data-sx-cols="3"] .sx-gallery-masonry,
    .sx-styled[data-sx-cols="4"] .sx-gallery-masonry { columns: 2; }

    /* The slide-out panel itself (fixed under the header, scrolling inside
       itself, hidden when closed) comes from css/style.css, for every menu.
       In it, a drop-down opens in place, under its item. */
    .nav-links .nav-dd { display: flex; flex-wrap: wrap; align-items: center; }
    .nav-links .nav-dd > a { flex: 1 1 auto; }
    .nav-dd-toggle { height: auto; padding: 1rem; margin: 0; color: var(--ink); font-size: 1rem; border-radius: var(--radius-sm); }
    .nav-dd-toggle.nav-dd-label { flex: 1 1 auto; justify-content: space-between; padding: 1rem; }
    .nav-dd-toggle:hover { background: var(--bg-3); }
    .nav-sub {
        position: static;
        flex: 1 0 100%;
        min-width: 0;
        max-width: none;
        padding: 0 0 0.5rem 1rem;
        background: transparent;
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0;
        box-shadow: none;
        margin-left: 1rem;
    }
    :root[data-theme="light"] .nav-sub { box-shadow: none; }
    .nav-links .nav-sub a { white-space: normal; font-size: 1rem; padding: 0.8rem 1rem; color: var(--ink-2); }
    .nav-links .nav-sub a:hover, .nav-links .nav-sub a.active { font-size: 1rem; }
}
@media (max-width: 800px) {
    .sx-split { grid-template-columns: minmax(0, 1fr); }
    .sx-split-right .sx-split-media { order: 0; }
}
@media (max-width: 700px) {
    .sx-hide-phone { display: none !important; }
    .sx-t-hero { min-height: 64vh; }
    .sx-t-hero[data-sx-height="medium"] { min-height: 46vh; }
    .sx-gallery-grid, .sx-gallery-grid[data-auto-cols] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    .sx-styled[data-sx-cols] :is(.gallery-grid, .blog-grid, .exh-grid) { grid-template-columns: minmax(0, 1fr); }
    .sx-styled[data-sx-cols="1"] .sx-gallery-grid { grid-template-columns: minmax(0, 1fr); }
    .sx-gallery-masonry, .sx-gallery-masonry[data-auto-cols], .sx-styled[data-sx-cols] .sx-gallery-masonry { columns: 2; column-gap: 0.5rem; }
    .sx-styled[data-sx-cols="1"] .sx-gallery-masonry { columns: 1; }
    .sx-gallery-masonry .sx-gallery-item { margin-bottom: 0.5rem; }
    .sx-lightbox { padding: 3.5rem 0.75rem; }
    .sx-lightbox .lb-prev { left: 0.5rem; }
    .sx-lightbox .lb-next { right: 0.5rem; }
    .sx-preview-bar { font-size: 13px; }
}
@media (min-width: 701px) {
    .sx-hide-desktop { display: none !important; }
}

html[dir="rtl"] .sx-rich blockquote { border-left: 0; border-right: 3px solid var(--line-2); padding: 0.25rem 1rem 0.25rem 0; }
html[dir="rtl"] .sx-btn::after { content: '\2190'; }

/* Right to left, the header drop-downs mirror: each chevron sits against
   its own item (it came before the item, against the previous one), the
   list opens from the item's right edge, and on a phone the sub-list's
   guide line is on the right, with its items. */
@media (min-width: 1001px) {
    html[dir="rtl"] .nav-dd-toggle { padding: 0 0 0 10px; margin-left: 0; margin-right: -8px; }
    html[dir="rtl"] .nav-dd-toggle.nav-dd-label { padding: 0 14px; margin-right: 0; }
    html[dir="rtl"] .nav-sub { left: auto; right: 4px; }
}
@media (max-width: 1000px) {
    html[dir="rtl"] .nav-sub { border-left: 0; border-right: 1px solid var(--line); margin-left: 0; margin-right: 1rem; padding: 0 1rem 0.5rem 0; }
}
