/*
 * Homepage — reproduces the approved decision comp
 * (.impeccable/mocks/comp-1-ledger-hero.jpg): framed formulary hero
 * with the flagship product on a cream pedestal, wax-seal CTA, and a
 * shelf of numbered category entries below.
 */

.rn-hero {
  background-color: var(--rn-green-700);
  background-image:
    /* soft vignette pulling the corners toward the deepest green, so the
       hero reads as a lit interior rather than a flat colour fill */
    radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(0, 0, 0, 0.32) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0) 30%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch' result='t'/%3E%3CfeColorMatrix in='t' type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  padding-block: var(--rn-space-2xl);
  position: relative;
  overflow: hidden;
}

.rn-hero::before {
  /*
   * Gold ornamental frame, echoing the comp's title-page border.
   * Both frame lines and the real content below are positioned
   * elements with the hero as their stacking context; without an
   * explicit z-index here, ::after (generated after .rn-hero__grid in
   * tree order) painted on top of the grid — including straight
   * through the seal button — since same-z-index positioned elements
   * stack in document order. z-index: 1 (vs. 2 on the grid) fixes
   * that without needing to touch .rn-hero__grid's own stacking.
   */
  content: '';
  position: absolute;
  inset: var(--rn-space-lg);
  border: 1px solid var(--rn-gold-500);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), inset 0 0 40px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  z-index: 1;
}

.rn-hero::after {
  content: '';
  position: absolute;
  inset: calc(var(--rn-space-lg) + 10px);
  border: 1px solid rgba(200, 167, 121, 0.35);
  pointer-events: none;
  z-index: 1;
}

.rn-hero__grid {
  /*
   * isolation: isolate keeps the gold frame lines (.rn-hero::before/
   * ::after) from painting through content in this grid — verified
   * empirically that z-index alone did not stop that in Chromium.
   */
  position: relative;
  z-index: 2;
  isolation: isolate;
  display: grid;
  grid-template-columns: 0.95fr 1fr;
  align-items: stretch;
  gap: var(--rn-space-xl);
  min-height: 460px;
}

.rn-hero__frame {
  display: flex;
  align-self: stretch;
}

/*
 * The photo now fills the whole arched frame directly — no small oval
 * cream pedestal floating inside it. The pedestal shrank the product
 * photo to a fraction of the available height and left the rest of
 * the arch as empty green; the arch itself (clip-path below) already
 * reads as the "specimen frame", so it doesn't need a second frame
 * nested inside it.
 */
.rn-hero__pedestal {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  overflow: hidden;
  /* Arch: rounded top, square-ish bottom. Radius is a fraction of the
     frame's own width so the curve holds its proportion at any size,
     rather than a fixed-pixel clip-path that would distort. */
  border-radius: 50% 50% 6% 6% / 30% 30% 4% 4%;
  box-shadow: inset 0 0 0 1px rgba(200, 167, 121, 0.4);
}

.rn-hero__pedestal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.rn-hero__pedestal--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rn-cream-deep);
}

.rn-hero__placeholder {
  font-family: var(--rn-font-label);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--rn-ink-soft);
  text-transform: uppercase;
}

.rn-hero__tag {
  position: absolute;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 1;
}

.rn-hero__copy {
  position: relative;
  color: var(--rn-on-green);
}



.rn-hero__copy h1 {
  color: var(--rn-on-green);
  margin-top: 0.5rem;
}

.rn-hero__lede {
  max-width: 46ch;
  font-size: 1.08rem;
  color: rgba(246, 237, 224, 0.88);
  margin-bottom: var(--rn-space-lg);
}

/* ---------- Catalog shelf ---------- */

.rn-catalog-shelf {
  background: var(--rn-cream);
  padding-block: var(--rn-space-xl);
}

.rn-catalog-shelf h2 {
  margin-bottom: var(--rn-space-lg);
}

.rn-shelf__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--rn-space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
 * Category tiles, un-boxed for the same reason as the product cards:
 * four identical bordered panels in a row was the dated part. The
 * thumbnail carries the tile; the number sits above it as a small
 * ledger mark and the name below as a plain caption with a rule that
 * draws in on hover.
 */
.rn-shelf-card a {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 0;
  background: none;
  padding: 0;
  height: 100%;
}

.rn-shelf-card__number {
  font-family: var(--rn-font-display);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--rn-gold-600);
}

.rn-shelf-card__thumb {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 0;
  background: var(--rn-cream-deep);
}

.rn-shelf-card__thumb img {
  transition: transform var(--rn-dur-slow) var(--rn-ease);
}

.rn-shelf-card a:hover .rn-shelf-card__thumb img,
.rn-shelf-card a:focus-visible .rn-shelf-card__thumb img {
  transform: scale(1.04);
}

.rn-shelf-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rn-shelf-card__thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--rn-cream-deep),
    var(--rn-cream-deep) 10px,
    #e6d8bd 10px,
    #e6d8bd 20px
  );
}

.rn-shelf-card__name {
  position: relative;
  display: inline-block;
  font-family: var(--rn-font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--rn-green-900);
  padding-bottom: 2px;
}

.rn-shelf-card__name::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--rn-bordeaux-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--rn-dur) var(--rn-ease);
}

.rn-shelf-card a:hover .rn-shelf-card__name::after,
.rn-shelf-card a:focus-visible .rn-shelf-card__name::after {
  transform: scaleX(1);
}

.rn-shelf__empty {
  font-style: italic;
  color: var(--rn-ink-soft);
}

@media (max-width: 900px) {
  .rn-hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: auto;
  }
  .rn-hero__frame {
    /* stretch has nothing to stretch to in a single-row layout, so the
       frame needs its own explicit height on mobile. */
    height: 320px;
  }
  .rn-hero__pedestal {
    min-height: 0;
  }
  .rn-hero__copy {
    text-align: left;
  }
  .rn-shelf__list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .rn-shelf__list {
    grid-template-columns: 1fr;
  }
  .rn-hero::before,
  .rn-hero::after {
    inset: var(--rn-space-sm);
  }
}
