/* ============================================================
   lore-race.css — Race detail page
   Hero · evolutionary origin · first-kingdoms history · subraces
   ============================================================ */

/* ── Race hero ── */
.race-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 1.5rem 0 2.2rem;
  margin-bottom: 0;
  position: relative;
}
/* Gold glow behind portrait */
.race-hero::before {
  content: '';
  position: absolute;
  left: -20px;
  top: -10px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.04;
  filter: blur(65px);
  pointer-events: none;
}

/* Portrait circle */
.race-hero__portrait {
  flex: 0 0 170px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 0 32px rgba(0,0,0,0.55),
              0 0 0 6px rgba(201,162,39,0.1);
  background: rgba(13,13,26,0.8);
  position: relative;
  z-index: 1;
}
.race-hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.race-hero__portrait--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--gold);
  opacity: 0.3;
}

/* Hero text */
.race-hero__text {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  z-index: 1;
  padding-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.race-hero__name {
  font-family: 'Cinzel', serif;
  font-size: 2.3rem;
  color: var(--gold);
  margin: 0 0 0.7rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 30px rgba(0,0,0,0.8), 0 0 60px rgba(201,162,39,0.12);
  line-height: 1.12;
}
/* Short intro snippet in hero */
.race-hero__intro {
  font-family: 'Crimson Text', serif;
  font-size: 0.97rem;
  line-height: 1.62;
  color: var(--text-muted);
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.race-hero__rules-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  padding: 0.35rem 1.1rem;
  border: 1px solid rgba(201,162,39,0.5);
  border-radius: 20px;
  background: rgba(201,162,39,0.07);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  align-self: flex-start;
}
.race-hero__rules-link:hover {
  background: rgba(201,162,39,0.13);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(201,162,39,0.2);
}

/* ── Section heading divider (shared) ── */
.race-section-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2rem 0 1.2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.race-section-divider::before,
.race-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
}

/* Green flavour for origin */
.race-section-divider--origin {
  color: rgba(130, 200, 150, 0.7);
}
.race-section-divider--origin::before,
.race-section-divider--origin::after {
  background: linear-gradient(90deg, transparent, rgba(100,180,120,0.35), transparent);
}

/* Amber/gold flavour for history */
.race-section-divider--history {
  color: rgba(201,162,39,0.7);
}
.race-section-divider--history::before,
.race-section-divider--history::after {
  background: linear-gradient(90deg, transparent, rgba(201,162,39,0.3), transparent);
}

/* Gold flavour for subraces */
.race-section-divider--subraces {
  color: rgba(201,162,39,0.65);
}
.race-section-divider--subraces::before,
.race-section-divider--subraces::after {
  background: linear-gradient(90deg, transparent, rgba(201,162,39,0.25), transparent);
}

/* ── Shared info block base ── */
.race-info-block {
  margin: 0 0 1.5rem;
  padding: 1.3rem 1.5rem 1.4rem;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.race-info-block::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  opacity: 0.06;
  filter: blur(40px);
  pointer-events: none;
}

/* ── Evolutionary origin (green) ── */
.race-origin {
  background: linear-gradient(135deg, rgba(60,130,80,0.07) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(100,180,120,0.18);
  border-left: 4px solid rgba(100,180,120,0.65);
}
.race-origin::before { background: rgba(100,180,120,1); }

.race-origin__heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.85rem;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: rgba(140,210,160,0.9);
  position: relative;
  z-index: 1;
  letter-spacing: 0.03em;
}

.race-origin__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.race-origin__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Crimson Text', serif;
  font-size: 0.82rem;
  padding: 0.2rem 0.75rem;
  border-radius: 14px;
  background: rgba(100,180,120,0.09);
  border: 1px solid rgba(100,180,120,0.28);
  color: rgba(150,220,170,0.85);
}

.race-origin__summary {
  font-family: 'Crimson Text', serif;
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 0.8rem;
  position: relative;
  z-index: 1;
}

