/* The Witcher Visual Album — global/base styles.
   Existing selector order is preserved to avoid changing the page's appearance. */

:root {
  --bg: #10171b;
  --panel: #182328;
  --panel2: #202d33;
  --line: #33454c;
  --gold: #c7a76c;
  --gold-soft: #d2bd96;
  --text-bright: #f2f4f7;
  --text: #eaeef1;
  --text-dark: #b5c0c7;
  --text-accent: #9fc5c5;
  --green-light: #b5c49d;
  --teal: #6fc1c5;
  /* 
  --gold -Główne nagłówki, metadane
  --gold-soft - Mniej ważne nagłówki
  --text-bright - prawie białe nagłówki kart
  --text - Podstawowy tekst
  --text-accent - Wyróżnienia w tekście
  --text-dark - Elementy nawigacji i interfejsu, informacje pomocnicze 
  --green-light - Metadane 2, delikatnie się odróżniające
  --teal - Linki, interakcje */

  /* Tła i powierzchnie */
  --bg-deep: #111719;
  --card-bg: #1c292e;
  --line-soft: #2d3d43;

  /* Tekst i akcenty */
  --text-muted: #9aabb1;
  --teal-muted: #5b9298;

  /* Przezroczyste warianty złota */
  --gold-surface-subtle: #c7a76c14;
  --gold-surface-soft: #c7a76c21;
  --gold-border: #c7a76c42;
  --gold-border-strong: #c7a76c73;

  /* Jasne, półprzezroczyste powierzchnie */
  --surface-white-subtle: #ffffff06;
  --surface-white-soft: #ffffff0e;

  /* Interactive Stories — osobna, pergaminowa paleta */
  --story-paper: #eadbb9;
  --story-paper-light: #f0e4c8;
  --story-ink: #352b20;
  --story-ink-soft: #503a25;
  --story-ink-muted: #76552f;
  --card-bg-translucent: #1c292ea6;
  --teal-muted-subtle: #5b929817;
  --teal-muted-soft: #5b929933;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0%, #1d343b 0%, #17272d 40%, #10171b 75%, #0b1013 100%) fixed;
  color: var(--text);
  font: 14px/1.6 "Segoe UI", Arial, sans-serif;
}

/* Zwykły tekst - wyjustowanie */
main p {
  text-align: justify;
}

/* Banner */
.hero {
  padding: 64px 24px 42px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, #0c1418b8, #1c373d7a),
    url("../assets/baner.webp") center/cover no-repeat;
}

.h0 {
  font-family: "Lora", Georgia, serif;
  font-weight: 500;
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.05;
  margin: 12px 0;
  color: var(--text);
  letter-spacing: .04em;
}

.subtitle {
  max-width: 780px;
  margin: 16px auto 0;
  color: var(--gold-soft);
  font-size: 18px;
  font-style: italic;
}

/* Global heading hierarchy */
/* Kategorie w index */
h1 {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.25;
  font-weight: 700;
  color: var(--gold);
}

/* Nagłówki kart */
h2 {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 9px;
}

/* Tytuły podkategorii */
h3 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 9px;
}

h4 {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--gold);
  margin: 0;
}

h5 {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--gold-soft);
  margin: 0;
}

h6 {
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text-bright);
}

/* Metadane ex. Release date, Platforms, Players, Playtime */
.meta,
.meta2 {
  font-size: 12px;
  font-weight: 700;
}

.meta {
  color: var(--gold);
}

.meta2 {
  color: var(--green-light);
}

/* Text accent — highlighted text without bold formatting */
.text-accent {
  color: var(--text-accent);
  font-weight: 400;
}

/* Links */
a {
  color: var(--teal);
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 0;
  background: transparent;
  border: 0;
  pointer-events: none;
}

nav {
  max-width: 1400px;
  margin: auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  overflow: visible;
  white-space: normal;
}

nav a {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-dark);
  white-space: nowrap;
}

nav a:hover {
  border-color: var(--teal);
  color: white;
}

