/* ==========================================================================
   RESSOURCES — TerraGrow
   Pixel-perfect reproduction: Auria (listing) + Halden (article)
   Adapted: Inter instead of Geist, TerraGrow tokens where possible
   ========================================================================== */

/* ---------- HUB HERO (light, left-aligned, Auria) ---------- */

.res-hero {
  padding: 128px 0 80px;
  text-align: center;
  overflow: visible;
}

.res-hero__eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.res-hero__title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 500;
  line-height: 100%;
  letter-spacing: -0.04em;
  color: var(--text-heading);
  max-width: 680px;
  margin: 0 auto 12px;
}

.res-hero__subtitle {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-body);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- HERO SEARCH BAR ---------- */

.res-search {
  margin: 28px auto 0;
  max-width: 480px;
  position: relative;
  z-index: 6;
}

.res-search__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 10px;
  padding: 0 16px;
  height: 48px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: border-color 200ms, box-shadow 200ms;
}

.res-search__inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,118,246,.1), 0 2px 8px rgba(0,0,0,.04);
}

.res-search__icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.res-search__inner:focus-within .res-search__icon {
  color: var(--accent);
}

.res-search__input {
  flex: 1;
  border: none;
  background: none;
  font-size: 0.9375rem;
  font-family: var(--font-family-primary);
  color: var(--text-heading);
  outline: none;
  height: 100%;
}

.res-search__input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.res-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.res-search__kbd {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-family: var(--font-family-primary);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-secondary);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 5px;
  padding: 2px 7px;
  line-height: 1.4;
  pointer-events: none;
}

.res-search__inner:focus-within .res-search__kbd {
  display: none;
}

/* Search dropdown results */
.res-search__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04);
  max-height: 380px;
  overflow-y: auto;
  z-index: 20;
  padding: 6px;
}

.res-search__dropdown[hidden] {
  display: none;
}

.res-search__result + .res-search__result {
  border-top: 1px solid rgba(0,0,0,.06);
}

.res-search__result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 120ms;
}

.res-search__result:hover,
.res-search__result.is-active {
  background: var(--surface-secondary);
}

.res-search__result-img {
  width: 56px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-secondary);
}

.res-search__result-body {
  flex: 1;
  min-width: 0;
}

.res-search__result-tag {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(59, 118, 246, 0.08);
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.res-search__result-title {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-heading);
  text-align: left;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.res-search__result-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 120ms;
}

.res-search__result:hover .res-search__result-arrow {
  opacity: 1;
}

.res-search__empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.res-search__footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(0,0,0,.06);
  margin-top: 4px;
}

.res-search__footer-link {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 4px;
}

.res-search__footer-link:hover {
  text-decoration: underline;
}

.res-search__result-title mark {
  background: rgba(59, 118, 246, 0.15);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

@media (max-width: 479px) {
  .res-search { max-width: 100%; }
  .res-search__kbd { display: none; }
}

/* ---------- HERO FLOATING UI FRAGMENTS (product PNGs) ---------- */

.res-frag {
  position: absolute;
  z-index: 3;
  background: #fff;
  border-radius: 10px;
  box-shadow:
    0 4px 12px rgba(0,0,0,.1),
    0 12px 32px rgba(0,0,0,.18);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  pointer-events: none;
}

.res-frag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #fff;
}

/* Top-left: marges */
.res-frag--1 {
  width: 200px;
  height: 150px;
  left: -80px;
  top: -5%;
  animation: resFragFloat1 7s ease-in-out infinite alternate;
}

/* Top-right: tréso */
.res-frag--2 {
  width: 190px;
  height: 140px;
  right: -70px;
  top: -5%;
  animation: resFragFloat2 8s ease-in-out infinite alternate;
}

/* Bottom-left: dataviz */
.res-frag--3 {
  width: 180px;
  height: 130px;
  left: -60px;
  bottom: -5%;
  animation: resFragFloat3 9s ease-in-out infinite alternate;
}

/* Bottom-right: stress test */
.res-frag--4 {
  width: 185px;
  height: 135px;
  right: -65px;
  bottom: -5%;
  animation: resFragFloat4 7.5s ease-in-out infinite alternate;
}

@keyframes resFragFloat1 {
  0% { transform: translateY(0) rotate(-1deg); }
  100% { transform: translateY(-10px) rotate(0.5deg); }
}

@keyframes resFragFloat2 {
  0% { transform: translateY(0) rotate(1deg); }
  100% { transform: translateY(-12px) rotate(-0.5deg); }
}

