/*
  Te Pā Tūwatawata — Media kit gateway pages
  Layered ON TOP of assets/kiwi-dialectic.css.
  Adds: filter bar, asset grid, language switcher, download chips.
  All colour tokens come from the parent stylesheet.
*/

/* ─── Sub-page hero ─── */
.kit-hero {
  padding: 56px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.kit-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--fg);
}
.kit-hero .lede {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 680px;
}
.kit-hero .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
  font-family: var(--font-sans);
  font-size: .9rem;
  color: var(--fg-muted);
}
.kit-hero .meta-row span { display: inline-flex; gap: 6px; align-items: center; }
.kit-hero .meta-row strong { color: var(--fg); font-weight: 600; }

/* ─── Breadcrumb (already in kiwi-dialectic.css but ensure spacing) ─── */
.kit-crumb {
  font-family: var(--font-sans);
  font-size: .85rem;
  color: var(--fg-muted);
  padding: 18px 0 0;
}
.kit-crumb a { color: var(--fg-muted); text-decoration: underline; }
.kit-crumb a:hover { color: var(--accent); }

/* ─── Language switcher ─── */
.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 8px;
  font-family: var(--font-sans);
}
.lang-switch button {
  background: var(--bg-card);
  border: 1px solid var(--border-bold);
  color: var(--fg);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.lang-switch button:hover { border-color: var(--accent); }
.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--ma-pure);
  border-color: var(--accent);
}

/* ─── Filter bar (multi-axis) ─── */
.filter-bar {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 24px 0 32px;
  font-family: var(--font-sans);
}
.filter-bar h3 {
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-muted);
  margin: 0 0 10px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-row > .filter-label {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-muted);
  align-self: center;
  margin-right: 6px;
  min-width: 84px;
}
.filter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-bold);
  color: var(--fg);
  font: inherit;
  font-size: .82rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip[aria-pressed="true"] {
  background: var(--mangu);
  color: var(--ma-pure);
  border-color: var(--mangu);
}
[data-theme="dark"] .filter-chip[aria-pressed="true"] {
  background: var(--ma); color: var(--mangu); border-color: var(--ma);
}
.filter-summary {
  font-size: .85rem;
  color: var(--fg-muted);
  margin-top: 12px;
}
.filter-summary strong { color: var(--fg); }

/* ─── Section heading inside kits ─── */
.kit-section { margin: 48px 0 24px; }
.kit-section h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  line-height: 1.15;
  margin: 0 0 6px;
}
.kit-section .sec-sub {
  font-family: var(--font-sans);
  font-size: .9rem;
  color: var(--fg-muted);
  margin: 0 0 18px;
}

/* ─── Asset grids ─── */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s, transform .15s;
}
.asset-card:hover { border-color: var(--accent); }
.asset-card .preview {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-raised);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.asset-card .preview img,
.asset-card .preview object {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.asset-card .preview--wide { aspect-ratio: 3 / 1; }
.asset-card .preview--poster { aspect-ratio: 0.707; } /* A4 */
.asset-card h3 {
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 4px 0 0;
  color: var(--fg);
}
.asset-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: .72rem;
  color: var(--fg-muted);
}
.asset-card .tag {
  background: var(--bg-raised);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: lowercase;
  letter-spacing: .02em;
}
.asset-card .dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.asset-card .dl-row a {
  background: var(--mangu);
  color: var(--ma-pure);
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  letter-spacing: .02em;
}
[data-theme="dark"] .asset-card .dl-row a {
  background: var(--ma); color: var(--mangu);
}
.asset-card .dl-row a:hover { background: var(--accent); color: var(--ma-pure); }

/* ─── Thread cards (launch announcements) ─── */
.thread-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.thread-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 20px 22px;
}
.thread-card[hidden] { display: none; }
.thread-card[dir="rtl"] { border-left: 1px solid var(--border); border-right: 4px solid var(--accent); }
.thread-card .lang-tag {
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.thread-card h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 0 0 4px;
  line-height: 1.2;
}
.thread-card .audience {
  font-family: var(--font-sans);
  font-size: .82rem;
  color: var(--fg-muted);
  margin-bottom: 14px;
}
.thread-card .dl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.thread-card .dl-row a {
  display: inline-block;
  background: var(--bg-raised);
  border: 1px solid var(--border-bold);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
}
.thread-card .dl-row a:hover { background: var(--accent); color: var(--ma-pure); border-color: var(--accent); }
.thread-card .dl-row a.primary {
  background: var(--mangu);
  color: var(--ma-pure);
  border-color: var(--mangu);
}
[data-theme="dark"] .thread-card .dl-row a.primary {
  background: var(--ma); color: var(--mangu); border-color: var(--ma);
}

/* ─── Big download buttons ─── */
.bundle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 12px;
}
.bundle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--ma-pure);
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 6px;
  border: 1px solid var(--accent);
}
.bundle-btn:hover { background: transparent; color: var(--accent); }
.bundle-btn.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-bold);
}
.bundle-btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Press-contact / licence card ─── */
.info-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 26px;
  margin: 32px 0;
  font-family: var(--font-sans);
}
.info-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin: 0 0 10px;
}
.info-card p { margin: 0 0 8px; line-height: 1.6; }
.info-card code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: .9em;
  border: 1px solid var(--border);
}

/* ─── Hashtags ─── */
.hash-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: .85rem;
  margin: 14px 0 0;
}
.hash-row span {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent);
}

/* ─── No-results state ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  background: var(--bg-raised);
  border-radius: 10px;
}
.empty-state strong { color: var(--fg); }

/* RTL languages (Arabic) */
[lang="ar"], [dir="rtl"] {
  text-align: right;
}

/* ─── Expandable inline thread reader ─── */
.thread-expand {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.thread-expand summary {
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  padding: 4px 0;
  user-select: none;
}
.thread-expand summary::-webkit-details-marker { display: none; }
.thread-expand summary:hover { text-decoration: underline; }
.thread-expand[open] summary { margin-bottom: 8px; }
.thread-body {
  font-family: var(--font-sans);
  font-size: .93rem;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg-raised);
  border-radius: 6px;
  padding: 14px 18px;
  max-height: 520px;
  overflow: auto;
}
.thread-body[dir="rtl"] { text-align: right; }
.thread-body h1 { font-size: 1.2rem; margin: 4px 0 10px; font-family: var(--font-serif); }
.thread-body h2 { font-size: 1.05rem; margin: 16px 0 6px; font-family: var(--font-serif); }
.thread-body h3 { font-size: .98rem; margin: 12px 0 6px; }
.thread-body p { margin: 6px 0; }
.thread-body ul, .thread-body ol { padding-inline-start: 22px; margin: 6px 0; }
.thread-body li { margin: 3px 0; }
.thread-body blockquote {
  border-inline-start: 3px solid var(--accent);
  margin: 8px 0;
  padding: 4px 12px;
  color: var(--fg-muted);
  font-style: italic;
}
.thread-body code {
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .86em;
}
.thread-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
.thread-body a { color: var(--accent); }
.thread-body .loading,
.thread-body .error { color: var(--fg-muted); font-style: italic; }
.thread-body .error a { font-style: normal; }