main {
  max-width: 1400px;
  margin: auto;
  padding: 20px 22px 70px;
}

.album-section {
  padding-top: 20px;
  margin-top: 25px;
  scroll-margin-top: 110px;
}

main>.album-section:first-child {
  margin-top: -40px;
}

[id] {
  scroll-margin-top: 110px;
}

.section-heading {
  display: flex;
  align-items: end;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  flex: 1;
}

/* Card columns */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 18px;
}

/* Card appearance */
.card {
  overflow: hidden;
  background: linear-gradient(180deg, var(--card-bg), #151e22);
  border: 1px solid #31444a;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow: 0 8px 20px #00000026;
  transition: transform .18s, border-color .18s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--teal-muted);
}

.card-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h2 {
  text-align: center;
}

.card p {
  margin: 0 0 14px;
  flex: 1;
  text-align: justify;
}

/* Card - Displaying tags */
.tag {
  display: block;
  width: fit-content;
  max-width: 100%;
  align-self: center;
  text-align: center;
  color: var(--text-accent);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin: -3px 0 12px;
}

/* Card - Release date, Publications, Players etc. */
.release-date {
  font-size: 12px;
  color: var(--text-dark);
  line-height: 1.45;
  margin: 0;
  padding: 8px 0 4px;
  border-top: 1px solid var(--line-soft);
}

/* Card - footnotes, sources */
.source {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.source a {
  text-decoration: none;
}

.image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 270px;
  background: transparent;
  overflow: hidden;
  text-decoration: none;
}

.image-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 10px;
  display: block;
  background: transparent;
}

.fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-content: center;
  text-align: center;
  color: #a7b8be;
  letter-spacing: .08em;
  font-size: 12px;
  background: repeating-linear-gradient(135deg, #172126, #172126 12px, var(--card-bg) 12px, var(--card-bg) 24px);
}

.more {
  display: block;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
  font-size: 13px;
  text-decoration: none;
  margin-top: 5px;
  font-weight: 700;
}

.more:hover {
  text-decoration: underline;
}


/* To Do - Ramka Do zrobienia */
.todo-badge {
  display: inline-block;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 5px 9px;
  border: 1px solid #8f774b;
  border-radius: 3px;
  background: #c5a66d1f;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.series-heading {
  margin: 22px 0 12px;
  padding: 12px 16px 10px;
  border-left: 0;
  border-bottom: 1px solid var(--line);
  background: var(--card-bg-translucent);
  border-radius: 6px;
}

.series-heading h3 {
  letter-spacing: .06em;
  margin: 0 0 6px;
}

.series-heading p {
  margin: 0 0 2px;
  max-width: none;
}

.section-intro {
  color: var(--text-dark);
  font-size: 14px;
  max-width: 900px;
  margin: -4px 0 22px;
  line-height: 1.65;
}

footer {
  border-top: 1px solid var(--line);
  padding: 25px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

footer .text-accent {
  color: var(--text);
}

ul {
  list-style: none;
  padding-left: 0;
  margin-top: 0;
  margin-bottom: 0;
}

ul li {
  position: relative;
  padding-left: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

ul li::before {
  content: "•";
  color: #75c5c9;
  position: absolute;
  left: 0;
}

/* Layout and scroll positioning */
.album-section {
    scroll-margin-top: 22px;
}

.series-heading[id] {
    scroll-margin-top: 76px;
}

/* Wide cinematic artwork should read as a video thumbnail, not a book cover. */
#game-trailers .image-link {
  height: auto;
  aspect-ratio: 16 / 9;
}

#game-trailers .image-link img {
  object-fit: cover;
  padding: 0;
}

/* Soundtrack artwork is usually square; preserve the full image without cropping. */
#music .image-link {
  height: auto;
  aspect-ratio: 1 / 1;
  max-height: 270px;
}

#music .image-link img {
  object-fit: contain;
  padding: 10px;
}

