/* =========================================================
   MHA ASSOCIATES — INSIGHTS PAGE
   File: assets/css/insights.css
   Premium editorial style | Responsive | Accessible motion
   ========================================================= */

:root {
  --mha-maroon: #821b25;
  --mha-maroon-dark: #5f1019;
  --mha-ink: #202023;
  --mha-muted: #66656a;
  --mha-paper: #fbfaf8;
  --mha-line: #e6e1dc;
  --mha-white: #ffffff;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
}

/* Base */
.insights-page {
  background: var(--mha-paper);
  color: var(--mha-ink);
  font-family: var(--sans);
}

.insights-main {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
  font-family: var(--sans);
}

.insights-main p {
  text-align: justify;
  text-justify: inter-word;
}

.insights-main a {
  text-decoration: none;
}

.insights-main button,
.insights-main input {
  font: inherit;
}

.insights-main button:focus-visible,
.insights-main a:focus-visible,
.insights-main input:focus-visible {
  outline: 2px solid var(--mha-maroon);
  outline-offset: 3px;
}

/* Hero */
.insights-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 350px;
  margin-block: 28px 0;
  overflow: hidden;
  background: var(--mha-paper);
}

.insights-hero__copy {
  align-self: center;
  padding: clamp(30px, 5vw, 68px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--mha-maroon);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25em;
  line-height: 1.4;
  text-align: left !important;
  text-transform: uppercase;
}

.insights-hero h1 {
  max-width: 560px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 65px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.insights-hero h1 em,
.section-heading h2 em,
.featured-insight h2 em {
  color: var(--mha-maroon);
  font-weight: 500;
}

.insights-hero__intro {
  max-width: 540px;
  margin: 0 0 22px;
  color: var(--mha-muted);
  font-size: 13.5px;
  line-height: 1.9;
}

.insights-hero__visual {
  position: relative;
  min-height: 350px;
  background-color: #d6c9bb;
  background-image:
    linear-gradient(90deg, rgba(247, 244, 239, 0.05), rgba(43, 19, 18, 0.15)),
    url("/assets/images/insights/hero-business.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.insights-hero__visual-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  min-width: 145px;
  gap: 5px;
  padding: 20px 24px;
  background: rgba(85, 18, 30, 0.92);
  color: var(--mha-white);
  font-family: var(--serif);
  font-size: 1.03rem;
}

/* Links and buttons */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--mha-maroon);
  font-size: 0.91rem;
  font-weight: 650;
  transition: gap 0.2s ease, color 0.2s ease;
}

.text-link:hover {
  gap: 14px;
  color: var(--mha-maroon-dark);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 19px;
  border-radius: 4px;
  background: var(--mha-maroon);
  color: var(--mha-white) !important;
  font-size: 0.9rem;
  font-weight: 650;
  transition: background 0.2s ease, transform 0.2s ease;
}

.button-link:hover {
  transform: translateY(-1px);
  background: var(--mha-maroon-dark);
}

/* Category filters and search */
.insights-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--mha-line);
}

.insights-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.filter-chip {
  padding: 10px 17px;
  border: 1px solid var(--mha-line);
  border-radius: 999px;
  background: var(--mha-white);
  color: var(--mha-ink);
  cursor: pointer;
  font-size: 0.88rem !important;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  border-color: var(--mha-maroon);
}

.filter-chip.is-active {
  border-color: var(--mha-maroon);
  background: var(--mha-maroon);
  color: var(--mha-white);
}

.insights-search {
  display: flex;
  flex: 0 0 min(250px, 100%);
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid var(--mha-line);
  border-radius: 6px;
  background: var(--mha-white);
}

.insights-search svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.insights-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.9rem;
}

.insights-search:focus-within {
  outline: 2px solid rgba(116, 29, 43, 0.18);
  border-color: var(--mha-maroon);
}

.insights-status {
  min-height: 0;
  margin: 0;
  color: var(--mha-muted);
  font-size: 0.84rem;
}

/* Featured article */
.featured-insight {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  padding: 28px 0 42px;
  border-bottom: 1px solid var(--mha-line);
}

.featured-insight__image,
.insight-card__image {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #ded4c8, #b6a79a);
}

.featured-insight__image {
  aspect-ratio: 1.48;
  border-radius: 5px;
}

.featured-insight__image img,
.insight-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.featured-insight__image:hover img,
.insight-card__image:hover img {
  transform: scale(1.035);
}

.image-fallback-label {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8a6c61, #4b242b);
  color: var(--mha-white);
  font-family: var(--serif);
  font-size: 1.4rem;
}

.image-fallback .image-fallback-label {
  display: flex;
}

.featured-insight__content {
  padding-block: 6px;
}

.insight-date {
  display: block;
  margin: 0 0 10px;
  color: var(--mha-muted);
  font-size: 0.8rem;
}

.featured-insight h2,
.section-heading h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.featured-insight h2 {
  margin: 0 0 13px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
}

.insight-summary {
  margin: 0 0 20px;
  color: var(--mha-muted);
  font-size: 13px;
  line-height: 1.8;
}

