/* =========================================
   CSS VARIABLES
   Základní design systém webu.
========================================= */

:root {
  /* Barvy */
  --color-background: #14110f;
  --color-surface: #211d1a;
  --color-text: #f2e6d0;
  --color-muted: #b8a58a;
  --color-accent: #c2a878;
  --color-border: #3b322c;

  /* Fonty */
  --font-heading: Georgia, serif;
  --font-body: Arial, sans-serif;

  /* Layout */
  --container-width: 1100px;

  /* Mezery */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;

  /* Tvar */
  --border-radius: 12px;
}

/* =========================================
   RESET
   Sjednotí výchozí styly browseru.
========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================================
   BODY
   Základ celé stránky.
========================================= */

body {
  background:
    radial-gradient(circle at top, rgba(194, 168, 120, 0.08), transparent 35%),
    var(--color-background);

  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
}

/* =========================================
   TYPOGRAPHY
========================================= */

h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
}

p {
  color: var(--color-muted);
}

a {
  color: var(--color-accent);
}

/* =========================================
   SHARED LAYOUT
========================================= */

.site-header,
.site-main,
.nav-container,
.entity-layout {
  width: min(100% - 2rem, var(--container-width));
  margin-inline: auto;
}

/* =========================================
   NAVIGATION
========================================= */

.main-navigation {
  position: sticky;
  top: 0;
  z-index: 100;

  background-color: rgba(20, 17, 15, 0.95);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
}

.nav-container {
  padding-block: 1rem;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  color: var(--color-accent);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--color-muted);
  text-decoration: none;
  transition: 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-accent);
}

/* =========================================
   HEADER
========================================= */

.site-header {
  padding-block: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.eyebrow {
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  margin-bottom: var(--spacing-sm);
}

.intro-text {
  max-width: 65ch;
}

/* =========================================
   MAIN CONTENT
========================================= */

.site-main {
  padding-block: var(--spacing-lg);
}

/* =========================================
   ARCHIVE GRID
========================================= */

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 320px));
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

/* =========================================
   ARCHIVE CARD
========================================= */

.archive-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  transition: 0.2s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.archive-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

/* =========================================
   NPC CARD
========================================= */

.npc-card {

  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.npc-card:hover {

  transform: translateY(-6px);
  border-color: var(--color-accent);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(194, 168, 120, 0.08);
}

.npc-image {

  height: 320px;

  overflow: hidden;

  border-bottom: 1px solid var(--color-border);

  background-color: #2f2925;
}

.npc-image img {

  width: 100%;

  height: 360px;

  object-fit: cover;

  object-position: center top;

  display: block;
  transition:
  transform 0.4s ease,
  filter 0.4s ease;
}
.npc-card:hover .npc-image img {

  transform: scale(1.03);

  filter: brightness(1.05);
}


/* Obsah karty */
.npc-content {
  padding: var(--spacing-md);
}

/* Metadata NPC */
.npc-role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-xs);
}

.npc-name {
  margin-bottom: var(--spacing-sm);
}

.npc-name a {
  color: var(--color-accent);
  text-decoration: none;
}

.npc-name a:hover {
  text-decoration: underline;
}

.npc-description {
  font-size: 0.95rem;
}

/* =========================================
   ENTITY PAGE LAYOUT
   Detailní stránka NPC / lokace / artefaktu.
========================================= */

.entity-layout {
  padding-block: var(--spacing-lg);

  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--spacing-lg);
  align-items: start;
}

.entity-sidebar {
  width: 100%;
  position: sticky;
  top: 100px;
}

.entity-content {
  width: 100%;
  max-width: 75ch;
}

/* =========================================
   ENTITY PORTRAIT
========================================= */

.entity-portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;

  background:
    linear-gradient(rgba(20, 17, 15, 0.4), rgba(20, 17, 15, 0.8)),
    var(--color-surface);

  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--color-muted);
  font-family: var(--font-heading);

  margin-bottom: var(--spacing-md);
}

.entity-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================
   ENTITY META
========================================= */

.entity-meta {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.meta-item {
  margin-bottom: var(--spacing-md);
}

.meta-item:last-child {
  margin-bottom: 0;
}

.meta-item h3 {
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  margin-bottom: var(--spacing-xs);
}

.meta-item p {
  color: var(--color-text);
}

/* =========================================
   ENTITY CONTENT
========================================= */

.entity-content h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1;
  margin-bottom: var(--spacing-md);
}

