/* ============================================================
   editorial.css — shared styles for Interviews & Good Causes pages
   Theme variables (set by layout inline script from localStorage):
     --cp  = primary color  (page background)
     --ca  = accent color   (text + highlights)
     --fg  = fallback text  (#f4f4f4, from base.css)
============================================================ */

/* ── Grainy gradient background overlay ─────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.68' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 80% 10%, rgba(254,134,244,0.28) 0%, transparent 60%);
  background-repeat: repeat, no-repeat;
  background-size: 180px 180px, 100% 100%;
  mix-blend-mode: overlay;
  opacity: 0.45;
}

/* ── Per-page diagonal pink gradients ───────────────────────────────────── */
body.page-press::after,
body.page-goodcauses::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}
body.page-press::after      { background: linear-gradient(to top left,    rgba(254,134,244,0.38) 0%, transparent 50%); }
body.page-goodcauses::after { background: linear-gradient(to bottom left, rgba(254,134,244,0.36) 0%, transparent 53%); }

/* ---- Root color: accent drives ALL text on these pages ---- */
.ed-page {
  min-height: 100vh;
  color: var(--ca, var(--fg));
}

/* ---- Page header ---- */
.ed-head {
  padding: 5rem 1.5rem 2.5rem;
  text-align: center;
}
@media (min-width: 768px) {
  .ed-head { padding: 7rem 2rem 3.5rem; }
}
.ed-head__inner {
  max-width: 640px;
  margin: 0 auto;
}
.ed-head__title {
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.6rem;
}
.ed-head__sub {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0;
}

/* ---- Body ---- */
.ed-body {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1rem 1.25rem 5rem;
}
@media (min-width: 768px) {
  .ed-body { padding: 1rem 2rem 6rem; }
}

/* ---- Section (recommendations groups) ---- */
.ed-section {
  margin-bottom: 4rem;
}
.ed-section__title {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  opacity: 0.88;
  margin: 0 0 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid currentColor;
}

/* ---- Grid ---- */
.ed-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .ed-grid--recs { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .ed-grid--interviews { grid-template-columns: repeat(2, 1fr); }
  .ed-grid--recs       { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .ed-grid--interviews { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Card ---- */
.ed-card {
  display: flex;
  flex-direction: column;
  border: 1px solid currentColor;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ed-card:hover {
  opacity: 1;
  transform: translateY(-3px);
}

/* Featured interview spans full width with accent left border */
.ed-card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
  border-left-width: 3px;
}
.ed-card--featured .ed-card__img-wrap {
  flex: 0 0 45%;
  max-width: 45%;
}
@media (max-width: 639px) {
  .ed-card--featured {
    flex-direction: column;
    border-left-width: 1px;
  }
  .ed-card--featured .ed-card__img-wrap { flex: unset; max-width: 100%; }
}

/* ---- Card image ---- */
.ed-card__img-wrap {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  aspect-ratio: 3 / 2;
}
.ed-card--rec .ed-card__img-wrap {
  aspect-ratio: 1 / 1;
}
.ed-card--featured .ed-card__img-wrap {
  aspect-ratio: unset;
  min-height: 260px;
}
.ed-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.35s ease;
}
.ed-card:hover .ed-card__img {
  transform: scale(1.04);
}

/* ---- Card body ---- */
.ed-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
}
@media (min-width: 768px) {
  .ed-card__body { padding: 1.5rem; }
  .ed-card--featured .ed-card__body { padding: 2rem 2.5rem; justify-content: center; }
}

/* ---- Badge ---- */
.ed-card__badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  border: 1px solid currentColor;
  border-radius: 1px;
  opacity: 0.65;
  width: fit-content;
}

/* ---- Title ---- */
.ed-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
}
.ed-card--featured .ed-card__title {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
}
.ed-card--rec .ed-card__title {
  font-size: 1rem;
}

/* ---- Meta (publication + date) ---- */
.ed-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
}
.ed-card__pub { font-weight: 600; }

/* ---- Excerpt ---- */
.ed-card__excerpt {
  font-size: 0.88rem;
  line-height: 1.65;
  opacity: 0.78;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ed-card--featured .ed-card__excerpt {
  -webkit-line-clamp: 6;
}

/* ---- Link ---- */
.ed-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cp, #8c75ff);
  background: var(--ca, #fe86f4);
  border: 2px solid var(--ca, #fe86f4);
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  text-decoration: none;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.ed-card__link:hover {
  opacity: 0.88;
  text-decoration: none;
  background: transparent;
  color: var(--ca, #fe86f4);
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  opacity: 0.45;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  padding: 4rem 1rem;
}

/* ---- Interview Modal ---- */
.interview-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.interview-modal--active {
  display: flex;
}
.interview-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}
.interview-modal__content {
  position: relative;
  z-index: 1;
  background: var(--cp, #8c75ff);
  border: none;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.interview-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: var(--ca, #fe86f4);
  color: var(--cp, #8c75ff);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}
.interview-modal__close:hover {
  opacity: 0.8;
}
.interview-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  overflow: hidden;
}
@media (max-width: 768px) {
  .interview-modal__grid {
    grid-template-columns: 1fr;
  }
}
.interview-modal__image-col {
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
  min-height: 0;
}
.interview-modal__image-col::-webkit-scrollbar {
  display: none;
}
.interview-modal__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  margin-bottom: 0;
}
.interview-modal__img:last-child {
  margin-bottom: 0;
}
.interview-modal__text-col {
  padding: 4rem 4rem 4rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.interview-modal__text-col::-webkit-scrollbar {
  display: none;
}
.get-involved-img {
  position: absolute;
  right: 0;
  bottom: -20px;
  width: 250px;
  height: auto;
  z-index: 1;
}
@media (max-width: 768px) {
  .get-involved-img {
    width: 150px;
    bottom: -60px;
    right: 10px;
  }
}
.interview-modal__type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.3em 0.8em;
  border: 1px solid var(--ca, #fe86f4);
  border-radius: 4px;
  color: var(--ca, #fe86f4);
  width: fit-content;
  font-family: 'Syne', sans-serif;
}
.interview-modal__title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  text-transform: uppercase;
  color: var(--ca, #fe86f4);
  font-family: 'Syne', sans-serif;
}
.interview-modal__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  color: var(--ca, #fe86f4);
}
.interview-modal__pub {
  font-weight: 600;
}
.interview-modal__content-text {
  font-size: 1.1rem;
  line-height: 1.9;
  opacity: 0.9;
  color: var(--ca, #fe86f4);
}
.interview-modal__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cp, #8c75ff);
  background: var(--ca, #fe86f4);
  border: 2px solid var(--ca, #fe86f4);
  border-radius: 999px;
  padding: 1rem 2.5rem;
  text-decoration: none;
  transition: opacity 0.15s ease;
  width: fit-content;
  font-family: 'Syne', sans-serif;
}
.interview-modal__link:hover {
  opacity: 0.88;
  text-decoration: none;
}
@media (max-width: 768px) {
  .interview-modal__text-col {
    padding: 3rem 1.5rem;
  }
  .interview-modal__image-col {
    padding: 0;
  }
  .interview-modal__close {
    width: 40px;
    height: 40px;
    font-size: 2rem;
    top: 3.5rem;
  }
}