@keyframes resFragFloat3 {
  0% { transform: translateY(0) rotate(0.5deg); }
  100% { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes resFragFloat4 {
  0% { transform: translateY(0) rotate(-0.5deg); }
  100% { transform: translateY(-10px) rotate(1deg); }
}

@media (max-width: 1100px) {
  .res-frag--1 { width: 150px; height: 110px; left: -10px; }
  .res-frag--2 { width: 140px; height: 105px; right: -10px; }
  .res-frag--3 { width: 140px; height: 100px; left: -5px; }
  .res-frag--4 { width: 140px; height: 105px; right: -10px; }
}

@media (max-width: 768px) {
  .res-frag { display: none; }
}

/* ---------- HERO FLOATING CHIPS ---------- */

.res-chip {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  pointer-events: none;
}

.res-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.res-chip__dot--green { background: #16A34A; }

.res-chip__dot--amber {
  background: #F59E0B;
  animation: resChipPulse 2s ease-in-out infinite;
}

@keyframes resChipPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.res-chip--1 {
  left: 10%;
  top: 42%;
  animation: resChipDrift1 8s ease-in-out infinite;
}

.res-chip--2 {
  right: 8%;
  top: 50%;
  animation: resChipDrift2 9s ease-in-out infinite;
}

.res-chip--3 {
  left: 18%;
  bottom: 12%;
  color: #16A34A;
  animation: resChipDrift3 7s ease-in-out infinite;
}

@keyframes resChipDrift1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -8px); }
}

@keyframes resChipDrift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-8px, 6px); }
}

@keyframes resChipDrift3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, -6px); }
}

@media (max-width: 1100px) {
  .res-chip { display: none; }
}

/* ---------- HERO COLLAB CURSORS ---------- */

.res-cursor {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.res-cursor__name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 14px;
}

.res-cursor--1 {
  top: 30%;
  right: 5%;
  animation: resCursorFloat1 8s ease-in-out infinite;
}

.res-cursor--2 {
  top: 55%;
  left: 3%;
  animation: resCursorFloat2 10s ease-in-out infinite;
}

.res-cursor--3 {
  bottom: 20%;
  right: 15%;
  animation: resCursorFloat3 9s ease-in-out infinite;
}

@keyframes resCursorFloat1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-20px, 15px); }
  50% { transform: translate(10px, -10px); }
  75% { transform: translate(-15px, -5px); }
}

@keyframes resCursorFloat2 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(15px, -10px); }
  50% { transform: translate(-10px, 20px); }
  75% { transform: translate(20px, 5px); }
}

@keyframes resCursorFloat3 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-10px, -15px); }
  50% { transform: translate(15px, 10px); }
  75% { transform: translate(-5px, -20px); }
}

@media (prefers-reduced-motion: reduce) {
  .res-frag,
  .res-chip,
  .res-cursor { display: none; }
}

@media (max-width: 768px) {
  .res-cursor { display: none; }
}

/* ---------- BLOG GRID (Auria: 3 cols, 12px gap) ---------- */

.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

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

@media (max-width: 479px) {
  .res-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

/* Featured: 3-col grid, card1 spans 2 cols top, card4 spans 2 cols bottom-right */
.res-grid--featured .res-card:first-child {
  grid-column: span 2;
}

.res-grid--featured .res-card:first-child .res-card__img {
  aspect-ratio: 5 / 2;
}

.res-grid--featured .res-card:first-child .res-card__title {
  font-size: 2rem;
}

.res-grid--featured .res-card:last-child {
  grid-column: span 2;
}

.res-grid--featured .res-card:last-child .res-card__img {
  aspect-ratio: 5 / 2;
}

@media (max-width: 991px) {
  .res-grid--featured .res-card:first-child,
  .res-grid--featured .res-card:last-child { grid-column: span 1; }
  .res-grid--featured .res-card:first-child .res-card__img,
  .res-grid--featured .res-card:last-child .res-card__img { aspect-ratio: 2 / 1; }
}

/* ---------- BLOG CARD (Auria exact) ---------- */

.res-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  overflow: clip;
  outline: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.res-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.res-card__img-wrap {
  border-radius: 8px;
  width: 100%;
  overflow: hidden;
  background: var(--surface-secondary);
}

.res-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.res-card:hover .res-card__img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .res-card:hover .res-card__img { transform: none; }
}

