/* ==========================================================================
   MASTER Risk Library — isolated stylesheet
   --------------------------------------------------------------------------
   EVERY rule below is scoped under .mrl (or .mrl-* for standalone elements),
   so this file cannot restyle the existing masterriskmodel.com pages.
   Bootstrap 5 supplies: container, row, col-*, d-flex, gap-*, ratio, etc.
   This file supplies: brand tokens, dark navy surfaces, cards, chips,
   buttons, and article typography.

   To rebrand: change the custom properties in the .mrl block only.
   ========================================================================== */

.mrl {
  /* Surfaces */
  --mrl-bg: #101a2f;              /* dark navy page background */
  --mrl-fg: #f7f9fc;
  --mrl-hero-muted: #c2c8d4;
  --mrl-nav-muted: #b6bdcb;
  --mrl-brand-line: rgba(247, 249, 252, 0.14);
  --mrl-brand-mark: #f7f9fc;

  /* Accent */
  --mrl-primary: #cf8a52;
  --mrl-primary-strong: #bd7539;
  --mrl-primary-fg: #121b30;
  --mrl-focus: #e0a35f;

  /* Library (grey) band */
  --mrl-library-surface: #e6eaf0;
  --mrl-library-fg: #1b2438;
  --mrl-library-muted: #6b7280;

  /* Article (warm white) band */
  --mrl-article-surface: #f9f7f3;
  --mrl-article-fg: #1b2438;
  --mrl-article-muted: #4a5262;

  /* Cards */
  --mrl-card: #ffffff;
  --mrl-card-fg: #131b2b;
  --mrl-card-muted: #5c6779;
  --mrl-card-line: #dfe4ec;

  /* Topic chips */
  --mrl-chip-bg: #f4f6f9;
  --mrl-chip-bg-hover: #e6eaf0;
  --mrl-chip-border: #b9c0cc;
  --mrl-chip-fg: #3c4557;

  /* CTA band */
  --mrl-cta-bg: #1a2740;
  --mrl-cta-fg: #f7f9fc;

  /* Type + shape */
  --mrl-font-display: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mrl-font-body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mrl-radius: 4px;
  --mrl-site-width: 1200px;
  --mrl-reading-width: 1088px;
  --mrl-prose-width: 768px;
  --mrl-shadow-card: 0 10px 24px rgba(12, 20, 40, 0.09);
  --mrl-shadow-card-hover: 0 16px 32px rgba(12, 20, 40, 0.14);
  --mrl-shadow-feature: 0 18px 44px rgba(12, 20, 40, 0.14);
  --mrl-shadow-nav: 0 14px 30px rgba(8, 14, 28, 0.18);

  background: var(--mrl-bg);
  color: var(--mrl-fg);
  font-family: var(--mrl-font-body);
}

.mrl *,
.mrl *::before,
.mrl *::after { box-sizing: border-box; }

.mrl img { max-width: 100%; }

