/* ============================================================
   PLUGIN PAGES - shared styles for /plugins/*.html
   Layered on top of ranks/rank-pages.css (the theme kit).
   ============================================================ */

/* ---------- Hexagon crest in the hero ---------- */
.pp-crest {
  position: relative;
  flex: 0 0 auto;
  width: clamp(170px, 22vw, 260px);
  filter: drop-shadow(0 14px 40px rgba(0, 0, 0, 0.55));
}
.pp-crest::before {
  content: "";
  position: absolute;
  inset: -14%;
  background: radial-gradient(circle, var(--rk-glow, rgba(230, 200, 74, 0.22)) 0%, transparent 62%);
  animation: rk-glow 4.5s ease-in-out infinite;
  pointer-events: none;
}
.pp-crest svg { position: relative; width: 100%; height: auto; display: block; }

/* ---------- Content figure / image slots ---------- */
.pp-fig {
  margin: 0 0 1.4rem;
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.pp-fig a { display: block; overflow: hidden; }
.pp-fig img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}
.pp-fig a:hover img { transform: scale(1.02); }
.pp-fig figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- Figure frame variants ----------
   fx-cine: animated showcase border for cinematic / art images.
   Tint per page with --fx1/--fx2/--fx3 (border), --fx-glow, --fxc (corner
   ticks), --fx-cap / --fx-capbg / --fx-capline (caption). Defaults: gold.
   fx-tech: HUD-style frame for UI screenshots. */
.pp-fig.fx-cine {
  position: relative;
  border: 3px solid transparent;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #0b0c10, #0b0c10) padding-box,
    linear-gradient(120deg, var(--fx1, #6d5210), var(--fx2, #e6c84a), var(--fx3, #fdf6d8), var(--fx2, #e6c84a), var(--fx1, #6d5210)) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: fx-border-shift 9s ease-in-out infinite;
  box-shadow: 0 0 30px var(--fx-glow, rgba(230, 200, 74, 0.2)), 0 14px 40px rgba(0, 0, 0, 0.55);
}
@keyframes fx-border-shift {
  0%, 100% { background-position: 0 0, 0% 50%; }
  50% { background-position: 0 0, 100% 50%; }
}
.pp-fig.fx-cine::after,
.pp-fig.fx-tech::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--fxc, rgba(255, 220, 140, 0.8)), var(--fxc, rgba(255, 220, 140, 0.8))),
    linear-gradient(var(--fxc, rgba(255, 220, 140, 0.8)), var(--fxc, rgba(255, 220, 140, 0.8))),
    linear-gradient(var(--fxc, rgba(255, 220, 140, 0.8)), var(--fxc, rgba(255, 220, 140, 0.8))),
    linear-gradient(var(--fxc, rgba(255, 220, 140, 0.8)), var(--fxc, rgba(255, 220, 140, 0.8))),
    linear-gradient(var(--fxc, rgba(255, 220, 140, 0.8)), var(--fxc, rgba(255, 220, 140, 0.8))),
    linear-gradient(var(--fxc, rgba(255, 220, 140, 0.8)), var(--fxc, rgba(255, 220, 140, 0.8))),
    linear-gradient(var(--fxc, rgba(255, 220, 140, 0.8)), var(--fxc, rgba(255, 220, 140, 0.8))),
    linear-gradient(var(--fxc, rgba(255, 220, 140, 0.8)), var(--fxc, rgba(255, 220, 140, 0.8)));
  background-size: 22px 2px, 2px 22px, 22px 2px, 2px 22px, 22px 2px, 2px 22px, 22px 2px, 2px 22px;
  background-position:
    10px 10px, 10px 10px,
    calc(100% - 10px) 10px, calc(100% - 10px) 10px,
    10px calc(100% - 10px), 10px calc(100% - 10px),
    calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) calc(100% - 10px);
}
.pp-fig.fx-cine figcaption {
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--fx-cap, #efe3b8);
  background: linear-gradient(180deg, var(--fx-capbg, rgba(230, 200, 74, 0.09)), transparent);
  border-top: 1px solid var(--fx-capline, rgba(230, 200, 74, 0.35));
}
.pp-fig.fx-tech {
  position: relative;
  border: 1px solid rgba(164, 245, 238, 0.32);
  border-radius: 8px;
  background: #0d1014;
  box-shadow: 0 0 22px rgba(164, 245, 238, 0.08), 0 10px 30px rgba(0, 0, 0, 0.5);
  --fxc: rgba(164, 245, 238, 0.6);
}
.pp-fig.fx-tech figcaption {
  font-family: Consolas, Menlo, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #9fd8d2;
  background: rgba(164, 245, 238, 0.05);
  border-top: 1px solid rgba(164, 245, 238, 0.28);
}
.pp-fig.fx-tech figcaption::before { content: "// "; color: #a4f5ee; opacity: 0.7; }
@media (prefers-reduced-motion: reduce) {
  .pp-fig.fx-cine { animation: none; }
}

/* Two-up figures */
.pp-fig-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.pp-fig-row .pp-fig { margin: 0; }

/* ---------- Command reference ---------- */
.pp-cmds {
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.4rem;
}
.pp-cmds-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.15rem;
  background: rgba(230, 200, 74, 0.06);
  border-bottom: 1px solid var(--rk-accent-line);
}
.pp-cmds-head h3, .pp-cmds-head h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1.02rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rk-accent-bright);
}
.pp-cmds-head span { font-size: 0.84rem; color: var(--muted); }
.pp-cmd-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.7rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.pp-cmd-row:last-child { border-bottom: 0; }
.pp-cmd-chip {
  flex: 0 0 auto;
  padding: 0.32rem 0.7rem;
  font-family: Consolas, Menlo, monospace;
  font-size: 0.92rem;
  background: #101318;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
}
.pp-cmd-chip .cmd { color: var(--rk-accent-bright); font-weight: 400; }
.pp-cmd-desc { font-size: 0.93rem; color: var(--muted); line-height: 1.55; }
.pp-cmd-desc a { color: var(--accent); }
.pp-cmd-desc a:hover { text-decoration: underline; }
.pp-cmd-desc strong { color: var(--text); }
@media (max-width: 640px) {
  .pp-cmd-row { flex-direction: column; gap: 0.3rem; }
  .pp-cmd-chip { white-space: normal; }
}

