/* ============================================
   ENS-EDITORIAL — Easter, Norwegian Style
   Warm spring celebration with one noir dip.
   Prefix: ens-
   ============================================ */

/* ── Themeable Custom Properties ── */
:root {
  --art-accent: #D4A017;
  --art-accent-dark: #B8890F;
  --art-accent-glow: rgba(212, 160, 23, 0.35);
  --art-accent-subtle: rgba(212, 160, 23, 0.06);
  --art-link: #2d6a3f;
  --art-link-hover: #D4A017;
  --art-link-underline: #D4A017;
  --art-ornament: #D4A017;
  --art-subtitle-color: rgba(212, 160, 23, 0.7);
  --art-hero-accent-line: #D4A017;

  /* Easter palette */
  --ens-daffodil: #D4A017;
  --ens-daffodil-muted: rgba(212, 160, 23, 0.6);
  --ens-spring-green: #6B8E4E;
  --ens-text-warm: #3a3530;
  --ens-text-secondary: #5a5248;
  --ens-text-muted: #8a8078;
}


/* ============================================
   HERO — Warm spring still-life
   ============================================ */
.art-hero__media img {
  object-position: center center;
  animation: ensHeroKB 24s ease-out forwards;
}

@keyframes ensHeroKB {
  0%   { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Warmer overlay — brown-black instead of midnight blue */
.art-hero__overlay {
  background:
    linear-gradient(180deg,
      rgba(30, 22, 14, 0.2) 0%,
      rgba(30, 22, 14, 0) 25%,
      rgba(30, 22, 14, 0.05) 50%,
      rgba(30, 22, 14, 0.55) 72%,
      rgba(30, 22, 14, 0.9) 88%,
      rgba(10, 22, 40, 1) 100%
    );
}

/* Softer vignette */
.art-hero__overlay::before {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(20, 16, 10, 0.35) 100%);
}


/* ============================================
   OVERFLOW — Required for sticky scene
   ============================================ */
html, body {
  overflow-x: clip;
}


/* ============================================
   ENS-FACTBOX — Fact/info box
   Gold left border, cream background.
   Supports <ol>, <ul>, and <dl>.
   ============================================ */
.ens-factbox {
  max-width: 800px;
  margin: var(--space-3xl) auto var(--space-xl);
  background: var(--color-warm-white, #FBF9F6);
  border: 1px solid rgba(212, 160, 23, 0.2);
  border-left: 4px solid var(--ens-daffodil);
  border-radius: 0 1rem 1rem 0;
  padding: 2rem 2.25rem;
  box-shadow:
    0 4px 20px rgba(80, 60, 40, 0.06),
    0 1px 4px rgba(80, 60, 40, 0.04);
}

/* On cream sections, use white background for contrast */
.art-section--cream .ens-factbox {
  background: #fff;
}

.ens-factbox__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-midnight, #0a1628);
  margin: 0 0 0.5rem;
  padding-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid rgba(212, 160, 23, 0.25);
}

.ens-factbox__intro {
  font-family: 'Glacial Indifference', sans-serif;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ens-text-secondary);
  margin: 0 0 0.75rem;
}

/* Ordered list variant (Mountain Code) */
.ens-factbox__list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: factbox;
}

.ens-factbox__list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.55rem;
  font-family: 'Glacial Indifference', sans-serif;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #2c2c2c;
  counter-increment: factbox;
}

.ens-factbox__list li::before {
  content: counter(factbox) '.';
  position: absolute;
  left: 0;
  color: var(--ens-daffodil);
  font-weight: 700;
  font-size: 0.95rem;
}

.ens-factbox__source {
  margin-top: 0.75rem;
  font-size: var(--text-xs, 0.75rem);
  color: var(--ens-text-muted);
  font-style: italic;
}

.ens-factbox__source a {
  color: var(--art-link);
  text-decoration: underline;
  text-decoration-color: var(--art-link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Definition list variant (Holy Week) */
.ens-factbox dl {
  margin: 0;
  padding: 0;
}

.ens-factbox dt {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ens-text-warm);
  margin-top: 0.75rem;
}

.ens-factbox dt:first-of-type {
  margin-top: 0;
}

.ens-factbox dt::before {
  content: '✦ ';
  color: var(--ens-daffodil);
}

.ens-factbox dd {
  margin: 0.15rem 0 0 1.25rem;
  font-family: 'Glacial Indifference', sans-serif;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ens-text-secondary);
}


