@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
/* ════════════════════════════════════════
   WIKI-CARDS.CSS — shared card system
   ════════════════════════════════════════ */

/* Bebas Neue for section headings */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

/* ── Page shell ── */
.wiki-page { padding-top: var(--hh); min-height: 100vh; display: flex; flex-direction: column; }

.wiki-header { padding: 52px 48px 30px; max-width: 1100px; margin: 0 auto; width: 100%; }
.wiki-header h1 {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: clamp(36px, 5vw, 58px);
  letter-spacing: .08em;
  color: var(--text);
  animation: fadeUp .6s ease forwards; opacity: 0;
}
.wiki-header p {
  font-size: 17px; color: var(--text2); margin-top: 10px;
  animation: fadeUp .6s ease .15s forwards; opacity: 0;
}

.wiki-nav-row {
  display: flex; align-items: center; gap: 12px;
  padding: 0 48px 22px; max-width: 1100px; margin: 0 auto; width: 100%;
}
.wiki-back-btn {
  font-family: var(--font); font-size: 16px; color: var(--text2);
  text-decoration: none; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: color var(--tr), border-color var(--tr), background var(--tr), transform var(--tr);
  animation: fadeUp .5s ease .1s forwards; opacity: 0;
}
.wiki-back-btn:hover { color: var(--accent); border-color: var(--border2); background: var(--bg3); transform: scale(1.05); }

.wiki-divider { height: 1px; background: var(--border); max-width: 1100px; margin: 0 auto 40px; width: calc(100% - 96px); }

/* ── Cards grid ── */
.cards-grid {
  display: flex; flex-wrap: wrap; gap: 32px;
  padding: 0 48px 100px;
  max-width: 1100px; margin: 0 auto; width: 100%;
  /* allow gear card to overflow */
  overflow: visible;
}

/* ══════════════════════════════
   BASE CARD — FIX: no opacity:0, use animation
   ══════════════════════════════ */
