/* magazine tuning: hand-written fixes and the mode's own design go here (loaded after magazine.css). */

/* MAGAZINE CARD HEIGHT FIX: adjust for wider portrait covers (0.77 aspect ratio) */

/* Desktop: 170px wide cards, covers ~221px tall */
html[data-plate][data-shelf="magazine"] .bk.bk-plate[data-kind="magazine"] {
  height: 347px;
}

html[data-plate][data-shelf="magazine"] .bk.bk-plate[data-kind="magazine"] .bk-cover {
  height: 239px;
}

html[data-plate][data-shelf="magazine"] .bk.bk-plate[data-kind="magazine"] .c-cov {
  height: 221px;
  width: 170px;
  max-width: 170px;
  aspect-ratio: 0.77;
  margin: 0 auto;
}

html[data-plate][data-shelf="magazine"] .bk.bk-plate[data-kind="magazine"] .c-cov img {
  width: 100%;
  height: 100%;
  aspect-ratio: 0.77;
  object-fit: cover;
}

/* Phone: 156px wide cards, covers ~203px tall */
@media (max-width: 767px) {
  html[data-plate][data-shelf="magazine"] .bk.bk-plate[data-kind="magazine"] {
    height: 320px;
  }

  html[data-plate][data-shelf="magazine"] .bk.bk-plate[data-kind="magazine"] .bk-cover {
    height: 221px;
  }

  html[data-plate][data-shelf="magazine"] .bk.bk-plate[data-kind="magazine"] .c-cov {
    height: 203px;
    width: 156px;
    max-width: 156px;
  }
}

/* Now panel mount */
html[data-plate][data-shelf="magazine"] .np-mount {
  width: 170px;
  height: 221px;
  max-width: 170px;
  max-height: 221px;
  flex-shrink: 0;
}

html[data-plate][data-shelf="magazine"] .np-mount img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 0.77;
}

@media (max-width: 767px) {
  html[data-plate][data-shelf="magazine"] .np-mount {
    width: 156px;
    height: 203px;
    max-width: 156px;
    max-height: 203px;
  }
}

/* Details mount */
html[data-plate][data-shelf="magazine"] .ob-mount {
  width: 240px;
  height: 312px;
  max-width: 240px;
  max-height: 312px;
  flex-shrink: 0;
}

html[data-plate][data-shelf="magazine"] .ob-mount img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 0.77;
}

@media (max-width: 767px) {
  html[data-plate][data-shelf="magazine"] .ob-mount {
    width: 200px;
    height: 260px;
    max-width: 200px;
    max-height: 260px;
  }
}

/* Step 3: Publications grid scrolls horizontally */
html[data-plate][data-shelf="magazine"] .pub-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 20px;
  padding-bottom: 8px;
}

html[data-plate][data-shelf="magazine"] .pub-grid .pub-card {
  flex-shrink: 0;
}

html[data-plate][data-shelf="magazine"] .pub-card {
  cursor: pointer;
  transition: transform 0.2s;
}

html[data-plate][data-shelf="magazine"] .pub-card:hover {
  transform: translateY(-2px);
}

/* Step 4: Library drawer publication filter strip */
html[data-plate][data-shelf="magazine"] .pub-filter-strip {
  display: flex;
  gap: 8px;
  padding: 16px 0;
  overflow-x: auto;
  flex-wrap: nowrap;
}

html[data-plate][data-shelf="magazine"] .pub-filter-key {
  min-height: 48px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font: 600 14px/1 var(--sans);
  letter-spacing: 0.02em;
  background: rgba(18, 35, 41, 0.96);
  color: var(--t2);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  flex-shrink: 0;
}

html[data-plate][data-shelf="magazine"] .pub-filter-key span {
  color: var(--t3);
  font-size: 13px;
}

html[data-plate][data-shelf="magazine"] .pub-filter-key:hover {
  background: rgba(36, 75, 90, 0.96);
  box-shadow: inset 0 0 0 1px rgba(200, 233, 247, 0.14);
}

html[data-plate][data-shelf="magazine"] .pub-filter-key.active {
  background: var(--acc);
  color: rgba(7, 19, 24, 1);
  box-shadow: 0 4px 12px rgba(200, 233, 247, 0.35);
}

html[data-plate][data-shelf="magazine"] .pub-filter-key.active span {
  color: rgba(7, 19, 24, 0.7);
}

/* Phone: single scrolling row */
@media (max-width: 767px) {
  html[data-plate][data-shelf="magazine"] .pub-filter-strip {
    padding: 12px 0;
    gap: 6px;
  }

  html[data-plate][data-shelf="magazine"] .pub-filter-key {
    min-height: 48px;
    padding: 0 16px;
    font-size: 13px;
  }
}

/* PUBLICATION PAGE: Remove SVG texture, fix card spacing */
html[data-plate][data-shelf="magazine"] .creator-panel {
  background: var(--brushed),
    radial-gradient(80% 70% at 20% 0%, rgba(200, 233, 245, 0.14) 0%, transparent 60%),
    linear-gradient(155deg, #2a3a3f 0%, #1d2a2f 60%, #141921 100%) !important;
}

html[data-plate][data-shelf="magazine"] .creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  padding: 20px;
}

@media (max-width: 767px) {
  html[data-plate][data-shelf="magazine"] .creator-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: 12px;
    padding: 16px;
  }
}

