/* =====================================================
   Holocron Pad – PNJ  |  holocron-pnj.css
   Style HUD impérial Star Wars
   ===================================================== */

/* ── Variables ──────────────────────────────────────── */
:root {
  --hpnj-cyan:       rgba(120, 220, 255, 1);
  --hpnj-cyan-glow:  rgba(120, 220, 255, .18);
  --hpnj-cyan-dim:   rgba(120, 220, 255, .35);
  --hpnj-cyan-mid:   rgba(120, 220, 255, .55);
  --hpnj-text:       rgba(210, 250, 255, .92);
  --hpnj-text-dim:   rgba(170, 240, 255, .7);
  --hpnj-bg:         rgba(8, 14, 20, .95);
  --hpnj-bg-2:       rgba(12, 20, 28, .88);
  --hpnj-border:     rgba(120, 220, 255, .22);
  --hpnj-green:      rgba(100, 240, 140, .9);
  --hpnj-scanline:
    repeating-linear-gradient(
      180deg,
      rgba(120,220,255,.03) 0,
      rgba(120,220,255,.03) 1px,
      transparent 2px,
      transparent 7px
    );
}

/* ── Wrapper page single ────────────────────────────── */
.hpnj-single-wrap {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ── Titre de lieu (section dans la grille) ─────────── */
.hpnj-lieu-title {
  margin: 2rem 0 1rem;
  padding: 10px 16px;
  background: rgba(10, 20, 30, .5);
  border-left: 3px solid var(--hpnj-cyan);
  color: var(--hpnj-cyan);
  font-size: .9rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ── Grille ─────────────────────────────────────────── */
.hpnj-grille {
  display: grid;
  gap: 16px;
  margin-bottom: 2rem;
}
.hpnj-cols-2 { grid-template-columns: repeat(2, 1fr); }
.hpnj-cols-3 { grid-template-columns: repeat(3, 1fr); }
.hpnj-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .hpnj-cols-3,
  .hpnj-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hpnj-cols-2,
  .hpnj-cols-3,
  .hpnj-cols-4 { grid-template-columns: 1fr; }
}

/* ── Carte grille ───────────────────────────────────── */
.hpnj-card {
  display: flex;
  flex-direction: column;
  background: var(--hpnj-bg-2);
  border: 1px solid var(--hpnj-border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--hpnj-text);
  transition: border-color .18s ease, box-shadow .18s ease, transform .1s ease;
  background-image: var(--hpnj-scanline);
}
.hpnj-card:hover {
  border-color: var(--hpnj-cyan-mid);
  box-shadow: 0 0 18px rgba(120, 220, 255, .1);
  transform: translateY(-2px);
  color: var(--hpnj-text);
  text-decoration: none;
}

.hpnj-card-portrait {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: rgba(6, 12, 18, .8);
}
.hpnj-card-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  filter: saturate(0.7) contrast(1.05);
  transition: filter .3s ease;
}
.hpnj-card:hover .hpnj-card-portrait img {
  filter: saturate(0.85) contrast(1.05);
}

.hpnj-card-no-portrait {
  width: 100%;
  height: 100%;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 30, .6);
  font-size: 2rem;
  font-weight: 700;
  color: var(--hpnj-cyan-dim);
  letter-spacing: .1em;
}

.hpnj-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hpnj-card-name {
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(200, 248, 255, .95);
}
.hpnj-card-role {
  font-size: .78rem;
  color: var(--hpnj-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hpnj-card-lieu {
  font-size: .72rem;
  letter-spacing: .08em;
  color: rgba(100, 200, 255, .6);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Fiche complète ─────────────────────────────────── */
.hpnj-fiche {
  background: var(--hpnj-bg);
  border: 1px solid var(--hpnj-border);
  border-radius: 14px;
  padding: 24px 28px;
  color: var(--hpnj-text);
  font-size: .9rem;
  line-height: 1.6;
  background-image: var(--hpnj-scanline);
  box-shadow:
    0 0 0 1px rgba(120, 220, 255, .05) inset,
    0 16px 50px rgba(0,0,0,.5);
}

.hpnj-fiche-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hpnj-border);
  flex-wrap: wrap;
}
.hpnj-fiche-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hpnj-cyan);
  flex: 1;
}
.hpnj-badge-lieu {
  padding: 4px 12px;
  border: 1px solid var(--hpnj-cyan-dim);
  border-radius: 4px;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hpnj-cyan-dim);
  white-space: nowrap;
}

/* ── Situation image ────────────────────────────────── */
.hpnj-situation-img {
  margin-bottom: 20px;
}
.hpnj-situation-img img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 8px;
  border: 1px solid var(--hpnj-border);
  filter: saturate(0.7) contrast(1.05);
}

/* ── Tableau structuré ──────────────────────────────── */
.hpnj-tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.hpnj-tableau th {
  background: rgba(12, 22, 32, .85);
  color: var(--hpnj-cyan);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 10px 14px;
  border: 1px solid var(--hpnj-border);
  text-align: left;
}