.res-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 16px;
  background: #fff;
  padding: 18px 18px 24px;
  border-radius: 6px;
}

.res-card__date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #4d4a45;
  text-transform: uppercase;
}

.res-card__title {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 115%;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  width: 80%;
}

@media (max-width: 479px) {
  .res-card__title { width: 100%; }
}

.res-card__divider {
  border-bottom: 1px solid #cacaca;
  width: 100%;
  height: 0;
}

.res-card__excerpt {
  font-size: 0.875rem;
  font-weight: 500;
  color: #707070;
  line-height: 1.5;
}

.res-card__read {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-heading);
  text-transform: uppercase;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.res-card__read::after {
  content: '\2192';
  transition: transform 200ms;
}

.res-card:hover .res-card__read::after {
  transform: translateX(4px);
}

/* ---------- SECTION SPACING ---------- */

.res-section {
  padding: 40px 0;
}

.res-section--alt {
  background: var(--surface-secondary);
  padding: 80px 0 48px;
}

.res-section__header {
  margin-bottom: 10px;
}

.res-section__title {
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 110%;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

/* ---------- FILTER PILLS (minimal) ---------- */

.res-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid #cacaca;
  margin-bottom: 48px;
}

.res-pill {
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-body);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 150ms;
  font-family: var(--font-family-primary);
  line-height: 1.4;
}

.res-pill:hover {
  border-color: var(--text-heading);
  color: var(--text-heading);
}

.res-pill.is-active {
  background: var(--text-heading);
  border-color: var(--text-heading);
  color: #fff;
}

.res-pill__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #DBEAFE;
  color: #2E5FD6;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  line-height: 1.3;
  vertical-align: middle;
}

/* ---------- NEWSLETTER CTA (Auria dark: #111111) ---------- */

.res-newsletter {
  background: #111827;
  color: #fff;
  padding: 48px 0;
}

.res-newsletter .container {
  display: flex;
  flex-direction: column;
  gap: 176px;
}

.res-newsletter__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 770px;
}

.res-newsletter__eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.res-newsletter__title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 500;
  line-height: 110%;
  letter-spacing: -0.02em;
  color: #fff;
}

.res-newsletter__subtitle {
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 110%;
  letter-spacing: -0.02em;
  color: grey;
}

@media (max-width: 767px) {
  .res-newsletter__subtitle { font-size: 1.5rem; }
}

.res-newsletter__form-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.res-newsletter__form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.res-newsletter__label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.res-newsletter__input {
  height: 44px;
  padding: 0 16px;
  font-size: var(--font-size-md);
  font-family: var(--font-family-primary);
  border: 1px solid transparent;
  border-radius: 6px;
  background: #363636;
  color: #fff;
  min-width: 260px;
}

.res-newsletter__input::placeholder { color: #807b73; }

.res-newsletter__input:focus {
  outline: none;
  border-color: var(--accent);
}

.res-newsletter__submit {
  padding: 12px 20px;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-family-primary);
  transition: opacity 150ms;
}

.res-newsletter__submit:hover { opacity: 0.85; }

.res-newsletter__consent {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  gap: 8px;
  align-items: start;
  margin-top: 8px;
}

.res-newsletter__consent input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.res-newsletter__line {
  border-bottom: 1px solid #292929;
  width: 100%;
}

@media (max-width: 479px) {
  .res-newsletter__form-wrap { flex-direction: column; align-items: stretch; }
  .res-newsletter__input { min-width: auto; }
  .res-newsletter .container { gap: 80px; }
}

/* ---------- CTA FINAL (dark, centered) ---------- */

.res-cta-final {
  background: var(--surface-inverse);
  color: var(--text-inverse);
  padding: 160px 0;
  text-align: center;
}

.res-cta-final__title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 100%;
  letter-spacing: -0.04em;
  max-width: 680px;
  margin: 0 auto 12px;
}

.res-cta-final__subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 32px;
}

/* ---------- SIGNATURE ---------- */

.res-signature {
  padding: 64px 0;
  text-align: center;
  border-top: 1px solid #cacaca;
}