/* Visible keyboard focus for every interactive Library control. */
.mrl a:focus-visible,
.mrl button:focus-visible {
  outline: 2px solid var(--mrl-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.mrl-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--mrl-primary, #cf8a52);
  color: #121b30;
  padding: 0.75rem 1rem;
  font-weight: 600;
}
.mrl-skip-link:focus { left: 1rem; }

/* ---------- Layout helpers (used with Bootstrap containers) ---------- */
.mrl-shell { max-width: var(--mrl-site-width); margin: 0 auto; padding-inline: 1.25rem; }
.mrl-reading { max-width: var(--mrl-reading-width); margin: 0 auto; padding-inline: 1.25rem; }
.mrl-prose { max-width: var(--mrl-prose-width); margin: 0 auto; padding-inline: 1.25rem; }
@media (min-width: 992px) {
  .mrl-shell, .mrl-reading, .mrl-prose { padding-inline: 2rem; }
}

/* ---------- Shared MASTER site chrome ---------- */
.mrl-header {
  position: relative;
  z-index: 40;
  height: 86px;
  background: #142237;
  border-bottom: 1px solid #466983;
}
.mrl-site-nav-wrap {
  width: 100%;
  height: 86px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.25rem;
}
.mrl-site-logo-link { display: flex; align-items: center; flex: 0 0 auto; height: 100%; }
.mrl-site-logo { display: block; height: 63px; width: auto; max-width: none; }
.mrl-nav {
  margin-left: auto;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
  min-width: 0;
  flex: 1 1 auto;
}
@media (min-width: 1180px) { .mrl-nav { display: flex; } }
.mrl-nav > a,
.mrl-site-dropdown > a,
.mrl-login-pill,
.mrl-login-pill a {
  color: #fff;
  text-decoration: none;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}
.mrl-nav > a:hover,
.mrl-site-dropdown > a:hover,
.mrl-login-pill a:hover { color: #ffae71; }
.mrl-nav-active { color: #F28A3D !important; }
.mrl-site-dropdown { position: relative; padding-block: 1.9rem; }
.mrl-site-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% - 0.2rem);
  left: 0;
  min-width: 260px;
  padding: 0.5rem 0;
  background: #18335C;
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}
.mrl-site-dropdown:hover .mrl-site-dropdown-menu,
.mrl-site-dropdown:focus-within .mrl-site-dropdown-menu { display: block; }
.mrl-site-dropdown-menu a {
  display: block;
  padding: 0.6rem 0.9rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.35;
}
.mrl-site-dropdown-menu a:hover { background: rgba(255,255,255,.15); color: #fff; }
.mrl-login-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid #72AAD2;
  border-radius: 999px;
}
.mrl-login-pill a { text-decoration: underline dotted 1px; }
.mrl-login-pill img { width: 16px; height: 16px; margin-left: 0.2rem; }
.mrl-nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 4px;
}
.mrl-nav-toggle svg { width: 22px; height: 22px; }
@media (min-width: 1180px) { .mrl-nav-toggle { display: none; } }
.mrl-nav-mobile {
  position: absolute;
  inset-inline: 0;
  top: 86px;
  z-index: 50;
  background: #142237;
  border-bottom: 1px solid #466983;
  box-shadow: 0 14px 30px rgba(8,14,28,.28);
}
.mrl-nav-mobile[hidden] { display: none; }
.mrl-nav-mobile > div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  padding: 0.75rem 1.25rem 1rem;
}
.mrl-nav-mobile a {
  width: 100%;
  padding: 0.65rem 0;
  text-align: right;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.mrl-nav-mobile a:hover { color: #ffae71; }
@media (max-width: 600px) {
  .mrl-site-nav-wrap { padding-inline: 1rem; }
  .mrl-site-logo { height: 54px; }
}

.mrl-footer {
  border-top: 1px solid #fff;
  background: rgba(26,26,26,.3);
  color: #fff;
}
.mrl-footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr);
  gap: 3rem;
}
.mrl-footer-logo { display: block; width: 333px; max-width: 100%; height: auto; }
.mrl-footer-brand p { margin: 1.5rem 0 0; color: #fff; font-size: 1rem; }
.mrl-footer-links { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; }
.mrl-footer-links a { display: block; margin: 0.55rem 0; color: #fff; text-decoration: none; font-size: 0.9rem; }
.mrl-footer-links a:hover { color: #ffae71; }
@media (max-width: 800px) {
  .mrl-footer-grid { grid-template-columns: 1fr; padding: 2.5rem 1.25rem; }
  .mrl-footer-links { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .mrl-footer-links { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.mrl-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--mrl-brand-line); background: var(--mrl-bg); }
.mrl-hero-pattern {
  position: absolute; inset-block: 0; right: 0; width: 42%; opacity: 0.7; pointer-events: none; display: none;
  background-image:
    linear-gradient(90deg, transparent 48%, rgba(247, 249, 252, 0.08) 49%, transparent 50%),
    linear-gradient(rgba(247, 249, 252, 0.07) 1px, transparent 1px);
  background-size: 5.5rem 100%, 100% 5.5rem;
  -webkit-mask-image: linear-gradient(to left, black, transparent 92%);
          mask-image: linear-gradient(to left, black, transparent 92%);
}
@media (min-width: 992px) { .mrl-hero-pattern { display: block; } }
.mrl-hero-inner { position: relative; padding-block: 4rem 3.5rem; }
@media (min-width: 992px) { .mrl-hero-inner { padding-block: 6rem 5rem; } }
.mrl-eyebrow { font-family: var(--mrl-font-display); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--mrl-primary); margin: 0; }
.mrl-hero h1 { font-family: var(--mrl-font-display); font-weight: 600; line-height: 1.08; margin: 1.25rem 0 0; font-size: clamp(2.25rem, 5vw, 3.75rem); }
.mrl-hero-intro { margin: 1.5rem 0 0; max-width: 42rem; font-size: 1.125rem; line-height: 1.75; color: var(--mrl-hero-muted); }

/* ---------- Library band: chips, featured, grid ---------- */
.mrl-library { background: var(--mrl-library-surface); color: var(--mrl-library-fg); padding-block: 2.5rem 5rem; }
@media (min-width: 992px) { .mrl-library { padding-block: 3rem 7rem; } }
.mrl-section-label { font-family: var(--mrl-font-display); font-size: 0.875rem; font-weight: 600; margin: 0; }
.mrl-chips { margin-top: 1.25rem; overflow-x: auto; padding-bottom: 0.5rem; scrollbar-width: none; }
.mrl-chips::-webkit-scrollbar { display: none; }
.mrl-chips-row { display: flex; gap: 0.5rem; width: max-content; }
.mrl-chip {
  border-radius: 999px; border: 1px solid var(--mrl-chip-border); background: var(--mrl-chip-bg);
  color: var(--mrl-chip-fg); font-size: 0.75rem; font-weight: 500; line-height: 1;
  padding: 0.65rem 1rem; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mrl-chip:hover { border-color: var(--mrl-primary); background: var(--mrl-chip-bg-hover); }
.mrl-chip[aria-pressed="true"] { background: var(--mrl-primary); border-color: var(--mrl-primary); color: var(--mrl-primary-fg); }
.mrl-chip[aria-pressed="true"]:hover { background: var(--mrl-primary-strong); border-color: var(--mrl-primary-strong); }

.mrl-featured { margin-top: 2.5rem; background: var(--mrl-card); color: var(--mrl-card-fg); border-radius: var(--mrl-radius); box-shadow: var(--mrl-shadow-feature); overflow: hidden; }
.mrl-featured-media { width: 100%; height: 100%; min-height: 16rem; object-fit: cover; }
@media (min-width: 992px) { .mrl-featured-media { min-height: 27rem; } }
.mrl-featured-body { display: flex; flex-direction: column; justify-content: center; padding: 1.75rem; }
@media (min-width: 576px) { .mrl-featured-body { padding: 2.5rem; } }
@media (min-width: 992px) { .mrl-featured-body { padding: 3rem; } }
.mrl-kicker { display: flex; align-items: center; gap: 0.75rem; }
.mrl-kicker i { display: block; width: 2rem; height: 1px; background: var(--mrl-primary); }
.mrl-kicker p { margin: 0; font-family: var(--mrl-font-display); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--mrl-primary); }
.mrl-featured h2 { margin: 1.25rem 0 0; font-family: var(--mrl-font-display); font-weight: 600; line-height: 1.15; font-size: clamp(1.75rem, 3vw, 2.25rem); }
.mrl-featured-desc { margin: 1.25rem 0 0; font-size: 1rem; line-height: 1.75; color: var(--mrl-card-muted); }
.mrl-featured-meta { margin: 1.25rem 0 0; font-size: 0.75rem; color: var(--mrl-card-muted); }

.mrl-grid { margin-top: 2rem; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .mrl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .mrl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mrl-grid--related { margin-top: 2rem; }
@media (min-width: 768px) { .mrl-grid--related { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.mrl-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--mrl-card); color: var(--mrl-card-fg); border-radius: var(--mrl-radius); box-shadow: var(--mrl-shadow-card); transition: box-shadow 0.2s ease; }
.mrl-card:hover { box-shadow: var(--mrl-shadow-card-hover); }
.mrl-card-media { display: block; overflow: hidden; }
.mrl-card-media img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.3s ease; }
.mrl-card--compact .mrl-card-media img { aspect-ratio: 16 / 9; }
.mrl-card:hover .mrl-card-media img { transform: scale(1.015); }
.mrl-card-body { display: flex; flex: 1; flex-direction: column; padding: 1.5rem; }
.mrl-card-category { margin: 0; font-family: var(--mrl-font-display); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--mrl-primary); }
.mrl-card-title { margin: 0.75rem 0 0; font-family: var(--mrl-font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.35; }
.mrl-card-title a { color: inherit; text-decoration: none; }
.mrl-card-title a:hover { text-decoration: underline; }
.mrl-card-desc { margin: 0.75rem 0 0; flex: 1; font-size: 0.875rem; line-height: 1.6; color: var(--mrl-card-muted); }
.mrl-card-foot { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--mrl-card-line); display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; color: var(--mrl-card-muted); }
.mrl-card-foot svg { width: 1rem; height: 1rem; color: var(--mrl-primary); }

.mrl-empty { padding-block: 4rem; text-align: center; color: var(--mrl-library-muted); }
.mrl-empty[hidden] { display: none; }
.mrl-empty-first { max-width: 34rem; margin-inline: auto; padding-block: 5rem; font-size: 1.0625rem; line-height: 1.7; }
.mrl-chip[disabled] { opacity: 0.45; cursor: default; }
.mrl-showmore-wrap { margin-top: 3rem; display: flex; justify-content: center; }
.mrl-showmore-wrap[hidden] { display: none; }
.mrl-btn-showmore { border: 1px solid var(--mrl-library-fg); background: transparent; color: var(--mrl-library-fg); font-size: 0.875rem; font-weight: 500; padding: 0.7rem 2rem; border-radius: 6px; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; }
.mrl-btn-showmore:hover { background: var(--mrl-library-fg); color: var(--mrl-library-surface); }

/* ---------- Buttons ---------- */
.mrl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-family: var(--mrl-font-body); font-size: 0.875rem; font-weight: 500; text-decoration: none; border-radius: 6px; cursor: pointer; border: 1px solid transparent; transition: background-color 0.15s ease, color 0.15s ease; }
.mrl-btn svg { width: 1rem; height: 1rem; flex: none; }
.mrl-btn-article { margin-top: 2rem; width: fit-content; padding: 0.6rem 1.25rem; background: var(--mrl-primary); color: var(--mrl-primary-fg); }
.mrl-btn-article:hover { background: var(--mrl-primary-strong); color: var(--mrl-primary-fg); }
.mrl-btn-cta { padding: 0.75rem 2rem; background: var(--mrl-cta-fg); border-color: var(--mrl-cta-fg); color: var(--mrl-cta-bg); white-space: nowrap; }
.mrl-btn-cta:hover { background: rgba(247, 249, 252, 0.9); color: var(--mrl-cta-bg); }

/* ---------- Article page ---------- */
.mrl-article-header { border-bottom: 1px solid var(--mrl-brand-line); background: var(--mrl-bg); padding-block: 3rem; }
@media (min-width: 992px) { .mrl-article-header { padding-block: 5rem; } }
.mrl-back { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--mrl-hero-muted); text-decoration: none; }
.mrl-back:hover { color: var(--mrl-fg); }
.mrl-back svg { width: 1rem; height: 1rem; }
.mrl-article-header .mrl-eyebrow { margin-top: 3rem; }
.mrl-article-header h1 { margin: 1.25rem 0 0; max-width: 56rem; font-family: var(--mrl-font-display); font-weight: 600; line-height: 1.12; font-size: clamp(2.25rem, 5vw, 3.75rem); }
.mrl-deck { margin: 1.5rem 0 0; max-width: 48rem; font-size: 1.125rem; line-height: 1.75; color: var(--mrl-hero-muted); }
.mrl-article-meta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.75rem; color: var(--mrl-nav-muted); }
.mrl-article-main { background: var(--mrl-article-surface); color: var(--mrl-article-fg); }
.mrl-article-hero { padding-top: 2rem; }
.mrl-article-hero img { width: 100%; max-height: 38rem; object-fit: cover; border-radius: var(--mrl-radius); box-shadow: var(--mrl-shadow-feature); }
.mrl-article-body { padding-block: 3.5rem; }
@media (min-width: 992px) { .mrl-article-body { padding-block: 5rem; } }
.mrl-article-body section + section { margin-top: 3rem; }
.mrl-article-body h2 { font-family: var(--mrl-font-display); font-weight: 600; line-height: 1.3; font-size: clamp(1.5rem, 2.4vw, 1.875rem); margin: 0; }
.mrl-article-body p { margin: 1.25rem 0 0; font-size: 1rem; line-height: 1.8; color: var(--mrl-article-muted); }
@media (min-width: 576px) { .mrl-article-body p { font-size: 1.125rem; } }
.mrl-quote { margin: 3rem 0; padding: 0.5rem 0 0.5rem 1.5rem; border-left: 2px solid var(--mrl-primary); font-family: var(--mrl-font-display); font-size: 1.5rem; font-weight: 500; line-height: 1.6; color: var(--mrl-article-fg); }
.mrl-related { background: var(--mrl-library-surface); color: var(--mrl-library-fg); padding-block: 4rem; }
@media (min-width: 992px) { .mrl-related { padding-block: 5rem; } }
.mrl-related h2 { font-family: var(--mrl-font-display); font-weight: 600; font-size: clamp(1.75rem, 3vw, 1.875rem); margin: 0; }

