/* The "exhibition" design: a calm gallery wall. Serif type for names, titles
   and captions, a quiet sans for everything you click, pictures set on a soft
   wall colour with a museum-style label under them, words instead of icons in
   the header on wide screens.

   Loaded after every other stylesheet when SITE_DESIGN (or the visitor's
   /design/ preview cookie) is "exhibition"; see templates/base.html. It only
   restyles: the markup is shared with the classic design, so removing this
   file's <link> gives back the classic look. Keep using the tokens (var(--…));
   this file just gives them new values. docs/DESIGN.md has the rules. */

/* ---------- fonts (self-hosted, SIL Open Font License: static/fonts/OFL-*.txt) ---------- */

@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4.e9192c2fe0a3.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-italic.66c33f6b248f.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3.9ef356ea553a.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }

/* ---------- tokens ---------- */

:root {
  --bg: #fcfbf9;
  --surface: #fcfbf9;
  --surface-2: #f3f1ed;
  --surface-3: #e9e6e0;
  --wall: #f1efea;        /* behind pictures */
  --ink: #1c1b19;
  --ink-2: #605d57;
  --ink-3: #87837b;
  --line: #e4e1db;
  --line-strong: #cfcbc3;
  --primary: #1c1b19;
  --primary-ink: #fcfbf9;
  --primary-hover: #3a3834;
  --link: #1c1b19;
  --focus: #3b6fd4;
  --success: #2d6a3e;
  --success-bg: #e9f2ea;
  --danger: #b3261e;
  --danger-bg: #fbeceb;
  --info-bg: #f3f1ed;
  --radius: 4px;
  --radius-sm: 4px;
  --shadow: none;
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-display: var(--serif);
  --max: 1080px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;
    --surface: #1a1a18;
    --surface-2: #22211f;
    --surface-3: #2c2b28;
    --wall: #1c1b19;
    --ink: #ebe8e2;
    --ink-2: #aaa69e;
    --ink-3: #7d7a73;
    --line: #2d2c29;
    --line-strong: #3d3c38;
    --primary: #ebe8e2;
    --primary-ink: #141413;
    --primary-hover: #ffffff;
    --link: #ebe8e2;
    --focus: #8eb0ff;
    --success: #7fcf95;
    --success-bg: #17271b;
    --danger: #ff8a80;
    --danger-bg: #351c1a;
    --info-bg: #22211f;
  }
}

:root[data-theme="dark"] {
  --bg: #141413;
  --surface: #1a1a18;
  --surface-2: #22211f;
  --surface-3: #2c2b28;
  --wall: #1c1b19;
  --ink: #ebe8e2;
  --ink-2: #aaa69e;
  --ink-3: #7d7a73;
  --line: #2d2c29;
  --line-strong: #3d3c38;
  --primary: #ebe8e2;
  --primary-ink: #141413;
  --primary-hover: #ffffff;
  --link: #ebe8e2;
  --focus: #8eb0ff;
  --success: #7fcf95;
  --success-bg: #17271b;
  --danger: #ff8a80;
  --danger-bg: #351c1a;
  --info-bg: #22211f;
}

/* ---------- type ---------- */

