/* Public plugin browser — layout and store-front touches unique to the
   end-user browser. Everything here builds on the shared design tokens so the
   page stays visually in sync with the admin console. */

.public-shell { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

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

.public-header {
  display: flex; align-items: center; gap: 18px;
  padding: 13px 30px;
  border-bottom: 1px solid var(--line-1);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}

.public-header .brand { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.public-header .brand .brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent) 0%, #0a5650 100%);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff;
  box-shadow: 0 2px 10px -3px var(--accent-line);
}
.public-header .brand .brand-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.15; }
.public-header .brand .brand-sub {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3);
}
.public-header .header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.public-content { flex: 1; overflow-y: auto; }
.public-content .content-inner { max-width: 1120px; margin: 0 auto; padding: 30px 30px 60px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-1);
  background:
    radial-gradient(900px 320px at 88% -40%, var(--accent-soft), transparent 70%),
    var(--surface);
  padding: 30px 32px;
  margin-bottom: 24px;
  overflow: hidden;
}
.hero .eyebrow { margin-bottom: 10px; }
.hero h1 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 8px; }
.hero p { color: var(--text-2); font-size: 14px; max-width: 62ch; }
.hero .hero-deco {
  position: absolute; right: -30px; top: -30px;
  width: 190px; height: 190px; opacity: 0.09; color: var(--accent);
  pointer-events: none;
}
.hero .hero-deco svg { width: 100%; height: 100%; }

/* ---------- Browse toolbar ---------- */

.browse-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.browse-bar .search-box { width: 320px; max-width: 100%; }
.browse-bar .result-count { color: var(--text-3); font-size: 12.5px; margin-left: auto; font-variant-numeric: tabular-nums; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; }
.pager .page-label { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* Card install affordance — a card is a link; keep the install button distinct. */
.plugin-card .plugin-foot .btn.small { margin-left: 2px; }

/* ---------- Detail page ---------- */

.detail-head { display: flex; gap: 18px; align-items: flex-start; }
.detail-head .plugin-icon { width: 60px; height: 60px; border-radius: 14px; }
.detail-head .plugin-icon .icon { width: 28px; height: 28px; }
.detail-head .detail-title { min-width: 0; }
.detail-head .detail-title h1 { font-size: 22px; letter-spacing: -0.02em; }
.detail-head .detail-sub { color: var(--text-3); font-size: 13px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.detail-head .detail-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex: none; }

.badge-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; align-items: center; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 12.5px; font-weight: 550;
  margin-bottom: 16px; cursor: pointer; border: 0; background: none; padding: 0;
}
.back-link:hover { color: var(--accent); }
.back-link .icon { width: 15px; height: 15px; }

.compat-line { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12px; }
.compat-line .icon { width: 13px; height: 13px; color: var(--text-3); }

/* ---------- Install modal ---------- */

.install-steps { display: flex; flex-direction: column; gap: 14px; }
.install-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius-ctl); padding: 11px 13px;
  font-size: 12.5px; color: var(--text-2);
}
.install-note .icon { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 1px; }

.copy-field {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line-1);
  border-radius: var(--radius-ctl); padding: 8px 8px 8px 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-1);
}
.copy-field span { flex: 1; word-break: break-all; }
.copy-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }

/* ---------- Security banner (plain-HTTP warning) ---------- */

.warn-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: var(--radius-ctl); padding: 12px 14px;
  font-size: 12.5px; color: var(--text-1); margin-bottom: 18px;
}
.warn-banner .icon { width: 17px; height: 17px; color: var(--warn); flex: none; margin-top: 1px; }
.warn-banner strong { color: var(--warn); }

/* ---------- Detail-page spacing ----------
   These live in CSS (not inline style attributes) because the public app ships a
   strict Content-Security-Policy (style-src 'self') that blocks inline styles. */

.detail-desc { margin-top: 16px; color: var(--text-2); max-width: 70ch; }
.card-note { margin-top: 10px; }
.note-sep { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }

/* Text column inside a plugin card / brand block, allowing ellipsis truncation. */
.plugin-meta { min-width: 0; }

/* Key-entry screen brand subtitle (the header rule is scoped to .public-header). */
.auth-brand .brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Install modal manual-fallback spacing. */
.install-hint { margin-bottom: 8px; }
.copy-field + .copy-field { margin-top: 7px; }

@media (max-width: 640px) {
  .public-header { padding: 12px 18px; }
  .public-content .content-inner { padding: 22px 18px 48px; }
  .detail-head { flex-wrap: wrap; }
  .detail-head .detail-actions { margin-left: 0; width: 100%; }
}

/* ---------- Detail page tabs ---------- */

.tabs {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 8px 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  border: 0; background: transparent;
  color: var(--text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s var(--ease-swift), border-color 0.15s var(--ease-swift);
}
.tab .icon { width: 15px; height: 15px; }
.tab:hover { color: var(--text-1); }
.tab[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; border-radius: 4px 4px 0 0; }

.tabpanels { padding-top: 18px; }
.tabpanel[hidden] { display: none; }

/* ---------- Overview tab ---------- */

.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 30px; align-items: start; }
.overview-grid.no-facts { grid-template-columns: 1fr; }
.overview-readme { min-width: 0; }

.facts-rail { display: flex; flex-direction: column; gap: 18px; }
.facts-group .eyebrow { margin-bottom: 8px; }
.facts-link {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-1); text-decoration: none;
  padding: 4px 0;
}
.facts-link:hover { color: var(--accent); }
.facts-link .icon { width: 14px; height: 14px; color: var(--text-3); flex: none; }

@media (max-width: 900px) {
  .overview-grid { grid-template-columns: 1fr; }
}

/* ---------- Screenshots tab ---------- */

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.gallery-item {
  padding: 0; border: 1px solid var(--line-1); border-radius: var(--radius-ctl);
  overflow: hidden; cursor: pointer; background: var(--surface-2);
  aspect-ratio: 16 / 10;
  transition: border-color 0.15s var(--ease-swift), transform 0.15s var(--ease-swift);
}
.gallery-item:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lightbox { display: flex; align-items: center; gap: 10px; }
.lightbox-image { flex: 1; min-width: 0; max-height: 60vh; width: 100%; object-fit: contain; border-radius: 8px; background: var(--surface-2); }
.lightbox-nav { flex: none; }
.lightbox-prev-icon { transform: scaleX(-1); }
.lightbox-counter { text-align: center; margin-top: 10px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- Changelog tab ---------- */

.changelog-entry + .changelog-entry { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.changelog-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
