/*
 * LOUCHE 2025 — Editorial inner-page layer.
 *
 * This file extends the baseline page template with feature-page treatments
 * for The Art, The Person, The Music, and The Hello. The first production
 * target is The Art. Content remains editable in WordPress; this layer owns
 * the visual system.
 */

/* ────────────────────────────────────────────────────────────────────────
 * Shared editorial feature pages
 * ──────────────────────────────────────────────────────────────────────── */

.louche-editorial {
  --louche-editorial-hero: none;
  --louche-editorial-wash: rgba(212, 132, 154, 0.18);
  --louche-editorial-accent-soft: rgba(212, 132, 154, 0.06);
  max-width: none;
  padding-inline: 0;
}

.louche-editorial-shell {
  width: min(1240px, calc(100vw - 80px));
  margin: 0 auto;
  padding: clamp(38px, 6vw, 74px) 0 clamp(70px, 9vw, 124px);
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 55%,
    var(--louche-editorial-accent-soft) 100%
  );
}

.louche-editorial-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.37fr) minmax(0, 0.63fr);
  grid-template-areas:
    "panel image"
    "meta image";
  gap: clamp(22px, 4vw, 64px);
  align-items: center;
  min-height: 0;
  isolation: isolate;
}

.louche-editorial-panel {
  grid-area: panel;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 620px;
  margin: 0;
  padding: clamp(24px, 4vw, 44px) clamp(34px, 5vw, 72px) clamp(24px, 4vw, 44px) clamp(31px, 4vw, 45px);
  background: linear-gradient(
    90deg,
    rgba(240, 235, 227, 0) 0%,
    rgba(240, 235, 227, 0.72) 52%,
    rgba(240, 235, 227, 0.34) 100%
  );
}

.louche-editorial-panel::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  background: var(--louche-section-accent);
  border-radius: 999px;
}

.louche-editorial-hero-image {
  grid-area: image;
  align-self: center;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background-color: transparent;
  background-image:
    linear-gradient(90deg, rgba(240, 235, 227, 0.18) 0%, rgba(240, 235, 227, 0) 24%),
    var(--louche-editorial-hero);
  background-position: center, center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: var(--louche-shadow);
  transition:
    transform 0.7s var(--louche-ease-out),
    box-shadow 0.7s ease,
    filter 0.7s ease;
}

@media (min-width: 981px) and (prefers-reduced-motion: no-preference) {
  .louche-editorial-hero:hover .louche-editorial-hero-image {
    transform: translate3d(0, -4px, 0);
    box-shadow: 0 30px 90px rgba(26, 26, 26, 0.18);
  }
}

.louche-editorial-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-family: var(--louche-font-mark);
  font-size: 10px;
  letter-spacing: 2.4px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--louche-section-accent);
}

