.tnm-issues-archive,
.tnm-single-issue {
  box-sizing: border-box;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px;
}

.tnm-issues-header,
.tnm-single-header {
  margin-bottom: 28px;
}

.tnm-issues-header-row,
.tnm-single-header-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.tnm-issues-header h1,
.tnm-single-header h1 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

.tnm-single-header {
  margin-bottom: 16px;
}

.tnm-single-header h1 {
  font-size: clamp(1.35rem, 3vw, 2.15rem);
}

.tnm-back-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #d8d4cf;
  border-radius: 6px;
  background: #fff;
  color: #6f1d1b;
  font-weight: 700;
  text-decoration: none;
}

.tnm-single-header .tnm-back-link {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.tnm-back-link:hover,
.tnm-issue-card a:hover h2,
.tnm-year-card:hover span {
  text-decoration: underline;
}

.tnm-year-grid,
.tnm-issue-grid {
  display: grid;
  gap: 18px;
}

.tnm-year-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
}

.tnm-issue-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tnm-year-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  min-height: 168px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid
    color-mix(in srgb, var(--tnm-card-accent, #6f1d1b) 26%, #d8d4cf);
  border-radius: 8px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.94),
      rgba(255, 255, 255, 0.8)
    ),
    linear-gradient(145deg, var(--tnm-card-soft, #f7f2e9), #fff);
  color: #1e1e1e;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(20, 20, 20, 0.09);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.tnm-year-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 7px;
  background: var(--tnm-card-accent, #6f1d1b);
  content: "";
}

.tnm-year-card::after {
  position: absolute;
  right: -38px;
  bottom: -46px;
  z-index: -1;
  width: 128px;
  height: 128px;
  border: 26px solid
    color-mix(in srgb, var(--tnm-card-accent, #6f1d1b) 24%, transparent);
  border-radius: 50%;
  content: "";
}

.tnm-year-card:nth-child(6n + 1) {
  --tnm-card-accent: #6f1d1b;
  --tnm-card-soft: #fff2ed;
}

.tnm-year-card:nth-child(6n + 2) {
  --tnm-card-accent: #1f6f5b;
  --tnm-card-soft: #eef8f3;
}

.tnm-year-card:nth-child(6n + 3) {
  --tnm-card-accent: #315b96;
  --tnm-card-soft: #eef4ff;
}

.tnm-year-card:nth-child(6n + 4) {
  --tnm-card-accent: #8a5a13;
  --tnm-card-soft: #fff7e8;
}

.tnm-year-card:nth-child(6n + 5) {
  --tnm-card-accent: #7b3f78;
  --tnm-card-soft: #fbf0fb;
}

.tnm-year-card:nth-child(6n) {
  --tnm-card-accent: #59642f;
  --tnm-card-soft: #f5f7eb;
}

.tnm-year-card:hover,
.tnm-issue-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(20, 20, 20, 0.14);
}

.tnm-year-card:hover {
  border-color: color-mix(
    in srgb,
    var(--tnm-card-accent, #6f1d1b) 58%,
    #d8d4cf
  );
}

.tnm-year-card span {
  color: var(--tnm-card-accent, #6f1d1b);
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
}

.tnm-year-card small {
  align-self: flex-start;
  margin-top: 18px;
  padding: 7px 10px;
  border: 1px solid
    color-mix(in srgb, var(--tnm-card-accent, #6f1d1b) 22%, #e7e0d5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #4a4742;
  font-size: 0.95rem;
  font-weight: 700;
}

.tnm-issue-card {
  overflow: hidden;
  border: 1px solid #d8d4cf;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.tnm-issue-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tnm-issue-card figure {
  position: relative;
  aspect-ratio: 4 / 5;
  margin: 0;
  background: #ece8df;
}

.tnm-issue-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tnm-placeholder-cover {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f7f2e9, #d5e1dd);
  color: #6f1d1b;
  font-size: 2.5rem;
  font-weight: 800;
}

.tnm-issue-card h2 {
  margin: 0;
  padding: 16px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.tnm-book-viewer {
  position: relative;
  overflow: hidden;
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 78vh;
  border: 1px solid #cac4bc;
  border-radius: 8px;
  background: #f8f4ec;
  box-shadow: 0 22px 60px rgba(20, 20, 20, 0.2);
}

body.tnm-pdf-viewer-expanded {
  overflow: hidden;
}

.tnm-pdf-gate[hidden],
.tnm-pdf-direct-link[hidden],
.tnm-pdf-download[hidden],
.tnm-pdf-fullscreen[hidden] {
  display: none;
}

.tnm-pdf-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(20, 20, 20, 0.58);
}

.tnm-pdf-gate-form {
  box-sizing: border-box;
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid #d8d4cf;
  border-radius: 8px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.98),
      rgba(248, 244, 236, 0.96)
    ),
    #fff;
  box-shadow: 0 28px 70px rgba(20, 20, 20, 0.26);
}

.tnm-pdf-gate-loader {
  display: none;
  box-sizing: border-box;
  width: min(100%, 280px);
  padding: 26px;
  border: 1px solid #d8d4cf;
  border-radius: 8px;
  background: #fff;
  color: #1e1e1e;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 28px 70px rgba(20, 20, 20, 0.26);
}

.tnm-pdf-gate-pending .tnm-pdf-gate-form,
.tnm-pdf-gate-loading .tnm-pdf-gate-form {
  display: none;
}

.tnm-pdf-gate-pending .tnm-pdf-gate-loader,
.tnm-pdf-gate-loading .tnm-pdf-gate-loader {
  display: block;
}

.tnm-pdf-gate-spinner {
  display: block;
  width: 38px;
  height: 38px;
  margin: 0 auto 14px;
  border: 4px solid #e7e0d5;
  border-top-color: #6f1d1b;
  border-radius: 50%;
  animation: tnm-pdf-gate-spin 800ms linear infinite;
}

@keyframes tnm-pdf-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

.tnm-pdf-gate-form h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  line-height: 1.15;
}

.tnm-pdf-gate-form p {
  margin: 0 0 20px;
  color: #5d5d5d;
}

.tnm-pdf-gate-form label {
  display: block;
  margin-bottom: 14px;
  font-weight: 700;
}

.tnm-pdf-gate-form span {
  display: block;
  margin-bottom: 6px;
}

.tnm-pdf-gate-form input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #bdb5aa;
  border-radius: 6px;
  background: #fff;
  color: #1e1e1e;
  font: inherit;
}

.tnm-pdf-gate-form button {
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 6px;
  background: #6f1d1b;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tnm-pdf-gate-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.tnm-pdf-gate-message {
  min-height: 20px;
  margin-top: 12px;
  color: #6f1d1b;
  font-weight: 700;
}

.tnm-pdf-locked .tnm-pdf-toolbar {
  pointer-events: none;
  opacity: 0.48;
}

.tnm-pdf-toolbar {
  position: absolute;
  right: auto;
  bottom: 14px;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  width: max-content;
  max-width: calc(100% - 28px);
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  border: 1px solid rgba(189, 181, 170, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(20, 20, 20, 0.18);
  backdrop-filter: blur(8px);
  transform: translateX(-50%);
  text-transform: capitalize;
}

.tnm-pdf-toolbar button,
.tnm-pdf-toolbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #bdb5aa;
  border-radius: 6px;
  background: #f7f2e9;
  color: #1e1e1e;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-transform: capitalize;
  text-decoration: none;
  cursor: pointer;
}

.tnm-pdf-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tnm-pdf-expanded {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: block;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh;
  min-height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tnm-pdf-expanded .tnm-pdf-stage {
  height: 100vh;
  min-height: 100vh;
}

.tnm-pdf-page-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 170px;
  text-align: center;
  font-weight: 700;
  text-transform: capitalize;
}

.tnm-pdf-page-status label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.tnm-pdf-page-status input {
  box-sizing: border-box;
  width: 74px;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid #bdb5aa;
  border-radius: 6px;
  background: #fff;
  color: #1e1e1e;
  font: inherit;
  font-weight: 700;
}

.tnm-pdf-stage {
  position: relative;
  overflow: auto;
  display: block;
  box-sizing: border-box;
  min-height: 760px;
  height: 82vh;
  padding: 28px 28px var(--tnm-pdf-toolbar-space, 86px);
  background: #e7e0d5;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.tnm-pdf-stage-dragging {
  cursor: grabbing;
}

.tnm-pdf-stage-pinching .tnm-pdf-spread {
  will-change: transform;
}

.tnm-pdf-spread {
  display: none;
  gap: 14px;
  align-items: flex-start;
  justify-content: center;
  width: max-content;
  min-width: max-content;
  margin: 0 auto;
}

.tnm-pdf-canvas {
  display: block;
  box-sizing: border-box;
  max-width: none;
  height: auto;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 20, 20, 0.24);
}

.tnm-pdf-page {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 20, 20, 0.24);
}

.tnm-pdf-page[hidden] {
  display: none;
}

.tnm-pdf-page .tnm-pdf-canvas {
  box-shadow: none;
}

.tnm-pdf-annotation-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.tnm-pdf-annotation-link {
  position: absolute;
  display: block;
  pointer-events: auto;
  cursor: pointer;
  background: transparent;
}

.tnm-pdf-annotation-link:hover,
.tnm-pdf-annotation-link:focus-visible {
  outline: 2px solid rgba(25, 103, 210, 0.7);
  background: rgba(25, 103, 210, 0.12);
}

.tnm-pdf-canvas[hidden] {
  display: none;
}

.tnm-pdfjs-ready .tnm-pdf-spread {
  display: flex;
}

.tnm-pdf-native-frame {
  display: block;
  width: 100%;
  min-height: 760px;
  height: 82vh;
  border: 0;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 20, 20, 0.24);
}