.entity-intro {
  color: var(--color-text);
  font-size: 1.2rem;
  line-height: 1.8;

  padding-bottom: var(--spacing-md);
  margin-bottom: var(--spacing-lg);

  border-bottom: 1px solid var(--color-border);
}

/* =========================================
   CONTENT SECTIONS
========================================= */

.content-section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.content-section h2 {
  font-size: 1.4rem;
  margin-bottom: var(--spacing-md);
}

.content-section p,
.content-section li {
  font-size: 1rem;
}

/* =========================================
   RELATION LISTS
========================================= */

.relation-list {
  padding-left: 1.5rem;
  color: var(--color-muted);
}

.relation-list li {
  margin-bottom: 0.7rem;
}

/* =========================================
   ENTITY LINKS
========================================= */

.entity-content a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(194, 168, 120, 0.4);
}

.entity-content a:hover {
  border-bottom-color: var(--color-accent);
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 900px) {
  .entity-layout {
    grid-template-columns: 1fr;
  }

  .entity-sidebar {
    position: relative;
    top: 0;
  }

  .nav-container {
    align-items: flex-start;
    gap: var(--spacing-sm);
    flex-direction: column;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
}

/* =========================================
   BREADCRUMBS
========================================= */

.breadcrumbs {

  display: flex;

  gap: 0.6rem;

  flex-wrap: wrap;

  margin-bottom: var(--spacing-md);

  color: var(--color-muted);

  font-size: 0.9rem;
}

.breadcrumbs a {

  color: var(--color-muted);

  text-decoration: none;
}

.breadcrumbs a:hover {

  color: var(--color-accent);
}

.current-page {

  color: var(--color-text);
}

/* =========================================
   TAG PILLS
========================================= */

.tag-list {

  display: flex;

  flex-wrap: wrap;

  gap: 0.6rem;
}

.tag-pill {

  background-color: rgba(194, 168, 120, 0.12);

  border: 1px solid rgba(194, 168, 120, 0.3);

  color: var(--color-accent);

  padding:
    0.3rem
    0.7rem;

  border-radius: 999px;

  font-size: 0.85rem;
}

/* =========================================
   RELATED ENTITIES
========================================= */

.related-panel {

  margin-top: var(--spacing-lg);
}

.related-grid {

  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(180px, 1fr));

  gap: var(--spacing-md);

  margin-top: var(--spacing-md);
}

.related-card {

  background-color: var(--color-surface);

  border: 1px solid var(--color-border);

  border-radius: var(--border-radius);

  padding: var(--spacing-md);

  text-decoration: none;

  color: var(--color-text);

  transition: 0.2s ease;
}

.related-card:hover {

  border-color: var(--color-accent);

  transform: translateY(-3px);
}

/* =========================================
   NOTE SECTION
   Pro nejisté, pracovní nebo archivní poznámky.
========================================= */

.note-section {
  border-color: rgba(194, 168, 120, 0.45);
  background:
    linear-gradient(
      rgba(194, 168, 120, 0.06),
      rgba(194, 168, 120, 0.02)
    ),
    var(--color-surface);
}

.note-section h2::before {
  content: "✦ ";
  color: var(--color-accent);
}

/* =========================================
   ARCHIVE TOOLBAR
   Horní řádek nad seznamem entit.
========================================= */

.archive-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);

  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);

  border-bottom: 1px solid var(--color-border);
}

.archive-count {
  color: var(--color-text);
  font-weight: bold;
}