/* ============================================
   ENS-NEWSPAPER — Vintage newspaper frame
   For the Aftenposten 1923 front page.
   Simpler than pk-evidence — no tape/stamps.
   ============================================ */
.ens-newspaper {
  max-width: 560px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-xl);
}

.ens-newspaper__surface {
  position: relative;
  background: rgba(255, 250, 235, 0.06);
  border: 1px solid rgba(255, 250, 235, 0.1);
  border-radius: var(--radius-lg, 0.75rem);
  padding: var(--space-lg);
  transform: rotate(-0.8deg);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.15);
}

.ens-newspaper__surface img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  filter: sepia(0.15) contrast(1.05);
}

.ens-newspaper figcaption {
  margin-top: var(--space-sm);
  font-size: var(--text-xs, 0.75rem);
  color: rgba(251, 249, 246, 0.5);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}


/* ============================================
   ENS-POSTCARD-GALLERY — Vintage postcard grid
   Scattered-on-table aesthetic.
   ============================================ */
.ens-postcard-gallery {
  padding: var(--space-3xl) var(--space-xl);
  background: linear-gradient(170deg, #F5F0E5 0%, #EDE6D8 100%);
}

.ens-postcard-gallery__heading {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.ens-postcard-gallery__eyebrow {
  display: block;
  font-family: 'Glacial Indifference', sans-serif;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ens-daffodil);
  margin-bottom: var(--space-sm);
}

.ens-postcard-gallery__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  color: var(--ens-text-warm);
  margin: 0;
}

.ens-postcard-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  max-width: 900px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}

.ens-postcard-gallery__card {
  position: relative;
  background: #FFFDF8;
  border-radius: 6px;
  padding: var(--space-md);
  box-shadow:
    0 4px 16px rgba(80, 60, 40, 0.1),
    0 1px 3px rgba(80, 60, 40, 0.08);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

/* Scattered rotations — target <li> since each card is sole child of its <li> */
.ens-postcard-gallery__grid > li:nth-child(1) .ens-postcard-gallery__card { transform: rotate(-2deg); }
.ens-postcard-gallery__grid > li:nth-child(2) .ens-postcard-gallery__card { transform: rotate(1.2deg) translateY(8px); }
.ens-postcard-gallery__grid > li:nth-child(3) .ens-postcard-gallery__card { transform: rotate(0.9deg) translateY(-4px); }
.ens-postcard-gallery__grid > li:nth-child(4) .ens-postcard-gallery__card { transform: rotate(-1.6deg) translateY(6px); }

.ens-postcard-gallery__grid > li:hover .ens-postcard-gallery__card {
  transform: rotate(0) scale(1.04) translateY(-6px);
  box-shadow:
    0 12px 36px rgba(80, 60, 40, 0.15),
    0 4px 12px rgba(80, 60, 40, 0.1);
}

.ens-postcard-gallery__card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}

.ens-postcard-gallery__card figcaption {
  margin-top: var(--space-sm);
  font-size: var(--text-xs, 0.75rem);
  color: var(--ens-text-muted);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}


/* ============================================
   ENS-FLOAT-RIGHT — Right-floating image
   For Solo sweater in food section.
   ============================================ */
.ens-float-right {
  float: right;
  width: 44%;
  max-width: 360px;
  margin: 0 0 var(--space-xl) var(--space-xl);
}

.ens-float-right__img-wrap {
  overflow: hidden;
  border-radius: var(--radius-xl, 12px);
  box-shadow:
    0 8px 32px rgba(80, 60, 40, 0.1),
    0 2px 8px rgba(80, 60, 40, 0.06);
}

.ens-float-right img {
  width: 100%;
  height: auto;
  display: block;
}

.ens-float-right figcaption {
  margin-top: var(--space-xs);
  font-size: var(--text-xs, 0.75rem);
  color: var(--ens-text-muted);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}