body { font-size: 16px; line-height: 1.55; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.4rem; }
h3 { font-weight: 600; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legal a, .auth__alt a, .field__help a, .page--medium p > a:not(.btn) { text-decoration: underline; }
.post-caption, .profile-head__bio, .comments__body, .dm-bubble { overflow-wrap: anywhere; }

/* ---------- header ---------- */

.site-header { border-bottom-color: transparent; }
.site-header__inner { max-width: 1240px; }
.brand .wordmark { height: 24px; }

/* Wide screens: words instead of icons. Counts become small superscripts. */
@media (min-width: 900px) {
  .site-nav { gap: 6px; }
  .site-nav .icon-btn:has(.nav-word) { width: auto; padding: 0 10px; color: var(--ink-2); font-size: .98rem; }
  .site-nav .icon-btn:has(.nav-word):hover { color: var(--ink); background: none; text-decoration: underline; }
  .site-nav .icon-btn:has(.nav-word) > .icon { display: none; }
  .site-nav .nav-word { display: inline; }
  .site-nav .menu > summary .nav-word { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
  .site-nav .menu[open] > summary { background: none; }
  .site-nav .nav-count__badge, .site-nav .dm-link__count {
    position: static; display: inline-block; vertical-align: super; min-width: 0; height: auto; margin-left: 2px; padding: 0;
    background: none; box-shadow: none; color: var(--ink); font-size: .68rem; line-height: 1;
  }
}

.menu__panel { border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }

/* ---------- buttons and forms ---------- */

.btn { border-radius: 999px; padding: 8px 18px; border-color: var(--ink); background: transparent; font-weight: 600; font-size: .92rem; }
.btn:hover { background: var(--surface-2); }
.btn--primary { background: var(--primary); border-color: var(--primary); }
.btn--ghost { border-color: transparent; }
.btn--danger { border-color: var(--danger); }
.btn--sm { padding: 5px 14px; font-size: .86rem; }
.btn--lg { padding: 12px 26px; }
.icon-btn:hover { background: var(--surface-2); }
.field > label { font-weight: 600; }
input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="url"], input[type="number"], input[type="datetime-local"], textarea, select { background: var(--bg); }
input[type="file"] { background: var(--wall); }
.badge { border-radius: 999px; font-weight: 600; }

/* ---------- cards: thin rules, no boxes ---------- */

.card { border-radius: var(--radius); }
.page--narrow .card, .page--narrow .auth { border: 0; background: none; padding-left: 0; padding-right: 0; }
.auth__head .logo { display: none; }
.auth__head h1 { font-size: 2.1rem; }

/* ---------- landing ---------- */

.landing__inner { width: min(420px, 100%); }
.landing__word { margin: 0 0 18px; }
.landing__word .wordmark { height: 60px; }
.landing__tag { margin: 0 auto 36px; max-width: 24ch; color: var(--ink-2); font: 400 1.25rem/1.4 var(--serif); }
.landing__actions { grid-template-columns: 1fr 1fr; gap: 10px; }
.landing__actions .btn--primary { order: 2; }

/* ---------- profile: an exhibition page ---------- */

.profile-head { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 10px; padding: 24px 0 36px; }
.profile-head__avatar, .profile-head > .story-ring { grid-row: auto; }
.profile-head .avatar--xl, .profile-head__avatar.avatar--xl { width: 104px; height: 104px; font-size: 2.4rem; }
.profile-head__name { justify-content: center; gap: 8px; }
.profile-head__name h1 { flex-basis: 100%; margin: 4px 0 6px; font: 400 2.6rem/1.1 var(--serif); letter-spacing: -.02em; }
.profile-head__stats { justify-content: center; gap: 22px; color: var(--ink-2); font-size: .95rem; }
.profile-head__stats strong, .profile-head__stats a strong { color: var(--ink); }
.profile-head__bio { grid-column: 1; max-width: 46ch; color: var(--ink-2); font: italic 400 1.12rem/1.5 var(--serif); }
.profile-head__bio .strong { font-style: normal; font-weight: 600; color: var(--ink); font-family: var(--font); font-size: 1rem; margin-bottom: 2px; }
.profile-head__more { grid-column: 1; }

.tabs { gap: 30px; margin-bottom: 28px; }
.tabs__link { padding: 16px 0 14px; border-top: 0; text-transform: none; letter-spacing: 0; font-size: .98rem; font-weight: 400; }
.tabs__link .icon { display: none; }
.tabs__link[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

/* The grid: works hung in rows, each with a small label underneath. */
.grid { gap: 36px 28px; }
.tile { min-width: 0; aspect-ratio: auto; overflow: visible; background: none; color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.tile:hover { text-decoration: none; }
.tile::after { display: none; }
.tile > img, .tile > video { aspect-ratio: 1; height: auto; background: var(--wall); transition: opacity .15s; }
.tile:hover > img { opacity: .9; }
.tile--locked > img { transform: none; }
.tile--locked:not(:has(> img))::before { content: ""; display: block; aspect-ratio: 1; background: var(--surface-3); }
.tile__locked { inset: 0 0 auto 0; aspect-ratio: 1; }
.tile__pending { aspect-ratio: 1; height: auto; background: var(--wall); }
.tile__label { display: block; min-width: 0; line-height: 1.35; }
.tile__title { display: block; font: italic 400 1rem/1.35 var(--serif); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile__date { display: block; margin-top: 2px; font-size: .82rem; color: var(--ink-3); }

/* ---------- a single post: the work on a wall, its label beside it ---------- */

.post { border: 0; border-radius: 0; background: none; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; overflow: visible; align-items: start; }
.post__media { background: var(--wall); padding: 48px; min-height: 360px; }
.post__media .carousel__slide { min-height: 0; }
.post__media img, .post__media video, .carousel__slide img, .carousel__slide video { max-height: 74vh; }
.post__side { border-left: 0; padding: 8px 0 0 36px; }
.post__head { border-bottom: 0; padding: 0 0 12px; border-left: 2px solid var(--ink); padding-left: 14px; margin-bottom: 8px; }
.post__head > a.strong { font: 400 1.35rem/1.2 var(--serif); }
.post__body { padding: 0; overflow: visible; }
.post__foot { border-top: 1px solid var(--line); padding: 16px 0 0; margin-top: 16px; }
.post-caption { font: 400 1.12rem/1.5 var(--serif); }
.carousel__count { background: transparent; color: var(--ink-2); font-size: .85rem; }
.carousel__btn { background: var(--bg); color: var(--ink); border: 1px solid var(--line-strong); }
.carousel__nav { bottom: 14px; }
.share-box { border-top-color: var(--line); }

/* ---------- home feed: one work at a time ---------- */

.feed { max-width: 680px; }
.feed-stories { border-bottom: 0; margin-bottom: 8px; }
.feed-posts { gap: 56px; }
.feed-card { border: 0; border-radius: 0; background: none; overflow: visible; display: flex; flex-direction: column; }
.feed-card__media { order: 0; background: var(--wall); padding: 32px; }
.feed-card__media .carousel__slide { min-height: 0; }
.feed-card__media .carousel__slide img, .feed-card__media .carousel__slide video { max-height: 70vh; }
.feed-card__media .carousel__nav { bottom: 6px; }
.feed-card__head { order: 1; padding: 16px 0 4px; }
.feed-card__head > a.strong { font: 400 1.2rem var(--serif); }
.feed-card__body { order: 2; padding: 0; }
.feed-card__body .post-caption > a.strong:first-child { display: none; }
.feed-card__body .post-caption { color: var(--ink-2); font-style: italic; }

/* ---------- comments ---------- */

.comments { border-top: 1px solid var(--line); }
.comments__head h2 { font: 600 .78rem var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.comments__body { font-family: var(--serif); font-size: 1.02rem; }

/* ---------- lists, staff tables, stats ---------- */

.list > li { border-bottom-color: var(--line); }
.empty h2 { font-size: 1.6rem; }
.section-head h2 { font-size: 1.5rem; }

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

.site-footer { border-top: 0; }
.site-footer__inner { padding-top: 28px; padding-bottom: 28px; }

/* ---------- phones ---------- */

@media (max-width: 735px) {
  .post { grid-template-columns: 1fr; }
  .post__media { padding: 20px; margin: 0 calc(-1 * var(--gutter)); min-height: 0; }
  .post__side { padding: 20px 0 0; border-top: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
  .profile-head { padding-top: 8px; }
  .profile-head__name h1 { font-size: 2.1rem; }
  .profile-head__bio { grid-column: 1; }
  .profile-head__stats { gap: 16px; }
  .tabs { margin-bottom: 20px; }
}

@media (max-width: 559px) {
  .feed-posts { margin: 0; gap: 40px; }
  .feed-card__media { padding: 16px; margin: 0 calc(-1 * var(--gutter)); }
}

@media (max-width: 480px) {
  .brand .wordmark { height: 22px; }
  .landing__word .wordmark { height: 48px; }
  .landing__actions { grid-template-columns: 1fr; }
  h1 { font-size: 1.7rem; }
  .tile__title { font-size: .92rem; }
}
