/* Base styles */
.magazine-hero-block {
  max-width: 1200px;
  margin: 0 auto;
}

.magazine-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* Single magazine layout: larger featured + details */
.magazine-hero-grid.layout-single .hero-featured.hero-large {
  height: 640px;
}

.hero-details {
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(7,12,20,0.06);
}

/* Standard featured card */
.hero-featured {
  position: relative;
  height: 560px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(7,12,20,0.06);
  background: #fff;
}

/* Small grid with smart centering */
.hero-small-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* 3 items: 2 in first row, 1 centered in second */
.hero-small-grid.grid-3 {
  grid-template-columns: 1fr 1fr;
}
.hero-small-grid.grid-3 .hero-small-card:nth-child(3) {
  grid-column: 1 / -1;
  max-width: 50%;
  margin: 0 auto;
}

/* 2 items: 1 in first row, 1 in second, both centered */
.hero-small-grid.grid-2 {
  grid-template-columns: 1fr;
  max-width: 70%;
  margin: 0 auto;
}

/* 1 item: larger and centered */
.hero-small-grid.grid-1 {
  grid-template-columns: 1fr;
}
.hero-small-grid.grid-1 .hero-small-card {
  height: 340px;
  max-width: 80%;
  margin: 0 auto;
}

.hero-small-card {
  position: relative;
  height: 260px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(7,12,20,0.06);
  background: #fff;
}

/* Cover images */
.hero-featured img,
.hero-small-card img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

/* Overlay styles */
.hero-featured .magazine-overlay,
.hero-small-card .magazine-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.12), rgba(0,0,0,0.6));
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Hover behavior */
.overlay-on-hover .magazine-overlay {
  opacity: 0;
  transform: translateY(8px);
}

.overlay-on-hover article:hover .magazine-overlay,
.overlay-on-hover article:focus .magazine-overlay {
  opacity: 1;
  transform: none;
}

/* Always visible */
.overlay-always .magazine-overlay {
  opacity: 1;
}

/* Overlay content styling */
.magazine-overlay .overlay-content {
  color: #fff;
}

.magazine-overlay .overlay-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.magazine-overlay .overlay-title a {
  color: #fff;
  text-decoration: none;
}

.magazine-overlay .overlay-title a:hover {
  text-decoration: underline;
}

.magazine-overlay .overlay-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 8px;
}

.magazine-overlay .overlay-excerpt {
  font-size: 14px;
  color: rgba(255,255,255,0.92);
  line-height: 1.35;
  margin-bottom: 12px;
}

.magazine-overlay .overlay-info {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.magazine-overlay .overlay-price {
  font-weight: 700;
  color: #fff;
  font-size: 16px;
}

.magazine-overlay .overlay-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.magazine-overlay .btn {
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
}

.magazine-overlay .btn-read {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.magazine-overlay .btn-buy {
  background: #fff;
  color: #0b74de;
}

.magazine-overlay .btn:hover {
  opacity: 0.9;
}

/* Small card overlay scaled down */
.hero-small-card .overlay-title {
  font-size: 15px;
}

.hero-small-card .overlay-meta {
  font-size: 12px;
}

/* Responsive breakpoints */
@media (max-width: 900px) {
  .magazine-hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-featured,
  .hero-featured.hero-large {
    height: 420px;
  }
  .hero-small-card {
    height: 200px;
  }
  .hero-small-grid.grid-3 .hero-small-card:nth-child(3),
  .hero-small-grid.grid-2,
  .hero-small-grid.grid-1 .hero-small-card {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .hero-small-grid {
    grid-template-columns: 1fr;
  }
  .hero-featured,
  .hero-featured.hero-large {
    height: 360px;
  }
  .hero-small-card {
    height: 160px;
  }
  .hero-small-grid.grid-1 .hero-small-card {
    height: 240px;
  }
}

/* Accessibility helpers */
.hero-featured:focus,
.hero-small-card:focus {
  outline: 3px solid rgba(11,116,222,0.18);
  outline-offset: 3px;
}

/* Magazine details styling */
.magazine-details {
  color: #333;
}

.magazine-details .details-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
}

.magazine-details .details-title a {
  color: #333;
  text-decoration: none;
}

.magazine-details .details-title a:hover {
  color: #0b74de;
  text-decoration: underline;
}

.magazine-details .details-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #666;
}

.magazine-details .details-excerpt {
  margin-bottom: 20px;
  line-height: 1.6;
  color: #555;
}

.magazine-details .details-access {
  margin-bottom: 16px;
}

.magazine-details .details-price {
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
}

.magazine-details .price-label {
  color: #666;
  margin-right: 8px;
}

.magazine-details .price-value {
  color: #0b74de;
}

.magazine-details .details-actions .btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.magazine-details .btn-primary {
  background: #0b74de;
  color: #fff;
}

.magazine-details .btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.magazine-details .btn:hover {
  opacity: 0.9;
}

/* Access badge styling */
.access-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.access-badge.owned {
  background: #d4edda;
  color: #155724;
}

.access-badge.free {
  background: #d1ecf1;
  color: #0c5460;
}

.access-badge.subscription {
  background: #fff3cd;
  color: #856404;
}

.access-badge.purchase {
  background: #f8d7da;
  color: #721c24;
}

/* Issue badge styling */
.issue-badge {
  background: #e9ecef;
  color: #495057;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

/* No magazines message */
.magazine-hero-block.no-magazines {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

