/*
  INSIGHTS PAGE
  -------------
  Load the shared style.css before this file.
  The shared header and footer are loaded through includes.js.
*/

.insights-page {
  background: var(--cream);
}

/* .animate.highlight-red {animation-name: highlight-red;} */

@keyframes highlight-red {
  0% {
    background: var(--ink);
  }
  100% {
    background: var(--red);
  }
}

.insights-intro {
  padding: clamp(170px, 15vw, 290px) 0 clamp(58px, 7vw, 110px);
  background: var(--cream);
}

.insights-intro h1 {
  margin: 0;
  font-family: var(--display);
  /* font-size: clamp(68px, 7vw, 132px); */
  font-weight: 300;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.insights-intro__lead {
  margin: clamp(26px, 3vw, 42px) 0 clamp(50px, 6vw, 88px);
  font-size: var(--thirty-nine);
  font-weight: 300;
  line-height: 1.25;
}

.insights-filter {
  position: relative;
  display: flex;
  align-items: center;
}

/* Desktop default: the toggle stays hidden and the menu renders as the
   original horizontal, underlined tab row — the dropdown treatment below
   is mobile-only. */
.insights-filter__toggle {
  display: none;
  gap: 8px;
  padding: 14px 24px;
  font-size: var(--sixteen);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #000;
}

.insights-filter__menu {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 52px);
  width: 100%;
  margin: 0;
  padding: 0 0 26px;
  list-style: none;
  overflow-x: auto;
  border-bottom: 1px solid rgba(33, 35, 34, 0.42);
  scrollbar-width: none;
}

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

/* The menu is only ever [hidden] via JS on mobile; on desktop it must
   stay visible regardless of that attribute. */
.insights-filter__menu[hidden] {
  display: flex;
}

.insights-filter__menu li {
  display: contents;
}

.insights-filter__option {
  position: relative;
  flex: 0 0 auto;
  padding: 0 0 16px;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  font-size: var(--thirteen);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.insights-filter__option::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -27px;
  width: 0;
  height: 3px;
  background: var(--ink);
  transition: width 180ms ease;
}

.insights-filter__option.is-active::after {
  width: 100%;
}

/* Tablet/mobile: matches the tablet/mobile menu trigger breakpoint in
   mobile-menu.css so the filter switches to the dropdown treatment at
   the same width the header switches to its hamburger menu. */
@media (max-width: 1280px) {
  .insights-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .insights-filter__toggle {
    display: inline-flex;
  }

  .insights-filter__menu {
    position: absolute;
    z-index: 5;
    top: calc(100% + 8px);
    left: 0;
    flex-direction: column;
    gap: 2px;
    width: max-content;
    min-width: 220px;
    padding: 8px;
    overflow: visible;
    border-bottom: 0;
    background: var(--cream-muted);
    border-radius: 20px;
    box-shadow: var(--shadow);
  }

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

  .insights-filter__option {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: left;
    transition: background-color 160ms ease;
  }

  .insights-filter__option::after {
    display: none;
  }

  .insights-filter__option:hover,
  .insights-filter__option:focus-visible {
    background: rgba(33, 35, 34, 0.08);
  }

  .insights-filter__option.is-active {
    background: var(--ink);
    color: var(--white);
  }
}

.insights-listing {
  background: var(--cream);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insight-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: var(--cream);
  transition: transform 180ms ease;
}

/* .insight-card:hover,
.insight-card:focus-visible {
  transform: translateY(-4px);
} */

.insight-card:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: -3px;
}

.insight-card:nth-child(3n + 1) .insight-card__body,
.insight-card:nth-child(3n + 3) .insight-card__body,
.insight-card:nth-child(5) .insight-card__body {
  background: var(--ink);
  color: var(--white);
}

.insight-card:nth-child(4) .insight-card__body,
.insight-card:nth-child(6) .insight-card__body {
  background: var(--cream);
  color: var(--ink);
}

.insight-card__media {
  margin: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #c7c7c5;
}

.insight-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform 260ms ease;
}

.insight-card__body {
  min-height: clamp(260px, 24vw, 410px);
  padding: clamp(34px, 4vw, 66px) clamp(30px, 4vw, 64px);
}

/* Zoom the photograph */
.insight-card:hover .insight-card__media img,
.insight-card:focus-visible .insight-card__media img {
  transform: scale(1.08);
}

.insight-card__category {
  margin: 0 0 clamp(34px, 4vw, 62px);
  font-size: var(--twelve);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-card h2 {
  max-width: 430px;
  margin: 0;
  font-family: var(--display);
  font-size: var(--forty-eight);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

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

.insights-empty {
  margin: 0;
  padding: 80px var(--page-gutter);
  text-align: center;
  font-size: var(--twenty-two);
}

.load-more {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 18vh;
  background-color: rgb(0, 0, 0);
}

.load-more[hidden] {
  display: none !important;
}

.load-more button {
  width: clamp(180px, 10vw, 240px);
  height: clamp(60px, 3.75vw, 90px);

  background: #4A4A47;
  backdrop-filter: blur(13.5px);
  /* Note: backdrop-filter has minimal browser support */
  border-radius: 1000px;

  font-size: var(--fifteen);
  color: var(--white);
}

/* .pagination > button {
  height: 2vw;
  width: 2vw;
  background-color: #4A4A47;
  border-color: #4A4A47;
  border-width: 1px;
  border-style: solid;
  border-radius: 1vw;
  font-size: clamp(12px, 0.14vh, 18px);
  color: var(--white);
} */

/* button.active {
  background-color: rgb(0, 0, 0);
} */


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

  .insight-card:nth-child(n) .insight-card__body {
    background: var(--cream);
    color: var(--ink);
  }

  .insight-card:nth-child(4n + 1) .insight-card__body,
  .insight-card:nth-child(4n + 4) .insight-card__body {
    background: var(--ink);
    color: var(--white);
  }
}

@media (max-width: 760px) {
  .insights-intro {
    padding-top: 130px;
  }

  .insights-intro h1 {
    font-size: var(--seventy-mobile);
  }

  .insights-intro__lead {
    font-size: var(--twenty-five-mobile);
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .insight-card:nth-child(n) .insight-card__body {
    background: var(--cream);
    color: var(--ink);
  }
/* 
  .insight-card:nth-child(odd) .insight-card__body {
    background: var(--ink);
    color: var(--white);
  } */

  .insight-card__body {
    min-height: 230px;
  }

  .insight-card h2 {
    font-size: var(--thirty-six-mobile);
  }
}

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