/* Mob Files additions. FRAME tokens and layout stay in style.css. */

.wordmark .site-name {
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 1.15rem;
  line-height: 1.1;
  color: var(--ink);
}
.wordmark:hover .site-name { color: var(--accent); }

.doc-plate {
  min-height: 18rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
}
.doc-kicker, .doc-kind, .doc-date, .doc-source { margin: 0; }
.doc-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.doc-kind {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.05;
  max-width: 16ch;
  overflow-wrap: break-word;
}
.doc-date { font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.04em; color: var(--ink); }
.doc-source {
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 36ch;
  overflow-wrap: break-word;
  border-top: 1px solid var(--muted);
  padding-top: 0.45rem;
  margin-top: 0.2rem;
}
@media (max-width: 40rem) {
  .object-figure.doc-plate { min-height: 0; padding: 1.6rem 1.25rem 1.3rem; gap: 0.5rem; }
  .doc-kind { font-size: 1.8rem; max-width: none; }
  .doc-date { font-size: 1rem; }
  .doc-source { font-size: 1.02rem; max-width: none; }
}

.stub-flag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.15rem 0.45rem;
  margin-bottom: 0.8rem;
}

.org { margin: 1.5rem 0 2rem; }
.org-tree, .org-level {
  list-style: none;
  margin: 0;
  padding: 0;
}
.org-level { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.org-level > li { flex: 1 1 12rem; position: relative; }
.org-node {
  display: block;
  position: relative;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  background: var(--paper-2);
  padding: 0.8rem 0.9rem 0.9rem;
}
/* Tree: the Boss seat above, the other seats below, joined by plain rules. */
.org-root { display: flex; flex-direction: column; align-items: center; }
.org-root > .org-node { width: min(100%, 16rem); }
.org-root > .org-node::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 0.85rem;
  background: var(--muted);
}
.org-root > .org-level { width: 100%; margin-top: 1.7rem; flex-wrap: nowrap; }
.org-root > .org-level > li { flex: 1 1 0; min-width: 0; }
.org-root > .org-level > li::before,
.org-root > .org-level > li::after {
  content: "";
  position: absolute;
  background: var(--muted);
}
.org-root > .org-level > li::before { left: 50%; top: -0.85rem; width: 1px; height: 0.85rem; }
.org-root > .org-level > li::after { top: -0.85rem; height: 1px; left: -0.4rem; right: -0.4rem; }
.org-root > .org-level > li:first-child::after { left: 50%; }
.org-root > .org-level > li:last-child::after { right: 50%; }
.org-root > .org-level > li:only-child::after { display: none; }
.org-key { margin: 1.1rem 0 0; font-size: 0.85rem; color: var(--muted); }
.org-key-note { margin-left: 0.25rem; }
.org-key-list { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.org-key-list span {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 0.2rem 0.5rem;
}
#statement-kinds { scroll-margin-top: 5rem; }
.org-seat {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.org-empty { display: block; margin-top: 0.35rem; }

.map-full { height: min(70vh, 40rem); min-height: 22rem; border: 1px solid var(--rule); }
.map-embed { height: 22rem; border: 1px solid var(--rule); margin: 1rem 0 1.5rem; }
.map-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: end; margin: 0 0 0.8rem; }
.map-toolbar label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.map-toolbar label { max-width: 100%; min-width: 0; }
.map-toolbar select { max-width: 100%; font: 1rem var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); padding: 0.4rem 0.5rem; }
.leaflet-container { background: var(--mount); font-family: var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--paper); color: var(--ink); }
.map-popup { max-height: min(24rem, 55vh); overflow-y: auto; }
.map-popup h3 { font-size: 1rem; margin: 0 0 0.35rem; }
.map-popup p { margin: 0 0 0.45rem; font-size: 0.9rem; }
.map-popup-media { display: block; margin: 0 0 0.55rem; background: var(--mount); border-top: 3px solid var(--accent); }
.map-popup-media img { display: block; width: 100%; height: 9.5rem; object-fit: contain; padding: 0.35rem; box-sizing: border-box; }
.map-popup .map-popup-kicker {
  margin: 0 0 0.25rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-form input[type="search"] {
  width: min(100%, 36rem);
  font: 1.05rem var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.55rem 0.7rem;
}
.search-results { list-style: none; margin: 1rem 0 0; padding: 0; }
.search-results li { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.search-results .kind { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.spoke-list { columns: 2; column-gap: 2rem; }
@media (max-width: 40rem) { .spoke-list { columns: 1; } }

/* Gallery layout: hubs and pages with `layout: gallery`. Image first, title and date under it. */
.gallery { margin-bottom: 3rem; }
.gallery-grid {
  list-style: none;
  margin: 1rem 0 2rem;
  padding: 0;
  display: grid;
  gap: 1.4rem 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
}
.gallery-tile a { display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; color: inherit; }
.gallery-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-top: 3px solid transparent;
  transition: border-color 0.15s ease;
}
.gallery-media.mount { padding: 0.6rem; }
.gallery-media img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.gallery-plate { background: var(--paper-2); }
.gallery-plate .doc-plate { min-height: 0; width: 100%; height: 100%; padding: 1rem; background: var(--mount); }
.gallery-plate .doc-kind { font-size: 1.35rem; }
.gallery-plate .doc-date, .gallery-plate .doc-source { font-size: 0.8rem; }
.gallery-kicker {
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-title { font-family: var(--sans); font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.gallery-tile a:hover .gallery-media, .gallery-tile a:focus-visible .gallery-media { border-top-color: var(--accent); }
.gallery-tile a:hover .gallery-title { color: var(--accent); }
@media (max-width: 34rem) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.7rem; }
  .gallery-title { font-size: 0.85rem; }
}

.gallery-plate .doc-source { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; border-top: 0; padding-top: 0; }
.gallery-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Breadcrumbs sit on the same gutter as the page. */
.breadcrumb-trail { max-width: var(--wide); margin: 0 auto; padding: 0.9rem var(--gutter) 0; }

/* Exhibit viewer: the stored image links to the file itself. */
.exhibit-link { display: block; cursor: zoom-in; }
.exhibit-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.exhibit-note span { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

/* Timeline: events per decade. */
.decade-chart { margin: 1.5rem 0 2rem; max-width: 28rem; }
.decade-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.decade-chart .bar { fill: var(--accent); }
.decade-chart .hit { fill: transparent; }
.decade-chart a:hover .bar, .decade-chart a:focus-visible .bar { fill: var(--ink); }
.decade-chart text { font-family: var(--mono); font-size: 13px; fill: var(--muted); }
.decade-chart .peak { fill: var(--ink); }
.decade-chart .axis { stroke: var(--muted); stroke-width: 1; }
.decade-chart figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.decade-table { margin-top: 0.5rem; font-size: 0.85rem; }
.decade-table summary { cursor: pointer; color: var(--ink-2); }
.decade-table table { border-collapse: collapse; margin-top: 0.5rem; }
.decade-table th, .decade-table td { text-align: left; padding: 0.15rem 1.2rem 0.15rem 0; border-bottom: 1px solid var(--rule); font-weight: normal; }
.decade-table td { font-family: var(--mono); }
.prose h2[id^="decade-"] { scroll-margin-top: 5rem; }

/* Home: a strip of stored images, then one tile per section. */
.lead-strip { margin: 2.5rem 0 1.5rem; }
.strip-head, .home-sections h2 { margin-bottom: 0.4rem; }
.lead-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1.2rem 0.9rem; }
.lead-grid .gallery-title { font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 80rem) { .lead-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.section-grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.section-grid .gallery-media { aspect-ratio: 4 / 3; }
.section-grid .gallery-title { font-size: 1.05rem; }
.home-sections { margin: 2rem 0 3rem; }
@media (max-width: 48rem) {
  .lead-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 34rem) {
  .lead-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 0.6rem;
    scroll-padding-left: var(--gutter);
    gap: 0.7rem;
  }
  .lead-grid .gallery-tile { flex: 0 0 62%; min-width: 0; scroll-snap-align: start; }
  .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Capone spokes and Five Families pages: compact tiles inside the text column. */
.spoke-tiles .gallery-grid, .prose-page > .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem 0.9rem; }
.spoke-tiles .gallery-media, .prose-page > .gallery-grid .gallery-media { aspect-ratio: 4 / 3; }
@media (max-width: 34rem) {
  .spoke-tiles .gallery-grid, .prose-page > .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