.archive-filter-note {
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Mobilní verze toolbaru */
@media (max-width: 700px) {
  .archive-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* =========================================
   NPC IMAGE PLACEHOLDER
   Použije se, když NPC zatím nemá portrét.
========================================= */

.npc-image-placeholder {
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: var(--spacing-md);

  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: 1.4rem;
  text-align: center;

  background:
    radial-gradient(circle at top, rgba(194, 168, 120, 0.14), transparent 45%),
    linear-gradient(rgba(20, 17, 15, 0.2), rgba(20, 17, 15, 0.85)),
    #2f2925;
}

/* =========================================
   FILTER BUTTONS
========================================= */

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-button {
  cursor: pointer;

  background-color: transparent;
  color: var(--color-muted);

  border: 1px solid var(--color-border);
  border-radius: 999px;

  padding: 0.45rem 0.9rem;

  font-family: var(--font-body);
  font-size: 0.9rem;

  transition: 0.2s ease;
}

.filter-button:hover,
.filter-button.active {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-color: rgba(194, 168, 120, 0.1);
}

/* =========================================
   RELATED ENTITIES
========================================= */

.related-section {
  margin-top: var(--spacing-x1);
  padding-top: var(--spacing-md);
}


.related-grid {

  display: flex;

  flex-direction: column;

  gap: 0.75rem;

  margin-top: var(--spacing-md);
}

.related-card {

  width: 100%;

  padding: var(--spacing-md);

  background-color: var(--color-surface);

  border: 1px solid var(--color-border);

  border-radius: var(--border-radius);

  transition: 0.2s ease;
}

.related-card:hover {
  border-color: var(--color-accent);

  transform: translateY(-2px);
}

.related-name a {
  color: var(--color-heading);

  text-decoration: none;
}

.related-role {
  margin-top: 0.5rem;

  color: var(--color-muted);

  font-size: 0.95rem;
}

/* Celá NPC karta je klikací */
.npc-card-link {
  display: block;
  height: 100%;

  color: inherit;
  text-decoration: none;
}

/* =========================================
   DEAD NPC STATE
========================================= */

.npc-card.is-dead {
  opacity: 0.75;
}

.npc-card.is-dead .npc-image {
  position: relative;
  overflow: hidden;
}

.npc-card.is-dead .npc-image::after {
  content: "RIP";

  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-family: var(--font-heading);

  font-size: 4rem;
  font-weight: bold;
  letter-spacing: 0.2em;

  color: rgba(180, 40, 40, 0.85);

  background:
    linear-gradient(
      to bottom,
      rgba(10, 10, 10, 0.1),
      rgba(10, 10, 10, 0.45)
    );

  text-shadow:
    0 0 20px rgba(120, 0, 0, 0.7);

  backdrop-filter: grayscale(20%);
}

.npc-card.is-dead img {
  filter:
    grayscale(40%)
    brightness(0.8);
}

.npc-card.is-dead .npc-name::after {
  content: " †";
  color: rgba(180, 40, 40, 0.9);
}

/* =========================================
   EMPTY STATE
========================================= */

.empty-state {
  display: none;

  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);

  color: var(--color-muted);
  background-color: var(--color-surface);

  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

.empty-state.is-visible {
  display: block;
}

/* =========================================
   LOCATION DETAIL
========================================= */

.location-detail-layout {
  width: min(100% - 2rem, 1100px);
  margin: 0 auto;
  padding-block: var(--spacing-lg);

  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 5rem;

  align-items: start;
}

.location-hero {
  grid-column: 1 / -1;

  max-width: 680px;
  margin: 0 auto 4rem auto;
}

.location-hero img {
  width: 100%;
  max-height: 620px;

  object-fit: contain;
  display: block;

  background: #111;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

.location-sidebar {
  position: sticky;
  top: 120px;
}

.location-detail-content {
  max-width: 760px;

  font-size: 1.05rem;
  line-height: 1.75;
}

.location-detail-content .entity-intro {
  font-size: 1.15rem;
  line-height: 1.8;
}

.location-detail-content h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.location-detail-content .content-section {
  font-size: 1.05rem;
}

@media (max-width: 900px) {
  .location-detail-layout {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .location-sidebar {
    position: relative;
    top: 0;
  }

  .location-hero {
    max-width: 100%;
  }
}

/* =========================================
   LOCATIONS INDEX MAP
========================================= */

.locations-map {
  max-width: 720px;

  margin: 0 auto var(--spacing-lg);
}

.locations-map img {
  width: 100%;
  height: auto;

  display: block;

  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);

  opacity: 0.92;
}

/* =========================================
   LOCATION INDEX CARDS
========================================= */

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.location-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.location-card-link {
  color: inherit;
  text-decoration: none;
}

.location-image {
  height: 220px;
  background-color: #111;
}

.location-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.location-content {
  padding: var(--spacing-md);
}


/* =========================================
   MISSING ENTRY
========================================= */

.missing-entry {
  min-height: 80vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: var(--spacing-xl);
}

.missing-entry-content {
  max-width: 560px;

  padding: var(--spacing-xl);

  text-align: center;

  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

.missing-link {
  color: var(--color-muted);
  font-style: italic;
}

.related-card.is-missing {
  opacity: 0.65;
}


/* =========================================
   EMPTY LORE TEXT
========================================= */

.empty-lore {
  color: var(--color-muted);
  font-style: italic;
  opacity: 0.75;
}