.hpnj-tableau td {
  padding: 12px 14px;
  border: 1px solid var(--hpnj-border);
  vertical-align: top;
  background: rgba(8, 16, 24, .7);
  color: var(--hpnj-text);
  line-height: 1.65;
}

.hpnj-tableau tr:hover td {
  background: rgba(12, 22, 32, .85);
}

.hpnj-tableau td ul {
  margin: 4px 0 0 0;
  padding-left: 1.2em;
  list-style: none;
}
.hpnj-tableau td ul li::before {
  content: '▸';
  color: var(--hpnj-cyan-dim);
  margin-right: 6px;
  font-size: .75em;
}

/* ── Fiche libre ──────────────────────────────────────── */
.hpnj-fiche-libre-wrap {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 20px;
}

.hpnj-portrait-block {
  grid-row: 1 / 3;
}
.hpnj-portrait-block img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--hpnj-border);
  filter: saturate(0.75) contrast(1.05);
  display: block;
}

.hpnj-situation-block img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--hpnj-border);
  max-height: 180px;
  object-fit: cover;
  filter: saturate(0.7) contrast(1.05);
}

.hpnj-libre-content {
  color: var(--hpnj-text);
  font-size: .88rem;
  line-height: 1.7;
  grid-column: 2;
}
.hpnj-libre-content h1,
.hpnj-libre-content h2,
.hpnj-libre-content h3 {
  color: var(--hpnj-cyan);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 1.2em;
}
.hpnj-libre-content p { margin: .6em 0; }
.hpnj-libre-content ul,
.hpnj-libre-content ol {
  padding-left: 1.4em;
  margin: .5em 0;
}
.hpnj-libre-content li::marker { color: var(--hpnj-cyan-dim); }
.hpnj-libre-content strong { color: rgba(200, 248, 255, .95); }
.hpnj-libre-content em { color: rgba(170, 220, 255, .75); }
.hpnj-libre-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.hpnj-libre-content table th,
.hpnj-libre-content table td {
  border: 1px solid var(--hpnj-border);
  padding: 8px 12px;
}
.hpnj-libre-content table th {
  background: rgba(12, 22, 32, .85);
  color: var(--hpnj-cyan);
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .08em;
}

@media (max-width: 680px) {
  .hpnj-fiche-libre-wrap {
    grid-template-columns: 1fr;
  }
  .hpnj-portrait-block { grid-row: auto; }
  .hpnj-portrait-block img { max-width: 160px; }
  .hpnj-libre-content { grid-column: 1; }
}

/* ── Vide ───────────────────────────────────────────── */
.hpnj-empty {
  color: var(--hpnj-text-dim);
  font-style: italic;
  padding: 1rem;
}

/* =====================================================
   Popup fiche PNJ (appelée depuis le plugin de dés)
   ===================================================== */
.hpnj-popup { display:flex; gap:14px; flex-wrap:wrap; }
.hpnj-popup-portrait { width:100px; height:130px; object-fit:cover; border-radius:8px; border:1px solid rgba(120,220,255,0.25); flex-shrink:0; }
.hpnj-popup-body { flex:1; min-width:200px; }
.hpnj-popup-rang { display:inline-block; padding:2px 10px; border-radius:999px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; margin-bottom:8px; }
.hpnj-rang-commun  { background:rgba(60,180,60,.15); color:#5dca5d; border:1px solid rgba(60,180,60,.3); }
.hpnj-rang-rival   { background:rgba(255,180,50,.12); color:#fac775; border:1px solid rgba(255,180,50,.3); }
.hpnj-rang-nemesis { background:rgba(220,60,60,.12); color:#f09595; border:1px solid rgba(220,60,60,.3); }
.hpnj-popup-table { width:100%; border-collapse:collapse; margin-bottom:8px; font-size:12px; }
.hpnj-popup-table td { padding:3px 6px; border-bottom:1px solid rgba(120,220,255,0.1); color:rgba(220,250,255,.85); }
.hpnj-popup-table td strong { color:rgba(120,220,255,1); font-size:14px; }
.hpnj-popup-caracs { width:100%; border-collapse:collapse; margin-bottom:8px; text-align:center; }
.hpnj-popup-caracs th { font-size:10px; color:rgba(120,220,255,.6); padding:2px 4px; letter-spacing:.06em; text-transform:uppercase; }
.hpnj-popup-caracs td { font-size:14px; font-weight:700; color:rgba(230,255,255,.92); padding:3px 4px; }
.hpnj-popup-comp { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:6px; }
.hpnj-comp-chip { padding:2px 8px; border-radius:999px; background:rgba(70,200,255,.12); border:1px solid rgba(70,200,255,.3); color:rgba(190,245,255,.9); font-size:11px; font-weight:600; }
.hpnj-popup-caps { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:6px; }
.hpnj-cap-chip { padding:2px 8px; border-radius:999px; background:rgba(255,150,50,.1); border:1px solid rgba(255,150,50,.3); color:rgba(255,200,120,.9); font-size:11px; }
.hpnj-popup-talents { font-size:11px; color:rgba(190,245,255,.65); font-style:italic; margin-top:6px; border-top:1px solid rgba(120,220,255,.1); padding-top:6px; line-height:1.5; }