/* ============================================
   CLOSING — Warm sign-off
   ============================================ */
.ens-signoff {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ens-daffodil);
  text-align: center;
  margin: var(--space-xl) 0 0;
}


/* ============================================
   DARK SECTION — Link card override
   For the påskekrim CTA in the dark section.
   ============================================ */
.art-section--dark .art-link-card {
  margin-top: var(--space-2xl);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.art-section--dark .art-link-card__body {
  background: rgba(255, 255, 255, 0.06);
}

.art-section--dark .art-link-card__title {
  color: var(--color-warm-white, #FBF9F6);
}

.art-section--dark .art-link-card:hover .art-link-card__title {
  color: var(--ens-daffodil);
}

.art-section--dark .art-link-card__desc {
  color: rgba(251, 249, 246, 0.6);
}

.art-section--dark .art-link-card__arrow {
  color: var(--ens-daffodil);
}


/* ============================================
   SPACING REFINEMENTS
   Tighten transitions between sections.
   ============================================ */

/* Holy Week factbox — must exceed art-figure's margin-bottom (32px) to beat margin collapsing */
#holy-week {
  margin-top: var(--space-3xl);
}

/* Closing → sources: tighten */
.art-closing {
  padding-bottom: var(--space-lg);
}

/* Sources → card grid: reduce gap */
.art-section--light:has(.art-sources) {
  padding-top: var(--space-xl);
  padding-bottom: 0;
}

.art-card-grid {
  padding-top: var(--space-xl);
}

/* Closing figure — the vintage card before sign-off */
.ens-closing-card {
  max-width: 500px;
  margin: 0 auto var(--space-xl);
}

.ens-closing-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-xl, 12px);
  box-shadow:
    0 8px 32px rgba(80, 60, 40, 0.1),
    0 2px 8px rgba(80, 60, 40, 0.06);
}

.ens-closing-card figcaption {
  margin-top: var(--space-sm);
  font-size: var(--text-xs, 0.75rem);
  color: var(--ens-text-muted);
  font-style: italic;
  text-align: center;
}


/* ============================================
   RESPONSIVE — Tablet (768px)
   ============================================ */
@media (max-width: 768px) {
  /* Recenter sticky scene image for portrait viewport */
  .art-sticky-scene__media img {
    object-position: 88% 70% !important;
  }

  .ens-factbox {
    padding: 1.25rem 1.5rem;
  }

  .ens-newspaper {
    padding: 0 var(--space-lg);
  }

  .ens-newspaper__surface {
    transform: rotate(0);
    padding: var(--space-md);
  }

  .ens-postcard-gallery__grid {
    gap: var(--space-lg);
  }

  .ens-postcard-gallery__card {
    padding: var(--space-sm);
  }

  /* Straighten cards on tablet */
  .ens-postcard-gallery__grid > li:nth-child(n) .ens-postcard-gallery__card {
    transform: none;
  }

  .ens-float-right {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: var(--space-lg) 0;
  }
}


/* ============================================
   RESPONSIVE — Mobile (480px)
   ============================================ */
@media (max-width: 480px) {
  /* Food section: move Solo image below its text on mobile */
  #easter-food .art-prose:has(.ens-float-right) {
    display: flex;
    flex-direction: column;
  }
  #easter-food .art-prose:has(.ens-float-right) .ens-float-right {
    order: 99;
  }

  .ens-factbox {
    padding: 1rem 1.25rem;
    border-radius: 0 0.75rem 0.75rem 0;
  }

  .ens-postcard-gallery {
    padding: var(--space-2xl) var(--space-lg);
  }

  .ens-postcard-gallery__grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }

  .ens-closing-card {
    max-width: 320px;
  }
}


/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .art-hero__media img {
    animation: none;
    transform: none;
  }

  .ens-postcard-gallery__grid > li:nth-child(n) .ens-postcard-gallery__card {
    transform: none;
    transition: none;
  }

  .ens-postcard-gallery__grid > li:hover .ens-postcard-gallery__card {
    transform: none;
  }
}
