/* ==========================================================
   Kalpa — library components (Resources, Case Studies, articles)
   Section titles/body, the blue featured section + green "closer look"
   card, the filterable library (sidebar + card grid) and its cards.
   Loaded after kalpa-shared.css; page-specific sections live in each
   template's <style>.
   ========================================================== */

.r-title {
  font-family: 'Montserrat Alternates', sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 35px;
  color: #fff;
  margin: 0 0 15px;
}

.r-body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 27px;
  color: #fff;
  margin: 0;
}

.r-shape {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.btn--outline-white { background: transparent; padding: 12px 23px; color: #fff; border: 1px solid #fff; }
.btn--outline-white:hover { background: #fff; color: var(--color-orange); }
.btn--outline-white:active { transform: translateY(1px); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Featured resource (blue) ---------- */
.rfeat { min-height: 877px; }
.rfeat .r-shape { width: max(100%, 1449px); transform: translateX(-50%); }
.rfeat .kalpa-section-inner { padding-top: 229px; padding-bottom: 0; } /* equal blue above/below the card (~166, to the nearest curve point) */

.rfeat-card {
  position: relative;
  display: grid;
  grid-template-columns: 439px 1fr;
  column-gap: 51px;
  align-items: start;
  min-height: 418px;
  margin: 0 calc(50% - 547px);
  padding: 67px 60px 60px 57px;
  background: #335B09;
  border-radius: 8px;
  /* 5px outside stroke + drop shadow */
  box-shadow: 0 0 0 5px #8FBE5E, 0 14px 30px 5px rgba(0, 0, 0, 0.3);
}

.rfeat-card__tag {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 5px 10px 4px 9px;
  background: #8FBE5E;
  border-radius: 0 0 8px 0;
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 22px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--color-navy);
}

/* PLACEHOLDER image */
.rfeat-card__image {
  aspect-ratio: 439 / 285;
  overflow: hidden;
  background: #D9D9D9;
  border-radius: 8px;
}

.rfeat-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }

.rfeat-card__title {
  font-family: 'Montserrat Alternates', sans-serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 35px;
  color: #D5FFA9;
  margin: 0 0 18px;
}

.rfeat-card .r-body { max-width: 450px; }
.rfeat-card .r-body + .r-body { margin-top: 14px; font-weight: 500; }
.rfeat-card .btn { margin-top: 26px; }

/* ---------- Resource library ---------- */
.rlib .kalpa-section-inner { padding-top: 195px; padding-bottom: 200px; }

.rlib__layout {
  display: grid;
  grid-template-columns: 237px 800px;
  column-gap: 50px;
  justify-content: center;
  align-items: start;
  margin: 0 calc(50% - 560px);
}

.rlib__side { padding-left: 10px; }

.rlib__eyebrow {
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #CDD5E6;
  margin: 0 0 12px;
}

.rlib__filter-title {
  margin: 93px 0 0 -10px; /* 100px visible gap below the intro */
  padding: 0 0 12px 10px;
  border-bottom: 1px solid rgba(205, 213, 230, 0.4);
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #fff;
}

.rlib__topics {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.rlib__topic {
  display: block;
  padding: 8px 0;
  background: none;
  border: 0;
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 25px;
  color: #CDD5E6;
  text-align: left;
  cursor: pointer;
  transition: color 0.25s ease;
}

.rlib__topic:hover { color: #fff; }
.rlib__topic[aria-pressed="true"] { font-weight: 600; color: var(--color-yellow); }
.rlib__topic:focus-visible { outline: 2px solid var(--color-yellow); outline-offset: 2px; }

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

.rcard[hidden] { display: none; }

/* "Show more" under the library grid (added by kalpa-library.js). */
.rlib__more { grid-column: 1 / -1; justify-self: center; margin-top: 6px; }
.rlib__more[hidden] { display: none; }

.rcard__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* PLACEHOLDER thumbnails */
.rcard__image {
  aspect-ratio: 250 / 175;
  overflow: hidden;
  background: #D9D9D9;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.rcard__image img { display: block; width: 100%; height: 100%; object-fit: cover; }

.rcard__body { padding: 23px 19px 0; }

.rcard__topic {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  font-size: 12px; /* per mock — below the 16px AAA minimum used elsewhere */
  line-height: 25px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #BFE6F1;
  margin: 0 0 4px;
}

.rcard__title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 26px;
  color: #fff;
  margin: 0 0 12px;
}

.rcard__excerpt {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 25px;
  color: #AEB6C8; /* muted so title leads; 8.3:1 on navy (AAA) */
  margin: 0;
}

.rcard__link:hover .rcard__image { transform: translateY(-4px); }
.rcard__link:hover .rcard__title { text-decoration: underline; text-underline-offset: 3px; }
.rcard__link:focus-visible { outline: 2px solid var(--color-yellow); outline-offset: 6px; border-radius: 8px; }

.rlib__empty { grid-column: 1 / -1; color: #CDD5E6; }

@media (prefers-reduced-motion: reduce) {
  .rcard__image { transition: none; }
}

/* ---------- Tablet + phone ---------- */
@media (max-width: 1200px) {
  .rfeat { min-height: 0; }
  .rfeat .kalpa-section-inner { padding-top: 150px; padding-bottom: 170px; }
  .rfeat-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; margin: 0 5px; padding: 64px 40px 44px; }

  .rlib .kalpa-section-inner { padding-top: 140px; padding-bottom: 170px; }
  .rlib__layout { grid-template-columns: 200px minmax(0, 1fr); column-gap: 40px; margin: 0; }
  .rlib__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .rfeat-card { grid-template-columns: 1fr; row-gap: 32px; }

  .rlib__layout { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .rlib__side { padding-left: 0; }
  .rlib__filter-title { margin-left: 0; padding-left: 0; }
  .rlib__topics { display: flex; flex-wrap: wrap; gap: 4px 22px; }
}

@media (max-width: 768px) {
  .rfeat .kalpa-section-inner { padding-top: 120px; padding-bottom: 140px; }
  .rfeat-card { padding: 56px 22px 32px; }

  .rlib .kalpa-section-inner { padding-top: 110px; padding-bottom: 150px; }
  .rlib__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .rcard__body { padding: 20px 4px 0; }
  .rlib__topics { flex-wrap: nowrap; gap: 22px; margin-right: -24px; padding-right: 24px; overflow-x: auto; scrollbar-width: none; }
  .rlib__topic { white-space: nowrap; }
}

/* Type scale — matches the homepage's tablet/phone steps. */
@media (max-width: 1200px) {
  .r-title { font-size: 30px; line-height: 34px; }
  .r-body { font-size: 18px; line-height: 27px; }
  .rfeat-card__title { font-size: 26px; line-height: 32px; }
}

@media (max-width: 768px) {
  .r-title { font-size: 26px; line-height: 31px; }
  .r-body { font-size: 16px; line-height: 24px; }
  .rfeat-card__title { font-size: 22px; line-height: 28px; }
  .rcard__title { font-size: 18px; line-height: 24px; }
}

/* ==========================================================
   Single templates (articles, case studies) and the case study hub
   ========================================================== */

/* ---------- Hero: fills the screen minus the nav (100) and a 120px peek of
   the band below, content left-aligned in a reading-width column ---------- */
.single-hero { display: flex; flex-direction: column; min-height: calc(100svh - 220px); }
.single-hero .kalpa-section-inner { flex: 1; display: flex; align-items: center; width: 100%; padding-top: 40px; padding-bottom: 40px; }
.single-hero .hero-grid { width: 100%; grid-template-columns: 1fr; }
.single-hero__content { max-width: 820px; }
.single-hero .hero-body { max-width: 640px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: #CDD5E6;
  text-decoration: none;
}

.back-link:hover { color: #fff; }
.back-link:focus-visible { outline: 2px solid var(--color-yellow); outline-offset: 4px; border-radius: 4px; }
.back-link .link-arrow { text-decoration: none; }
.back-link:hover .link-arrow, .back-link:focus-visible .link-arrow { translate: -4px 0; }

.article-meta {
  margin: 24px 0 0;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #9EA8BC; /* 7:1 on navy */
}

/* ---------- Stat cards (case study hero) — same card as the homepage stats ---------- */
.lib-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 260px));
  gap: 16px;
  margin-top: 44px;
}

.lib-stat {
  padding: 12px 20px 14px;
  background: #FAF0E6;
  border: 5px solid #8FBE5E;
  border-radius: 12px;
  font-family: 'IBM Plex Sans', sans-serif;
}

.lib-stat strong {
  display: block;
  font-weight: 700;
  font-size: 40px;
  line-height: 56px;
  letter-spacing: -0.42px;
  color: var(--color-navy);
}

.lib-stat > span {
  display: block;
  font-weight: 500;
  font-size: 16px;
  line-height: 22px;
  color: #4D4D4D;
}

/* ---------- Article band: blue shape (ResourceFeatureBKGD, three pieces) with a
   cream "paper" panel for long reading ---------- */
.article-band { z-index: 1; }
.article-band .s3 { width: max(100%, 1449px); }
.article-band .kalpa-section-inner { max-width: calc(1120px + 2 * var(--side-padding-desktop)); padding-top: 180px; padding-bottom: 220px; } /* room for the 1120px card */

/* Grows with the screen: 860px on laptops up to 1120px on large screens. */
.article-paper {
  max-width: clamp(860px, 72vw, 1120px);
  margin: 0 auto;
  padding: 72px 80px 80px;
  background: #FAF0E6;
  border-radius: 15px;
  box-shadow: 0 14px 30px rgba(19, 28, 54, 0.18);
}

/* PLACEHOLDER featured image */
.article-paper__image {
  aspect-ratio: 16 / 9;
  margin: 0 0 48px;
  overflow: hidden;
  background: #D9D9D9;
  border-radius: 12px;
}

.article-paper__image img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Reading typography for post content (the_content). */
.prose {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 18px;
  line-height: 30px;
  color: var(--color-navy); /* 15:1 on the cream paper */
}

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 24px; }

/* Wider card on large screens: a touch more room around and in the text. */
@media (min-width: 1300px) {
  .article-paper { padding: 80px 104px 88px; }
  .prose, .prose p, .prose li { font-size: 19px; line-height: 32px; }
}

/* WordPress editor alignment classes (Basic Page content). */
.prose .has-text-align-center { text-align: center; }
.prose .has-text-align-right { text-align: right; }

.prose h2 {
  font-family: 'Montserrat Alternates', sans-serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 34px;
  margin: 52px 0 16px;
}

.prose h3 {
  font-family: 'Montserrat Alternates', sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 28px;
  margin: 40px 0 12px;
}

.prose ul, .prose ol { margin: 0 0 24px; padding-left: 26px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: #335B09; }

.prose a {
  color: var(--color-navy);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #8FBE5E;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.prose a:hover { text-decoration-color: var(--color-navy); }

.prose blockquote {
  margin: 44px 0;
  padding: 4px 0 4px 28px;
  border-left: 5px solid #8FBE5E;
}

.prose blockquote p {
  margin: 0;
  font-family: 'Raleway', sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 36px;
}

.prose blockquote cite {
  display: block;
  margin-top: 14px;
  font-style: normal;
  font-size: 16px;
  line-height: 24px;
  color: #4D4D4D;
}

.prose img { max-width: 100%; height: auto; border-radius: 12px; }
.prose figure { margin: 40px 0; }
.prose figcaption { margin-top: 10px; font-size: 16px; line-height: 24px; color: #4D4D4D; }

/* ---------- Related items (navy) ---------- */
.related .kalpa-section-inner { padding-top: 200px; padding-bottom: 200px; }

.related__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

.related__head .r-title { margin: 0; }

.related__all {
  flex-shrink: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: #CDD5E6;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.related__all:hover { color: #fff; }

/* ---------- Case study hub hero (centered) ---------- */
.hub-hero { display: flex; flex-direction: column; min-height: calc(100svh - 220px); }
.hub-hero .kalpa-section-inner { flex: 1; display: flex; align-items: center; width: 100%; padding-top: 40px; padding-bottom: 40px; text-align: center; }
.hub-hero .hero-grid { width: 100%; grid-template-columns: 1fr; }
.hub-hero .hero-eyebrow { justify-content: center; }
.hub-hero .hero-eyebrow::after { content: ''; flex-shrink: 0; width: 20px; height: 2px; background: var(--color-orange); }
.hub-hero h1 { max-width: 700px; margin-left: auto; margin-right: auto; }
.hub-hero .hero-body { max-width: 520px; margin: 0 auto; }

@media (max-width: 1200px) {
  .article-band .kalpa-section-inner { padding-top: 150px; padding-bottom: 180px; }
  .article-paper { padding: 56px 48px 60px; }
  .related .kalpa-section-inner { padding-top: 150px; padding-bottom: 150px; }
}

@media (max-width: 900px) {
  .single-hero, .hub-hero { min-height: calc(100svh - 172px); } /* 72 nav + 100 peek */
  /* stays left-aligned (the shared hero centers on small screens) */
  .single-hero .hero-grid { text-align: left; }
  .single-hero .hero-eyebrow { justify-content: flex-start; }
  .single-hero .hero-eyebrow::after { display: none; }
  .single-hero .hero-body { margin: 0; }
  .related__head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .article-band .kalpa-section-inner { padding-top: 120px; padding-bottom: 140px; }
  .article-paper { padding: 36px 22px 40px; border-radius: 12px; }
  .article-paper__image { margin-bottom: 32px; }
  .prose { font-size: 16px; line-height: 27px; }
  .prose h2 { font-size: 23px; line-height: 29px; margin-top: 40px; }
  .prose h3 { font-size: 19px; line-height: 25px; }
  .prose blockquote { padding-left: 20px; }
  .prose blockquote p { font-size: 20px; line-height: 30px; }
  .lib-stats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .lib-stat strong { font-size: 34px; line-height: 46px; }
  .related .kalpa-section-inner { padding-top: 110px; padding-bottom: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .back-link:hover .link-arrow, .back-link:focus-visible .link-arrow { translate: none; }
}
