/* The showcase grid, ported from the 18+ landing page's own grid
   (only-one/components/pub/pub.module.css) so both read as one house: a dense
   CSS grid, three columns, every seventh tile twice as wide.

   Everything is namespaced under .om-showcase: this runs inside a theme, and a
   plugin has no business restyling anything it was not asked to. */

.om-showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  gap: 20px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0;
  list-style: none;
}

@media (max-width: 1200px) {
  .om-showcase {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .om-showcase {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

.om-showcase-item {
  margin: 0;
  overflow: hidden;
  position: relative;
}

.om-showcase-item-wide {
  grid-column: span 2;
}

.om-showcase-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.om-showcase-frame {
  position: relative;
  width: 100%;
  background: #000;
  line-height: 0;
  overflow: hidden;
}

.om-showcase-frame img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease-out, opacity 0.3s ease-out;
}

.om-showcase-link:hover .om-showcase-frame img,
.om-showcase-link:focus-visible .om-showcase-frame img {
  transform: scale(1.03);
}

/* The title is the way back into the writing: it names the post the image
   belongs to, which is the whole point of the page. */
.om-showcase-title {
  display: block;
  margin: 10px 2px 0;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.om-showcase-link:hover .om-showcase-title,
.om-showcase-link:focus-visible .om-showcase-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.om-showcase-empty {
  margin: 0;
  padding: 24px 0;
  text-align: center;
}

/* The dark look: the same paint as the 18+ landing page (its page background
   and black tiles), for a page meant to read as that page's all-ages twin.
   Opt-in through look="dark" — a plugin does not decide a site's colours. */
.om-showcase-dark {
  background: #020b0e;
  padding: 40px;
}

@media (max-width: 600px) {
  .om-showcase-dark {
    padding: 22px 14px;
  }
}

.om-showcase-dark .om-showcase-frame {
  background: #000;
}

.om-showcase-dark .om-showcase-title {
  color: rgba(255, 255, 255, 0.92);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.om-showcase-dark .om-showcase-empty {
  color: rgba(255, 255, 255, 0.6);
}