/* ---------- Terminal-style keybind panel ---------- */
.pp-term {
  background: #101318;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.4rem;
}
.pp-term-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pp-term-head::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rk-accent);
  box-shadow: 14px 0 0 rgba(230, 200, 74, 0.45), 28px 0 0 rgba(230, 200, 74, 0.2);
  margin-right: 28px;
}
.pp-term-body { padding: 0.9rem 1.15rem; }
.pp-term-line {
  font-family: Consolas, Menlo, monospace;
  font-size: 0.92rem;
  color: #d7dce6;
  padding: 0.28rem 0;
  line-height: 1.5;
}
.pp-term-line::before { content: "> "; color: var(--rk-accent); }
.pp-term-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: "Inter", sans-serif;
}
.pp-term-line .cmd { color: var(--rk-accent-bright); }

/* ---------- Callouts ---------- */
.pp-note, .pp-warn {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1.15rem;
  border-radius: 10px;
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}
.pp-note { background: rgba(230, 200, 74, 0.06); border: 1px solid var(--rk-accent-line); }
.pp-warn { background: rgba(226, 69, 43, 0.07); border: 1px solid rgba(226, 69, 43, 0.4); }
.pp-note strong, .pp-warn strong { color: var(--text); }
.pp-warn strong { color: #ffcbb0; }
.pp-note svg, .pp-warn svg { flex: 0 0 auto; margin-top: 0.15rem; }
.pp-note svg { color: var(--rk-accent); }
.pp-warn svg { color: #e2452b; }
.pp-note a, .pp-warn a { color: var(--accent); }

/* ---------- Prose inside plugin pages ---------- */
.pp-prose { color: var(--muted); font-size: 0.98rem; line-height: 1.65; }
.pp-prose p { margin: 0 0 0.9rem; }
.pp-prose a { color: var(--accent); }
.pp-prose a:hover { text-decoration: underline; }
.pp-prose strong { color: var(--text); }
.pp-prose ul, .pp-prose ol { margin: 0.5rem 0 1rem; padding-left: 1.35rem; }
.pp-prose li { margin-bottom: 0.45rem; }
.pp-prose code {
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
}

/* ---------- Data tables ---------- */
.pp-tablewrap { overflow-x: auto; margin-bottom: 1.4rem; background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel)); border: 1px solid var(--line); border-radius: 12px; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.pp-table th {
  text-align: left;
  padding: 0.65rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rk-accent-line);
  white-space: nowrap;
}
.pp-table td {
  padding: 0.6rem 1.1rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.pp-table tbody tr:last-child td { border-bottom: 0; }
.pp-table td:first-child { color: var(--text); font-weight: 600; }
.pp-table tbody tr:hover { background: rgba(230, 200, 74, 0.04); }
.pp-table a { color: var(--accent); }
.pp-table .pp-best { color: var(--rk-accent-bright); font-weight: 700; }

/* ---------- Legendary catalog grid (unscoped copy of the .content-prose version) ---------- */
.rankpage .leg-catalog {
  margin: 0.75rem 0 1rem;
  padding: 0.95rem 1.2rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border-radius: 12px;
}
.rankpage ul.leg-catalog-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(17, auto);
  column-gap: 1.5rem;
  row-gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-content: start;
}
.rankpage ul.leg-catalog-grid li {
  margin: 0;
  font-size: 0.97rem;
  color: var(--text);
}
@media (max-width: 768px) {
  .rankpage ul.leg-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(26, auto);
  }
}
@media (max-width: 480px) {
  .rankpage ul.leg-catalog-grid { display: block; }
  .rankpage ul.leg-catalog-grid li { margin-bottom: 0.3rem; }
}