/* Latest insights grid */
.latest-insights {
  padding: 36px 0 54px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading .eyebrow {
  margin-bottom: 7px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.insight-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--mha-line);
  border-radius: 5px;
  background: var(--mha-white);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.insight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(39, 28, 23, 0.08);
}

.insight-card__image {
  aspect-ratio: 1.65;
}

.insight-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 18px 20px;
}

.insight-card__body .eyebrow {
  margin-bottom: 8px;
  font-size: 9px;
}

.insight-card h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
}

.insight-card h3 a {
  color: var(--mha-ink);
}

.insight-card h3 a:hover {
  color: var(--mha-maroon);
}

.insight-card .insight-summary {
  margin-bottom: 18px;
  font-size: 12px;
}

.insight-card__read {
  margin-top: auto;
}

/* Pagination and empty state */
.insights-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 28px;
}

.insights-pagination button {
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--mha-line);
  border-radius: 4px;
  background: var(--mha-white);
  color: var(--mha-ink);
  cursor: pointer;
}

.insights-pagination button:hover:not(:disabled),
.insights-pagination button.is-current {
  border-color: var(--mha-maroon);
  background: var(--mha-maroon);
  color: var(--mha-white);
}

.insights-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.insights-empty {
  padding: 42px 20px;
  background: var(--mha-paper);
  text-align: center;
}

.insights-empty h3 {
  margin-top: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.insights-empty p {
  color: var(--mha-muted);
  text-align: center;
}

/* Screen-reader-only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tablet */
@media (max-width: 980px) {
  .insights-main {
    width: min(760px, calc(100% - 36px));
  }

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

  .insights-hero__copy {
    padding: 30px;
  }

  .insights-hero h1 {
    font-size: clamp(2.1rem, 4vw, 3.1rem);
  }

  .insights-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .insights-search {
    flex-basis: auto;
    width: 100%;
    box-sizing: border-box;
  }

  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 640px) {
  .insights-main {
    width: calc(100% - 36px);
  }

  .insights-hero {
    display: flex;
    flex-direction: column;
    margin-top: 14px;
  }

  .insights-hero__copy {
    padding: 28px 22px 24px;
  }

  .insights-hero h1 {
    max-width: 14ch;
    font-size: clamp(2.15rem, 10vw, 3rem);
    line-height: 1.06;
  }

  .insights-hero__intro {
    font-size: 0.96rem;
    line-height: 1.75;
    text-align: left;
  }

  .insights-hero__visual {
    min-height: 190px;
    aspect-ratio: 16 / 8;
  }

  .insights-hero__visual-caption {
    min-width: 115px;
    padding: 13px 16px;
    font-size: 0.88rem;
  }

  .insights-toolbar {
    gap: 14px;
    padding: 17px 0;
  }

  .insights-categories {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-right: -2px;
    padding: 1px 1px 7px;
    scrollbar-width: thin;
  }

  .filter-chip {
    flex: 0 0 auto;
    padding: 9px 14px;
    font-size: 0.82rem !important;
  }

  .featured-insight {
    grid-template-columns: 1fr;
    gap: 19px;
    padding: 22px 0 30px;
  }

  .featured-insight__image {
    aspect-ratio: 1.55;
  }

  .featured-insight h2 {
    font-size: 1.85rem;
  }

  .featured-insight .insight-summary {
    text-align: left;
  }

  .button-link {
    width: 100%;
    box-sizing: border-box;
  }

  .latest-insights {
    padding: 30px 0 40px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-heading h2 {
    font-size: 2rem;
  }

  .insight-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .insight-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .insight-card__image {
    height: 100%;
    min-height: 150px;
    aspect-ratio: auto;
  }

  .insight-card__body {
    padding: 13px 13px 14px;
  }

  .insight-card__body .eyebrow {
    margin-bottom: 6px;
    font-size: 0.62rem;
  }

  .insight-card .insight-date {
    margin-bottom: 7px;
    font-size: 0.73rem;
  }

  .insight-card h3 {
    margin-bottom: 7px;
    font-size: 1.08rem;
    line-height: 1.22;
  }

  .insight-card .insight-summary {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 10px;
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: left;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .insight-card__read {
    font-size: 0.82rem;
  }

  .insights-pagination {
    gap: 5px;
    padding-top: 22px;
  }

  .insights-pagination button {
    min-width: 34px;
    min-height: 36px;
  }
}

/* Small mobile */
@media (max-width: 370px) {
  .insights-main {
    width: calc(100% - 28px);
  }

  .insight-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .insight-card__body {
    padding: 11px;
  }

  .insight-card h3 {
    font-size: 1rem;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .insights-main *,
  .insights-main *::before,
  .insights-main *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Google Sheets article content presentation */
.article-body h2 { color: var(--mha-maroon, #741d2b); margin: 2rem 0 .8rem; line-height: 1.25; }
.article-body ul { padding-left: 1.4rem; margin: 0 0 1.4rem; line-height: 1.85; }
.article-body li { margin-bottom: .45rem; }
.article-body a { color: var(--mha-maroon, #741d2b); text-decoration: underline; text-underline-offset: 3px; }
