/* =========================================================
   Dynamic Cover Edition
   ========================================================= */

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

:root {
  --cover-bg: #0a0a0a;
  --cover-primary: #c0a030;
  --cover-border: #c0a030;
  --font-display: 'Georgia', 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: #0a0a0a;
  color: #e8e0d0;
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* ---- Cover ---- */

.cover {
  position: relative;
  min-height: 100dvh;
  background: var(--cover-bg, #0a0a0a);
  display: flex;
  flex-direction: column;
  border: 2px solid var(--cover-border, #c0a030);
  overflow: hidden;
  will-change: transform;
}

.cover-inner {
  display: flex;
  flex: 1;
  min-height: 100dvh;
}

/* ---- Cover columns ---- */

.cover-col--left {
  width: 55%;
  padding: 2.5rem 2.5rem 4rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
  justify-content: center;
}

.cover-col--right {
  width: 45%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---- Masthead ---- */

.masthead {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.masthead-title {
  font-size: clamp(0.6rem, 1.1vw, 0.8rem);
  letter-spacing: 0.35em;
  font-weight: 700;
  color: #999;
  font-family: var(--font-body);
  text-transform: uppercase;
}

.masthead-rule {
  height: 1px;
  background: var(--cover-primary);
  width: 100%;
}

.masthead-meta {
  font-size: clamp(0.58rem, 0.95vw, 0.72rem);
  letter-spacing: 0.15em;
  color: #777;
  font-family: var(--font-body);
  text-transform: uppercase;
}

/* ---- Cover name ---- */

.cover-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
  line-height: 1.0;
  font-weight: 700;
  color: #f5f0e8;
  letter-spacing: -0.02em;
}

/* ---- Cover tagline ---- */

.cover-tagline {
  font-style: italic;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  color: #a09888;
  line-height: 1.55;
  max-width: 38ch;
}

/* ---- Coloured rule ---- */

.cover-rule {
  height: 3px;
  background: var(--cover-primary);
  width: 100%;
}

/* ---- Cover lines ---- */

.cover-lines-label {
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: #777;
  font-weight: 700;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.cover-headlines {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.cover-line a {
  color: #e0d8cc;
  text-decoration: none;
  font-size: clamp(0.78rem, 1.25vw, 0.93rem);
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  transition: color 0.15s;
}

.cover-line a::before {
  content: '■';
  color: var(--cover-primary);
  font-size: 0.48em;
  flex-shrink: 0;
  position: relative;
  top: -0.1em;
}

.cover-line a:hover { color: #fff; }

.cover-pages {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
}

.cover-page-link a {
  color: #777;
  text-decoration: none;
  font-size: clamp(0.72rem, 1vw, 0.82rem);
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.cover-page-link a::before { content: '→ '; }

.cover-page-link a:hover { color: var(--cover-primary); }

/* ---- Right column imagery ---- */

.cover-main-img-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.cover-main-img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--cover-bg, #0a0a0a) 0%,
    rgba(0,0,0,0.35) 20%,
    transparent 50%
  );
  z-index: 1;
  pointer-events: none;
}

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

.cover-secondary-imgs {
  display: flex;
  height: 22%;
  gap: 2px;
  flex-shrink: 0;
}

.cover-secondary-img {
  flex: 1;
  object-fit: cover;
  display: block;
  filter: brightness(0.65);
  transition: filter 0.22s;
}

.cover-secondary-img:hover { filter: brightness(0.9); }

.cover-img-placeholder {
  flex: 1;
  min-height: 100%;
}

/* ---- Scroll indicator ---- */

.scroll-indicator {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.scroll-label {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  color: #555;
  text-transform: uppercase;
}

.scroll-chevron {
  display: block;
  font-size: 1.6rem;
  color: var(--cover-primary);
  line-height: 1;
}

/* ---- Contents section ---- */

.contents {
  background: #111;
  min-height: 100vh;
  padding: 4rem 2rem 5rem;
}

.contents-header {
  max-width: 1200px;
  margin: 0 auto 2rem;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 0.85rem;
}

.contents-heading {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.45em;
  color: #555;
  font-weight: 600;
  text-transform: uppercase;
}

/* ---- Contents grid ---- */

.contents-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem 1.5rem;
  align-items: start;
}

.contents-category-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 0 0.6rem;
  color: #444;
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  font-weight: 600;
  text-transform: uppercase;
}

.contents-category-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #252525;
}

/* ---- Contents entry ---- */

.contents-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.75rem 0.75rem 0.9rem;
  border-left: 2px solid var(--entry-primary, #444);
  background: rgba(255,255,255,0.02);
  transition: background 0.15s;
}

.contents-entry:hover {
  background: rgba(255,255,255,0.05);
}

.contents-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2e2e2e;
  min-width: 2.1rem;
  line-height: 1;
  font-family: var(--font-display);
  flex-shrink: 0;
  transition: color 0.18s;
  padding-top: 0.1rem;
}

.contents-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  transform-origin: center;
}

.contents-thumb-placeholder {
  width: 80px;
  height: 60px;
  background: #1e1e1e;
  flex-shrink: 0;
}

.contents-info {
  flex: 1;
  min-width: 0;
}

.contents-name {
  display: block;
  color: #d8d0c4;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.3;
  transition: color 0.15s;
}

.contents-name:hover { color: #fff; }

.contents-badge {
  display: inline-block;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  padding: 0.15em 0.5em;
  background: rgba(255,255,255,0.07);
  color: #777;
  border-radius: 2px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.contents-sublinks {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.contents-sublink {
  font-size: 0.68rem;
  color: #555;
  text-decoration: none;
  transition: color 0.15s;
}

.contents-sublink::before { content: '→ '; }

.contents-sublink:hover { color: #999; }

/* ---- Footer ---- */

.edition-footer {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #1e1e1e;
  text-align: center;
  font-size: 0.72rem;
  color: #444;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.edition-footer a {
  color: #4a4a4a;
  text-decoration: none;
  transition: color 0.15s;
}

.edition-footer a:hover { color: #888; }

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .cover-inner {
    flex-direction: column-reverse;
    min-height: 100dvh;
  }

  .cover-col--left {
    width: 100%;
    padding: 1.5rem 1.5rem 3rem;
    gap: 1rem;
    justify-content: flex-start;
  }

  .cover-col--right {
    width: 100%;
    height: 48vw;
    flex-shrink: 0;
  }

  .cover-main-img-wrap {
    height: 100%;
    flex: none;
  }

  .cover-main-img-wrap::before {
    background: linear-gradient(
      to top,
      var(--cover-bg, #0a0a0a) 0%,
      transparent 40%
    );
  }

  .cover-secondary-imgs { display: none; }

  .cover-name { font-size: clamp(2rem, 9vw, 3.2rem); }

  .contents-grid { grid-template-columns: 1fr; }

  .contents-category-divider { grid-column: 1; }

  .cover-tagline { max-width: 100%; }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .contents-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cover { will-change: auto; }
  .cover-secondary-img { transition: none; }
  .contents-entry { transition: none; }
}