/* ---------- Related plugin cards footer ---------- */
.pp-related { margin-top: 2.6rem; }
.pp-related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.7rem; }
a.pp-rel-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, var(--rk-panel-2), var(--rk-panel));
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
a.pp-rel-card:hover { transform: translateY(-2px); border-color: var(--rk-accent-line); color: var(--rk-accent-bright); }
a.pp-rel-card svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--rk-accent); }

/* ---------- Heli signal icon table ---------- */
.pp-sig-table td { vertical-align: middle; }
.pp-sig-table td:first-child { width: 72px; padding-right: 0.4rem; }
.pp-sig-icon { display: inline-block; width: 56px; height: 56px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); padding: 4px; transition: transform 0.15s ease, border-color 0.15s ease; }
.pp-sig-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
a.lightbox-link:hover .pp-sig-icon { transform: scale(1.06); border-color: var(--rk-accent-line); }
.pp-sig-table .pp-sig-group td { padding-top: 0.55rem; padding-bottom: 0.35rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rk-accent-bright); background: rgba(230, 200, 74, 0.05); }
.pp-sig-table .pp-sig-group:hover td { background: rgba(230, 200, 74, 0.05); }
.pp-sig-name { display: block; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) {
  .pp-sig-icon { width: 44px; height: 44px; }
  .pp-sig-table td:first-child { width: 56px; }
}

/* ---------- Drifting fog overlay (add .pp-has-fog to the figure link, then a .pp-fog span after the img) ---------- */
.pp-fig a.pp-has-fog { position: relative; }
.pp-fog {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 35%, rgba(0, 0, 0, 0.22) 65%, transparent 92%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 35%, rgba(0, 0, 0, 0.22) 65%, transparent 92%);
}
.pp-fog::before,
.pp-fog::after {
  content: "";
  position: absolute;
  top: -25%;
  bottom: -25%;
  background: url(../images/plugins/fog-tile.png) repeat;
  will-change: transform;
}
.pp-fog::before {
  left: 0;
  width: calc(100% + 520px);
  background-size: 520px 520px;
  opacity: 0.6;
  animation: pp-fog-drift-a 65s linear infinite;
}
.pp-fog::after {
  left: -900px;
  width: calc(100% + 900px);
  background-size: 900px 900px;
  opacity: 0.45;
  animation: pp-fog-drift-b 100s linear infinite;
}
@keyframes pp-fog-drift-a { to { transform: translateX(-520px); } }
@keyframes pp-fog-drift-b { to { transform: translateX(900px); } }
@media (prefers-reduced-motion: reduce) {
  .pp-fog::before, .pp-fog::after { animation: none; }
}