/* ---------- Single end-of-page CTA ---------- */
.mrl-cta { border-top: 1px solid var(--mrl-brand-line); background: var(--mrl-cta-bg); color: var(--mrl-cta-fg); }
.mrl-cta-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 1.75rem; padding-block: 4rem; }
@media (min-width: 576px) { .mrl-cta-inner { flex-direction: row; align-items: center; justify-content: space-between; } }
@media (min-width: 992px) { .mrl-cta-inner { padding-block: 5rem; } }
.mrl-cta h2 { margin: 0; max-width: 34rem; font-family: var(--mrl-font-display); font-weight: 600; line-height: 1.2; font-size: clamp(1.75rem, 3.2vw, 2.25rem); }

/* ---------- 404 ---------- */
.mrl-notfound { text-align: center; padding-block: 6rem; }
.mrl-notfound h1 { margin: 1rem 0 0; font-family: var(--mrl-font-display); font-weight: 600; font-size: clamp(2rem, 4vw, 2.5rem); }
.mrl-notfound p { color: var(--mrl-hero-muted); margin-top: 1.25rem; }
.mrl-notfound a { display: inline-flex; margin-top: 2rem; padding: 0.75rem 1.25rem; border: 1px solid var(--mrl-primary); color: var(--mrl-fg); text-decoration: none; font-size: 0.875rem; font-weight: 600; }

