/* magazine-display.css - Styles for magazine collection */

/* Magazine page container */
body.magazines-page #container {
  max-width: 1280px;
  width: 1280px;
  margin: 1em auto;
}

body.magazines-page #content {
  padding: 10px 0;
}

body.magazines-page h1 {
  padding-left: 8px;
  margin-bottom: 10px;
}

body.magazines-page #footer {
  padding: 10px 5px;
}

/* Collection container */
.magazine-collection {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Filters */
.magazine-filters {
  margin: 0 5px 1em 5px;
  padding: 1em;
  background-color: #f7f7f7;
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.search-input {
  flex: 1;
  min-width: 200px;
}

.magazine-filters input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 1em;
}

.magazine-filters select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: white;
  min-width: 150px;
}

.magazine-filters button {
  padding: 8px 12px;
  background-color: #3a78a7;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}

.magazine-filters button:hover {
  background-color: #2c5c82;
}

/* Stats */
.magazine-stats {
  margin: 0 5px 1em 5px;
  font-style: italic;
  color: #555;
}

/* Table container */
.magazine-table-container {
  width: 100%;
  overflow-x: auto;
  margin: 0 0 1em 0;
}

/* Magazine table */
.magazine-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  table-layout: fixed;
}

.magazine-table th,
.magazine-table td {
  box-sizing: border-box;
  padding: 8px 6px;
}

.magazine-table th {
  background-color: #eaeaea;
  cursor: pointer;
  text-align: left;
  border-bottom: 2px solid #ccc;
  font-weight: 600;
}

.magazine-table th:hover {
  background-color: #ddd;
}

.magazine-table td {
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.magazine-table tr:hover {
  background-color: #f5f8fa;
}

/* Column widths */
.magazine-table th:first-child,
.magazine-table td:first-child {
  width: 144px;
  min-width: 144px;
}

.magazine-table th:nth-child(2),
.magazine-table td:nth-child(2) {
  width: 14%;
}

.magazine-table th:nth-child(3),
.magazine-table td:nth-child(3) {
  width: 6%;
}

.magazine-table th:nth-child(4),
.magazine-table td:nth-child(4) {
  width: 10%;
}

.magazine-table th:nth-child(5),
.magazine-table td:nth-child(5) {
  width: 10%;
}

.magazine-table th:nth-child(6),
.magazine-table td:nth-child(6) {
  width: 8%;
}

.magazine-table th:nth-child(7),
.magazine-table td:nth-child(7) {
  width: 5%;
}

.magazine-table th:nth-child(8),
.magazine-table td:nth-child(8) {
  width: 5%;
}

.magazine-table th:nth-child(9),
.magazine-table td:nth-child(9) {
  width: 20%;
}

.magazine-table th:nth-child(10),
.magazine-table td:nth-child(10) {
  width: 15%;
}

/* Magazine cover thumbnails */
.magazine-thumbnail {
  width: 100%;
  max-width: 128px;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: block;
  margin: 0 auto;
  transition: all 0.2s ease;
}

.thumbnail-cell {
  padding: 8px;
  text-align: center;
  vertical-align: middle;
  width: 128px;
  height: 170px;
  cursor: zoom-in;
}

.thumbnail-cell:hover .magazine-thumbnail {
  filter: brightness(0.7) contrast(1.1);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
}

/* Tags and special styles */
.nsfw-tag {
  background-color: #c25450;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8em;
}

.sfw-tag {
  background-color: #468847;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8em;
}

.issue-number {
  font-weight: bold;
  text-align: center;
  color: #333;
}

/* Digital link */
.digital-link {
  color: #3a78a7;
  text-decoration: none;
  padding: 3px 8px;
  background-color: #eef5fb;
  border-radius: 3px;
  display: inline-block;
  transition: background-color 0.2s;
}

.digital-link:hover {
  text-decoration: underline;
  background-color: #d9e9f7;
}

.digital-unavailable {
  color: #999;
  font-style: italic;
}

/* Features and interviews */
.features-cell,
.interviews-cell {
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.4;
  max-height: 10em;
  overflow: hidden;
  position: relative;
  padding-bottom: 20px;
}

.features-cell.expanded,
.interviews-cell.expanded {
  max-height: none;
}

.features-cell:after,
.interviews-cell:after {
  display: none;
}

.expand-button {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 10;
  background-color: #f2f2f2;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 0.8em;
  cursor: pointer;
  margin-right: 3px;
  margin-bottom: 3px;
}

.expand-button:hover {
  background-color: #e5e5e5;
}

/* Responsive tweaks */
@media only screen and (max-width: 768px) {
  .magazine-table {
    font-size: 0.9em;
  }
  
  .magazine-table th:nth-child(4),
  .magazine-table td:nth-child(4),
  .magazine-table th:nth-child(6),
  .magazine-table td:nth-child(6) {
    display: none;
  }
  
  .magazine-filters {
    flex-direction: column;
    align-items: stretch;
  }
}

@media only screen and (max-width: 480px) {
  .magazine-table th,
  .magazine-table td {
    padding: 8px 6px;
  }
  
  .magazine-table th:nth-child(4),
  .magazine-table td:nth-child(4),
  .magazine-table th:nth-child(6),
  .magazine-table td:nth-child(6),
  .magazine-table th:nth-child(9),
  .magazine-table td:nth-child(9),
  .magazine-table th:nth-child(10),
  .magazine-table td:nth-child(10) {
    display: none;
  }
}