/* =============================================================================
   PLUGIN REGISTRY · wordpress.org published plugins
   Standalone module — independent of the projects grid.
============================================================================= */

:root, [data-theme="light"] {
  --sh-bg: #ffffff;
  --sh-panel: #f4f5f6;
  --sh-line: #dcdcde;
  --sh-text: #1e1e1e;
  --sh-mute: #8c8f94;
  --sh-admin: #1d2327;
  --sh-onaccent: #0c1d35;
  --wp-blue: #3858e9;
}
[data-theme="dark"] {
  --sh-bg: #0f2038;
  --sh-panel: #16294a;
  --sh-line: rgba(207, 240, 35, 0.16);
  --sh-text: #E6F0F8;
  --sh-mute: #6A7A95;
  --sh-admin: #071426;
  --sh-onaccent: #0c1d35;
  --wp-blue: #6f8bff;
}

/* mockup SVGs paint their accent from the plugin's own accent colour */
.plugin-card, .pl-sheet { --sh-accent: var(--pl-accent); }

/* ---------------------------------- strip --------------------------------- */
.wp-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  background: var(--bg-2);
  box-shadow: var(--shadow-2);
  margin-bottom: 28px;
  overflow: hidden;
}
.wp-strip-mark {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-right: 1px solid var(--line-1);
  background: var(--bg-inset);
  align-self: stretch;
}
.wp-strip-mark svg { width: 26px; height: 26px; fill: var(--fg-1); flex: none; }
[data-theme="dark"] .wp-strip-mark svg { fill: var(--lime); }
.wp-strip-mark b {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-1);
  line-height: 1.4;
}
.wp-strip-mark b span { display: block; color: var(--fg-3); font-weight: 400; }
.wp-stat {
  padding: 16px 24px;
  border-right: 1px solid var(--line-1);
  flex: 1 1 auto; min-width: 120px;
}
.wp-stat:last-child { border-right: 0; }
.wp-stat .n {
  font-family: var(--font-sans); font-size: 20px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--fg-1); line-height: 1;
}
.wp-stat .n em {
  font-family: var(--font-serif); font-style: italic; font-weight: 600;
  color: var(--lime-on-light);
}
.wp-stat .k {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-3); margin-top: 7px;
}
.wp-live .n { display: flex; align-items: center; gap: 9px; }
.wp-live .n i {
  width: 8px; height: 8px; border-radius: 50%; background: #3fca6b;
  box-shadow: 0 0 0 3px color-mix(in srgb, #3fca6b 22%, transparent);
  animation: wp-pulse 2.4s ease-in-out infinite;
}
@keyframes wp-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .wp-live .n i { animation: none; } }

/* ---------------------------------- cards --------------------------------- */
.plugins-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.plugin-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  background: var(--bg-2);
  box-shadow: var(--shadow-2);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.2,.7,.3,1), box-shadow 220ms, border-color 220ms;
  overflow: hidden;
}
.plugin-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--pl-accent); opacity: 0; transition: opacity 220ms;
}
.plugin-card:hover, .plugin-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
  border-color: var(--line-strong);
  outline: none;
}
.plugin-card:hover::before { opacity: 1; }

.plugin-card-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.plugin-icon {
  width: 52px; height: 52px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--pl-accent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--pl-accent) 40%, transparent);
}
.plugin-icon svg { width: 28px; height: 28px; stroke: var(--sh-onaccent); fill: none; stroke-width: 1.7; }
.plugin-card-id { min-width: 0; flex: 1; padding-right: 68px; }
.plugin-card-id h3 {
  font-family: var(--font-sans); font-size: 17px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--fg-1); margin: 2px 0 5px;
}
.plugin-author {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--fg-3);
}
.plugin-author b { color: var(--lime-on-light); font-weight: 600; }
.plugin-wp-badge {
  position: absolute; top: 16px; right: 16px;
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-3);
  border: 1px solid var(--line-1); border-radius: var(--r-full);
  padding: 4px 9px 4px 6px;
  background: var(--bg-inset);
}
.plugin-wp-badge svg { width: 11px; height: 11px; fill: currentColor; }

.plugin-tagline {
  font-size: 13.5px; line-height: 1.55; color: var(--fg-2);
  margin: 0 0 16px; flex: 1;
}
.plugin-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; }
.plugin-tag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em;
  color: var(--fg-2); background: var(--bg-inset);
  border: 1px solid var(--line-1); border-radius: var(--r-2);
  padding: 4px 7px;
}
.plugin-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 14px; border-top: 1px dashed var(--line-2);
}
.plugin-ver {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-3);
}
.plugin-ver b { color: var(--fg-1); font-weight: 600; }
.plugin-open {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--lime-on-light);
}
.plugin-open svg { width: 12px; height: 12px; transition: transform 220ms; }
.plugin-card:hover .plugin-open svg { transform: translateX(3px); }

