* {
  box-sizing: border-box;
}

:root {
  --bg: #0b0d10;
  --bg-soft: #11151a;
  --accent: #1aff9f;
  --text: #ffffffee;
  --text-soft: #ffffffaa;
  --text-dim: #66717e;
  --border: #252c34;
  
  --max-width: 1450px;
  --sidebar-width: 240px;
  --info-width: 300px;
}

body {
  font-family: "Open Sans", "Droid Sans", "Calibri", sans-serif;
  margin: 0;
  background:
    linear-gradient(
      rgba(255,255,255,0.012) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255,255,255,0.012) 1px,
      transparent 1px
    ),
    var(--bg);
  color: var(--text);
  background: #15191E;
  background-image: url(../images/bg/cartographer.png); 
  /* background-image: url(../images/bg/cartographer.png), linear-gradient(#15191E, #000000 20%);  */
}

.header-bar {
  background-color: #0B0D10;
  border-bottom: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  height: 58px;
  z-index: 100;
}

.header-bar p {
  color: var(--accent);
  text-decoration: none;
  font-family: 'Glancyr';
  font-size: 18px;
  margin: 0;
}

.page-layout {
  max-width: var(--max-width);
  margin: auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--info-width);
  gap: 38px;
  padding: 42px 28px 80px;
}

.sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}

.sidebar-title {
  color: var(--text-dim);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-weight: 700;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar nav a {
  color: var(--text-soft);
  padding: 7px 10px;
  font-size: 14px;
  border-left: 2px solid transparent;
  display: block;
  transition: .15s ease;
  text-decoration: none;
  font-family: 'Glancyr';
}

.sidebar nav a:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.page-layout > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-layout [id] {
  scroll-margin-top: 82px;
}

/* ARTICLE */

article h1{
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
  margin: 0 0 18px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  margin-bottom: 28px;
}
.tag {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 5px 9px;
  font-family: 'Glancyr';
  font-size: 11px;
  color: var(--text-soft);
}
.tag:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.6);
}

.resume{  
  font-family: 'Glancyr';
  padding-top:1em;
  padding-bottom: 1em;
}
.wiki-text{  
  font-family: 'Glancyr';
  font-weight:500;
}
.wiki-text li{  
  font-family: 'Glancyr';
  font-weight:500;
}
.wiki-text b{  
  color:var(--accent);
  font-family: 'Glancyr';
  font-weight:700;
}

.wiki-link {
  color:var(--accent);
}
.wiki-link:before {
  content:"↗ ";
  color:var(--accent);
}

.wiki-title{
  font-family: 'Glancyr';
  font-size: clamp(2rem, 4.5vw, 3.4375rem);
}
.wiki-subtitle{
  font-family: 'Glancyr';
  font-size:25px;
}
.wiki-subtitle::before {
  content: "// ";
  color: var(--accent); 
}

/* INFOBOX */

.infobox {
  position: relative;
  top: 100px;
  align-self: start;
  border: 1px solid var(--border);
  background: rgba(21, 26, 32, 0.85);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: 'Glancyr';
}

.infobox-image {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.infobox-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.infobox-header {
  text-align:center;
  padding: 17px 19px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.info-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.info-label {
  color: var(--text-dim);
  font-family: 'Glancyr';
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.info-value {
  color: var(--text);
}
.info-row-title{
  background: #0B0D10;
  background: linear-gradient(180deg,rgba(20, 24, 29, 1) 0%, var(--accent) 100%);
  color: white;
  text-align:center;
  font-size:14px;
  font-weight:500;
  padding-top:0.5em;
  padding-bottom:0.5em;
}

/* WIKI HOME - Grilles de hubs et de personnages, extensibles sans JavaScript. */
.wiki-home article {
  min-width: 0;
}

.wiki-home .wiki-title {
  font-size: clamp(2rem, 4.5vw, 3.4375rem);
  overflow-wrap: anywhere;
}

.wiki-home .wiki-section {
  margin-top: 36px;
}

.wiki-home [id] {
  scroll-margin-top: 82px;
}

.wiki-home .wiki-text,
.wiki-home .resume {
  line-height: 1.65;
}

.hub-grid,
.character-grid {
  display: grid;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.hub-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.character-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
}

.hub-grid > li,
.character-grid > li {
  min-width: 0;
}

.hub-card,
.character-card {
  height: 100%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color .15s ease, background-color .15s ease;
}

.hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border-top: 3px solid var(--accent);
}

.hub-card-category {
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hub-card h3 {
  font-size: 24px;
  margin: 14px 0 10px;
}

.hub-card p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.hub-card-cta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.character-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.character-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center top;
}

.character-card > span {
  padding: 14px;
  font-weight: 700;
  border-top: 1px solid var(--border);
}

.hub-card:hover,
.character-card:hover {
  border-color: var(--accent);
  background: #17221f;
}

.hub-card:focus-visible,
.character-card:focus-visible,
.wiki-home .sidebar a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 1200px) {
  .page-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 28px;
  }

  .infobox {
    grid-column: 2;
    top: 0;
    width: 100%;
    max-width: 440px;
  }
}

@media (max-width: 700px) {
  .page-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 18px 48px;
    gap: 20px;
  }

  .sidebar {
    position: static;
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .sidebar nav a {
    border: 1px solid var(--border);
    padding: 10px 12px;
  }

  .infobox {
    grid-column: 1;
  }

  .hub-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-card,
  .character-card {
    transition: none;
  }
}
