.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-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-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);
}

.tnm-pdf-gate[hidden],
.tnm-pdf-direct-link[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-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 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-bottom: 1px solid #cac4bc;
  background: #fff;
}

.tnm-pdf-toolbar button {
  min-width: 42px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #bdb5aa;
  border-radius: 6px;
  background: #f7f2e9;
  color: #1e1e1e;
  font-weight: 700;
  cursor: pointer;
}

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

.tnm-pdf-page-status {
  min-width: 72px;
  text-align: center;
  font-weight: 700;
}

.tnm-pdf-stage {
  position: relative;
  overflow: auto;
  display: flex;
  min-height: 760px;
  height: 82vh;
  align-items: flex-start;
  justify-content: center;
  padding: 28px;
  background: #e7e0d5;
}

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

.tnm-pdfjs-ready .tnm-pdf-canvas {
  display: block;
}

.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 16px;
  }

  .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;
  }
}
