/* ============================================================================
   Maine DOE Newsletter — Block Library Styles
   ----------------------------------------------------------------------------
   Source of truth: reference/newsletter-block-library.html
   These are the styles used both inside the editor preview AND in the final
   exported newsletter. Don't drift from the mockup without updating both.
   ============================================================================ */

/* Brand variables are scoped to .newsletter-root (NOT :root) so this file is
   safe to inject site-wide via Drupal's CSS Injector without leaking variable
   overrides onto other maine.gov pages. The whole published fragment lives
   inside .newsletter-root, so every block inherits these. The editor chrome
   (toolbar/library/etc., which is outside .newsletter-root) gets the same
   variables from a :root block in editor.css. */
.newsletter-root {
  --navy: #0c1926;
  --navy-mid: #162d44;
  --navy-light: #1e3a56;
  --teal: #42c3f7;
  --teal-deep: #1a9fd6;
  --teal-glow: rgba(66, 195, 247, 0.18);
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --warm-bg: #eee6df;  /* Maine DOE beige */
  --light-card: #f0f4f8;
  --light-card-border: #dce4ed;
  --accent-amber: #f59e0b;
  --accent-amber-bg: #fef3c7;
  --accent-rose: #e11d48;
  --accent-rose-bg: #ffe4e6;
  --accent-green: #059669;
  --accent-green-bg: #d1fae5;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-navy: 0 10px 30px rgba(12, 25, 38, 0.15);
}

.newsletter-root *,
.newsletter-root *::before,
.newsletter-root *::after {
  box-sizing: border-box;
}
.newsletter-root {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--warm-bg);
  color: var(--slate-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}
.newsletter-root a { color: var(--teal-deep); text-decoration: none; }
.newsletter-root a:hover { color: var(--navy-mid); }

/* Bullet lists inside block bodies — the `.rich-list` class comes from the
   editor's richText / richParagraphs helpers whenever an editor uses the
   "• List" toolbar button (or types `- item` on consecutive lines). Kept
   subtle so bullets don't fight the block's own accent styling. */
.newsletter-root .rich-list {
  margin: 8px 0 12px;
  padding-left: 22px;
  list-style: disc;
}
.newsletter-root .rich-list li {
  margin: 4px 0;
  padding-left: 4px;
  line-height: 1.55;
}
.newsletter-root .rich-list li::marker { color: var(--teal-deep); }
/* Nested lists (in case someone builds one later) — smaller marker + tighter. */
.newsletter-root .rich-list .rich-list {
  margin: 4px 0 4px;
  list-style: circle;
}
/* When a block's body starts or ends with a list, avoid double top/bottom
   margin against the block's own padding. */
.newsletter-root .block-body > .rich-list:first-child,
.newsletter-root p:has(+ .rich-list) + .rich-list { margin-top: 4px; }
.newsletter-root .block-body > .rich-list:last-child { margin-bottom: 0; }

/* ============================================================
   THEME-PROOF OVERRIDES
   maine.gov's site theme styles content links with an ID-based selector
   that out-ranks plain classes even with !important. The published body
   carries id="newsletter-root", so these #newsletter-root rules win on
   specificity (ID > any number of classes). The .newsletter-root copies
   keep the same colors working in the editor preview / standalone export.
   ============================================================ */