.louche-editorial-kicker::before {
  content: "";
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.louche-editorial-title {
  max-width: 7.7ch;
  margin: 0;
  color: var(--louche-ink);
  font-family: var(--louche-font-display);
  font-size: clamp(3.1rem, 6.25vw, 6.35rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 0.9;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  text-wrap: balance;
}

.louche-editorial-deck {
  max-width: 32ch;
  margin: clamp(20px, 3vw, 34px) 0 0;
  font-family: var(--louche-font-display);
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.18;
  color: #3a3333;
}

.louche-editorial-meta {
  grid-area: meta;
  position: relative;
  z-index: 2;
  align-self: start;
  justify-self: start;
  width: min(100%, 330px);
  margin-top: clamp(22px, 4vw, 44px);
  padding: 18px 18px 16px;
  border-left: 3px solid var(--louche-section-accent);
  color: #555;
  font-size: 11px;
  letter-spacing: 1.4px;
  line-height: 1.6;
  text-transform: uppercase;
}

.louche-editorial-meta strong {
  display: block;
  margin-bottom: 4px;
  color: var(--louche-ink);
  font-family: var(--louche-font-mark);
  font-weight: 400;
  letter-spacing: 1.7px;
}

.louche-editorial-body {
  display: grid;
  grid-template-columns: minmax(170px, 0.34fr) minmax(0, 0.66fr);
  gap: clamp(26px, 5vw, 76px);
  margin-top: clamp(56px, 8vw, 108px);
}

.louche-editorial-rail {
  position: sticky;
  top: 110px;
  align-self: start;
  padding-top: 8px;
  font-size: 10px;
  letter-spacing: 2px;
  line-height: 1.9;
  text-transform: uppercase;
  color: #777;
}

.louche-editorial-rail span {
  display: block;
  margin-bottom: 12px;
  color: var(--louche-section-accent);
  font-family: var(--louche-font-mark);
}

.louche-editorial-copy {
  max-width: 760px;
  font-size: clamp(1.03rem, 1.18vw, 1.18rem);
  line-height: 1.86;
  color: #292929;
}

.louche-editorial-copy a {
  color: inherit;
  text-decoration-color: var(--louche-section-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.louche-editorial-copy a:hover,
.louche-editorial-copy a:focus-visible {
  color: var(--louche-section-accent);
}

.louche-editorial-copy > p:first-child,
.louche-entry-content > p:first-child {
  font-family: var(--louche-font-display);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--louche-ink);
}

.louche-editorial-copy p {
  margin: 0 0 1.35em;
}

.louche-editorial-copy h2,
.louche-editorial-copy h3 {
  margin: 1.7em 0 0.58em;
}

.louche-editorial-quote {
  margin: clamp(38px, 6vw, 70px) 0;
  padding: clamp(24px, 4vw, 40px) 0 clamp(24px, 4vw, 40px) clamp(22px, 3vw, 36px);
  border-left: 4px solid var(--louche-section-accent);
  font-family: var(--louche-font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 1.02;
  color: var(--louche-ink);
}

.louche-editorial-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(30px, 5vw, 52px);
}

.louche-editorial-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--louche-section-accent);
  border-radius: 999px;
  padding: 13px 22px;
  color: var(--louche-cream);
  background: var(--louche-section-accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.7px;
  text-decoration: none;
  text-transform: uppercase;
}

.louche-editorial-button:hover,
.louche-editorial-button:focus-visible {
  color: var(--louche-ink);
  background: transparent;
}

.louche-editorial-button.is-secondary {
  color: var(--louche-section-accent);
  background: transparent;
}

.louche-editorial-button.is-secondary:hover,
.louche-editorial-button.is-secondary:focus-visible {
  color: var(--louche-cream);
  background: var(--louche-section-accent);
}

/*
 * The utility region's own styling lives in louche-interactions.css, which
 * owns the region. This file previously restated all of it under a second
 * class name, so the two could drift apart.
 */
.louche-editorial .louche-utility {
  max-width: 760px;
}

@media (max-width: 980px) {
  .louche-editorial-shell {
    width: min(100% - 44px, 820px);
    padding-top: clamp(24px, 5vw, 46px);
  }

  .louche-editorial-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "panel"
      "meta";
    gap: 18px;
    align-items: stretch;
  }

  .louche-editorial-hero-image {
    min-height: 0;
    margin: 0;
    border-radius: 16px;
  }

  .louche-editorial-panel {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: clamp(22px, 5vw, 34px) clamp(22px, 5vw, 40px);
    background: rgba(240, 235, 227, 0.82);
    backdrop-filter: blur(8px);
  }

  .louche-editorial-title {
    max-width: 10ch;
    font-size: clamp(3rem, 12vw, 5.2rem);
  }

  .louche-editorial-meta {
    width: 100%;
    max-width: 100%;
    margin-top: 0;
  }

  .louche-editorial-body {
    grid-template-columns: 1fr;
    margin-top: 56px;
  }

  .louche-editorial-rail {
    position: static;
    padding-top: 18px;
    border-top: 1px solid rgba(26, 26, 26, 0.12);
  }
}

@media (max-width: 640px) {
  .louche-editorial-shell {
    width: min(100% - 28px, 620px);
    padding-top: 22px;
  }

  .louche-editorial-panel {
    padding: 22px 18px 22px 24px;
  }

  .louche-editorial-kicker {
    font-size: 9px;
    letter-spacing: 1.8px;
  }

  .louche-editorial-title {
    max-width: 10ch;
    font-size: clamp(2.65rem, 15vw, 4.2rem);
    line-height: 0.92;
  }

  .louche-editorial-deck {
    font-size: clamp(1.18rem, 5.4vw, 1.48rem);
  }

  .louche-editorial-copy > p:first-child,
  .louche-entry-content > p:first-child {
    font-size: clamp(1.42rem, 7.2vw, 1.9rem);
    line-height: 1.18;
  }
}

@media (prefers-reduced-motion: reduce) {
  .louche-editorial * {
    transition: none !important;
    animation: none !important;
  }
}


/* ────────────────────────────────────────────────────────────────────────
 * The Art Gallery stream
 *
 * Floating editorial image cards, not a plugin-looking grid. Moved here from
 * the launch-fixes patch file; this is editorial geometry and belongs with the
 * rest of it.
 *
 * A note on !important below. WordPress core styles gallery figures with
 *   .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image)
 * and that :not(#id) deliberately carries ID-level specificity, which no
 * class-based selector can outrank. The box-model overrides therefore keep
 * !important and say why. Everything core states at ordinary specificity is
 * overridden by being more specific instead.
 * ──────────────────────────────────────────────────────────────────────── */

.louche-gallery-page {
  --louche-section-accent: var(--louche-pink);
  overflow: hidden;
}

.louche-gallery-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) 0 clamp(70px, 10vw, 140px);
}

