/* Shared magazine layout for the public site and the editor preview. */
.editorial-home { padding: 30px 0 78px; }
.editorial-hero {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  align-items: stretch;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background: #152e4d;
}
.hero-copy { align-self: center; padding: clamp(24px, 4cqw, 54px); }
.hero-copy h1 { font-size: clamp(1.65rem, 3.25cqw, 2.9rem); line-height: 1.27; }
.hero-copy h1 span { white-space: nowrap; }
.hero-copy p { margin-top: 14px; color: #d9e7f8; font-size: .97rem; text-wrap: pretty; }
.hero-copy .primary-action {
  margin-top: 22px;
  color: #172e4e;
  background: #e8f2ff;
  border-color: #e8f2ff;
}
.hero-copy .primary-action:hover { background: white; border-color: white; }
.hero-copy .primary-action:focus-visible { outline-color: #acd0ff; }
.hero-photo, .story-cover { position: relative; min-width: 0; }
.hero-photo img, .story-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #dce5ef;
}
.hero-photo figcaption, .story-cover figcaption {
  position: absolute;
  inset: auto 8px 8px auto;
  padding: 1px 6px;
  border-radius: 3px;
  color: white;
  background: #172e4e;
  font-size: .68rem;
  line-height: 1.55;
}
.editorial-group { margin-top: 40px; }
.editorial-group h2 {
  margin-bottom: 16px;
  padding-top: 9px;
  border-top: 2px solid var(--ink);
  font-size: 1.45rem;
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.story-grid:not(:has(> :nth-child(3))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#camera-guides .story-grid:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.story-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  text-decoration: none;
}
.story-card:hover { border-color: var(--link); }
.story-card:hover h3 { text-decoration: underline; text-underline-offset: .18em; }
.story-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.68;
  object-fit: cover;
  background: #edf3f9;
}
.story-card-copy { padding: 10px 12px 13px; }
.story-card h3 { font-size: 1.05rem; line-height: 1.4; }
.story-card p { margin-top: 4px; color: var(--muted); font-size: .83rem; line-height: 1.45; }
.editorial-group .story-grid:not(:has(> :nth-child(3))) .story-card {
  display: grid;
  grid-template-columns: minmax(0, 41%) minmax(0, 1fr);
  align-items: center;
}
.editorial-group .story-grid:not(:has(> :nth-child(3))) .story-card img { height: 100%; }
.story-cover { height: clamp(163px, 32cqw, 308px); margin: 18px 0 0; }
.story-cover img { border-radius: 6px; }
.camera-article .story-cover img { object-fit: contain; background: #f7f8fa; }
.article-content .related:has(.story-grid) { display: block; }
.related > .story-grid { padding: 0; margin: 0; }
.article-content .related > .story-grid > li { margin: 0; }
.related .story-card img { aspect-ratio: 2; }

@container reader (max-width: 780px) {
  .editorial-home { padding: 16px 0 50px; }
  .editorial-hero { grid-template-columns: 1fr; }
  .hero-photo { grid-row: 1; height: clamp(137px, 37cqw, 230px); }
  .hero-copy { padding: 16px 17px 19px; }
  .hero-copy h1 { font-size: clamp(1.48rem, 6.7cqw, 2.25rem); }
  .hero-copy p { margin-top: 7px; font-size: .89rem; }
  .hero-copy .primary-action { margin-top: 13px; min-height: 44px; }
  .editorial-group { margin-top: 27px; }
  .editorial-group h2 { margin-bottom: 11px; font-size: 1.19rem; }
  .story-grid, .story-grid:not(:has(> :nth-child(3))), #camera-guides .story-grid:has(> :nth-child(3)) {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .story-card, .editorial-group .story-grid:not(:has(> :nth-child(3))) .story-card {
    display: grid;
    grid-template-columns: minmax(82px, 30%) minmax(0, 1fr);
    min-height: 88px;
    align-items: center;
  }
  .story-card img, .related .story-card img { height: 100%; aspect-ratio: auto; }
  .story-card-copy { padding: 9px 10px; }
  .story-card h3 { font-size: .97rem; }
  .story-card p { font-size: .77rem; }
  .story-cover { margin-top: 14px; }
}
@container reader (max-width: 420px) {
  .header-inner { flex-wrap: wrap; gap: 0; padding-block: 4px 0; }
  .primary-nav { width: 100%; justify-content: space-between; }
  .primary-nav a { padding-inline: 7px; font-size: .87rem; }
}