.res-signature__text {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- BREADCRUMBS ---------- */

.breadcrumbs {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 150ms;
}

.breadcrumbs a:hover { color: var(--accent); }

.breadcrumbs__sep {
  margin: 0 8px;
  opacity: 0.4;
}

/* ---------- BLOG HEADER (light, minimal) ---------- */

.blog-header {
  padding: 128px 0 48px;
}

.blog-header__title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 500;
  line-height: 100%;
  letter-spacing: -0.04em;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.blog-header__subtitle {
  font-size: 0.875rem;
  font-weight: 500;
  color: #707070;
  max-width: 480px;
  line-height: 1.5;
}

/* ==========================================================================
   ARTICLE PAGE — Halden style
   Centered column 680px, wide hero 1100px, 12px radius
   ========================================================================== */

/* ---------- ARTICLE HEADER (left-aligned) ---------- */

.res-article-header {
  max-width: none;
  padding-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.res-article-meta {
  display: flex;
  gap: 24px;
  align-items: center;
}

.res-article-meta__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: var(--accent);
  line-height: 1.33;
}

.res-article-meta__date {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.75px;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1.33;
}

.res-article-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 108%;
  letter-spacing: -2px;
  color: var(--navy, #0A1A3C);
  margin: 0;
}

.res-article-header__intro {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-heading);
  line-height: 1.5;
}

/* ---------- HERO IMAGE (left-aligned, 12px radius) ---------- */

.res-article-hero {
  max-width: none;
  height: 400px;
  margin: 24px 0 32px;
  border-radius: 12px;
  overflow: hidden;
}

.res-article-hero img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}


@media (max-width: 991px) {
  .res-article-hero { height: 450px; }
}

@media (max-width: 479px) {
  .res-article-hero { height: 300px; margin: 48px auto; }
}

/* ---------- ARTICLE BODY (680px centered) ---------- */

.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
  max-width: none;
}

/* Article container */
article .container {
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
    max-width: 680px;
  }
}

/* ---------- SIDEBAR (sticky, enriched) ---------- */

.article-layout__sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 45px;
}

/* Sidebar card (generic) */
.sidebar-card {
  background: var(--surface-secondary);
  border-radius: 12px;
  padding: 24px;
}

.sidebar-card__title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Sidebar CTA card (white with border) */
.sidebar-card--cta {
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
}

.sidebar-card--cta p {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-body);
  margin-bottom: 16px;
}

.sidebar-card--cta .btn {
  width: 100%;
  justify-content: center;
}

/* Sidebar related cards (mini res-card style) */
.sidebar-related__item {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  background: #fff;
  margin-bottom: 12px;
  transition: box-shadow 200ms;
}

.sidebar-related__item:last-child {
  margin-bottom: 0;
}

.sidebar-related__item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.sidebar-related__img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
}

.sidebar-related__body {
  padding: 12px 14px 14px;
}

.sidebar-related__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.sidebar-related__title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.4;
  transition: color 150ms;
}

.sidebar-related__item:hover .sidebar-related__title {
  color: var(--accent);
}

.sidebar-related__read {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-heading);
  text-transform: uppercase;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sidebar-related__read::after {
  content: '\2192';
  transition: transform 200ms;
}

.sidebar-related__item:hover .sidebar-related__read::after {
  transform: translateX(3px);
}

/* Sidebar author card */
.sidebar-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-author__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-author__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
}

.sidebar-author__role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toc { padding: 0; }

.toc__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc__item { margin-bottom: 4px; }

.toc__link {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 0 4px 12px;
  line-height: 1.5;
  transition: all 150ms;
  border-left: 2px solid transparent;
}

.toc__link:hover { color: var(--text-heading); }

.toc__link.is-active {
  color: var(--text-heading);
  border-left-color: var(--accent);
  font-weight: 500;
}

@media (max-width: 1024px) {
  .article-layout__sidebar {
    position: static;
    border-bottom: 1px solid var(--border-default);
    padding-bottom: 16px;
    margin-bottom: 24px;
  }
  .toc__link { border-left: none; padding-left: 0; }
  .toc__list { display: flex; flex-wrap: wrap; gap: 8px; }
}

/* ---------- READING PROGRESS ---------- */

.reading-progress {
  position: fixed;
  top: 64px;
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0;
  z-index: 150;
  transition: width 80ms linear;
}

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

/* ---------- ARTICLE BODY (prose styles) ---------- */

.article-body {
  color: var(--text-heading);
  font-size: 1rem;
  line-height: 1.65;
}

.article-body h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--navy, #0A1A3C);
  margin: 32px 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.article-body h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--navy, #0A1A3C);
  margin: 24px 0 8px;
  line-height: 1.4;
}

.article-body p {
  margin: 0 0 12px;
  color: var(--text-heading);
}

