/* Maskukat · مسكوكات — museum-catalogue styling */
:root {
  --bg: #13110e;
  --bg-2: #1b1814;
  --panel: #211d18;
  --panel-2: #29241d;
  --line: rgba(201, 169, 97, 0.22);
  --line-strong: rgba(201, 169, 97, 0.5);
  --gold: #c9a961;
  --gold-bright: #e6cb85;
  --text: #ece4d3;
  --muted: #a3967f;
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, 'Times New Roman', serif;
  --arabic: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
  --radius: 4px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) radial-gradient(ellipse at top, #221d16 0%, var(--bg) 60%) no-repeat;
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html[lang="ar"] body { font-family: var(--arabic); font-size: 18px; line-height: 1.9; }
[lang="ar"] { font-family: var(--arabic); }
html[lang="ar"] [lang="en"] { font-family: var(--serif); }
body.no-scroll { overflow: hidden; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }
h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0 0 .4em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-weight: 700; line-height: 1.5; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: .01em; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(19, 17, 14, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 10px var(--gutter);
}
.header-top, .header-bottom {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
}
.header-bottom { margin-top: 6px; }
.brand { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; color: var(--text); }
.brand:hover { color: var(--text); }
/* Both languages are shown; the current language comes first and larger */
.brand-name, .brand-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.brand [lang="en"] { font-family: var(--serif); }
.brand [lang="ar"] { font-family: var(--arabic); }
.brand-name > span { color: var(--gold); font-size: 1.05rem; }
.brand-sub > span { color: var(--muted); font-size: .8rem; }
html[lang="en"] .brand-name > [lang="en"], html[lang="ar"] .brand-name > [lang="ar"] { order: -1; color: var(--text); font-size: 1.6rem; }
html[lang="en"] .brand-name > [lang="en"] { letter-spacing: .1em; text-transform: uppercase; }
html[lang="en"] .brand-sub > [lang="en"], html[lang="ar"] .brand-sub > [lang="ar"] { order: -1; color: var(--text); font-size: .95rem; font-style: italic; }
html[lang="ar"] .brand-sub > [lang="ar"] { font-style: normal; }
.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lang-btn {
  background: transparent; border: 1px solid var(--line-strong); color: var(--gold);
  padding: 2px 14px; border-radius: 999px; cursor: pointer; font-size: .95rem;
}
.lang-btn:hover { background: var(--gold); color: var(--bg); }
.lang-btn[lang="ar"] { font-family: var(--arabic); }
.lang-btn[lang="en"] { font-family: var(--serif); }

.main-nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.main-nav a { color: var(--muted); letter-spacing: .06em; font-size: 1rem; padding: 2px 0; border-bottom: 1px solid transparent; }
html[lang="en"] .main-nav a { text-transform: uppercase; font-size: .85rem; }
.main-nav a.active, .main-nav a:hover { color: var(--gold-bright); border-bottom-color: var(--gold); }
.search-form { flex: 1 1 220px; max-width: 340px; }
.search-form input, .filters input, .filters select, .inline-select select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 10px; outline: none;
}
.search-form input:focus, .filters input:focus, .filters select:focus { border-color: var(--gold); }

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px var(--gutter) 60px; outline: none; }
.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; border-top: 1px solid var(--line); }
.site-footer p { margin: 4px 0 0; }
.ornament { color: var(--gold); }
.loading, .empty { color: var(--muted); text-align: center; padding: 40px 0; font-style: italic; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .9rem; margin: 0 0 .5em; }
html[lang="ar"] .eyebrow { text-transform: none; letter-spacing: 0; font-size: .95rem; }
.muted { color: var(--muted); }
.nw { white-space: nowrap; }
.btn {
  display: inline-block; border: 1px solid var(--line-strong); color: var(--gold); background: transparent;
  padding: 8px 20px; border-radius: var(--radius); cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--gold); color: var(--bg); }
.btn.small { padding: 5px 14px; font-size: .9rem; }