.tnm-pdf-native-frame[hidden] {
  display: none;
}

.tnm-pdf-native-ready .tnm-pdf-toolbar,
.tnm-pdf-native-ready .tnm-pdf-message {
  display: none;
}

.tnm-pdf-native-ready .tnm-pdf-stage {
  padding: 0;
  background: #fff;
}

.tnm-pdf-message {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff;
  color: #1e1e1e;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(20, 20, 20, 0.12);
}

.tnm-pdfjs-ready .tnm-pdf-message {
  display: none;
}

.tnm-pdf-actions {
  margin-top: 16px;
}

.tnm-pdf-actions a {
  font-weight: 700;
  color: #6f1d1b;
}

.tnm-empty {
  padding: 20px;
  border: 1px solid #d8d4cf;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 700px) {
  .tnm-issues-archive,
  .tnm-single-issue {
    padding: 32px 0px;
  }

  .tnm-year-grid {
    grid-template-columns: 1fr;
  }

  .tnm-issues-header-row,
  .tnm-single-header-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .tnm-issue-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tnm-book-viewer,
  .tnm-pdf-stage {
    min-height: 70vh;
    height: 70vh !important;
  }

  .tnm-pdf-stage {
    padding: 16px 16px var(--tnm-pdf-toolbar-space, 112px);
  }

  .tnm-pdf-toolbar {
    bottom: 8px;
    max-width: calc(100% - 16px);
    gap: 5px;
    padding: 6px;
  }

  .tnm-pdf-expanded .tnm-pdf-toolbar {
    position: fixed;
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 2147483646;
    display: flex !important;
    visibility: visible;
    opacity: 1;
  }

  .tnm-pdf-toolbar button,
  .tnm-pdf-toolbar a {
    min-width: 32px;
    min-height: 32px;
    padding: 4px 7px;
    font-size: 0.82rem;
  }

  .tnm-pdf-page-status {
    gap: 4px;
    min-width: 0;
    font-size: 0.82rem;
  }

  .tnm-pdf-page-status label > span,
  .tnm-pdf-fullscreen-text {
    display: none;
  }

  .tnm-pdf-fullscreen::before {
    content: "\26F6";
    font-size: 1.1rem;
    line-height: 1;
  }

  .tnm-pdf-page-status input {
    width: 52px;
    min-height: 30px;
    padding: 2px 5px;
  }

  .tnm-pdf-spread {
    min-width: max-content;
    width: max-content;
  }

  .tnm-pdf-canvas {
    max-width: none;
  }

  .tnm-pdf-canvas + .tnm-pdf-canvas {
    display: none;
  }
}

.tnm-book-viewer.tnm-pdf-expanded {
  height: 100vh !important;
  min-height: 100vh !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
}

.tnm-pdf-expanded .tnm-pdf-stage {
  height: 100vh !important;
  min-height: 100vh !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
}