.article-body ul,
.article-body ol {
  margin: 4px 0 12px;
  padding-left: 20px;
  color: var(--text-heading);
}

.article-body li {
  margin-bottom: 4px;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--navy, #0A1A3C);
}

.article-body strong {
  font-weight: 600;
  color: var(--navy, #0A1A3C);
}

/* ---------- CALLOUTS (Halden-inspired: subtle, no colored border) ---------- */

.callout {
  border-radius: 12px;
  padding: 28px 32px;
  margin: 40px 0;
  background: var(--surface-secondary);
  border: 1px solid rgba(0,0,0,.06);
}

.callout__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  margin-bottom: 12px;
  color: var(--navy, #0A1A3C);
}

.callout p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-heading);
  margin: 0;
}

.callout--retenir { background: var(--surface-secondary); }
.callout--agricole { background: var(--surface-secondary); }
.callout--chiffres { background: var(--surface-secondary); }

.callout--retenir { background: var(--surface-secondary); }
.callout--agricole { background: var(--surface-secondary); }
.callout--chiffres { background: var(--surface-secondary); }

/* ---------- ARTICLE SHARE ---------- */

.article-share {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 48px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
}

.article-share__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.article-share__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: #fff;
  color: var(--text-body);
  cursor: pointer;
  transition: all 150ms;
  text-decoration: none;
}

.article-share__btn:hover {
  background: var(--surface-secondary);
  color: var(--text-heading);
}

/* ---------- FEEDBACK ---------- */

.article-feedback {
  text-align: center;
  padding: 24px;
  background: var(--surface-secondary);
  border-radius: 10px;
  margin: 32px 0 24px;
  border: 1px solid rgba(0,0,0,.06);
}

.article-feedback__question {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 16px;
}

.article-feedback__buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.article-feedback__btn {
  padding: 8px 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border-default);
  border-radius: 50px;
  background: #fff;
  color: var(--text-body);
  cursor: pointer;
  transition: all 150ms;
  font-family: var(--font-family-primary);
}

.article-feedback__btn:hover {
  border-color: var(--text-heading);
  color: var(--text-heading);
}

.article-feedback__thanks {
  display: none;
  font-size: 1rem;
  color: var(--state-success);
  font-weight: 500;
}

/* ---------- DOUBLE CTA ---------- */

.article-double-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0 48px;
}

.article-double-cta__card {
  border-radius: 10px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,.06);
}

.article-double-cta__card--resource {
  background: #fff;
}

.article-double-cta__card--demo {
  background: var(--navy, #0A1A3C);
  color: #fff;
  border-color: transparent;
}

.article-double-cta__eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: var(--accent);
}

.article-double-cta__card--demo .article-double-cta__eyebrow {
  color: rgba(255,255,255,.5);
}

.article-double-cta__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--navy, #0A1A3C);
}

.article-double-cta__card--demo .article-double-cta__title {
  color: #fff;
}

.article-double-cta__desc {
  font-size: 0.8125rem;
  margin-bottom: 20px;
  line-height: 1.5;
  color: var(--text-body);
  flex: 1;
}

.article-double-cta__card--demo .article-double-cta__desc {
  color: rgba(255, 255, 255, 0.6);
}

.article-double-cta__card .btn {
  align-self: flex-start;
}

@media (max-width: 600px) {
  .article-double-cta { grid-template-columns: 1fr; }
}

/* ---------- RELATED ARTICLES (Halden 2-col, 16px gap) ---------- */

.res-related {
  padding: 120px 0;
  background: var(--surface-secondary);
}

.res-related__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.res-related .res-card__img {
  aspect-ratio: 16 / 9;
}

@media (max-width: 479px) {
  .res-related__grid { grid-template-columns: 1fr; }
  .res-related { padding: 64px 0; }
}

/* ---------- PAGINATION ---------- */

.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 48px;
}

.pagination__btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-body);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 50px;
  cursor: pointer;
  transition: all 150ms;
  font-family: var(--font-family-primary);
}

.pagination__btn:hover:not(:disabled) {
  border-color: var(--text-heading);
  color: var(--text-heading);
}

.pagination__btn.is-active {
  background: var(--text-heading);
  border-color: var(--text-heading);
  color: #fff;
}

.pagination__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ---------- NO RESULTS ---------- */

.res-no-results {
  text-align: center;
  padding: 80px 32px;
}

.res-no-results__title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.res-no-results__desc {
  font-size: 0.875rem;
  color: #707070;
}