.wiki-card {
  width: 340px; height: 360px;
  border-radius: 14px;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease;
  border: 1px solid var(--border2);
  text-decoration: none; color: var(--text);
  /* FIX: use animation not opacity:0 standalone */
  animation: cardIn .6s ease forwards;
  opacity: 0;
  cursor: pointer;
}
/* stagger delays */
.wiki-card:nth-child(1) { animation-delay: .1s; }
.wiki-card:nth-child(2) { animation-delay: .22s; }
.wiki-card:nth-child(3) { animation-delay: .34s; }
.wiki-card:nth-child(4) { animation-delay: .46s; }
.wiki-card:nth-child(5) { animation-delay: .58s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wiki-card:hover { transform: translateY(-8px) scale(1.025); }

/* ── GRADIENT card (КубиКарты) ── */
.wiki-card.grad-pink-blue {
  background: linear-gradient(160deg, #1a0830 0%, #0d1a3a 100%);
  border-color: rgba(214,62,255,.4);
}
.wiki-card.grad-pink-blue:hover { box-shadow: 0 0 38px rgba(214,62,255,.35), 0 12px 44px rgba(0,0,0,.6); }
[data-theme="light"] .wiki-card.grad-pink-blue { background: linear-gradient(160deg, #f5e8ff 0%, #e0eeff 100%); border-color: rgba(180,60,220,.4); }

/* ── PHOTO-BG card (vladislavvc) ── */
.wiki-card.photo-bg .card-photo {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(.32) saturate(.65);
  transition: filter .3s;
}
.wiki-card.photo-bg:hover .card-photo { filter: brightness(.44) saturate(.8); }
.wiki-card.photo-bg { border-color: rgba(80,120,200,.4); }
.wiki-card.photo-bg:hover { box-shadow: 0 0 36px rgba(60,100,220,.3), 0 12px 44px rgba(0,0,0,.7); }

/* ── TENAR card: dark grey gradient + avatar corner ── */
.wiki-card.tenar-card {
  background: linear-gradient(145deg, #1c1c22 0%, #0f0f14 100%);
  border-color: rgba(0,200,255,.3);
}
.wiki-card.tenar-card:hover { box-shadow: 0 0 36px rgba(0,200,255,.2), 0 12px 44px rgba(0,0,0,.7); }
.tenar-corner-img {
  position: absolute; bottom: -10px; right: -10px;
  width: 110px; height: 110px;
  object-fit: cover; border-radius: 50%;
  opacity: .22;
  pointer-events: none;
  z-index: 1;
  filter: blur(1px);
}

/* ── FISH/ocean card ── */
.wiki-card.ocean-card {
  background: linear-gradient(160deg, #032040 0%, #063060 60%, #041828 100%);
  border-color: rgba(0,180,220,.4);
  overflow: hidden;
}
.wiki-card.ocean-card:hover { box-shadow: 0 0 40px rgba(0,180,220,.35), 0 12px 44px rgba(0,0,0,.7); }

/* ── GEAR card ── */
.wiki-card.gear-card {
  background: transparent;
  border: none;
  overflow: visible;
  width: 320px; height: 320px;
  border-radius: 0;
}
.gear-card:hover { transform: translateY(-8px) scale(1.025) rotate(3deg); }
.gear-shape {
  position: absolute; inset: 0;
  clip-path: polygon(
    38% 0%, 62% 0%,
    62% 12%, 75% 8%, 84% 17%,
    80% 30%, 92% 38%, 100% 38%,
    100% 62%, 88% 62%,
    92% 75%, 83% 84%,
    70% 80%, 62% 92%,
    62% 100%, 38% 100%,
    38% 88%, 25% 92%,
    17% 83%, 21% 70%,
    8% 62%, 0% 62%,
    0% 38%, 12% 38%,
    8% 25%, 17% 17%,
    30% 21%, 38% 8%
  );
  background: linear-gradient(145deg, #2e2e35, #1a1a22);
  border: 2px solid rgba(160,160,180,.3);
  z-index: 0;
}
.gear-card:hover .gear-shape {
  border-color: rgba(160,160,200,.6);
  box-shadow: 0 0 28px rgba(130,130,200,.3);
}
/* inner circle cutout on gear */
.gear-hole {
  position: absolute;
  width: 32%; height: 32%;
  top: 34%; left: 34%;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  z-index: 1;
  pointer-events: none;
}

/* ── Canvas overlays ── */
.card-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

/* ── Card body ── */
.card-body {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  height: 100%; padding: 20px 20px 18px; gap: 11px;
}
/* gear card body must be clipped */
.gear-card .card-body { z-index: 3; }

.card-logo-row { display: flex; align-items: center; gap: 12px; }
.card-logo { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid rgba(255,255,255,.2); image-rendering: pixelated; }

.card-title { font-size: 20px; color: #fff; line-height: 1.2; font-family: var(--font); }
.card-tag   { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-top: 3px; }

.card-desc-label { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.card-desc-text  {
  font-size: 15px; color: rgba(255,255,255,.72); line-height: 1.78;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.card-read-btn {
  display: inline-block; font-family: var(--font);
  font-size: 15px; letter-spacing: .07em;
  padding: 9px 18px; border-radius: 5px;
  border: 1px solid rgba(255,255,255,.28);
  color: #fff; text-decoration: none;
  background: rgba(255,255,255,.07);
  cursor: pointer; margin-top: auto; align-self: flex-start;
  transition: background .15s, transform .15s, box-shadow .15s, border-color .15s;
}
.card-read-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.55); transform: scale(1.05); }

/* ── Responsive ── */
@media (max-width: 700px) {
  .cards-grid { padding: 0 18px 70px; gap: 22px; }
  .wiki-header { padding: 36px 18px 18px; }
  .wiki-nav-row { padding: 0 18px 14px; }
  .wiki-divider { width: calc(100% - 36px); }
  .wiki-card { width: 100%; height: auto; min-height: 300px; }
  .gear-card  { width: 100%; height: auto; min-height: 300px; }
}