/* Every CTA button keeps white text, regardless of the theme's <a> color. */
#newsletter-root .btn,
#newsletter-root .btn-outline,
#newsletter-root .btn-mini,
.newsletter-root .btn,
.newsletter-root .btn-outline,
.newsletter-root .btn-mini { color: #ffffff !important; }
/* Header title + compact-event date badge stay legible. */
#newsletter-root .nl-header h1,
.newsletter-root .nl-header h1 { color: #ffffff !important; }
#newsletter-root .block-event--compact .date-badge .nl-ev-day,
.newsletter-root .block-event--compact .date-badge .nl-ev-day { color: #ffffff !important; }
#newsletter-root .block-event--compact .date-badge .nl-ev-month,
.newsletter-root .block-event--compact .date-badge .nl-ev-month { color: var(--teal) !important; }
/* Footer text links: teal + underline (WCAG), excluding social chips + buttons. */
#newsletter-root .block-footer a:not(.social-link):not(.btn),
.newsletter-root .block-footer a:not(.social-link):not(.btn) {
  color: var(--teal) !important;
  text-decoration: underline !important;
}
/* Footer social icons: teal (navy on hover). */
#newsletter-root .block-footer .social-link,
.newsletter-root .block-footer .social-link { color: var(--teal) !important; }
#newsletter-root .block-footer .social-link:hover,
.newsletter-root .block-footer .social-link:hover { color: var(--navy) !important; }
/* Header "visit homepage" link + its globe icon stay teal. */
#newsletter-root .nl-header .nl-home-link,
#newsletter-root .nl-header .nl-home-link span,
#newsletter-root .nl-header .nl-home-link svg,
.newsletter-root .nl-header .nl-home-link,
.newsletter-root .nl-header .nl-home-link span,
.newsletter-root .nl-header .nl-home-link svg { color: var(--teal) !important; }

.newsletter-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

.newsletter-stack > * + * { margin-top: 24px; }
.newsletter-stack .block-section-header { margin-top: 36px; margin-bottom: 4px; }
.newsletter-stack .block-section-header + * { margin-top: 16px; }

/* ===== UNIFIED BLOCK TITLE BAR =====
   Layout: eyebrow pill above the title on the LEFT, type tag absolutely
   positioned on the RIGHT and vertically centered against the whole bar.
   When eyebrow is removed, the row collapses naturally — the title moves up.
   Pills use a semi-transparent fill + light color text for a soft, layered
   look against the navy bar. */
.block-title-bar {
  background: var(--navy-mid);
  color: white;
  padding: 14px 130px 14px 24px;  /* extra right padding reserves space for tag */
  border-top: 3px solid var(--teal);
  position: relative;
}
.block-title-bar .tb-tag,
.block-title-bar .tb-eyebrow {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);  /* 8px — blocky, like the date badge */
}
.block-title-bar .tb-eyebrow {
  /* Descriptive label — soft brand-blue pill */
  background: rgba(66, 195, 247, 0.22);
  color: #7dd3fc;
  font-weight: 700;
  margin-bottom: 8px;
}
.block-title-bar .tb-tag {
  /* Type tag — absolutely positioned on the right, vertically centered */
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
}
.block-title-bar .tb-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: white;
}

/* Per-block-type TAG colors — semi-transparent fill, light text */
.block-event .tb-tag       { background: rgba(74, 222, 128, 0.25); color: #86efac; }   /* green */
.block-news .tb-tag        { background: rgba(168, 85, 247, 0.28); color: #d8b4fe; }   /* purple */
.block-opportunity .tb-tag { background: rgba(251, 146, 60, 0.28); color: #fdba74; }   /* orange */
.block-update .tb-tag      { background: rgba(251, 191, 36, 0.30); color: #fde68a; }   /* amber */
.block-resources .tb-tag   { background: rgba(236, 72, 153, 0.28); color: #f9a8d4; }   /* pink */
.block-spotlight .tb-tag   { background: rgba(6, 182, 212, 0.28);  color: #67e8f9; }   /* cyan */
.block-stats .tb-tag       { background: rgba(99, 102, 241, 0.30); color: #a5b4fc; }   /* indigo */
.block-video .tb-tag       { background: rgba(220, 38, 38, 0.28);  color: #fca5a5; }   /* red */
.block-toc .tb-tag         { background: rgba(129, 140, 248, 0.28); color: #a5b4fc; }  /* indigo */
.block-intro .tb-tag       { background: rgba(66, 195, 247, 0.22); color: #7dd3fc; }   /* teal */

/* Per-block-type colored bottom border on the title bar — teal top + category bottom */
.block-event .block-title-bar       { border-bottom: 3px solid #22c55e; }
.block-news .block-title-bar        { border-bottom: 3px solid #a855f7; }
.block-opportunity .block-title-bar { border-bottom: 3px solid #fb923c; }
.block-update .block-title-bar      { border-bottom: 3px solid #f59e0b; }
.block-resources .block-title-bar   { border-bottom: 3px solid #ec4899; }
.block-spotlight .block-title-bar   { border-bottom: 3px solid #06b6d4; }
.block-stats .block-title-bar       { border-bottom: 3px solid #6366f1; }
.block-video .block-title-bar       { border-bottom: 3px solid #dc2626; }
.block-toc .block-title-bar         { border-bottom: 3px solid var(--teal); }
.block-intro .block-title-bar       { border-bottom: 3px solid var(--teal); }

/* ===== VIDEO BLOCK ===== */
.block-video {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-video .video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.block-video .video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.block-video .video-frame--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--slate-100);
  color: var(--slate-500);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}
.block-video .video-caption {
  padding: 12px 18px 16px;
  font-size: 0.88rem;
  color: var(--slate-600);
  line-height: 1.5;
}

/* ===== EVENT LIST BLOCK =====
   Dense rows for 3+ events. Each row: date · title/meta · CTA. */
.block-event-list {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-event-list .block-title-bar { border-bottom: 3px solid #22c55e; }
.block-event-list .tb-tag { background: rgba(34, 197, 94, 0.22); color: #86efac; }
.block-event-list .ev-list { padding: 0; }
.block-event-list .ev-list-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--slate-100);
}
.block-event-list .ev-list-row:last-child { border-bottom: none; }
.block-event-list .ev-list-row:nth-child(even) { background: var(--slate-50); }
.block-event-list .ev-list-date-main {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.block-event-list .ev-list-date-sub {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 2px;
}
.block-event-list .ev-list-title {
  font-weight: 600;
  color: var(--navy-mid);
  font-size: 0.98rem;
  margin-bottom: 2px;
}
.block-event-list .ev-list-meta {
  font-size: 0.82rem;
  color: var(--slate-500);
}
.block-event-list .ev-list-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-deep);
  text-decoration: none;
  white-space: nowrap;
}
.block-event-list .ev-list-cta:hover { color: var(--navy-mid); text-decoration: underline; }
@media (max-width: 600px) {
  .block-event-list .ev-list-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .block-event-list .ev-list-cta { justify-self: start; }
}

/* ===== TABLE BLOCK =====
   Editable grid — useful for fee schedules, deadlines, multi-event listings. */
.block-table {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-table .block-title-bar { border-bottom: 3px solid #8b5cf6; }
.block-table .tb-tag { background: rgba(139, 92, 246, 0.22); color: #c4b5fd; }
.block-table .table-scroll { overflow-x: auto; }
.block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.block-table thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 3px solid var(--teal);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.block-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
  vertical-align: top;
}
.block-table tbody tr:nth-child(even) td { background: var(--slate-50); }
.block-table tbody tr:last-child td { border-bottom: none; }
.block-table .table-caption {
  padding: 10px 22px 16px;
  font-size: 0.82rem;
  color: var(--slate-500);
}

/* ===== GALLERY BLOCK =====
   2–6 photos in a grid — the layout adapts to the count so it always looks
   intentional. Used for "Shout Out!" / community-event photo strips. */
.block-gallery {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-gallery .block-title-bar { border-bottom: 3px solid #14b8a6; }
.block-gallery .tb-tag { background: rgba(20, 184, 166, 0.22); color: #5eead4; }
.block-gallery .gallery-grid {
  display: grid;
  gap: 6px;
  padding: 6px;
}
.block-gallery .gallery-grid--1 { grid-template-columns: 1fr; }
.block-gallery .gallery-grid--2 { grid-template-columns: 1fr 1fr; }
.block-gallery .gallery-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.block-gallery .gallery-grid--4 { grid-template-columns: 1fr 1fr; }
.block-gallery .gallery-grid--5 { grid-template-columns: 1fr 1fr 1fr; }
.block-gallery .gallery-grid--6 { grid-template-columns: 1fr 1fr 1fr; }
.block-gallery .gallery-tile {
  background: var(--slate-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: block;
  text-decoration: none;
}
.block-gallery .gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.block-gallery .gallery-caption {
  padding: 12px 22px 16px;
  font-size: 0.88rem;
  color: var(--slate-600);
  line-height: 1.5;
}
.block-gallery .gallery-empty {
  padding: 32px 22px;
  background: var(--slate-50);
  color: var(--slate-500);
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px dashed var(--slate-300);
  border-bottom: 1px dashed var(--slate-300);
}
@media (max-width: 600px) {
  .block-gallery .gallery-grid--3,
  .block-gallery .gallery-grid--5,
  .block-gallery .gallery-grid--6 { grid-template-columns: 1fr 1fr; }
}

/* ===== "MARK AS IMPORTANT" FLAG =====
   Per-block opt-in: red badge with ! on the left of the block plus a subtle red
   glow on the card itself. The Table of Contents shows the same red ! beside
   important entries. */
.block-flagged-important {
  position: relative;
  padding-left: 18px;
}
.block-flagged-important > :not(.important-flag) {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4), 0 4px 18px rgba(239, 68, 68, 0.18) !important;
  border-radius: var(--radius);
}
.block-flagged-important .important-flag {
  position: absolute;
  top: 14px;
  left: -10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.22), 0 4px 14px rgba(239, 68, 68, 0.45);
  animation: importantPulse 2s ease-in-out infinite;
}
@keyframes importantPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.22), 0 4px 14px rgba(239, 68, 68, 0.45); }
  50%      { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0), 0 4px 14px rgba(239, 68, 68, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
  .block-flagged-important .important-flag { animation: none; }
}
/* TOC indicator on important entries */
.block-toc .toc-item--important .toc-title { color: #b91c1c; font-weight: 700; }
.block-toc .toc-important-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.20);
}

/* ===== ALERT / CALLOUT BLOCK =====
   Bright, friendly callout boxes for time-sensitive info — readers' eyes go to
   these first, like the colored boxes Child Nutrition uses for "Important!" */
.block-alert {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 18px;
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  border-left-width: 6px;
}
.block-alert .alert-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
}
.block-alert .alert-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.block-alert .alert-text {
  font-size: 0.95rem;
  line-height: 1.5;
}
.block-alert .alert-text p { margin: 0 0 8px; }
.block-alert .alert-text p:last-child { margin-bottom: 0; }
/* Variant palettes */
.block-alert--important {
  background: #fef3c7;       /* amber-100 */
  border-color: #f59e0b;     /* amber-500 */
  color: #78350f;            /* amber-900 */
}
.block-alert--important .alert-title { color: #78350f; }
.block-alert--heads-up {
  background: #dbeafe;       /* blue-100 */
  border-color: #3b82f6;     /* blue-500 */
  color: #1e3a8a;            /* blue-900 */
}
.block-alert--heads-up .alert-title { color: #1e3a8a; }
.block-alert--urgent {
  background: #fee2e2;       /* rose-100 */
  border-color: #ef4444;     /* red-500 */
  color: #7f1d1d;            /* red-900 */
}
.block-alert--urgent .alert-title { color: #7f1d1d; }
.block-alert--celebrate {
  background: #d1fae5;       /* mint-100 */
  border-color: #10b981;     /* mint-500 */
  color: #064e3b;            /* mint-900 */
}
.block-alert--celebrate .alert-title { color: #064e3b; }
/* Per-variant icon glow — colored halo behind the icon circle */
.block-alert--important .alert-icon {
  background: #fef3c7;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25), 0 4px 14px rgba(245, 158, 11, 0.35);
}
.block-alert--heads-up .alert-icon {
  background: #dbeafe;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 4px 14px rgba(59, 130, 246, 0.35);
}
.block-alert--urgent .alert-icon {
  background: #fee2e2;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.30), 0 4px 14px rgba(239, 68, 68, 0.45);
  animation: alertPulse 1.8s ease-in-out infinite;
}
.block-alert--celebrate .alert-icon {
  background: #d1fae5;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25), 0 4px 14px rgba(16, 185, 129, 0.35);
}
@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55), 0 4px 14px rgba(239, 68, 68, 0.45); }
  50%      { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0), 0 4px 14px rgba(239, 68, 68, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
  .block-alert--urgent .alert-icon { animation: none; }
}
@media (max-width: 600px) {
  .block-alert { grid-template-columns: 56px 1fr; padding: 14px 16px; gap: 12px; }
  .block-alert .alert-icon { width: 44px; height: 44px; font-size: 1.4rem; }
}

/* ===== LIGHTBOX (opt-in "click to enlarge") =====
   Pure CSS — uses :target so it works in Drupal body (no JS) and in exports. */
.has-lightbox .nl-zoom-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
  position: relative;
}
.has-lightbox .nl-zoom-link:hover .block-image,
.has-lightbox .nl-zoom-link:hover .block-banner-image {
  opacity: 0.94;
}
.nl-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 25, 38, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.nl-lightbox:target { display: flex; }
.nl-lightbox img {
  max-width: 95vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  display: block;
}
.nl-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}
.nl-lightbox-close:hover { background: #fff; }
/* Don't print the lightbox layer in PDF/HTML print */
@media print { .nl-lightbox { display: none !important; } }

.block-body {
  padding: 22px 26px;
}

/* ===== IMAGE POSITION OPTIONS =====
   Card blocks (News, Opportunity, Event Featured, Intro) support four
   image positions: banner (full-width above title), left, right, or none.
   The .block-card--* modifier on the block root selects the layout. */
/* Banner image — natural aspect ratio (so flyers display tall, photos display wide).
   Three width sizes; default is full (1/1). The image wrapper centers smaller sizes. */
.block-banner-wrap {
  display: flex;
  justify-content: center;
  background: var(--slate-100);
}
.block-banner-image {
  display: block;
  width: 100%;
  height: auto;
  background: var(--slate-100);
}
.block-banner-wrap--half .block-banner-image  { width: 50%; }
.block-banner-wrap--third .block-banner-image { width: 33.33%; }
@media (max-width: 600px) {
  .block-banner-wrap--half .block-banner-image,
  .block-banner-wrap--third .block-banner-image { width: 80%; }
}
/* Side image — show the WHOLE image (no cropping). It scales to the column
   width and keeps its natural height, with rounded corners. */
.block-image {
  width: 100%;
  background: var(--slate-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  align-self: start;
}
.block-image img {
  width: 100%;
  height: auto;
  display: block;
  /* Safety net for an extreme aspect ratio: never taller than this, and if it
     hits the cap, show the whole image (contain) rather than crop. */
  max-height: 460px;
  object-fit: contain;
}
/* Side image — sizes set the column width:
   - size-third: small thumbnail (160px)
   - size-half:  medium (220px) — default-ish
   - size-full:  large (320px) — still leaves text room */
.block-card--with-image-left .block-body,
.block-card--with-image-right .block-body {
  display: grid;
  gap: 22px;
  align-items: start;
}
.block-card--with-image-left.size-third .block-body  { grid-template-columns: 160px 1fr; }
.block-card--with-image-left.size-half .block-body   { grid-template-columns: 220px 1fr; }
.block-card--with-image-left.size-full .block-body   { grid-template-columns: 320px 1fr; }
.block-card--with-image-right.size-third .block-body { grid-template-columns: 1fr 160px; }
.block-card--with-image-right.size-half .block-body  { grid-template-columns: 1fr 220px; }
.block-card--with-image-right.size-full .block-body  { grid-template-columns: 1fr 320px; }
/* Fallback when no explicit size class is set */
.block-card--with-image-left .block-body  { grid-template-columns: 220px 1fr; }
.block-card--with-image-right .block-body { grid-template-columns: 1fr 220px; }
.block-card--with-image-right .block-body > .block-image {
  order: 2;
}
@media (max-width: 600px) {
  .block-card--with-image-left .block-body,
  .block-card--with-image-right .block-body,
  .block-card--with-image-left[class*='size-'] .block-body,
  .block-card--with-image-right[class*='size-'] .block-body {
    grid-template-columns: 1fr;
  }
  .block-card--with-image-right .block-body > .block-image {
    order: 0;
  }
}

/* ===== UNIFIED BUTTON STYLE =====
   All CTAs use the same dark-navy + teal-left-border treatment. The legacy
   .btn-outline class is preserved as an alias for backward-compat. */
/* Unified CTA button — every card uses the same one so all blocks match. The
   .newsletter-root prefix raises specificity above maine.gov's link styles, and
   the solid background means it never depends on the theme's <a> color. */
.newsletter-root .btn,
.newsletter-root .btn-outline {
  display: inline-block;
  background: var(--navy-mid);
  color: white;
  padding: 11px 22px;
  border: none;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-top: 4px;
}
.newsletter-root .btn:hover,
.newsletter-root .btn-outline:hover {
  background: var(--navy);
  color: white;
  text-decoration: none;
}

/* ===== NEWSLETTER HEADER BLOCK ===== */
.nl-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius);
  padding: 36px 36px 32px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-navy);
}
.nl-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-deep) 100%);
}
.nl-header::after {
  content: '';
  position: absolute;
  bottom: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.nl-header .nl-issue {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.nl-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 8px;
  max-width: 540px;
  color: #ffffff;
}
/* maine.gov's theme sets element-level colors on h1–h6 and links inside the
   content region; the .newsletter-root prefix raises our specificity so the
   brand colors win without !important. */
.newsletter-root .nl-header h1 { color: #ffffff; }
.newsletter-root .nl-header .nl-home-link,
.newsletter-root .nl-header .nl-home-link span { color: var(--teal); }
.newsletter-root .nl-header .nl-home-link:hover,
.newsletter-root .nl-header .nl-home-link:hover span { color: var(--navy); }
.nl-header .nl-team {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}
.nl-header .nl-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 5px 12px;
  background: rgba(66, 195, 247, 0.18);
  color: var(--teal);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(66, 195, 247, 0.30);
  transition: all 0.15s ease;
}
.nl-header .nl-home-link:hover {
  background: var(--teal);
  color: var(--navy);
  border-color: var(--teal);
  text-decoration: none;
}
.nl-header .nl-home-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.nl-header .nl-logos {
  position: absolute;
  top: 28px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 1;
}
.nl-header .nl-logo-chip {
  display: inline-flex;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.nl-header .nl-logo-img {
  display: block;
  width: auto;
  height: auto;
}
.nl-header .nl-logo-primary { max-height: 48px; max-width: 190px; }
.nl-header .nl-logo-secondary { max-height: 42px; max-width: 170px; }
@media (max-width: 600px) {
  .nl-header { padding: 28px 24px; }
  .nl-header h1 { font-size: 1.5rem; }
  .nl-header .nl-logos {
    position: static;
    flex-direction: row;
    align-items: center;
    margin-bottom: 16px;
  }
}

/* ===== INTRO BLOCK ===== */
.block-intro {
  background: var(--light-card);
  border: 1px solid var(--light-card-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.block-intro .block-body { padding: 22px 26px; }
.block-intro p {
  color: var(--slate-600);
  line-height: 1.65;
  margin-bottom: 12px;
}
.block-intro p:last-child { margin-bottom: 0; }

.block-intro--with-photo .block-body {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 22px;
  align-items: start;
}
.block-intro--with-photo .photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  flex-shrink: 0;
  overflow: hidden;
}
.block-intro--with-photo .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.block-intro--with-photo .photo svg {
  width: 60px;
  height: 60px;
  color: rgba(255,255,255,0.7);
}
@media (max-width: 600px) {
  .block-intro--with-photo .block-body {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .block-intro--with-photo .photo {
    margin: 0 auto;
    width: 100px;
    height: 100px;
  }
}

/* ===== EVENT BLOCK ===== */
.block-event {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.block-event:hover { box-shadow: var(--shadow); }

/* Event - Compact */
.block-event--compact {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
}
.block-event--compact .date-badge {
  background: var(--navy-mid);
  color: white;
  border-radius: var(--radius-sm);
  text-align: center;
  padding: 10px 8px;
  border-top: 3px solid var(--teal);
}
.block-event--compact .date-badge .nl-ev-month {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}
.block-event--compact .date-badge .nl-ev-day {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  margin-top: 2px;
}
.block-event--compact .info h4 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy-mid);
  margin-bottom: 4px;
  line-height: 1.3;
}
.block-event--compact .info .meta {
  font-size: 0.85rem;
  color: var(--slate-500);
}
.block-event--compact .info .ev-desc {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--slate-600);
  line-height: 1.5;
}
/* With a description the row gets taller — top-align so the badge/button don't float. */
.block-event--compact:has(.ev-desc) { align-items: start; }
.block-event--compact .btn-mini {
  background: var(--navy-mid);
  color: white;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border-left: 3px solid var(--teal);
  white-space: nowrap;
  transition: all 0.2s ease;
}
.block-event--compact .btn-mini:hover {
  background: var(--navy);
  color: white;
}
@media (max-width: 600px) {
  .block-event--compact {
    grid-template-columns: 70px 1fr;
    gap: 14px;
  }
  .block-event--compact .btn-mini {
    grid-column: 1 / -1;
    text-align: center;
  }
}

/* Event - Featured */
.block-event--featured .block-body {
  padding: 22px 26px;
}
.block-event--featured .ev-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.block-event--featured .ev-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
}
.block-event--featured .ev-chip svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.block-event--featured .ev-chip--type,
.block-event--featured .ev-chip--format {
  background: var(--navy-mid);
  color: white;
  border-left: 3px solid var(--teal);
  padding-left: 9px;
}
.block-event--featured p {
  color: var(--slate-600);
  margin-bottom: 18px;
  line-height: 1.6;
}
.block-event--featured .btn {
  display: inline-block;
  background: var(--navy-mid);
  color: white;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-left: 4px solid var(--teal);
  transition: all 0.2s ease;
}
.block-event--featured .btn:hover {
  background: var(--navy);
  color: white;
}

/* ===== OPPORTUNITY BLOCK ===== */
.block-opportunity {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-opportunity .block-body { padding: 22px 26px; }
.block-opportunity .opp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.block-opportunity .opp-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-amber-bg);
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
}
.block-opportunity .opp-tag svg {
  width: 13px;
  height: 13px;
}
.block-opportunity .deadline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-rose-bg);
  color: var(--accent-rose);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
}
.block-opportunity .deadline svg {
  width: 13px;
  height: 13px;
}
.block-opportunity p {
  color: var(--slate-600);
  margin-bottom: 16px;
  line-height: 1.6;
}
/* .btn-outline kept as a class name in render output; styles are unified
   in the .block-opportunity .btn-outline rule above (now solid navy). */

/* ===== NEWS BLOCK ===== */
.block-news {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-news .block-body { padding: 22px 26px; }
.block-news p {
  color: var(--slate-600);
  line-height: 1.6;
  margin-bottom: 12px;
}
.block-news .read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-deep);
  text-decoration: none;
}
.block-news .read-more:hover { color: var(--navy-mid); }
.block-news .read-more::after {
  content: '→';
  transition: transform 0.2s;
}
.block-news .read-more:hover::after { transform: translateX(3px); }

/* News with side image (when image is present and variant is 'side') */
.block-news--side .block-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  align-items: center;
}
.block-news--side .news-photo {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
}
.block-news--side .news-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.block-news--side .news-photo svg { width: 40px; height: 40px; }
@media (max-width: 600px) {
  .block-news--side .block-body { grid-template-columns: 1fr; }
  .block-news--side .news-photo { max-width: 100%; aspect-ratio: 16/9; }
}

/* ===== UPDATE BLOCK =====
   Like a "callout" — light card with title bar at top, optional left image. */
.block-update {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-update .block-body { padding: 18px 24px; }
.block-update .update-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.block-update .update-row.no-media { grid-template-columns: 1fr; }
.block-update .update-media {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--navy-mid);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border-left: 3px solid var(--teal);
}
.block-update .update-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.block-update .update-media svg { width: 22px; height: 22px; }
/* When the media is an uploaded IMAGE (not an icon), give it a real thumbnail
   size instead of the tiny icon square. */
.block-update .update-media--img {
  width: 150px;
  height: 110px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
}
@media (max-width: 600px) {
  .block-update .update-row { grid-template-columns: 1fr; }
  .block-update .update-media--img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
}
.block-update p {
  font-size: 1rem;            /* match the other card body text */
  color: var(--slate-600);
  line-height: 1.6;
  margin: 0 0 12px;
}
.block-update p:last-child { margin-bottom: 0; }
.block-update a {
  color: var(--teal-deep);
  font-weight: 600;
  text-decoration: none;
}
.block-update a:hover { text-decoration: underline; }

/* ===== RESOURCE BLOCK ===== */
.block-resources {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.block-resources .res-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
/* THEME-PROOF: FLEXBOX (not grid) for the resource-item row. Grid had subtle
   "min-content floor" issues where the widest word pinned the middle column;
   flex handles narrow containers more predictably. Selector uses `a.res-item`
   (tag+class) so it beats any theme rule like `.field a` on specificity. */
#newsletter-root .block-resources a.res-item,
#newsletter-root .block-resources .res-item,
.newsletter-root .block-resources a.res-item,
.block-resources .res-item {
  padding: 20px 26px;
  border-bottom: 1px solid var(--slate-100);
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 18px;
  text-decoration: none !important;
  color: inherit;
  transition: background 0.15s ease;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  float: none !important;
  white-space: normal !important;
  box-sizing: border-box;
}
/* Icon = fixed 36px width AND flex-basis. maine.gov theme often sets
   `width: 100%` on all divs inside body content — we need explicit width
   overrides, not just flex properties, because `width` beats `flex-basis`
   when both are set. */
#newsletter-root .block-resources .res-item > .res-icon,
.block-resources .res-item > .res-icon {
  flex: 0 0 36px !important;
  width: 36px !important;
  max-width: 36px !important;
}
/* Content column = grows to fill. Now targets .res-body specifically since
   the render uses spans (Drupal CKEditor strips <div> from inside <a>). */
#newsletter-root .block-resources .res-item > .res-body,
.block-resources .res-item > .res-body {
  display: block !important;   /* span defaults to inline; make it a real block */
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  clear: none !important;
  float: none !important;
}
/* Name/desc/meta are spans now too — make them stack vertically inside
   .res-body by forcing display: block. */
#newsletter-root .block-resources .res-item .res-name,
#newsletter-root .block-resources .res-item .res-desc,
#newsletter-root .block-resources .res-item .res-meta,
.block-resources .res-item .res-name,
.block-resources .res-item .res-desc,
.block-resources .res-item .res-meta {
  display: block !important;
}
/* Arrow = fixed auto width, non-shrinking */
#newsletter-root .block-resources .res-item > .res-arrow,
.block-resources .res-item > .res-arrow {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  clear: none !important;
  float: none !important;
}
#newsletter-root .block-resources .res-item:hover,
.block-resources .res-item:hover {
  background: var(--slate-50);
}
.block-resources .res-item:last-child { border-bottom: none; }
#newsletter-root .block-resources .res-icon,
.block-resources .res-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--navy-mid);
  color: var(--teal);
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-left: 3px solid var(--teal);
  flex-shrink: 0;
}
.block-resources .res-icon svg {
  width: 16px;
  height: 16px;
}
.block-resources .res-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy-mid);
  line-height: 1.3;
  margin-bottom: 2px;
}
.block-resources .res-desc {
  font-size: 0.82rem;
  color: var(--slate-500);
  line-height: 1.45;
}
.block-resources .res-meta {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy-mid);
  background: rgba(12, 25, 38, 0.06);
  padding: 1px 7px;
  border-radius: 4px;
}
.block-resources .res-arrow {
  color: var(--slate-400);
  font-size: 1.2rem;
}
@media (max-width: 600px) {
  /* Res-item is now flex (see rule above); shrink the icon a bit and hide
     the arrow on narrow screens. No grid-template-columns needed. */
  #newsletter-root .block-resources .res-item > .res-icon,
  .block-resources .res-item > .res-icon {
    flex: 0 0 32px !important;
  }
  .block-resources .res-arrow { display: none; }
}

/* ===== SPOTLIGHT BLOCK =====
   For recognizing a person, school, or program — celebratory style with
   optional photo (banner/left/right). Uses cyan as the type accent. */
.block-spotlight {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-spotlight .block-body { padding: 22px 26px; }
.block-spotlight .spotlight-subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0891b2;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.block-spotlight p {
  color: var(--slate-600);
  line-height: 1.65;
  margin-bottom: 14px;
}
.block-spotlight .read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal-deep);
  text-decoration: none;
}
.block-spotlight .read-more:hover { color: var(--navy-mid); }
.block-spotlight .read-more::after { content: '→'; transition: transform 0.2s; }
.block-spotlight .read-more:hover::after { transform: translateX(3px); }

/* ===== PULL QUOTE BLOCK =====
   Subtle, no title bar — just a styled quote with attribution. Uses the
   Source Serif 4 font (already loaded) for editorial weight. */
.block-quote {
  background: white;
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 28px 36px 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.block-quote .quote-mark {
  position: absolute;
  top: 6px;
  left: 24px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 4.6rem;
  font-weight: 700;
  color: var(--teal);
  opacity: 0.5;
  line-height: 1;
  font-style: normal;
  pointer-events: none;
  user-select: none;
}
.block-quote blockquote {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 400;
  color: var(--navy-mid);
  line-height: 1.5;
  margin: 12px 0 16px 28px;
  letter-spacing: -0.005em;
}
.block-quote cite {
  display: block;
  margin-left: 28px;
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.005em;
}
.block-quote .cite-role {
  display: block;
  font-weight: 500;
  color: var(--slate-500);
  font-size: 0.78rem;
  margin-top: 2px;
}

/* ===== STATS BLOCK =====
   Big-number callouts in a responsive grid. Uses indigo as the type accent. */
.block-stats {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-stats .block-body { padding: 22px 26px; }
.block-stats .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.block-stats .stat-item {
  text-align: center;
  padding: 20px 12px 18px;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  border: 2px solid #6366f1;          /* full indigo/purple border */
}
.block-stats .stat-number {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.block-stats .stat-icon {
  display: inline-flex;
  align-items: center;
  color: #6366f1;
}
.block-stats .stat-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}
.block-stats .stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--slate-600);
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 600px) {
  .block-stats .stats-grid { grid-template-columns: 1fr 1fr; }
  .block-stats .stat-number { font-size: 1.9rem; }
}

/* ===== TABLE OF CONTENTS BLOCK ===== */
.block-toc {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-toc .block-body { padding: 12px 26px 22px; }
.block-toc .toc-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.block-toc .toc-item {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 14px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--navy-mid);
  transition: all 0.15s ease;
}
.block-toc .toc-item:hover {
  background: var(--slate-50);
  color: var(--navy);
}
.block-toc .toc-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--navy-mid);
  color: var(--teal);
  font-weight: 800;
  font-size: 1.25rem;
  border-radius: var(--radius-sm);
  border-top: 3px solid var(--teal);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.block-toc .toc-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.block-toc .toc-type {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  width: max-content;
  background: rgba(66, 195, 247, 0.20);
  color: var(--teal-deep);
}
/* TOC type pills — semi-transparent on white card, darker text for readability.
   Same hue family as the title-bar tag pills. */
.block-toc .toc-type--event       { background: rgba(34, 197, 94, 0.20);  color: #15803d; }
.block-toc .toc-type--news        { background: rgba(168, 85, 247, 0.18); color: #7e22ce; }
.block-toc .toc-type--opportunity { background: rgba(251, 146, 60, 0.22); color: #c2410c; }
.block-toc .toc-type--update      { background: rgba(245, 158, 11, 0.25); color: #b45309; }
.block-toc .toc-type--resources   { background: rgba(236, 72, 153, 0.22); color: #be185d; }
.block-toc .toc-type--spotlight   { background: rgba(6, 182, 212, 0.22);  color: #0e7490; }
.block-toc .toc-type--stats       { background: rgba(99, 102, 241, 0.20); color: #4338ca; }
.block-toc .toc-type--intro       { background: rgba(66, 195, 247, 0.22); color: var(--teal-deep); }
.block-toc .toc-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
}
@media (max-width: 600px) {
  .block-toc .toc-list { grid-template-columns: 1fr; }
}

/* ===== SECTION HEADER BLOCK ===== */
.block-section-header {
  padding: 18px 0 14px;
  border-bottom: 2px solid var(--slate-200);
  display: flex;
  align-items: center;
  gap: 14px;
}
.block-section-header::before {
  content: '';
  width: 32px;
  height: 3px;
  background: var(--teal);
  border-radius: 2px;
  flex-shrink: 0;
}
.block-section-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* ===== FOOTER BLOCK ===== */
.block-footer {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-navy);
  position: relative;
  overflow: hidden;
}
.block-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-deep) 100%);
}

/* Brand row: Maine DOE logo + Team logo, side by side */
.block-footer .footer-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.block-footer .brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}
.block-footer .brand-mark img {
  max-height: 48px;
  max-width: 140px;
  width: auto;
  height: auto;
  display: block;
}
/* White chip behind the official Maine DOE logo (it has a white background, so
   it needs a light surface on the dark footer). */
.block-footer .footer-logo-chip {
  display: inline-flex;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.block-footer .footer-logo-chip img {
  display: block;
  max-height: 44px;
  max-width: 160px;
  width: auto;
  height: auto;
}
.block-footer .brand-mark-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.block-footer .brand-mark--doe .brand-mark-text {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.block-footer .brand-mark--doe .brand-mark-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 2px;
}
.block-footer .brand-mark--team {
  text-align: right;
}
.block-footer .brand-mark--team .brand-mark-text {
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}
.block-footer .brand-mark--team .brand-mark-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
}

/* Heading + intro section */
.block-footer h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.block-footer .footer-intro {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 18px;
  line-height: 1.55;
}

/* Liaison grid */
.block-footer .liaison-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 22px;
}
.block-footer .liaison {
  font-size: 0.85rem;
  line-height: 1.5;
}
.block-footer .liaison .name {
  color: var(--teal);
  font-weight: 600;
  display: block;
}
.block-footer .liaison .region {
  color: rgba(255,255,255,0.65);
  font-size: 0.78rem;
  display: block;
}
.block-footer a {
  color: var(--teal);
  text-decoration: none;
}
.block-footer a:hover { text-decoration: underline; }

/* Contact + social row */
.block-footer .footer-contact-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.block-footer .footer-contact {
  font-size: 0.82rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
}
.block-footer .footer-contact-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.block-footer .footer-contact-line svg {
  width: 14px;
  height: 14px;
  color: var(--teal);
  flex-shrink: 0;
}
.block-footer .footer-contact a {
  color: rgba(255,255,255,0.92);
  font-weight: 500;
}
.block-footer .footer-contact a:hover { color: var(--teal); text-decoration: none; }

.block-footer .socials {
  display: flex;
  gap: 8px;
}
.block-footer .social-link {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(66, 195, 247, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  transition: all 0.15s ease;
  border: 1px solid rgba(66, 195, 247, 0.30);
}
.block-footer .social-link:hover {
  background: var(--teal);
  color: var(--navy);
  border-color: var(--teal);
  text-decoration: none;
}
.block-footer .social-link svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 600px) {
  .block-footer { padding: 24px; }
  .block-footer .liaison-grid { grid-template-columns: 1fr; }
  .block-footer .footer-brand-row { flex-direction: column; align-items: flex-start; }
  .block-footer .brand-mark--team { text-align: left; }
  .block-footer .brand-mark--team .brand-mark-text { text-align: left; }
  .block-footer .footer-contact-row { flex-direction: column; align-items: flex-start; }
}

/* ===== MOBILE TWEAKS ===== */
@media (max-width: 600px) {
  .newsletter-wrap { padding: 0 16px; }
  .block-body { padding: 20px 22px; }
  .block-footer { padding: 22px; }
}

/* ===== PRINT STYLESHEET ===== */
@media print {
  .newsletter-root {
    background: white;
    font-size: 11pt;
  }
  .nl-header,
  .block-footer {
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .block-event,
  .block-opportunity,
  .block-news,
  .block-resources {
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .nl-header,
  .block-footer {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .newsletter-wrap {
    max-width: 100%;
    padding: 0;
  }
}