/* --------------------------------- modal ---------------------------------- */
.pl-modal {
  position: fixed; inset: 0; z-index: 10050;
  display: grid; place-items: center;
  grid-template-columns: minmax(0, 1fr);
  padding: 24px;
  background: rgba(7, 20, 42, 0.62);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 240ms;
}
.pl-modal[hidden] { display: none; }
.pl-modal.open { opacity: 1; pointer-events: auto; }
.pl-sheet {
  width: 100%; min-width: 0; max-width: 1080px; max-height: min(90vh, 900px);
  display: flex; flex-direction: column;
  background: var(--bg-0);
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  box-shadow: 0 40px 90px rgba(7, 20, 42, 0.5);
  overflow: hidden;
  transform: translateY(18px) scale(.985);
  transition: transform 300ms cubic-bezier(.2,.7,.3,1);
}
.pl-modal.open .pl-sheet { transform: none; }

.pl-head {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-1);
  flex: none;
}
.pl-head .plugin-icon { width: 58px; height: 58px; border-radius: 13px; }
.pl-head .plugin-icon svg { width: 31px; height: 31px; }
.pl-head-id { flex: 1; min-width: 0; }
.pl-head-id h2 {
  font-family: var(--font-sans); font-size: clamp(19px, 2.4vw, 26px);
  font-weight: 800; letter-spacing: -0.028em; color: var(--fg-1);
  margin: 0 0 6px;
}
.pl-head-sub {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--fg-3);
}
.pl-head-sub b { color: var(--lime-on-light); font-weight: 600; }
.pl-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pl-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600;
  padding: 10px 15px; border-radius: var(--r-2);
  border: 1px solid var(--line-2); color: var(--fg-1);
  background: var(--bg-2); cursor: pointer; white-space: nowrap;
  transition: all 180ms;
}
.pl-btn:hover { border-color: var(--fg-1); transform: translateY(-1px); }
.pl-btn svg { width: 13px; height: 13px; fill: currentColor; }
.pl-btn-wp {
  background: var(--brand-navy-deep); color: var(--lime);
  border-color: var(--brand-navy-deep);
}
.pl-btn-wp:hover { background: var(--brand-navy); border-color: var(--brand-navy); }
[data-theme="dark"] .pl-btn-wp {
  background: var(--lime); color: var(--brand-navy-deep); border-color: var(--lime);
}
[data-theme="dark"] .pl-btn-wp:hover { background: var(--brand-lime-bright); }
.pl-close {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: var(--r-2);
  background: var(--bg-2); color: var(--fg-2); cursor: pointer;
  transition: all 180ms;
}
.pl-close:hover { color: var(--fg-1); border-color: var(--fg-1); transform: rotate(90deg); }
.pl-close svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.2; fill: none; }

.pl-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 288px;
  overflow: hidden; flex: 1; min-height: 0;
}
.pl-main { overflow-y: auto; min-width: 0; padding: 0 0 28px; }
.pl-tabs {
  display: flex; gap: 2px; padding: 0 24px;
  border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-0);
}
.pl-tab {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-3); background: none; border: 0;
  border-bottom: 2px solid transparent;
  padding: 15px 13px; cursor: pointer; transition: all 180ms;
}
.pl-tab:hover { color: var(--fg-1); }
.pl-tab.active { color: var(--fg-1); border-bottom-color: var(--pl-accent); }
.pl-pane { display: none; padding: 26px 24px 0; }
.pl-pane.active { display: block; animation: plFade 320ms cubic-bezier(.2,.7,.3,1); }
@keyframes plFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pl-pane h4 {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--lime-on-light); margin: 26px 0 12px;
}
.pl-pane h4:first-child { margin-top: 0; }
.pl-pane p { font-size: 14.5px; line-height: 1.65; color: var(--fg-2); margin: 0 0 14px; }
.pl-pane p strong { color: var(--fg-1); font-weight: 600; }
.pl-pane code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-inset); border: 1px solid var(--line-1);
  border-radius: var(--r-1); padding: 2px 6px; color: var(--lime-on-light);
}
.pl-feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.pl-feat li {
  position: relative; padding-left: 24px;
  font-size: 14px; line-height: 1.55; color: var(--fg-2);
}
.pl-feat li::before {
  content: ''; position: absolute; left: 4px; top: 8px;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--pl-accent);
}
.pl-feat li b, .pl-feat li strong, .pl-steps li strong, .pl-faq-q dd strong {
  color: var(--fg-1); font-weight: 600;
}
.pl-steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pl-steps li {
  counter-increment: s; position: relative; padding-left: 36px;
  font-size: 14px; line-height: 1.6; color: var(--fg-2);
}
.pl-steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--sh-onaccent); background: var(--pl-accent);
  width: 22px; height: 22px; border-radius: var(--r-2);
  display: grid; place-items: center;
}
.pl-faq { display: grid; gap: 14px; }
.pl-faq-q {
  border: 1px solid var(--line-1); border-radius: var(--r-3);
  background: var(--bg-2); padding: 16px 18px;
}
.pl-faq-q dt {
  font-family: var(--font-sans); font-size: 14px; font-weight: 700;
  color: var(--fg-1); margin-bottom: 7px; letter-spacing: -0.01em;
}
.pl-faq-q dd { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--fg-2); }