/* ---------- Home ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 5vw, 64px);
  align-items: center; padding: 18px 0 48px;
}
.hero-figure { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); }
/* The photo's dark background blends into the page, leaving only the coin */
.hero-figure img { width: 100%; max-width: 520px; aspect-ratio: 1; object-fit: contain; mix-blend-mode: lighten; }
.hero-figure:hover { color: var(--gold-bright); }
.hero-caption { font-size: .92rem; font-style: italic; text-align: center; }
html[lang="ar"] .hero-caption { font-style: normal; }
.hero-text { text-align: start; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); font-weight: 400; margin-bottom: .05em; letter-spacing: .02em; }
html[lang="en"] .hero h1 { text-transform: uppercase; letter-spacing: .12em; }
.hero-sub { font-size: clamp(1.25rem, 2.6vw, 1.75rem); font-style: italic; margin: 0 0 .3em; }
html[lang="ar"] .hero-sub { font-style: normal; }
.hero-alt { color: var(--gold); font-size: clamp(1rem, 2vw, 1.3rem); margin: 0; }
.rule { display: flex; align-items: center; gap: 14px; max-width: 320px; margin: 20px 0; color: var(--gold); }
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.hero-intro { color: var(--text); max-width: 34em; margin: 0 0 14px; font-size: 1.12rem; }
.hero-aim { color: var(--muted); font-size: 1.02rem; margin-bottom: 12px; }
.hero-learn { margin-bottom: 24px; }
.hero-aim a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.stats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 32px; color: var(--muted); }
.stats strong { display: block; color: var(--text); font-size: 2rem; font-weight: 500; line-height: 1.1; }

.section-title { text-align: center; font-size: 1rem; text-transform: uppercase; letter-spacing: .24em; color: var(--muted); margin: 8px 0 24px; font-weight: 500; }
.section-title::after { content: ''; display: block; width: 56px; height: 1px; margin: 12px auto 0; background: var(--gold); opacity: .7; }
html[lang="ar"] .section-title { text-transform: none; letter-spacing: 0; font-size: 1.3rem; }

/* Highlights: large photos of star pieces */
.highlights-wrap { margin-top: 56px; }
.frames-wrap { margin-bottom: 0; }
.highlights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.highlight { display: flex; flex-direction: column; color: var(--text); }
.highlight-img {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 8%;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s;
}
.highlight-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.highlight:hover .highlight-img { border-color: var(--gold); }
.highlight:hover .highlight-img img { transform: scale(1.03); }
.highlight:hover { color: var(--gold-bright); }
.highlight-text { padding: 12px 2px 0; }
.highlight h3 { font-size: 1.15rem; margin: 0 0 2px; line-height: 1.3; }
.highlight p { margin: 0; color: var(--gold); font-size: .92rem; }

