/* ==========================================================================
   Culvera AI — Editorial pages
   --------------------------------------------------------------------------
   Research & Insights: library grid, article cards and article pages.
   Loaded alongside contact.css, whose static header and .contact-hero
   editorial intro these pages reuse.

   Same restraint as the rest of the site: Warm Ivory ground, Deep Navy
   type, Montserrat Light headings, gold for small labels and accents only.
   No shadows or product-card chrome — cards are image + type + whitespace.
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* Research & Insights — library intro + topic filters                     */
/* ---------------------------------------------------------------------- */

.insights-hero {
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
}

.insights {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

.insights-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
  max-width: 44rem;
}

.insights-filters[hidden] {
  display: none;
}

.insights-filter {
  font-family: var(--font-nav);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-navy);
  background: transparent;
  border: 1px solid rgba(20, 46, 70, 0.22);
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  cursor: pointer;
  transition:
    border-color var(--hover-duration) var(--ease-out-cinematic),
    background-color var(--hover-duration) var(--ease-out-cinematic),
    color var(--hover-duration) var(--ease-out-cinematic);
}

/* Phones: one swipeable row instead of several wrapped lines. The strip
   bleeds to the screen edges and scrolls within itself, never the page. */
@media (max-width: 640px) {
  .insights-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-left: calc(-1 * clamp(1.5rem, 4vw, 3rem));
    margin-right: calc(-1 * clamp(1.5rem, 4vw, 3rem));
    padding: 0.2rem clamp(1.5rem, 4vw, 3rem);
    max-width: none;
  }

  .insights-filters::-webkit-scrollbar {
    display: none;
  }

  .insights-filter {
    flex-shrink: 0;
  }
}

.insights-filter:hover {
  border-color: var(--color-gold);
}

.insights-filter:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.insights-filter[aria-pressed="true"] {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-ivory);
}

.insights-empty {
  font-family: var(--font-nav);
  font-size: 0.95rem;
  color: var(--color-navy);
  opacity: 0.7;
  text-align: center;
  margin: 2rem 0 0;
}

/* ---------------------------------------------------------------------- */
/* Article grid + card (library and "Related research")                    */
/* 3 columns on large screens → 2 on tablet / small desktop → 1 on mobile. */
/* ---------------------------------------------------------------------- */

.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(3rem, 5vw, 4rem) clamp(1.75rem, 3vw, 2.75rem);
}

.insight-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.insight-card[hidden] {
  display: none;
}

.insight-card__media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 2px;
  background: var(--color-neutral-warm);
  margin-bottom: 1.4rem;
}

.insight-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 480ms var(--ease-out-cinematic);
}

.insight-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.insight-card__category {
  font-family: var(--font-nav);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 0.75rem;
}

.insight-card__title {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  line-height: 1.3;
  color: var(--color-navy);
  margin: 0 0 0.85rem;
}

/* The title link is stretched over the whole card, so the entire card is
   clickable while screen readers still announce just the title. */
.insight-card__link {
  transition: color 220ms var(--ease-out-cinematic);
}

/* z-index keeps the overlay above the excerpt/meta, whose opacity would
   otherwise stack them on top and swallow clicks. */
.insight-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.insight-card__link:focus-visible {
  outline: none;
}

.insight-card:has(.insight-card__link:focus-visible) {
  outline: 2px solid var(--color-gold);
  outline-offset: 8px;
}

.insight-card__excerpt {
  font-family: var(--font-nav);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-navy);
  opacity: 0.8;
  margin: 0 0 1rem;
}

.insight-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-family: var(--font-nav);
  font-size: 0.8rem;
  color: var(--color-navy);
  opacity: 0.65;
  margin: 0 0 1.1rem;
}

.insight-card__cta {
  margin-top: auto;
  font-family: var(--font-nav);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-field-green-deep);
  transition:
    color 220ms var(--ease-out-cinematic),
    transform 220ms var(--ease-out-cinematic);
}

.insight-card:hover .insight-card__media img {
  transform: scale(1.04);
}

.insight-card:hover .insight-card__link {
  color: var(--color-field-green-deep);
}

.insight-card:hover .insight-card__cta {
  color: var(--color-gold);
  transform: translateX(3px);
}

@media (max-width: 1080px) {
  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .insight-card__media img,
  .insight-card__cta {
    transition: none;
  }
  .insight-card:hover .insight-card__media img,
  .insight-card:hover .insight-card__cta {
    transform: none;
  }
}

/* ---------------------------------------------------------------------- */
/* Article page                                                            */
/* ---------------------------------------------------------------------- */

