/* ============================================================================
   Inner pages — news, gallery, and the MDA-named collections.

   Loaded on every generated site alongside base.css and the chosen template's
   own stylesheet. Everything here is template-neutral: it uses --primary and
   --accent, so a Works site and an Agency site get the same components in
   their own colours.
   ========================================================================= */

/* ---- breadcrumb -------------------------------------------------------- */
.crumb { margin-bottom: var(--s-3); }
.crumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.crumb li { font-size: var(--t-xs); color: var(--soft); display: flex; gap: .4rem; align-items: center; }
.crumb li:not(:last-child)::after { content: "/"; color: var(--line); }
.crumb a { color: var(--soft); text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--primary); text-decoration: underline; }
.crumb li[aria-current] { color: var(--ink); font-weight: 700; }

/* ---- filter bar -------------------------------------------------------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  align-items: center; justify-content: space-between;
  margin-bottom: var(--s-3);
}
.search-field { position: relative; flex: 1 1 260px; min-width: 0; }
.search-field input {
  width: 100%; padding: .85rem 1rem .85rem 2.9rem;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); font-size: var(--t-sm);
  min-height: 52px;
}
.search-field input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--soft); width: 20px; height: 20px; pointer-events: none;
}

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-btn {
  border: 2px solid var(--line); background: var(--panel); color: var(--body);
  border-radius: 100px; padding: .55rem 1.05rem; cursor: pointer;
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .03em;
  transition: background-color .16s, border-color .16s, color .16s;
  min-height: 44px;
}
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }
.chip-btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

.result-count { font-size: var(--t-xs); color: var(--soft); margin-bottom: var(--s-3); font-variant-numeric: tabular-nums; }
.empty-note { text-align: center; color: var(--soft); padding: var(--s-4) 0; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--primary); font-weight: 700; text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- news index -------------------------------------------------------- */
.post-grid {
  display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.post-card { min-width: 0; }
.post-link {
  display: flex; flex-direction: column; height: 100%;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.post-link:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}
.post-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ground); }
.post-body { padding: var(--s-3); display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.post-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.post-body h2 { font-size: var(--t-lg); color: var(--ink); }
.post-sum { font-size: var(--t-sm); color: var(--body); }
.chip {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .05em;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary); padding: .2rem .65rem; border-radius: 100px;
}
.byline { font-size: var(--t-xs); color: var(--soft); }
.read-more {
  margin-top: auto; padding-top: .4rem;
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: var(--t-xs); font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
}
.read-more .i { width: 15px; height: 15px; }
.i.flip { transform: scaleX(-1); }

/* ---- article (a post, or one collection item) -------------------------- */
.measure-wide { max-width: 78ch; }
.article-head { margin-bottom: var(--s-3); }
.article-head h1 { font-size: var(--t-3xl); margin-block: .4rem; }
.standfirst { font-size: var(--t-lg); color: var(--ink); font-weight: 600; margin-top: var(--s-2); }
.article-img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); margin-bottom: var(--s-3); background: var(--ground);
}
.prose { font-size: var(--t-md); }
.prose p { margin-bottom: var(--s-2); }
.prose p:last-child { margin-bottom: 0; }
.back-link { margin-top: var(--s-4); }

.facts {
  display: grid; gap: 1px; margin-bottom: var(--s-3);
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.facts > div { background: var(--panel); padding: var(--s-2) var(--s-3); }
.facts dt {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--soft); margin-bottom: .2rem;
}
.facts dd { margin: 0; font-weight: 700; color: var(--ink); font-size: var(--t-md); }

.more-block { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.more-head { font-size: var(--t-xl); margin-bottom: var(--s-3); }

/* ---- collections ------------------------------------------------------- */
.col-card { display: flex; flex-direction: column; gap: .4rem; text-decoration: none; }
.col-card h2 { font-size: var(--t-lg); color: var(--ink); }
.col-img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: .5rem; background: var(--ground);
}

/* ---- gallery ----------------------------------------------------------- */
.album-grid {
  display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.album {
  display: block; text-decoration: none; border-radius: var(--radius);
  overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
}
.album:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.album img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--ground); }
.album-body { padding: var(--s-2) var(--s-3); }
.album-body h2 { font-size: var(--t-lg); color: var(--ink); }
.album-body p { font-size: var(--t-xs); color: var(--soft); }

.photo-grid {
  display: grid; gap: var(--s-2);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.photo {
  position: relative; display: block; border-radius: var(--radius);
  overflow: hidden; background: var(--ground); text-decoration: none;
}
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .35s ease; }
.photo:hover img { transform: scale(1.05); }
.photo-zoom {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgb(10 20 30 / .45); color: #fff; opacity: 0; transition: opacity .2s ease;
}
.photo-zoom .i { width: 34px; height: 34px; }
.photo:hover .photo-zoom, .photo:focus-visible .photo-zoom { opacity: 1; }
.photo-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem .8rem .6rem;
  background: linear-gradient(to top, rgb(10 20 30 / .8), transparent);
  color: #fff; font-size: var(--t-xs); font-weight: 600;
}

/* ---- lightbox ---------------------------------------------------------- */
.lb {
  position: fixed; inset: 0; z-index: 1500;
  background: rgb(6 12 20 / .94);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: var(--s-2); padding: var(--s-3);
}
.lb[hidden] { display: none; }
.lb-figure { margin: 0; display: grid; gap: var(--s-2); justify-items: center; min-width: 0; }
.lb-figure img {
  max-width: 100%; max-height: 78dvh; width: auto; object-fit: contain;
  border-radius: var(--radius-sm); background: #000;
}
.lb-figure figcaption {
  color: rgb(255 255 255 / .82); font-size: var(--t-sm); text-align: center;
  max-width: 60ch;
}
.lb-close {
  position: absolute; top: var(--s-3); right: var(--s-3);
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  background: rgb(255 255 255 / .12); border: none; color: #fff;
  display: grid; place-items: center;
}
.lb-close:hover { background: rgb(255 255 255 / .24); }
.lb-nav {
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer; flex: none;
  background: rgb(255 255 255 / .12); border: none; color: #fff;
  display: grid; place-items: center;
}
.lb-nav:hover { background: rgb(255 255 255 / .24); }
.lb-count {
  position: absolute; left: 0; right: 0; bottom: var(--s-2);
  text-align: center; color: rgb(255 255 255 / .6);
  font-family: var(--font-mono); font-size: var(--t-xs);
}
@media (max-width: 620px) {
  /* On a phone the side arrows would eat the photo — put them under it. */
  .lb { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding-bottom: var(--s-5); }
  .lb-figure { grid-row: 1; }
  .lb-nav { position: absolute; bottom: var(--s-4); }
  .lb-prev { left: 22%; }
  .lb-next { right: 22%; }
  .lb-count { bottom: .35rem; }
}

/* ---- inner-page hero band --------------------------------------------- */
.page-hero {
  background: var(--primary-dark); color: #fff;
  padding-block: var(--s-5);
  margin-bottom: var(--s-5);
}
.page-hero h1 { color: #fff; }
.page-hero .eyebrow { color: #fff; opacity: .85; }