/* ------------------------------ screenshots ------------------------------- */
.pl-shot-stage {
  border: 1px solid var(--line-2); border-radius: var(--r-3);
  background: var(--bg-inset); padding: 14px;
  box-shadow: var(--shadow-2);
}
.pl-shot-stage svg { width: 100%; height: auto; display: block; border-radius: var(--r-2); }
.pl-shot-cap {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em;
  color: var(--fg-3); margin-top: 13px; text-align: center;
}
.pl-shot-cap b { color: var(--lime-on-light); font-weight: 600; }
.pl-thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pl-thumb {
  flex: 1 1 0; min-width: 90px;
  border: 1px solid var(--line-2); border-radius: var(--r-2);
  background: var(--bg-2); padding: 5px; cursor: pointer;
  transition: all 200ms; opacity: .58;
}
.pl-thumb svg { width: 100%; height: auto; display: block; border-radius: 2px; pointer-events: none; }
.pl-thumb:hover { opacity: .9; transform: translateY(-2px); }
.pl-thumb.active { opacity: 1; border-color: var(--pl-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pl-accent) 30%, transparent); }

/* -------------------------------- sidebar --------------------------------- */
.pl-side {
  border-left: 1px solid var(--line-2);
  background: var(--bg-1);
  overflow-y: auto; padding: 22px;
}
.pl-side-box {
  border: 1px solid var(--line-1); border-radius: var(--r-3);
  background: var(--bg-2); overflow: hidden; margin-bottom: 16px;
}
.pl-side-box:last-child { margin-bottom: 0; }
.pl-side-title {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3);
  padding: 12px 14px; border-bottom: 1px solid var(--line-1);
  background: var(--bg-inset);
}
.pl-meta-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-1);
  font-size: 12.5px;
}
.pl-meta-row:last-child { border-bottom: 0; }
.pl-meta-row .k { color: var(--fg-3); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.pl-meta-row .v { color: var(--fg-1); font-weight: 600; text-align: right; }
.pl-side-tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 14px; }
.pl-dl {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 700;
  color: var(--accent-ink); background: var(--brand-navy-deep);
  border: 0; cursor: pointer; transition: all 180ms;
}
.pl-dl:hover { background: var(--brand-navy); }
[data-theme="dark"] .pl-dl { background: var(--lime); color: var(--brand-navy-deep); }
[data-theme="dark"] .pl-dl:hover { background: var(--brand-lime-bright); }
.pl-dl svg { width: 14px; height: 14px; fill: currentColor; }
.pl-dl-note {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-3);
  text-align: center; padding: 10px;
}

/* ------------------------------- responsive ------------------------------- */
@media (max-width: 900px) {
  .pl-body { display: block; overflow-y: auto; }
  .pl-side { border-left: 0; border-top: 1px solid var(--line-2); overflow: visible; }
  .pl-main { overflow: visible; }
}
@media (max-width: 640px) {
  .pl-modal { padding: 0; }
  .pl-sheet { max-height: 100vh; height: 100%; border-radius: 0; border: 0; }
  .pl-head { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .pl-head .plugin-icon { width: 44px; height: 44px; border-radius: 10px; }
  .pl-head .plugin-icon svg { width: 24px; height: 24px; }
  .pl-head-actions { width: 100%; }
  .pl-head-actions .pl-btn { flex: 1; justify-content: center; }
  .pl-tabs { padding: 0 10px; overflow-x: auto; }
  .pl-tab { padding: 14px 10px; white-space: nowrap; }
  .pl-pane { padding: 20px 16px 0; }
  .pl-side { padding: 16px; }
  .wp-stat { padding: 14px 16px; min-width: 0; flex: 1 1 40%; }
  .wp-stat:nth-child(even) { border-right: 0; }
  .wp-strip-mark { width: 100%; border-right: 0; border-bottom: 1px solid var(--line-1); }
}