/* Collapsible sections */
.race-origin__sections {
  border-top: 1px solid rgba(100,180,120,0.12);
  padding-top: 0.9rem;
  margin-top: 0.2rem;
  position: relative;
  z-index: 1;
}
.race-origin__section-heading {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: rgba(140,210,160,0.75);
  margin: 0.9rem 0 0.35rem;
  letter-spacing: 0.03em;
}
.race-origin__section-heading:first-child { margin-top: 0; }
.race-origin__section-text {
  font-family: 'Crimson Text', serif;
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--text-muted);
  margin: 0 0 0.45rem;
}

/* Toggle button */
.race-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.45rem 0;
  margin-top: 0.5rem;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}
.race-toggle-btn--green { color: rgba(130,200,150,0.65); }
.race-toggle-btn--green:hover { color: rgba(160,230,180,0.9); }
.race-toggle-btn--gold { color: rgba(201,162,39,0.6); }
.race-toggle-btn--gold:hover { color: var(--gold); }
.race-toggle-btn__arrow {
  display: inline-block;
  transition: transform 0.25s;
  font-style: normal;
}
.race-toggle-btn[aria-expanded="true"] .race-toggle-btn__arrow {
  transform: rotate(180deg);
}

/* ── History block (amber/gold) ── */
.race-history {
  background: linear-gradient(135deg, rgba(201,162,39,0.05) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(201,162,39,0.15);
  border-left: 4px solid rgba(201,162,39,0.55);
}
.race-history::before { background: rgba(201,162,39,1); }

.race-history__heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold-light, #e8c84a);
  position: relative;
  z-index: 1;
  letter-spacing: 0.03em;
}
.race-history__civ-name {
  font-family: 'Crimson Text', serif;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-dim);
  margin: 0 0 1rem;
  position: relative;
  z-index: 1;
}

.race-history__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  position: relative;
  z-index: 1;
}
.race-history__tag {
  font-family: 'Crimson Text', serif;
  font-size: 0.79rem;
  padding: 0.15rem 0.65rem;
  border-radius: 12px;
  background: rgba(201,162,39,0.08);
  border: 1px solid rgba(201,162,39,0.22);
  color: var(--gold);
}

.race-history__summary {
  font-family: 'Crimson Text', serif;
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 0.8rem;
  position: relative;
  z-index: 1;
}

/* Collapsible sections */
.race-history__sections {
  border-top: 1px solid rgba(201,162,39,0.1);
  padding-top: 0.9rem;
  margin-top: 0.2rem;
  position: relative;
  z-index: 1;
}
.race-history__section-heading {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: rgba(201,162,39,0.7);
  margin: 0.9rem 0 0.35rem;
  letter-spacing: 0.03em;
}
.race-history__section-heading:first-child { margin-top: 0; }
.race-history__section-text {
  font-family: 'Crimson Text', serif;
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--text-muted);
  margin: 0 0 0.45rem;
}

/* ── Subraces (Podrasy) ── */
.race-subraces {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.race-subrace-card {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1rem 1.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.race-subrace-card:hover {
  border-color: var(--gold);
  transform: translateX(5px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.38);
  background: rgba(201,162,39,0.04);
}

.race-subrace-card__portrait {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(201,162,39,0.45);
  box-shadow: 0 0 10px rgba(201,162,39,0.15);
  background: var(--bg-card2);
}
.race-subrace-card__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.race-subrace-card__portrait--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--gold);
  opacity: 0.3;
}

.race-subrace-card__body {
  flex: 1;
  min-width: 0;
  padding-top: 0.1rem;
}
.race-subrace-card__name {
  font-family: 'Cinzel', serif;
  font-size: 0.97rem;
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.4rem;
  letter-spacing: 0.025em;
}
.race-subrace-card__lore {
  font-family: 'Crimson Text', serif;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Extra lore sections ── */
.race-section-block {
  margin-bottom: 1.4rem;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .race-hero { gap: 1.2rem; }
  .race-hero__portrait { flex: 0 0 120px; width: 120px; height: 120px; }
  .race-hero__name { font-size: 1.8rem; }
  .race-info-block { padding: 1rem 1.1rem; }
}
@media (max-width: 480px) {
  .race-hero { flex-direction: column; align-items: center; text-align: center; }
  .race-hero__portrait { flex: 0 0 140px; width: 140px; height: 140px; }
  .race-hero__rules-link { align-self: center; }
}