@media (max-width: 760px) {
  main {
    padding: 16px 14px 55px;
  }

  .album-section {
    scroll-margin-top: 130px;
  }

  .grid {
    gap: 14px;
  }

  .card-body {
    padding: 13px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 42px 18px;
  }

  .subtitle {
    font-size: 16px;
  }

  nav {
    justify-content: flex-start;
    padding: 7px 10px;
    gap: 5px;
  }

  nav a {
    font-size: 11px;
    padding: 5px 7px;
  }

  main {
    padding: 12px;
  }

  .image-link {
    height: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}

@media print {
  .nav-wrap {
    position: static;
  }

  .card {
    break-inside: avoid;
  }
}

/* v22: mobile navigation hides while scrolling down and reappears while scrolling up */
.nav-wrap {
  transition: transform .22s ease;
  will-change: transform;
}

@media (max-width: 760px) {
  .nav-wrap.nav-hidden {
    transform: translateY(-110%);
  }
}

/* Featured primary-source quotation in the interviews section */
.featured-quote {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent, #b5a06a);
  background: #7f7f7f14;
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.94rem;
  line-height: 1.65;
}

.featured-quote p {
  margin: 0;
}

.featured-quote .quote-note {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.82rem;
  opacity: 0.78;
}

/* Books - Polish editions */
.polish-editions-heading {
  margin-top: 36px !important;
  margin-bottom: 18px;
  padding-top: 13px;
}

.polish-editions-grid {
  margin-bottom: 34px;
}

.polish-exclusive-heading {
  margin-top: 34px;
}

@media (max-width: 600px) {
  .discovery-article>summary {
    padding: 14px 12px;
    font-size: 10px;
  }

  .discovery-article-body {
    padding: 18px 15px 24px;
  }

  .discovery-article-body .article-lead {
    font-size: 16px;
  }
}


/* Books - International editions */
.international-editions {
  margin-top: 34px;
}

.international-editions-grid {
  margin-top: 20px;
}

.international-edition-card .card-image {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.international-edition-card .card-content {
  padding: 18px;
}

.international-edition-card h4 {
  margin: 8px 0;
}

.international-edition-card p {
  line-height: 1.65;
}

/* Scrollbar - subtle petrol */

html {
  scrollbar-color: var(--line) var(--bg-deep);
  scrollbar-width: auto;
}

::-webkit-scrollbar {
  width: 15px;
  height: 15px;
}

@media (max-width: 760px) {
  html {
    scrollbar-width: thin;
  }

  ::-webkit-scrollbar {
    width: 9px;
    height: 9px;
  }
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 2px solid var(--bg-deep);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #435960;
}

::-webkit-scrollbar-corner {
  background: var(--bg-deep);
}

/* Dropdown navigation: only the framed menu icon remains visible; no full-width bar. */
.nav-wrap .album-dropdown {
  pointer-events: auto;

}


/* Shared lightbox — responsive frame with dedicated side gutters. */
.collection-lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(93vw, 1400px);
  height: 93vh;
  max-width: min(93vw, 1400px);
  max-height: 93vh;
  margin: auto;
  padding: 42px 58px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101617;
  overflow: auto;
}

.collection-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(calc(92vw - 116px), 1284px);
  max-height: calc(92vh - 75px);
  margin: auto;
  object-fit: contain;
}

.collection-lightbox::backdrop {
  background: #00000099;
}

