/* =========================================================
   Broadside Edition — edition-broadside.css
   Edge / Mean Machines aesthetic — 1990s UK games press
   ========================================================= */

:root {
  --bs-bg: #0d0d0d;
  --bs-text: #ffffff;
  --bs-accent: #4a7fa5;
  --bs-font-headline: 'IBM Plex Sans Condensed', sans-serif;
  --bs-font-mono: 'IBM Plex Mono', monospace;
  --bs-cut: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bs-bg);
  color: var(--bs-text);
  font-family: var(--bs-font-mono);
  overflow: hidden;
}

/* ── Wrapper ── */
.broadside-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* ── Swiper container ── */
.broadside-swiper {
  width: 100%;
  height: 100%;
}

/* ── Slide base ── */
.bs-slide {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Loading slide ── */
.bs-slide--loading {
  align-items: center;
  justify-content: center;
}

.bs-loading-text {
  font-family: var(--bs-font-mono);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Cover slide ── */
.bs-slide--cover {
  background: var(--bs-bg);
  position: relative;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 64px;
  box-sizing: border-box;
}

/* Scanline overlay */
.bs-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 0;
}

.bs-cover-issue {
  position: absolute;
  top: 24px;
  right: 40px;
  font-family: var(--bs-font-mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 1;
}

.bs-cover-date {
  position: absolute;
  bottom: 60px;
  right: 40px;
  font-family: var(--bs-font-mono);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.1em;
  z-index: 1;
}

.bs-cover-masthead {
  position: relative;
  z-index: 1;
  margin-bottom: 44px;
}

.bs-masthead-title {
  font-family: var(--bs-font-headline);
  font-weight: 700;
  font-size: clamp(3.5rem, 11vw, 8.5rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bs-text);
  margin: 0;
  line-height: 1;
}

/* Splitting.js wraps each char in .char */
.bs-masthead-title .char {
  display: inline-block;
}

.bs-masthead-sub {
  font-family: var(--bs-font-mono);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 10px 0 0;
}

/* Cover lines */
.bs-cover-lines {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0 0 0 20px;
  border-left: 2px solid var(--bs-accent);
}

.bs-cover-lines li {
  margin-bottom: 10px;
}

.bs-cover-lines a {
  font-family: var(--bs-font-mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.bs-cover-lines a::before {
  content: '• ';
  color: var(--bs-accent);
}

.bs-cover-lines a:hover,
.bs-cover-lines a:focus {
  color: var(--bs-text);
  outline: none;
}

/* ── Section slide ── */
.bs-slide--section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bs-section-header {
  flex-shrink: 0;
  height: 80px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 2px solid var(--bs-accent);
  clip-path: var(--bs-cut);
  box-sizing: border-box;
}

.bs-section-title {
  font-family: var(--bs-font-headline);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
  color: var(--bs-text);
  white-space: nowrap;
}

.bs-section-intro {
  font-family: var(--bs-font-mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  letter-spacing: 0.05em;
}

/* ── Tile grid ── */
.bs-tile-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 40px 56px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 12px;
  align-content: start;
}

/* ── Tile size classes ── */
.flip-card--large {
  grid-column: span 2;
  grid-row: span 2;
}

.flip-card--medium {
  grid-column: span 2;
  grid-row: span 1;
}

.flip-card--small {
  grid-column: span 1;
  grid-row: span 1;
}

/* ── Flip card ── */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
  min-height: 200px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Front face */
.card-front {
  background-size: cover;
  background-position: center;
  background-color: #1c1c1c;
  overflow: hidden;
}

.card-front__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
}

.card-front__border {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.card-front__hint {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.28);
  transition: color 0.2s;
  pointer-events: none;
}

.flip-card:hover .card-front__hint {
  color: rgba(255, 255, 255, 0.7);
}

.card-front__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px 12px 18px;
}

.card-front__name {
  font-family: var(--bs-font-headline);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
  line-height: 1.2;
  text-transform: uppercase;
  color: #fff;
}

.flip-card--large .card-front__name {
  font-size: 1.35rem;
}

.flip-card--medium .card-front__name {
  font-size: 1.05rem;
}

.card-front__year {
  font-family: var(--bs-font-mono);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
  margin: 0;
}

/* Back face */
.card-back {
  transform: rotateY(180deg);
  overflow: hidden;
  clip-path: var(--bs-cut);
  display: flex;
  flex-direction: column;
}

.card-back__topbar {
  height: 20px;
  width: 100%;
  flex-shrink: 0;
}

.card-back__border {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  z-index: 1;
}

.card-back__body {
  padding: 8px 14px 10px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  box-sizing: border-box;
}

.card-back__name {
  font-family: var(--bs-font-headline);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 5px;
  line-height: 1.2;
  color: #fff;
}

.card-back__desc {
  font-family: var(--bs-font-mono);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.55;
  margin: 0 0 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.flip-card--large .card-back__desc {
  -webkit-line-clamp: 4;
}

.card-back__pages {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.card-back__pages li {
  margin-bottom: 4px;
}

.card-back__pages a {
  font-family: var(--bs-font-mono);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.card-back__pages a::before {
  content: '→ ';
  color: var(--bs-accent);
}

.card-back__pages a:hover,
.card-back__pages a:focus {
  color: #fff;
  outline: none;
}

.card-back__return {
  font-family: var(--bs-font-mono);
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.25);
  text-align: right;
  margin-top: auto;
  padding-top: 6px;
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .card-inner {
    transition: none !important;
  }
}

/* ── Masthead / credits slide ── */
.bs-slide--masthead {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 40px 48px;
  box-sizing: border-box;
}

.bs-masthead-heading {
  font-family: var(--bs-font-headline);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bs-accent);
  margin: 0 0 6px;
  border-bottom: 2px solid var(--bs-accent);
  padding-bottom: 8px;
}

.bs-masthead-sub-heading {
  font-family: var(--bs-font-mono);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.1em;
  margin: 0 0 22px;
}

.bs-credits-grid {
  flex: 1;
  overflow-y: auto;
  columns: 3;
  column-gap: 28px;
}

.bs-credit-item {
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

.bs-credit-name {
  font-family: var(--bs-font-mono);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.75);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bs-credit-name a {
  color: inherit;
  text-decoration: none;
}

.bs-credit-name a:hover {
  color: #fff;
}

.bs-credit-year {
  font-family: var(--bs-font-mono);
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.28);
  white-space: nowrap;
}

.bs-credit-cat {
  font-family: var(--bs-font-mono);
  font-size: 0.55rem;
  color: var(--bs-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.bs-credits-footer {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 28px;
}

.bs-credits-footer a {
  font-family: var(--bs-font-mono);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.bs-credits-footer a:hover {
  color: var(--bs-accent);
}

/* ── Swiper pagination override ── */
.broadside-pagination {
  bottom: 16px !important;
}

.broadside-pagination .swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.28);
  opacity: 1;
  width: 6px;
  height: 6px;
}

.broadside-pagination .swiper-pagination-bullet-active {
  background: var(--bs-accent);
  width: 18px;
  border-radius: 3px;
}

/* ── Nav cluster ── */
.broadside-nav-cluster {
  position: fixed;
  bottom: 10px;
  right: 60px;
  display: flex;
  gap: 6px;
  z-index: 100;
}

.broadside-nav-btn {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.85rem;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  transition: background 0.15s, border-color 0.15s;
}

.broadside-nav-btn:hover,
.broadside-nav-btn:focus {
  background: rgba(74, 127, 165, 0.35);
  border-color: var(--bs-accent);
  outline: none;
}

/* ── Scrollbars for inner overflow ── */
.bs-tile-grid::-webkit-scrollbar,
.bs-credits-grid::-webkit-scrollbar {
  width: 4px;
}

.bs-tile-grid::-webkit-scrollbar-track,
.bs-credits-grid::-webkit-scrollbar-track {
  background: transparent;
}

.bs-tile-grid::-webkit-scrollbar-thumb,
.bs-credits-grid::-webkit-scrollbar-thumb {
  background: rgba(74, 127, 165, 0.5);
  border-radius: 2px;
}

/* ── Responsive: 375px mobile ── */
@media (max-width: 600px) {
  .bs-slide--cover {
    padding: 36px 24px;
  }

  .bs-cover-issue {
    right: 20px;
  }

  .bs-cover-date {
    right: 20px;
    bottom: 50px;
  }

  .bs-section-header {
    padding: 0 20px;
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    clip-path: none;
  }

  .bs-section-title {
    font-size: 1.1rem;
  }

  .bs-section-intro {
    width: 100%;
    padding-bottom: 8px;
  }

  .bs-tile-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px 16px 50px;
    gap: 8px;
  }

  .flip-card--large,
  .flip-card--medium {
    grid-column: span 2;
  }

  .flip-card--small {
    grid-column: span 1;
  }

  .bs-slide--masthead {
    padding: 24px 20px;
  }

  .bs-credits-grid {
    columns: 2;
    column-gap: 16px;
  }

  .broadside-nav-cluster {
    right: 52px;
    bottom: 8px;
  }
}