.article {
  padding: clamp(4rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem);
}

.article-header {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  text-align: center;
}

.article-header__crumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-nav);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 1.4rem;
}

.article-header__crumbs a {
  color: var(--color-navy);
  opacity: 0.7;
  transition: color 220ms var(--ease-out-cinematic), opacity 220ms var(--ease-out-cinematic);
}

.article-header__crumbs a:hover,
.article-header__crumbs a:focus-visible {
  color: var(--color-field-green-deep);
  opacity: 1;
}

.article-header__title {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.18;
  color: var(--color-navy);
  margin: 0 0 1.25rem;
}

.article-header__dek {
  font-family: var(--font-nav);
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--color-navy);
  opacity: 0.8;
  max-width: 42rem;
  margin: 0 auto 1.4rem;
}

.article-header__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-nav);
  font-size: 0.82rem;
  color: var(--color-navy);
  opacity: 0.65;
  margin: 0;
}

.article-figure {
  max-width: 66rem;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
  background: var(--color-neutral-warm);
}

/* Readable measure for body copy, sources and the closing note. */
.article-layout {
  max-width: calc(44rem + 2 * clamp(1.5rem, 4vw, 3rem));
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

/* ---------------------------------------------------------------------- */
/* Long-form prose (article bodies)                                        */
/* ---------------------------------------------------------------------- */

.prose {
  font-family: var(--font-nav);
  color: var(--color-navy);
}

.prose p,
.prose li {
  font-size: 1.04rem;
  line-height: 1.8;
  color: rgba(20, 46, 70, 0.88);
}

.prose p {
  margin: 0 0 1.35rem;
}

.prose h2 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  line-height: 1.3;
  color: var(--color-navy);
  margin: 3rem 0 1rem;
}

.prose h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--color-navy);
  margin: 2.25rem 0 0.75rem;
}

.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.7rem;
  padding-left: 0.25rem;
}

.prose li::marker {
  color: var(--color-gold);
}

.prose strong {
  font-weight: 600;
  color: var(--color-navy);
}

.prose a {
  color: var(--color-field-green-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(89, 120, 90, 0.4);
  transition: color 220ms var(--ease-out-cinematic);
}

.prose a:hover,
.prose a:focus-visible {
  color: var(--color-gold);
  text-decoration-color: currentColor;
}

.prose sup.cite {
  line-height: 0;
  font-size: 0.7em;
  margin-left: 0.1em;
}

.prose sup.cite a {
  color: var(--color-gold);
  font-weight: 600;
  text-decoration: none;
  padding: 0 0.1em;
}

/* ---------------------------------------------------------------------- */
/* Sources + closing "About Culvera" note                                  */
/* ---------------------------------------------------------------------- */

.article-sources {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(30, 42, 53, 0.12);
}

.article-sources__heading {
  font-family: var(--font-nav);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 1rem;
}

.article-sources__list {
  margin: 0;
  padding-left: 1.25rem;
  font-family: var(--font-nav);
  font-size: 0.88rem;
  line-height: 1.65;
  color: rgba(20, 46, 70, 0.8);
}

.article-sources__list li {
  margin-bottom: 0.55rem;
  overflow-wrap: anywhere;
  /* keep cited sources clear of the sticky header when jumped to */
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.article-sources__list li:target {
  color: var(--color-navy);
}

.article-sources__list a {
  color: var(--color-field-green-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(89, 120, 90, 0.4);
}

.article-sources__list a:hover,
.article-sources__list a:focus-visible {
  color: var(--color-gold);
}

.article-about {
  margin-top: 2.5rem;
  padding: 1.35rem 1.6rem;
  border-left: 2px solid var(--color-gold);
  background: rgba(89, 120, 90, 0.07);
}

.article-about p {
  font-family: var(--font-nav);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-navy);
  margin: 0;
}

.article-about a {
  color: var(--color-field-green-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(89, 120, 90, 0.4);
}

.article-about a:hover,
.article-about a:focus-visible {
  color: var(--color-gold);
}

/* ---------------------------------------------------------------------- */
/* Related research                                                        */
/* ---------------------------------------------------------------------- */

.related-insights {
  border-top: 1px solid rgba(30, 42, 53, 0.12);
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

.related-insights__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.related-insights__heading {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--color-navy);
  margin: 0;
}

.related-insights__all {
  font-family: var(--font-nav);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-field-green-deep);
  transition: color 220ms var(--ease-out-cinematic);
}

.related-insights__all:hover,
.related-insights__all:focus-visible {
  color: var(--color-gold);
}