.collection-lightbox [data-lightbox-close] {
  position: absolute;
  top: 8px;
  right: 14px;
  bottom: auto;
  left: auto;
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: 700 30px/1 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.collection-lightbox .lightbox-navigation {
  position: absolute;
  top: 50%;
  bottom: auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e2e6e8;
  font: 30px/1 Georgia, "Times New Roman", serif;
  font-weight: 600;
  text-shadow: 0 1px 4px #000000e6;
  cursor: pointer;
  opacity: 1;
  transform: translateY(-50%);
  transition: color .18s ease, opacity .18s ease;
}

.collection-lightbox .lightbox-navigation:hover,
.collection-lightbox [data-lightbox-close]:hover {
  border: 0;
  background: transparent;
  color: #fff;
  opacity: 1;
}

.collection-lightbox .lightbox-previous {
  left: 13px;
  right: auto;
}

.collection-lightbox .lightbox-next {
  right: 13px;
  left: auto;
}

@media (max-width: 700px) {
  .collection-lightbox {
    max-width: 94vw;
    padding: 42px 40px 16px;
  }

  .collection-lightbox img {
    max-width: min(calc(94vw - 80px), 1284px);
  }

  .collection-lightbox .lightbox-previous {
    left: 7px;
  }

  .collection-lightbox .lightbox-next {
    right: 7px;
  }

  .collection-lightbox .lightbox-navigation {
    width: 28px;
    height: 40px;
    font-size: 26px;
  }

  .collection-lightbox [data-lightbox-close] {
    top: 7px;
    right: 10px;
  }
}


/* Lightbox keyboard focus — keep controls visually discreet in both galleries. */
.collection-lightbox:focus,
.collection-lightbox button:focus,
.collection-lightbox button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}


/* Polish Editions and My Collection thumbnails — consistent zoom cursor,
   without a persistent focus highlight after opening/closing the lightbox. */
.polish-editions-grid .image-link,
.polish-editions-grid .image-link *,
.polish-editions-grid .image-link img {
  cursor: zoom-in !important;
}

.polish-editions-grid .image-link:focus,
.polish-editions-grid .image-link:focus-visible,
.polish-editions-grid .image-link:active,
.collection-card-image:focus,
.collection-card-image:focus-visible,
.collection-gallery button:focus,
.collection-gallery button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Lightbox — layout with horizontal thumbnail strip. */
.collection-lightbox.has-thumbnails[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  max-height: 93vh;
}

.collection-lightbox.has-thumbnails[open] > [data-lightbox-image] {
  align-self: center;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(calc(92vh - 220px), 980px);
  margin: 0 auto;
  flex: 0 1 auto;
}

/* Thumbnail strip */
.lightbox-thumbnails {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  height: 144px;
  min-height: 144px;
  padding: 10px 2px;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #687477 transparent;
}

.lightbox-thumbnail {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  box-sizing: border-box;
  padding: 3px;
  border: 1px solid #dce2e48c;
  border-radius: 4px;
  background: #ffffff09;
  cursor: pointer;
  opacity: .82;
  transition: opacity .18s ease, border-color .18s ease, background .18s ease;
}

.lightbox-thumbnail img {
  display: block;
  width: auto;
  height: auto;
  max-width: 110px;
  max-height: 110px;
  object-fit: contain;
  margin: 0;
}

.lightbox-thumbnail:hover {
  opacity: 1;
  border-color: #dce2e4f2;
}

.lightbox-thumbnail[aria-current="true"] {
  border: 2px solid #c5a66b;
  background: #c5a66b1a;
  opacity: 1;
}


@media (max-width: 700px) {
  .collection-lightbox.has-thumbnails[open] {
    gap: 8px;
    padding-bottom: 10px;
    max-height: 90vh;
  }

  .collection-lightbox.has-thumbnails[open] > [data-lightbox-image] {
    max-height: calc(90vh - 190px);
  }

  .lightbox-thumbnails {
    gap: 6px;
    height: 116px;
    min-height: 116px;
    padding: 8px 2px;
  }

  .lightbox-thumbnail {
    width: 96px;
    height: 96px;
  }

  .lightbox-thumbnail img {
    max-width: 86px;
    max-height: 86px;
  }
}


/* Lightbox caption: quiet metadata line between the main image and thumbnails. */
.collection-lightbox [data-lightbox-image] {
  transition: opacity .12s ease;
}

.collection-lightbox [data-lightbox-image].is-loading {
  opacity: 0;
}

.collection-lightbox .lightbox-caption {
  display: block;
  box-sizing: border-box;
  flex: 0 0 auto;
  max-width: 100%;
  height: auto;
  margin: 4px auto;
  color: #e1e8eab8;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
  text-align: left;
  overflow-wrap: anywhere;
}

.collection-lightbox .lightbox-caption[hidden] {
  display: none !important;
}