/* Frame tiles: a shadow box with a fine inner gold frame; the cover is a faded
   "ghost" half cut off at the tile's end edge (the left edge in Arabic), and the
   text keeps clear of it */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 210px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px 18px; color: var(--text); transition: border-color .2s, transform .2s;
}
.tile:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--text); }
.tile::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(201, 169, 97, .08); pointer-events: none; }
.tile-num { font-size: 1.6rem; color: var(--gold); line-height: 1; margin-bottom: 10px; position: relative; z-index: 1; }
html[lang="ar"] .tile-num { font-size: 1rem; }
.tile h3 { font-size: 1.55rem; position: relative; z-index: 1; }
.tile-blurb { color: var(--muted); font-size: .95rem; margin: 0 0 12px; position: relative; z-index: 1; max-width: 80%; }
.tile-count { margin-top: auto; color: var(--gold); font-size: .95rem; letter-spacing: .04em; position: relative; z-index: 1; }
.tile-thumb {
  position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: -115px;
  width: 230px; height: 230px; opacity: .5;
  border-radius: 50%; overflow: hidden; transition: opacity .2s; pointer-events: none;
  /* half the coin sits outside the tile and is cut off; only the photo's dark margin fades */
  -webkit-mask-image: radial-gradient(closest-side, #000 84%, transparent 99%);
  mask-image: radial-gradient(closest-side, #000 84%, transparent 99%);
}
.tile-thumb.banknote {
  border-radius: 4px; width: 252px; height: auto; inset-inline-end: -126px;
  -webkit-mask-image: none; mask-image: none;
}
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile-thumb.coin img, .tile-thumb.medal img { transform: none; }
/* the box takes the note photo's own shape; enlarging the photo slightly pushes its
   dark margin outside the box, so only the note itself shows */
.tile-thumb.banknote img { display: block; height: auto; object-fit: fill; transform: scale(1.11); }
.tile-thumb .placeholder { display: none; }
.tile:hover .tile-thumb, .tile:focus-visible .tile-thumb { opacity: .65; }
/* keep the text clear of the cover */
.tile.has-thumb .tile-num, .tile.has-thumb h3 { margin-inline-end: 56px; }
.tile.has-thumb .tile-blurb { margin-inline-end: 100px; max-width: none; }
.tile.has-thumb.banknote .tile-num, .tile.has-thumb.banknote h3 { margin-inline-end: 100px; }
.tile.has-thumb.banknote .tile-blurb { margin-inline-end: 132px; }
@media (max-width: 600px) {
  .tile-thumb { width: 250px; height: 250px; inset-inline-end: -125px; }
  .tile-thumb.banknote { width: 270px; inset-inline-end: -135px; }
  /* tall enough for the coin to show as a whole half-circle */
  .tile.has-thumb { min-height: 262px; }
  .tile.has-thumb .tile-num, .tile.has-thumb h3 { margin-inline-end: 100px; }
  .tile.has-thumb .tile-blurb { margin-inline-end: 124px; }
  .tile.has-thumb.banknote .tile-num, .tile.has-thumb.banknote h3 { margin-inline-end: 140px; }
  .tile.has-thumb.banknote .tile-blurb { margin-inline-end: 150px; }
}
.home-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 48px; }

/* ---------- Page headings ---------- */
.crumbs { font-size: .92rem; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 0 8px; }
.crumbs span { color: var(--muted); }
/* one line: the links keep their size and a long item title ends in "…" */
.crumbs > a, .crumbs > span { flex-shrink: 0; }
.crumbs > .crumb-title { flex-shrink: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
.lede { color: var(--muted); font-size: 1.15rem; max-width: 760px; margin: 0 0 14px; font-style: italic; }
html[lang="ar"] .lede { font-style: normal; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; font-size: .95rem; }
.count { color: var(--gold); margin: 0 0 14px; }
.page-tools .count { margin: 0; }
.inline-select { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.inline-select select { width: auto; padding: 3px 8px; }
.link { border-bottom: 1px dotted var(--line-strong); }

/* ---------- Cards ---------- */
/* Every card has the same square picture area and the same height */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-auto-rows: 1fr; gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: var(--text); transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--text); }
.card-img {
  aspect-ratio: 1; flex: none; display: flex; align-items: center; justify-content: center; padding: 10%;
  background: var(--bg);
}
.card-img.banknote { padding: 6%; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-img .placeholder { min-height: 0; }
.card-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; border-top: 1px solid var(--line); }
.card h3 {
  font-size: 1.12rem; margin: 0 0 4px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
html[lang="ar"] .card h3 { line-height: 1.6; }
.card-date { color: var(--gold); margin: 0; font-size: .92rem; }
.card-mint { color: var(--muted); margin: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  align-self: flex-start; margin-top: auto; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 2px;
  font-family: var(--serif); font-size: .75rem; letter-spacing: .12em; color: var(--gold); text-transform: uppercase;
}
.card .badge { margin-top: auto; }
.card-body > .card-mint:last-child, .card-body > .card-date:last-child { margin-bottom: 0; }
/* Frame pages: heading above the pieces still awaiting photographs (eyebrow style) */
.awaiting-heading {
  margin: 40px 0 16px; color: var(--muted); font-family: inherit; font-weight: 500; line-height: 1.3;
  text-transform: uppercase; letter-spacing: .12em; font-size: .9rem;
}
html[lang="ar"] .awaiting-heading { text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 400; }
.awaiting-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 14px; color: var(--muted); font-size: .95rem; cursor: pointer; }
.awaiting-toggle input { width: 18px; height: 18px; accent-color: var(--gold); }

/* ---------- Placeholder: line drawing with the denomination ---------- */
.placeholder { width: 100%; height: 100%; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.placeholder svg { width: 78%; max-width: 230px; fill: none; stroke: var(--gold); stroke-width: 1.1; opacity: .6; overflow: visible; }
.placeholder.banknote svg { width: 92%; max-width: 300px; }
.placeholder.medal svg { width: 62%; }
.placeholder svg .thin { stroke-width: .6; }
.placeholder svg .dotted { stroke-dasharray: 1.2 2.6; }
.placeholder svg text { fill: var(--gold-bright); stroke: none; font-family: var(--serif); letter-spacing: .02em; }
html[lang="ar"] .placeholder svg text { font-family: var(--arabic); }

/* ---------- Item page ---------- */
.item { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.item-images { display: grid; gap: 18px; position: sticky; top: 140px; }
.item-images.coin, .item-images.medal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.item-images figure { margin: 0; min-width: 0; }
/* the photo strip (phones only, below) has no box of its own on wider screens */
.slides { display: contents; }
.item-images .zoomable, .item-images .placeholder {
  display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: zoom-in;
}
.item-images.banknote .zoomable, .item-images.banknote .placeholder { aspect-ratio: 16 / 9; }
.item-images .placeholder { cursor: default; }
/* a coin or medal with one photo: the empty side stays square, so both captions line up */
.item-images.coin .placeholder, .item-images.medal .placeholder { height: auto; }
.item-images img { max-height: 100%; width: auto; object-fit: contain; }
.item-images figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 6px; letter-spacing: .08em; }
html[lang="en"] .item-images figcaption { text-transform: uppercase; font-size: .86rem; letter-spacing: .14em; }
.item-info h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.alt-title { color: var(--gold); font-size: 1.25rem; margin: -4px 0 8px; }
.item-date { font-size: 1.3rem; color: var(--gold-bright); margin: 0 0 18px; }
.notes { border-inline-start: 2px solid var(--gold); padding: 2px 0 2px 16px; padding-inline: 16px 0; margin: 0 0 24px; }
.notes h2, html[lang="ar"] .notes h2, html[lang="ar"] .notes p { margin: 0; font-size: 1.08rem; }
.fields { margin: 0; border-top: 1px solid var(--line); }
.field { display: grid; grid-template-columns: 11em 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.field dt { color: var(--muted); font-size: .95rem; }
.field dd { margin: 0; }
.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; max-width: 48%; }
.pager a.next { text-align: end; margin-inline-start: auto; }
.pager small { color: var(--muted); font-size: .9rem; }

/* ---------- Browse ---------- */
.filters {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 16px; align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px;
}
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
.filters .q { grid-column: 1 / -1; }
.filters .btn { justify-self: start; }
/* Wider screens: the five filters, Sort and the Clear button sit in the form's own
   grid in their written order; the Filters button is for phones only */
.filter-bar, .filter-more { display: contents; }
.filters .filter-toggle { display: none; }
.filter-toggle .chev { fill: none; stroke: currentColor; stroke-width: 1.4; transition: transform .2s; }
.filter-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
/* The Keywords box does the header search's job here */
[data-page="browse"] .search-form, [data-page="browse"] .search-toggle { visibility: hidden; }

/* ---------- Timeline ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chips a { border: 1px solid var(--line); border-radius: 999px; padding: 2px 14px; font-size: .9rem; color: var(--muted); }
.chips a.on, .chips a:hover { border-color: var(--gold); color: var(--gold-bright); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; top: 0; bottom: 0; inset-inline-start: 7.2em; width: 1px; background: linear-gradient(var(--gold), var(--line) 90%, transparent); }
.tl-century { padding-inline-start: 8.6em; } /* measured in the list's font size, like the line */
.tl-century h2 {
  margin: 28px 0 12px; font-size: 1rem; text-transform: uppercase;
  letter-spacing: .18em; color: var(--gold);
}
html[lang="ar"] .tl-century h2 { text-transform: none; letter-spacing: 0; font-size: 1.15rem; }
.tl-entry a { display: grid; grid-template-columns: 6.4em 64px 1fr; gap: 18px; align-items: center; padding: 10px 0; color: var(--text); position: relative; }
.tl-entry a::before {
  content: ''; position: absolute; inset-inline-start: calc(7.2em - 4px); top: 50%; width: 9px; height: 9px;
  margin-top: -4px; border-radius: 50%; background: var(--bg); border: 1px solid var(--gold);
}
.tl-entry a:hover::before { background: var(--gold); }
.tl-entry a:hover strong { color: var(--gold-bright); }
.tl-year { text-align: end; color: var(--gold); font-size: .95rem; white-space: nowrap; }
.tl-thumb { width: 64px; height: 64px; margin-inline-start: 1.2em; display: flex; align-items: center; justify-content: center; }
.tl-thumb img { max-height: 100%; object-fit: contain; }
.tl-thumb .placeholder { min-height: 0; }
.tl-thumb .placeholder span { display: none; }
.tl-thumb .placeholder svg { width: 80%; }
.tl-text { display: flex; flex-direction: column; padding-inline-start: 1.2em; }
.tl-text small { color: var(--muted); font-size: .9rem; }
.tl-text em { color: var(--gold); font-size: .8rem; font-style: normal; opacity: .75; }

/* ---------- Gaps ---------- */
.gap-group { margin-bottom: 30px; }
.gap-group h2 { font-size: 1.4rem; display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.gap-group .num { color: var(--gold); font-size: 1rem; }
.gap { display: grid; grid-template-columns: 76px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px dotted var(--line); align-items: start; }
.gap .placeholder { min-height: 0; aspect-ratio: 1; opacity: .7; }
.gap .placeholder span { display: none; }
.gap .placeholder svg { width: 100%; }
.gap h3 { font-size: 1.2rem; margin: 0; }
.gap p { margin: 2px 0; color: var(--muted); }
.gap .alt-title { font-size: 1rem; margin: 0 0 4px; color: var(--gold); }

/* ---------- Notices ---------- */
.notice { max-width: 640px; margin: 40px auto; text-align: center; background: var(--panel); border: 1px solid var(--line); padding: 30px; border-radius: var(--radius); }
.notice h1 { font-size: 1.8rem; }
.notice p { color: var(--muted); }
.file-btn { margin-top: 10px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 7, 5, 0.96); overflow: auto; }
.lightbox[hidden] { display: none; }
.lb-stage { display: flex; min-width: 100%; min-height: 100%; width: max-content; padding: 40px 20px; }
.lb-stage img { margin: auto; max-width: calc(100vw - 40px); max-height: calc(100vh - 100px); cursor: zoom-in; }
.lightbox.zoomed .lb-stage img { max-width: none; max-height: none; cursor: zoom-out; }
.lb-close {
  position: fixed; top: 10px; right: 14px; z-index: 2; width: 44px; height: 44px; font-size: 2rem; line-height: 1;
  background: rgba(19,17,14,.8); border: 1px solid var(--line-strong); color: var(--gold); border-radius: 50%; cursor: pointer;
}
.lb-hint { position: fixed; bottom: 8px; left: 0; right: 0; text-align: center; margin: 0; color: var(--muted); font-size: .85rem; pointer-events: none; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .item { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .item-images { position: static; }
}
/* Coin and medal photos on phones: a swipe strip running to the screen edges, each
   side 82% wide so the other one peeks in. Banknotes keep stacking. */
@media (max-width: 600px) {
  .item-images.coin, .item-images.medal { grid-template-columns: minmax(0, 1fr); }
  .slides {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .slides::-webkit-scrollbar { display: none; }
  .slides > figure { flex: 0 0 82%; scroll-snap-align: start; }
  .slides .placeholder { height: auto; }
}
@media (max-width: 600px) {
  body { font-size: 18px; }
  .site-header { position: static; }
  html[lang="en"] .brand-name > [lang="en"], html[lang="ar"] .brand-name > [lang="ar"] { font-size: 1.35rem; }
  .search-form { max-width: none; flex-basis: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  /* Browse: Keywords, Sort, then the Filters button beside Clear filters; the five
     filters open below it in two columns */
  .filters { grid-template-columns: minmax(0, 1fr); }
  .filters .sort-field { order: 1; }
  .filter-bar { order: 2; }
  .filter-more { order: 3; }
  .filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .filters .filter-toggle { display: inline-flex; gap: 10px; }
  .filter-more { display: none; }
  .filters-open .filter-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
  .card h3 { font-size: 1.05rem; }
  .card-body { padding: 10px 12px 12px; }
  .tiles { grid-template-columns: 1fr; }
  /* label beside value */
  .field { grid-template-columns: 8.6em 1fr; gap: 10px; }
  .field dt { font-size: .95rem; }
  .timeline::before { inset-inline-start: 4.6em; }
  .tl-century { padding-inline-start: 5.8em; }
  .tl-entry a { grid-template-columns: 4em 44px 1fr; gap: 10px; font-size: .95rem; }
  .tl-entry a::before { inset-inline-start: calc(4.6em - 4px); }
  .tl-thumb { width: 44px; height: 44px; margin-inline-start: .9em; }
  .tl-year { font-size: .8rem; white-space: normal; }
}

/* In Arabic mode, keep English-language values aligned with the rest of the page */
html[dir="rtl"] [dir="auto"] { text-align: right; }
html[dir="rtl"] .pager a.next [dir="auto"] { text-align: left; }

/* ---------- Keyboard focus and skip link ---------- */
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 2px; }
.card:focus-visible, .tile:focus-visible { outline-offset: 2px; border-color: var(--gold); }
main:focus { outline: none; }
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; padding: 10px 16px;
  background: var(--gold); color: var(--bg); border: 0; border-radius: var(--radius); font: inherit; cursor: pointer;
}
.skip-link:focus { top: 12px; }

/* ---------- Comfortable tap targets (at least 44px) ---------- */
.main-nav a, .chips a, .crumbs a, .lang-btn, .btn, .btn.small, .inline-select select,
.filters input, .filters select, .search-form input, .pager a, .link {
  min-height: 44px;
}
.main-nav a, .crumbs a, .link { display: inline-flex; align-items: center; }
.main-nav a { min-width: 44px; justify-content: center; }
.chips a, .lang-btn, .btn { display: inline-flex; align-items: center; justify-content: center; }
.btn.small { padding: 6px 16px; }
.pager a { justify-content: center; }

/* ---------- Item page extras ---------- */
.item-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.share-status { color: var(--muted); font-size: .9rem; word-break: break-all; }
.keys-hint { color: var(--muted); font-size: .85rem; text-align: center; margin: 14px 0 0; }
@media (hover: none) { .keys-hint { display: none; } }

/* ---------- About page ---------- */
.about { max-width: 760px; }
/* the opening paragraph reads as body text, not as a muted italic standfirst */
.about .lede { font-style: normal; color: var(--text); }
.about p { margin: 0 0 16px; }
.about-frames { margin: 0 0 20px; padding-inline-start: 1.4em; }
.about-frames li { margin-bottom: 10px; }
.about-frames li > a { display: inline-flex; align-items: center; min-height: 44px; }
.about-blurb { color: var(--muted); font-size: .95rem; }
.about-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Compact header on phones ---------- */
.search-toggle { display: none; }
@media (max-width: 600px) {
  .header-top { flex-wrap: nowrap; align-items: center; }
  .controls { flex-shrink: 0; gap: 10px; }
  .brand-sub { display: none; }
  /* the search box opens under the nav from a round button beside the language button */
  .search-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
    background: transparent; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold); cursor: pointer;
  }
  .search-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
  .search-toggle:hover, .search-toggle[aria-expanded="true"] { background: var(--gold); color: var(--bg); }
  .search-form { display: none; }
  .search-open .search-form { display: block; }
  /* fade only the edge with more links behind it (classes set in app.js) */
  .main-nav.fade-end:not(.fade-start) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .main-nav.fade-start:not(.fade-end) { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
  .main-nav.fade-start.fade-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
  html[dir="rtl"] .main-nav.fade-end:not(.fade-start) { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
  html[dir="rtl"] .main-nav.fade-start:not(.fade-end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .main-nav { flex-wrap: nowrap; overflow-x: auto; gap: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { white-space: nowrap; flex-shrink: 0; }
  html[lang="en"] .main-nav a { font-size: .92rem; letter-spacing: .03em; }
  html[lang="ar"] .main-nav { gap: 0 11px; }
  html[lang="ar"] .main-nav a { font-size: .95rem; }
  .header-bottom { margin-top: 2px; }
}
@media (max-width: 359px) {
  .main-nav { gap: 0 11px; }
  html[lang="en"] .main-nav a { letter-spacing: 0; font-size: .8rem; }
  html[lang="ar"] .main-nav { gap: 0 4px; }
  html[lang="ar"] .main-nav a { font-size: .88rem; }
}

/* ---------- Inscriptions ---------- */
.inscriptions { margin: 0 0 24px; }
.inscriptions h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); margin-bottom: 4px; }
html[lang="ar"] .inscriptions h2 { text-transform: none; letter-spacing: 0; font-size: 1rem; }
.inscriptions dd { font-style: italic; }
html[lang="ar"] .inscriptions dd { font-style: normal; }

/* ---------- Desktop: keep both photos in view while the text scrolls ---------- */
@media (min-width: 861px) {
  .item-images { top: 136px; max-height: calc(100vh - 150px); }
  .item-images figure { min-height: 0; }
  /* Banknotes stack front over back: size each so the pair fits the screen height */
  .item-images.banknote .zoomable, .item-images.banknote .placeholder {
    aspect-ratio: auto; height: calc((100vh - 150px - 70px) / 2); max-height: calc((100vh - 150px - 70px) / 2);
  }
  .item-images.banknote img { max-height: 100%; max-width: 100%; }
}
/* No photographs yet: one wide box with the drawing fitted to its height */
.item-images.no-photo { grid-template-columns: minmax(0, 1fr); }
.item-images.no-photo .placeholder { aspect-ratio: 2 / 1; height: auto; max-height: none; }
.item-images.no-photo .placeholder svg { height: 100%; width: auto; max-width: none; }

/* Photo credit under the item photos */
.photo-credit { grid-column: 1 / -1; margin: -6px 0 0; text-align: center; color: var(--muted); font-size: .8rem; letter-spacing: .03em; }

/* ---------- Frame essay ---------- */
.essay { max-width: 68ch; margin: 0 0 36px; font-size: 1.08rem; }
.essay p { margin: 0 0 1em; }
.essay p:first-child::first-letter { float: left; font-size: 3.4em; line-height: .9; padding: 4px 8px 0 0; color: var(--gold); }
html[lang="ar"] .essay p:first-child::first-letter { float: none; font-size: inherit; line-height: inherit; padding: 0; color: inherit; }
html[lang="ar"] .essay { font-size: 1.1rem; }
.essay-more summary { cursor: pointer; color: var(--gold); min-height: 44px; display: inline-flex; align-items: center; list-style: none; border-bottom: 1px dotted var(--line-strong); margin-bottom: 1em; }
.essay-more summary::-webkit-details-marker { display: none; }
.essay-more summary::after { content: ' ↓'; white-space: pre; }
.essay-more[open] summary { display: none; }
.grid-tools { border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: 16px; }

/* ---------- Wanted ---------- */
.offers { color: var(--gold-bright); font-size: 1.15rem; margin: 0 0 6px; }

/* ---------- Map ---------- */
.map-wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.map { height: 62vh; min-height: 380px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.map.leaflet-container { background: var(--bg); font: inherit; }
.leaflet-container { font-family: var(--serif); }
.leaflet-container .leaflet-control-attribution { background: rgba(19,17,14,.92) !important; color: var(--text) !important; font-size: 12px; padding: 2px 8px; }
.leaflet-control-attribution a { color: var(--gold) !important; }
.leaflet-bar a { background: var(--panel) !important; color: var(--gold) !important; border-color: var(--line) !important; }
.leaflet-tooltip.map-label { background: rgba(19,17,14,.88); color: var(--text); border: 1px solid var(--line-strong); border-radius: 2px; box-shadow: none; font-family: var(--serif); font-size: 13px; padding: 1px 7px; }
.leaflet-tooltip.map-label.ar { font-family: var(--arabic); font-size: 14px; }
.leaflet-tooltip.map-label::before { display: none; }
.leaflet-tooltip.map-label.ar { direction: rtl; }
.leaflet-tooltip.map-label.is-hidden { opacity: 0 !important; pointer-events: none; }
.leaflet-interactive:hover + .leaflet-tooltip, .map .leaflet-tooltip { transition: opacity .15s; }
.map-controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.map-modes { display: inline-flex; align-self: flex-start; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.map-modes button { min-height: 44px; padding: 4px 18px; background: transparent; border: 0; color: var(--muted); cursor: pointer; }
.map-modes button + button { border-inline-start: 1px solid var(--line-strong); }
.map-modes button[aria-pressed="true"] { background: var(--gold); color: var(--bg); }
.map-chips { margin: 0; }
.map-chips button { min-height: 44px; display: inline-flex; align-items: center; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 2px 14px; font-size: .9rem; color: var(--muted); cursor: pointer; }
.map-chips button[aria-pressed="true"], .map-chips button:hover { border-color: var(--gold); color: var(--gold-bright); }
.map-note { margin: 0; color: var(--muted); font-size: .9rem; font-style: italic; }
html[lang="ar"] .map-note { font-style: normal; }
.map-box { position: relative; }
.map-all { position: absolute; z-index: 500; top: 10px; right: 10px; background: rgba(19,17,14,.9); }
.map-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; max-height: 62vh; overflow: auto; }
.map-panel h2 { font-size: 1.4rem; margin: 0; }
.mini-list { list-style: none; margin: 8px 0 0; padding: 0; }
.mini-list a { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.mini-list a:hover strong { color: var(--gold-bright); }
.mini-thumb { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.mini-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mini-thumb .placeholder { min-height: 0; }
.mini-text { display: flex; flex-direction: column; }
.mini-text strong { font-weight: 500; font-size: 1rem; line-height: 1.3; }
.mini-text small { color: var(--gold); font-size: .85rem; }
.place-list { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.place-list button { min-height: 44px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; color: var(--muted); cursor: pointer; }
.place-list button:hover, .place-list button.on { border-color: var(--gold); color: var(--gold-bright); }

/* ---------- Stories ---------- */
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.story-card { display: grid; grid-template-columns: 130px 1fr; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); }
.story-card:hover { border-color: var(--gold); color: var(--text); }
.story-img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.story-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.story-text { display: flex; flex-direction: column; align-items: flex-start; }
.story-text .link { margin-top: auto; }
.story-text h2 { font-size: 1.35rem; margin: 4px 0 6px; }
.story-text p { color: var(--muted); margin: 0 0 8px; font-size: .98rem; }
.draft-badge { display: inline-block; white-space: nowrap; align-self: flex-start; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: #1a1610; background: #d9a441; padding: 0 8px; border-radius: 2px; }
html[lang="ar"] .draft-badge { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.draft-banner { background: rgba(217, 164, 65, .14); border: 1px dashed #d9a441; color: #f0c86e; padding: 8px 14px; border-radius: var(--radius); text-align: center; margin: 0 0 20px; }
.story { max-width: 760px; margin: 0 auto; }
.story-head { text-align: center; margin-bottom: 26px; }
.story-cover { max-width: 300px; margin: 0 auto 18px; }
.story-cover.banknote { max-width: 480px; }
.story-cover .zoomable { display: block; width: 100%; background: none; border: 0; padding: 0; cursor: zoom-in; }
.story-cover img { width: 100%; height: auto; mix-blend-mode: lighten; }
.story-body { font-size: 1.12rem; }
.story-body p { margin: 0 0 1.05em; }
.story-body a { border-bottom: 1px solid var(--line-strong); }
.story-items { margin-top: 36px; }
.story-subhead {
  font-size: .82rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em; color: var(--muted);
  margin: 2.2em 0 .9em; padding-top: 1.2em; border-top: 1px solid var(--line);
}
html[lang="ar"] .story-subhead { text-transform: none; letter-spacing: 0; font-size: 1.05rem; font-weight: 700; }
.sources { margin: 0 0 1.2em; padding-inline-start: 1.2em; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.sources li { margin: 0 0 .7em; padding-inline-start: .2em; }
.sources li::marker { color: var(--gold); }
.sources a { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; letter-spacing: .06em; }
/* the header's pages again, in one centred row */
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; margin-top: 4px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; letter-spacing: .04em; }

/* ---------- New layouts on small screens ---------- */
@media (max-width: 960px) {
  .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; text-align: center; padding-top: 0; padding-bottom: 32px; }
  /* the words first, so the first screen says what the site is */
  .hero-text { text-align: center; order: -1; }
  .hero-figure img { max-width: 240px; }
  .rule { margin: 18px auto; }
  .hero-intro { margin-inline: auto; }
  .stats { justify-content: center; }
  .map-wrap { grid-template-columns: 1fr; }
  .map { height: 52vh; min-height: 320px; }
  .map-panel { max-height: none; }
}
@media (max-width: 600px) {
  /* the four Arabic stat labels do not fit in one row: two by two */
  html[lang="ar"] .stats { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 12px 44px; }
  /* keep the six footer links on one row down to 360px */
  .site-footer { padding-inline: var(--gutter); }
  .footer-nav { gap: 0 12px; }
  .highlights { gap: 14px; }
  .highlight h3 { font-size: 1rem; }
  .grid { gap: 12px; }
  .card h3 { font-size: 1rem; }
  .stories { grid-template-columns: 1fr; }
  .story-card { grid-template-columns: 90px 1fr; gap: 14px; }
  .essay { font-size: 1.02rem; }
  .essay p:first-child::first-letter { font-size: 2.8em; }
}

/* Timeline frame chips on phones: one scrolling row */
@media (max-width: 600px) {
  .tl-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tl-chips::-webkit-scrollbar { display: none; }
  .tl-chips a { flex-shrink: 0; white-space: nowrap; }
}

/* Map controls on phones: one scrolling row of period chips, so the map stays in view */
@media (max-width: 600px) {
  .map-modes button { padding: 4px 12px; font-size: .92rem; }
  .map-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .map-chips::-webkit-scrollbar { display: none; }
  .map-chips button { flex-shrink: 0; white-space: nowrap; }
  .map-controls { gap: 10px; margin-bottom: 12px; }
}