.louche-gallery-hero {
  position: relative;
  max-width: 820px;
  margin-bottom: clamp(46px, 8vw, 104px);
  padding-top: 18px;
}

.louche-gallery-hero::before {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  margin-bottom: 24px;
  border-radius: 99px;
  background: var(--louche-pink);
}

.louche-gallery-title {
  margin: 0;
  color: var(--louche-ink);
  font-family: var(--louche-font-display);
  font-size: clamp(3.7rem, 10vw, 9.5rem);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 0.82;
}

.louche-gallery-deck {
  max-width: 52ch;
  margin: 24px 0 0;
  color: var(--louche-ink-light);
  font-size: clamp(1.08rem, 1.6vw, 1.34rem);
  line-height: 1.65;
}

.louche-gallery-stream {
  position: relative;
}

.louche-gallery-stream::before {
  content: "";
  position: absolute;
  inset: -6vw -12vw auto;
  height: 72%;
  z-index: -1;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(216, 132, 154, 0.18), transparent 42%),
    radial-gradient(ellipse at 86% 28%, rgba(45, 122, 122, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 72%);
  filter: blur(2px);
}

.louche-gallery-content > .wp-block-gallery,
.louche-gallery-content > .wp-block-image,
.louche-gallery-content .wp-block-gallery {
  margin-block: 0;
}

.louche-gallery-content .wp-block-gallery.has-nested-images {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 58px);
  align-items: start;
}

.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image,
.louche-gallery-content > figure.wp-block-image {
  position: relative;
  /* Core's :not(#individual-image) rule sets these; only !important wins. */
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: clamp(10px, 1.3vw, 16px);
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 22px 76px rgba(26, 26, 26, 0.10);
  transform: translateY(0) rotate(var(--louche-gallery-tilt, 0deg));
  transition:
    transform 0.32s var(--louche-ease-out),
    box-shadow 0.32s ease,
    border-color 0.32s ease;
}

/* A six-step rhythm so the stream reads as a spread, not a product grid. */
.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(6n+1) {
  grid-column: span 7;
  --louche-gallery-tilt: -0.35deg;
}

.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(6n+2) {
  grid-column: span 5;
  margin-top: clamp(40px, 8vw, 110px) !important;
  --louche-gallery-tilt: 0.45deg;
}

.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(6n+3) {
  grid-column: 2 / span 4;
  --louche-gallery-tilt: 0.25deg;
}

.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(6n+4) {
  grid-column: span 8;
  margin-top: clamp(24px, 5vw, 76px) !important;
  --louche-gallery-tilt: -0.25deg;
}

.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(6n+5) {
  grid-column: span 5;
  --louche-gallery-tilt: -0.45deg;
}

.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(6n) {
  grid-column: span 7;
  margin-top: clamp(34px, 7vw, 96px) !important;
  --louche-gallery-tilt: 0.35deg;
}

.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image:hover,
.louche-gallery-content > figure.wp-block-image:hover {
  z-index: 2;
  border-color: rgba(216, 132, 154, 0.46);
  box-shadow: 0 30px 96px rgba(26, 26, 26, 0.15);
  transform: translateY(-6px) rotate(0deg) scale(1.01);
}

.louche-gallery-content figure.wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  filter: saturate(0.9) contrast(0.98);
}

/*
 * Captions follow the house pattern:
 *   Person/place/thing. City, State, Country, c. Year.
 * At 11px rather than the 9px this used to be — that was below the point where
 * the tracking and uppercasing stay readable.
 */
.louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption,
.louche-gallery-content > figure.wp-block-image figcaption {
  margin: 12px 2px 2px;
  padding: 0;
  position: static;
  color: var(--louche-ink-light);
  background: none;
  font-family: var(--louche-font-mark);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.2px;
  line-height: 1.55;
  text-align: left;
  text-transform: uppercase;
}

.louche-editorial-button-disabled {
  cursor: default;
  opacity: 0.72;
}

@media (max-width: 980px) {
  .louche-gallery-content .wp-block-gallery.has-nested-images {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image:nth-child(n) {
    grid-column: span 3;
    margin-top: 0 !important;
    --louche-gallery-tilt: 0deg;
  }
}

@media (max-width: 640px) {
  .louche-gallery-shell {
    padding-block: 44px 72px;
  }

  .louche-gallery-title {
    font-size: clamp(3rem, 18vw, 5.2rem);
  }

  .louche-gallery-content .wp-block-gallery.has-nested-images {
    display: block;
  }

  .louche-gallery-content .wp-block-gallery.has-nested-images figure.wp-block-image,
  .louche-gallery-content > figure.wp-block-image {
    margin-bottom: 24px !important;
    padding: 10px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .louche-gallery-content figure.wp-block-image {
    transform: none !important;
    transition: none !important;
  }
}