/* ---------- Figma Library alignment (Draft 37) ---------- */
.mrl {
  --mrl-bg: #172238;
  --mrl-library-surface: #172238;
  --mrl-library-fg: #f7f9fc;
  --mrl-library-muted: #aeb7c6;
  --mrl-chip-bg: rgba(255,255,255,.045);
  --mrl-chip-bg-hover: rgba(255,255,255,.085);
  --mrl-chip-border: rgba(255,255,255,.22);
  --mrl-chip-fg: #f1f4f8;
  background: #172238;
}
.mrl-hero {
  min-height: 295px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(90deg, rgba(11,19,34,.78), rgba(20,34,55,.54)), url("/assets/img/library-hero.jpg") center 48% / cover no-repeat;
}
.mrl-hero-pattern { display: none !important; }
.mrl-hero-inner { width: 100%; padding-block: 4.5rem; }
.mrl-eyebrow { display: none; }
.mrl-hero h1 { margin: 0; font-family: "Montserrat", system-ui, sans-serif; font-size: clamp(2.8rem, 5vw, 4.25rem); font-weight: 400; letter-spacing: .005em; }
.mrl-hero-intro { margin-top: 1.25rem; max-width: 68rem; color: #f3f5f8; font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.55; }

.mrl-library { background: #172238; color: #f7f9fc; padding-block: 2rem 5.5rem; }
.mrl-section-label { color: #aeb7c6; font-size: .9rem; font-weight: 500; }
.mrl-chips { margin-top: 1rem; }
.mrl-chip { background: rgba(255,255,255,.045); color: #eef2f7; border-color: rgba(255,255,255,.22); padding: .55rem 1rem; }
.mrl-chip[aria-pressed="true"] { background: #fff; border-color: #fff; color: #172238; }
.mrl-chip:disabled { opacity: 1; cursor: default; }

.mrl-featured {
  background: radial-gradient(circle at 30% 45%, rgba(119,103,158,.26), transparent 45%), linear-gradient(110deg, #222d46, #182338);
  color: #fff; border-radius: 0 18px 18px 0; box-shadow: 0 15px 28px rgba(5,10,20,.28);
}
.mrl-featured-media { min-height: 25rem; }
.mrl-featured-body { color: #fff; }
.mrl-featured-desc, .mrl-featured-meta { color: #cbd2dd; }
.mrl-featured h2 { color: #fff; font-size: clamp(2rem,3vw,2.8rem); }
.mrl-btn-article { width: fit-content; background: #fff; color: #172238 !important; border-radius: 999px; }

.mrl-card { background: #fff; color: #172238; border-radius: 18px 18px 8px 8px; border-top: 3px solid #d68aa3; }
.mrl-grid .mrl-card:nth-child(3n+2) { border-top-color: #8db9da; }
.mrl-grid .mrl-card:nth-child(3n+3) { border-top-color: #e78750; }

.mrl-holding { margin-top: 2.1rem; }
.mrl-holding-featured {
  display: grid; grid-template-columns: minmax(290px, 31%) 1fr; min-height: 330px; overflow: hidden; border-radius: 18px;
  background: radial-gradient(circle at 45% 42%, rgba(117,98,154,.24), transparent 38%), linear-gradient(110deg, #29334d 0%, #1a253a 70%);
  box-shadow: 0 16px 30px rgba(4,9,20,.28);
}
.mrl-holding-media { background: #e7e7e7; overflow: hidden; }
.mrl-holding-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mrl-holding-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem,4vw,3.4rem); }
.mrl-holding-tags { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }
.mrl-holding-badge, .mrl-holding-topic { display: inline-flex; align-items: center; border-radius: 999px; padding: .35rem .75rem; font-family: "Montserrat", sans-serif; font-size: .68rem; font-weight: 700; }
.mrl-holding-badge { color: #fff; background: linear-gradient(90deg,#9a68b7,#77b8dc); letter-spacing: .04em; }
.mrl-holding-topic { color: #fff; background: rgba(255,255,255,.14); }
.mrl-holding-copy h2 { margin: 1.8rem 0 0; color: #fff; font-family: "Montserrat", sans-serif; font-size: clamp(1.8rem,3vw,2.7rem); line-height: 1.16; }
.mrl-holding-copy p { margin: 1rem 0 0; color: #c6ceda; max-width: 52rem; line-height: 1.7; }
.mrl-holding-copy .mrl-holding-meta { margin-top: 2rem; font-size: .8rem; color: #d8dee7; }

.mrl-holding-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; margin-top: 1.6rem; }
.mrl-holding-card { min-height: 138px; padding: 1.5rem; border-radius: 18px 18px 8px 8px; border-top: 3px solid #d68aa3; background: #fff; color: #172238; }
.mrl-holding-card:nth-child(2) { border-top-color: #8db9da; }
.mrl-holding-card:nth-child(3) { border-top-color: #e78750; }
.mrl-holding-card span { display: block; color: #6d7481; font-size: .72rem; margin-bottom: .8rem; }
.mrl-holding-card strong { display: block; font-family: "Montserrat", sans-serif; font-size: 1.15rem; line-height: 1.3; }

.mrl-cta { background: #fff; color: #172238; }
.mrl-cta h2 { color: #172238; }
.mrl-btn-cta { background: #F28A3D; color: #fff !important; border-radius: 999px; }

@media (max-width: 900px) {
  .mrl-hero { min-height: 250px; }
  .mrl-holding-featured { grid-template-columns: 1fr; }
  .mrl-holding-media { min-height: 250px; }
  .mrl-holding-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mrl-hero { min-height: 220px; background-position: 60% 50%; }
  .mrl-hero-inner { padding-block: 3rem; }
  .mrl-hero h1 { font-size: 2.2rem; }
  .mrl-hero-intro { font-size: .95rem; }
  .mrl-library { padding-block: 1.4rem 3.5rem; }
  .mrl-holding-media { min-height: 210px; }
  .mrl-holding-copy { padding: 1.5rem; }
}

/* ---------- Lucía interaction spec implementation ---------- */

/* Topic chips: exact inactive/active values plus topic diamond accents. */
.mrl-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  color: #e8ecf2;
}
.mrl-chip::before {
  content: "";
  width: .48rem;
  height: .48rem;
  flex: 0 0 .48rem;
  transform: rotate(45deg);
  border-radius: 1px;
  background: transparent;
}
.mrl-chip[data-mrl-chip="All"]::before { display: none; }
.mrl-chip[data-mrl-chip="Risk as a Process"]::before { background: #f28a3d; }
.mrl-chip[data-mrl-chip="Risk Zones"]::before { background: #72AAD2; }
.mrl-chip[data-mrl-chip="Mindset / Abilities / Situation"]::before { background: #83449b; }
.mrl-chip[data-mrl-chip="Decisions & Fear"]::before { background: #dd88a9; }
.mrl-chip[data-mrl-chip="Career & Leadership"]::before { background: #5ba697; }
.mrl-chip[data-mrl-chip="Entrepreneurship & Work"]::before { background: #df6945; }
.mrl-chip[aria-pressed="true"] {
  background: #fff;
  border-color: transparent;
  color: #142237;
}

/* Article-card topic accent is a filtering dimension, not a visible tag. */
.mrl-card {
  box-shadow: 0 4px 4px rgba(0,0,0,.25);
  transition: box-shadow 180ms ease-in-out;
}
.mrl-card[data-mrl-category="Risk as a Process"] { border-top-color: #f28a3d; }
.mrl-card[data-mrl-category="Risk Zones"] { border-top-color: #72AAD2; }
.mrl-card[data-mrl-category="Mindset / Abilities / Situation"] { border-top-color: #83449b; }
.mrl-card[data-mrl-category="Decisions & Fear"] { border-top-color: #dd88a9; }
.mrl-card[data-mrl-category="Career & Leadership"] { border-top-color: #5ba697; }
.mrl-card[data-mrl-category="Entrepreneurship & Work"] { border-top-color: #df6945; }
.mrl-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.30); }
.mrl-card:hover .mrl-card-media img { transform: none; }
.mrl-card-media img { transition: none; }
.mrl-card[aria-disabled="true"],
.mrl-card.mrl-card--coming-soon {
  opacity: .6;
  pointer-events: none;
}

/* Featured card: only the title glow changes on hover; card geometry stays fixed. */
.mrl-featured-body {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.mrl-featured-body::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 560px;
  height: 320px;
  left: 42%;
  top: 50%;
  transform: translate(-50%,-50%);
  background: linear-gradient(135deg,#83449b 0%,#72AAD2 100%);
  filter: blur(80px);
  opacity: .25;
  transition:
    width 400ms ease-in-out,
    height 400ms ease-in-out,
    opacity 400ms ease-in-out;
  pointer-events: none;
}
.mrl-featured:hover .mrl-featured-body::before {
  width: 680px;
  height: 380px;
  opacity: .40;
}

/* Extra cards are hidden until the single in-place expansion. */
.mrl-card[hidden] { display: none !important; }
.mrl-card--extra-visible {
  animation: mrl-extra-card-in 350ms ease-in-out both;
}
@keyframes mrl-extra-card-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mrl-showmore-wrap {
  min-height: 48px;
  transition: min-height 350ms ease-in-out;
}
.mrl-showmore-wrap.is-expanded {
  min-height: 48px;
}
.mrl-btn-showmore {
  transition:
    opacity 350ms ease-in-out,
    background-color 150ms ease,
    color 150ms ease;
}
.mrl-btn-showmore:disabled,
.mrl-btn-showmore[aria-disabled="true"] {
  opacity: .4;
  pointer-events: none;
}

/* Mobile menu is full-screen, with no hover-only behavior on mobile. */
.mrl-nav-toggle-open,
.mrl-nav-toggle-close { display: inline-flex; }
.mrl-nav-toggle-close { display: none; }
.mrl-nav-toggle[aria-expanded="true"] .mrl-nav-toggle-open { display: none; }
.mrl-nav-toggle[aria-expanded="true"] .mrl-nav-toggle-close { display: inline-flex; }
.mrl-nav-toggle-open svg,
.mrl-nav-toggle-close svg { width: 22px; height: 22px; }

@media (max-width: 1179px) {
  html.mrl-nav-open,
  body.mrl-nav-open { overflow: hidden; }

  .mrl-nav-mobile {
    position: fixed;
    inset: 86px 0 0 0;
    height: calc(100dvh - 86px);
    overflow-y: auto;
    background: #142237;
    border-bottom: 0;
    box-shadow: none;
  }
  .mrl-nav-mobile > div {
    min-height: 100%;
    justify-content: flex-start;
    padding: 1.25rem 1.5rem 2rem;
  }
  .mrl-mobile-library-home {
    font-family: var(--mrl-font-display);
    font-weight: 600;
  }

  /* No hover states on mobile/touch presentation. */
  .mrl-card:hover { box-shadow: 0 4px 4px rgba(0,0,0,.25); }
  .mrl-featured:hover .mrl-featured-body::before {
    width: 560px;
    height: 320px;
    opacity: .25;
  }
  .mrl-chip:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.16);
    color: #e8ecf2;
  }
  .mrl-chip[aria-pressed="true"]:hover {
    background: #fff;
    border-color: transparent;
    color: #142237;
  }
}

@media (max-width: 600px) {
  .mrl-showmore-wrap { min-height: 75px; }
  .mrl-showmore-wrap.is-expanded { min-height: 75px; }
}

/* Users who request reduced motion should not receive animated transitions. */
@media (prefers-reduced-motion: reduce) {
  .mrl-card,
  .mrl-featured-body::before,
  .mrl-showmore-wrap,
  .mrl-btn-showmore,
  .mrl-card--extra-visible {
    transition: none !important;
    animation: none !important;
  }
}


/* ---------- Final Figma parity pass — Library Only, 2026-09-25 ---------- */
/* Source: Lucía Monteiro, MASTER Risk Website — Library Only. */
.mrl {
  --mrl-bg:#142237;
  --mrl-library-surface:#142237;
  --mrl-site-width:1200px;
  --mrl-radius:20px;
  font-family:"Montserrat",system-ui,-apple-system,"Segoe UI",sans-serif;
}
.mrl-shell{max-width:1440px;padding-inline:120px}
.mrl-header{height:83px}
.mrl-site-nav-wrap{height:83px}
.mrl-hero{
  min-height:299px;
  height:299px;
  align-items:flex-start;
  background:linear-gradient(90deg,rgba(13,21,38,.22),rgba(13,21,38,.08)),url("/assets/img/library-hero.jpg") center/cover no-repeat;
}
.mrl-hero-inner{padding:104px 120px 64px}
.mrl-hero h1{
  font-family:"Montserrat",system-ui,sans-serif;
  font-size:68px;
  font-weight:400;
  line-height:1.12;
  letter-spacing:0;
}
.mrl-hero-intro{
  margin-top:20px;
  max-width:1200px;
  font-family:"Montserrat",system-ui,sans-serif;
  font-size:22px;
  font-weight:400;
  line-height:1.6;
  color:#fff;
}
.mrl-library{padding:0 0 112px}
.mrl-library>.mrl-shell{max-width:1440px;padding:26.5px 120px 0}
.mrl-section-label{
  font-family:"Montserrat",system-ui,sans-serif;
  font-size:14px;
  font-weight:500;
  line-height:17px;
  color:rgba(255,255,255,.72);
}
.mrl-chips{margin-top:16px;padding-bottom:38.5px}
.mrl-chips-row{gap:10px}
.mrl-chip{
  min-height:32px;
  padding:8px 16px;
  border-radius:999px;
  font-family:"Montserrat",system-ui,sans-serif;
  font-size:12px;
  font-weight:500;
  line-height:16px;
}
.mrl-featured{
  margin-top:0;
  min-height:336px;
  height:336px;
  border-radius:20px;
  background:rgba(255,255,255,.05);
  box-shadow:0 10px 18px rgba(0,0,0,.2);
}
.mrl-featured>.col-lg-6:first-child{flex:0 0 320px;width:320px}
.mrl-featured>.col-lg-6:last-child{flex:1 1 auto;width:auto}
.mrl-featured-media{min-height:336px;height:336px;object-fit:cover}
.mrl-featured-body{
  min-height:336px;
  height:336px;
  justify-content:flex-start;
  padding:32px 28px 32px 32px;
}
.mrl-featured h2{
  margin-top:14px;
  font-size:34px;
  font-weight:700;
  line-height:1.14;
}
.mrl-featured-desc{margin-top:14px;font-size:15px;line-height:1.55;color:rgba(255,255,255,.85)}
.mrl-featured-meta{margin-top:auto;font-size:12px}
.mrl-grid{margin-top:25px;gap:24px;grid-template-columns:repeat(3,minmax(0,1fr))}
.mrl-card{
  min-height:248px;
  height:248px;
  border-radius:20px;
  border-top-width:3px;
  box-shadow:0 4px 4px rgba(0,0,0,.25);
}
.mrl-card-media{display:none}
.mrl-card-body{padding:20px 20px 22px;gap:12px}
.mrl-card-title{margin:0;font-size:20px;line-height:1.28;font-weight:600}
.mrl-card-title a:hover{text-decoration:none}
.mrl-card-desc{margin:0;font-size:15px;line-height:1.5;color:#4f5969}
.mrl-card-foot{margin-top:auto;padding-top:0;border-top:0;font-size:12px;color:#89909b;letter-spacing:.24px}
.mrl-showmore-wrap{margin-top:25px;min-height:48px}
.mrl-btn-showmore{
  min-height:48px;
  padding:15px 24px 15px 28px;
  border:1.5px solid rgba(255,255,255,.24);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:#fff;
  font-family:"Montserrat",system-ui,sans-serif;
  font-size:15px;
  font-weight:700;
}
.mrl-btn-showmore::after{content:" ↓";margin-left:8px}
.mrl-cta{height:280px;border-top:0}
.mrl-cta-inner{height:280px;padding:73.5px 0;flex-direction:column;justify-content:flex-start;align-items:center;gap:26px}
.mrl-cta h2{max-width:1048px;text-align:center;font-size:42px;line-height:1.4}
.mrl-footer{min-height:315px}

@media (max-width:1179px){
  .mrl-header,.mrl-site-nav-wrap{height:68px}
  .mrl-site-nav-wrap{padding-inline:20px}
  .mrl-site-logo{height:36px}
  .mrl-nav-toggle{width:24px;height:24px;border:0;border-radius:0;padding:0}
  .mrl-nav-mobile{top:68px}
  .mrl-hero{height:190px;min-height:190px;background-position:center}
  .mrl-hero-inner{padding:36px 24px 32px}
  .mrl-hero h1{font-size:32px;line-height:36px}
  .mrl-hero-intro{margin-top:14px;max-width:354px;font-size:15px;line-height:24px}
  .mrl-library>.mrl-shell{padding:4px 0 0 24px}
  .mrl-section-label{font-size:13px;line-height:16px}
  .mrl-chips{margin-top:14px;padding-bottom:28px}
  .mrl-chips-row{gap:8px;padding-right:24px}
  .mrl-chip{padding-inline:14px}
  .mrl-featured{margin-right:24px;height:auto;min-height:434px;display:block}
  .mrl-featured>.col-12{width:100%;max-width:none}
  .mrl-featured>.col-lg-6:first-child{width:100%;height:180px}
  .mrl-featured-media{width:100%;height:180px;min-height:180px}
  .mrl-featured-body{height:254px;min-height:254px;padding:22px}
  .mrl-featured h2{font-size:24px}
  .mrl-grid{margin-top:24px;margin-right:24px;grid-template-columns:1fr;gap:16px}
  .mrl-card{height:auto;min-height:188px}
  .mrl-card-body{padding:18px 16px}
  .mrl-card-title{font-size:18px}
  .mrl-card-desc{font-size:14px}
  .mrl-showmore-wrap{margin-right:24px}
  .mrl-cta{height:201px}
  .mrl-cta-inner{height:201px;padding:44px 28px;gap:14px}
  .mrl-cta h2{font-size:24px;line-height:1.125}
  .mrl-footer{min-height:169px}
}
@media (max-width:600px){
  .mrl-library{padding-bottom:64px}
  .mrl-holding{margin-right:24px}
  .mrl-holding-featured{grid-template-columns:1fr;min-height:434px}
  .mrl-holding-media{height:180px}
  .mrl-holding-copy{padding:22px}
  .mrl-holding-copy h2{font-size:24px}
  .mrl-holding-grid{grid-template-columns:1fr}
}


/* Featured article navigation: image and heading are links alongside the existing CTA.
   Keep the approved Figma card geometry and article visuals unchanged. */
.mrl-featured-media-link {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
}
.mrl-featured-media-link:focus-visible {
  outline: 3px solid #cf8a52;
  outline-offset: -3px;
}
.mrl-featured-title-link,
.mrl-featured-title-link:visited {
  color: inherit;
  text-decoration: none;
}
.mrl-featured-title-link:hover {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .15em;
}
.mrl-featured-title-link:focus-visible {
  outline: 3px solid #cf8a52;
  outline-offset: 4px;
}

/* Let the panel grow with longer translated or mobile article summaries.
   Desktop's featured image and copy must remain in the same flex row. */
.mrl-featured,
.mrl-featured-body {
  height: auto;
}
@media (min-width: 1180px) {
  .mrl-featured {
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .mrl-featured > .col-lg-6:last-child {
    min-width: 0;
  }
}


/* Keep the Free Snapshot CTA readable on hover and keyboard focus.
   Prior rule made the button nearly white while its text remained white. */
.mrl-btn-cta:hover,
.mrl-btn-cta:focus-visible {
  background: #B85618;
  border-color: #B85618;
  color: #fff !important;
}
