/* ═══════════════════════════════════════════════════════════════════════
   LETLOU ENERGY — SHARED COMPONENTS
   Loaded after LetlouGlobal.css, before any section file.
   Defines every reusable pattern once. Section files may apply a
   --modifier class for section-specific overrides but must NOT
   re-implement the base pattern.

   Contents
   ────────
   1. Buttons        .btn-primary / .btn-ghost / .btn-navy / .btn-outline
   2. Eyebrow labels .eyebrow
   3. Section labels .section-label
   4. Minimum font-size floor (0.65rem)
   5. RSS Links
   6. Modal Styles   .article-overlay, .article-modal, etc. (shared)
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   1. BUTTONS
   ═══════════════════════════════════════════════════════════════ */

/* ── Primary (amber fill, navy text) ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-amber);
  color: var(--color-navy);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  padding: 0.8rem 1.75rem;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
  background: var(--color-amber-hover);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.btn-primary--pill {
  border-radius: 99px;
}

.btn-primary--elevated:hover {
  box-shadow: 0 6px 20px color-mix(in srgb, var(--color-amber) 30%, transparent);
}

.btn-primary--sm {
  font-size: 0.8rem;
  padding: 0.6rem 1.2rem;
}

/* ── Ghost (transparent, white border, on dark backgrounds) ── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  padding: 0.8rem 1.75rem;
  text-decoration: none;
  border: 1.5px solid color-mix(in srgb, white 55%, transparent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.btn-ghost:hover {
  border-color: var(--color-amber);
  color: var(--color-amber);
  transform: translateY(-2px);
}

.btn-ghost:active {
  transform: translateY(0);
}

.btn-ghost:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}

.btn-ghost--pill {
  border-radius: 99px;
}

/* ── Navy fill (dark CTA, light text) ── */
.btn-navy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--color-navy);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-navy:hover {
  background: var(--color-navy-darker);
  transform: translateY(-1px);
}

.btn-navy:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}

.btn-navy--pill {
  border-radius: 99px;
}

/* ── Outline / subtle (light bg, bordered) ── */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.65rem 1.1rem;
  text-decoration: none;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.btn-outline:hover {
  border-color: var(--color-amber);
  color: var(--color-navy);
}

.btn-outline:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}

.btn-outline--pill {
  border-radius: 99px;
}

/* ═══════════════════════════════════════════════════════════════
   2. EYEBROW LABELS
   ═══════════════════════════════════════════════════════════════ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-amber);
  margin-bottom: 0.6rem;
}

.eyebrow::before {
  content: '';
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--color-amber);
  flex-shrink: 0;
}

.eyebrow--lg {
  font-size: 0.78rem;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.eyebrow--lg::before {
  width: 28px;
  height: 2px;
}

.eyebrow--pill {
  background: var(--color-amber-tint);
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
  gap: 0;
}

.eyebrow--pill::before {
  display: none;
}

.eyebrow--muted {
  color: var(--color-text-hint);
}

.eyebrow--muted::before {
  background: var(--color-text-hint);
}

.eyebrow--bare::before {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   3. SECTION LABELS
   ═══════════════════════════════════════════════════════════════ */

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-hint);
  margin-bottom: 1rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-soft);
}

.section-label--bare::after {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   4. MINIMUM FONT-SIZE FLOOR
   ═══════════════════════════════════════════════════════════════ */

.footer-legal-sep {
  font-size: 0.65rem;
}

/* .footer-legal-links a font-size is set to 0.65rem in LetlouFooter.css — no breakpoint needed */

/* ═══════════════════════════════════════════════════════════════
   5. RSS / SUBSCRIBE LINK
   ═══════════════════════════════════════════════════════════════ */

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-amber);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  transition: opacity var(--transition-fast);
}

.rss-link:hover {
  opacity: 0.8;
}

.rss-link:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
  border-radius: 2px;
}

.rss-link i,
.rss-link svg {
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   6. SITEWIDE ARTICLE/PROJECT MODAL — Featured Project Style
   Used by LetlouSearch.js (search modal) and LetlouNewsPortal.js
   (<dialog> modal on news.html).
   ═══════════════════════════════════════════════════════════════ */

/* ── Modal Shell ── */
/* ── Search detail modal — native <dialog> ──────────────────────
   POSITIONING STRATEGY: Do NOT fight the UA stylesheet on <dialog>.
   Chrome, Firefox and Safari all apply conflicting default margin/
   position rules to <dialog> that break inset:0 + flexbox centering.

   Instead:
   · <dialog> is left in its UA-default position (acts as backdrop host only)
   · .article-modal is positioned INDEPENDENTLY with position:fixed +
     translate(-50%,-50%) from the viewport centre — this always works
   · Backdrop-click: dialog padding provides the click target;
     JS checks e.target === dialog to close                          */

dialog.article-overlay:not([open]) {
  display: none;
}

/* Dialog shell — transparent, full-viewport, backdrop only.
   No flex, no inset override — let the UA do its thing here. */
dialog.article-overlay {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  /* Cover the full viewport so padding area catches backdrop clicks.
     100% is correct here — the dialog is position:fixed with inset:0,
     so 100% resolves to the viewport size without the scrollbar-bleed
     that 100vw causes when a scrollbar is present. */
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  z-index: 3000;
  /* Pointer events on the dialog shell itself = backdrop click zone */
  pointer-events: auto;
}

dialog.article-overlay::backdrop {
  background: color-mix(in srgb, var(--color-navy-deep) 75%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Modal Container — self-centering, independent of <dialog> ── */
.article-modal {
  /* Fixed to viewport centre — completely independent of dialog position */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3001; /* one above the dialog shell */

  background: #fff;
  /* min(100% - 2rem, 760px): on narrow phones this gives full width minus 1rem
     each side; on wider screens it caps at 760px. Uses 100% not 100vw to avoid
     scrollbar-bleed (100vw includes scrollbar width on desktop). */
  width: min(100% - 2rem, 760px);
  max-width: 760px;
  max-height: min(90dvh, 900px);
  border-radius: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 64px color-mix(in srgb, var(--color-navy) 28%, transparent);

  /* Prevent clicks on modal from bubbling up to dialog (backdrop close) */
  pointer-events: auto;
}

/* Wider on large screens (≥1024px desktop, TV) */
@media (min-width: 1024px) {
  .article-modal {
    max-width: min(900px, 90vw);
  }
}

/* Extra wide: cap at a comfortable reading width even on very large screens */
@media (min-width: 1600px) {
  .article-modal {
    max-width: min(960px, 80vw);
  }
}

/* Mobile (≤480px) — full-width sheet slides up from bottom */
@media (max-width: 480px) {
  .article-modal {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
  }
}

/* Enter animation — applied to .article-modal, not the dialog */
dialog.article-overlay[open] .article-modal {
  animation: modal-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-enter {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Mobile slide-up animation */
@media (max-width: 480px) {
  dialog.article-overlay[open] .article-modal {
    animation: modal-slide-up 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes modal-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.article-overlay[open] .article-modal { animation: none; }
}

/* Remove now-unused backdrop div */
.article-overlay-backdrop { display: none; }

/* ── Close Button ── */
.article-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, white 20%, transparent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s;
}

.article-modal-close:hover {
  background: var(--color-amber, #F8A61F);
  color: var(--color-navy, #122C4B);
}

.article-modal-close:focus-visible {
  outline: 2px solid var(--color-amber, #F8A61F);
  outline-offset: 2px;
}

/* ── Modal Header (Hero Image) ── */
.article-modal-header {
  position: relative;
  height: clamp(220px, 35vh, 380px);
  background-color: var(--color-navy, #122C4B);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

.article-modal-header.no-image {
  background: linear-gradient(135deg, var(--color-navy, #122C4B), var(--color-navy-deep, #0a1a2e));
}

.article-modal-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--color-navy-deep) 92%, transparent) 0%, transparent 60%);
  z-index: 1;
}

.article-modal-header-text {
  position: relative;
  z-index: 2;
  width: 100%;
}

/* ── Top Badges ── */
.modal-top-badges {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 5;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.badge-featured {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-amber, #F8A61F);
  background: color-mix(in srgb, var(--color-amber) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-amber) 35%, transparent);
  padding: 0.22rem 0.7rem;
  border-radius: 99px;
  backdrop-filter: blur(6px);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.7rem;
  border-radius: 99px;
  backdrop-filter: blur(6px);
  background: color-mix(in srgb, white 12%, transparent);
  border: 1px solid color-mix(in srgb, white 25%, transparent);
  color: #fff;
}

.status-badge.development {
  background: color-mix(in srgb, var(--color-amber) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-amber) 30%, transparent);
  color: var(--color-amber, #F8A61F);
}

.status-badge.financial-close {
  background: rgba(124, 156, 255, 0.18);
  border: 1px solid rgba(124, 156, 255, 0.35);
  color: #b9c8ff;
}

.status-badge.construction {
  background: rgba(255, 148, 77, 0.18);
  border: 1px solid rgba(255, 148, 77, 0.35);
  color: #ffb27a;
}

.status-badge.commissioning {
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

.status-badge.operations {
  background: color-mix(in srgb, var(--color-teal) 25%, transparent);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #6ee7b7;
}

.status-badge.decommissioning {
  background: color-mix(in srgb, white 8%, transparent);
  border: 1px solid color-mix(in srgb, white 20%, transparent);
  color: color-mix(in srgb, white 65%, transparent);
}

.status-badge.feasibility {
  background: color-mix(in srgb, white 8%, transparent);
  border: 1px solid color-mix(in srgb, white 20%, transparent);
  color: color-mix(in srgb, white 65%, transparent);
}

/* ── Bottom Badge (Mandate Pill) ── */
.modal-bottom-badge {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 5;
}

.mandate-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  backdrop-filter: blur(8px);
}

.mandate-pill.oe {
  background: color-mix(in srgb, var(--color-teal) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-teal) 55%, transparent);
  color: #6ee7c7;
}

.mandate-pill.lta {
  background: color-mix(in srgb, var(--color-purple) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-purple) 55%, transparent);
  color: #c7c2ff;
}

.mandate-pill.ie {
  background: rgba(113, 43, 19, 0.35);
  border: 1px solid rgba(113, 43, 19, 0.55);
  color: #ffb89c;
}

.mandate-pill.ta {
  background: rgba(14, 116, 144, 0.35);
  border: 1px solid rgba(14, 116, 144, 0.55);
  color: #7dd3e8;
}

.mandate-pill.advisory {
  background: rgba(99, 56, 6, 0.35);
  border: 1px solid rgba(99, 56, 6, 0.55);
  color: #ffd699;
}

/* ── Header Text ── */
.article-modal-header-text .modal-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.article-modal-header-text .modal-tech-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.7rem;
  border-radius: 99px;
}

.modal-tech-chip.solar {
  background: color-mix(in srgb, var(--color-amber) 20%, transparent);
  color: var(--color-amber, #F8A61F);
}

.modal-tech-chip.biogas {
  background: color-mix(in srgb, var(--color-teal) 20%, transparent);
  color: #6ee7b7;
}

.modal-tech-chip.wind {
  background: rgba(14, 110, 86, 0.2);
  color: #6ee7b7;
}

.modal-tech-chip.storage {
  background: color-mix(in srgb, var(--color-purple) 20%, transparent);
  color: #c4b5fd;
}

.modal-tech-chip.hybrid {
  background: color-mix(in srgb, var(--color-amber) 12%, transparent);
  color: var(--color-amber, #F8A61F);
}

.modal-tech-chip.biomass {
  background: color-mix(in srgb, var(--color-purple) 12%, transparent);
  color: #c4b5fd;
}

.modal-tech-chip.csp {
  background: rgba(29, 100, 170, 0.15);
  color: #7ab8f5;
}

.modal-tech-chip.gas {
  background: rgba(153, 60, 29, 0.15);
  color: #ffb89c;
}

.modal-tech-chip.coal {
  background: color-mix(in srgb, white 10%, transparent);
  color: color-mix(in srgb, white 70%, transparent);
}

/* ── News meta (date, read time) ── */
.modal-news-date,
.modal-news-readtime {
  font-size: 0.75rem;
  color: color-mix(in srgb, white 70%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.modal-news-date i,
.modal-news-readtime i {
  color: var(--color-amber, #F8A61F);
  font-size: 0.7rem;
}

.article-modal-header-text h2 {
  color: #fff !important;
  margin: 0.25rem 0 0.25rem;
  font-family: var(--font-display, 'Georgia', serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.2;
}

.modal-location {
  color: color-mix(in srgb, white 70%, transparent);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.modal-location i {
  color: var(--color-amber, #F8A61F);
  font-size: 0.7rem;
}

/* ── News Tag (in meta) ── */
.news-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  border: 1px solid currentColor;
}

/* ── Modal Body ── */
.article-modal-body {
  padding: 2rem 2rem 2.5rem;
}

.article-modal-body .modal-summary {
  font-size: 0.95rem;
  color: var(--color-text, #333);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.article-modal-body .article-author {
  font-size: 0.85rem;
  color: var(--color-text-muted, #5F5E5A);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border-soft, color-mix(in srgb, black 7%, transparent));
}

.article-modal-body .img-credit {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-hint, #696862);
  font-style: italic;
  margin-bottom: 1.5rem;
  text-align: right;
  border-bottom: 1px solid var(--color-border-soft, color-mix(in srgb, black 7%, transparent));
  padding-bottom: 0.5rem;
}

.article-modal-body .img-credit i {
  color: var(--color-amber, #F8A61F);
  margin-right: 4px;
}

/* ── News Body ── */
#sd-news-body h3 {
  font-family: var(--font-display, 'Georgia', serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text, #111);
  margin: 1.5rem 0 0.5rem;
}

#sd-news-body p {
  font-size: 0.97rem;
  color: var(--color-text-mid, #333);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ── Project Specs ── */
.modal-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.modal-spec {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  background: var(--color-off-white, #f4f6f9);
  border: 1px solid var(--color-border-soft, color-mix(in srgb, black 6%, transparent));
  border-radius: 99px;
  color: var(--color-text-muted, #444);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.modal-spec i {
  color: var(--color-amber, #F8A61F);
  font-size: 0.6rem;
}

/* ── Stage Status (replaces Stage Rail) ── */
/* Compact badge + "Stage N of 7" fraction + thin progress bar.
   Works at every viewport width — no truncation possible. */
.modal-stage-status {
  margin: 1.25rem 0 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--color-off-white, #f8f9fa);
  border-radius: 8px;
  border: 1px solid var(--color-border-soft, color-mix(in srgb, black 5%, transparent));
}

.modal-stage-status__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-hint, #696862);
  display: block;
  margin-bottom: 0.55rem;
}

.modal-stage-status__body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* The stage name badge — reuses existing .status-badge colour tokens
   but rendered on a light background, so we override colours here */
.modal-stage-status__badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.28rem 0.85rem;
  border-radius: 99px;
  /* Colour overrides per stage — on light bg so inverted from hero badge */
  background: color-mix(in srgb, var(--color-amber) 12%, transparent);
  color: var(--color-amber-dark);
  border: 1px solid color-mix(in srgb, var(--color-amber) 30%, transparent);
}

.modal-stage-status__badge[data-stage="feasibility"] {
  background: rgba(100, 100, 120, 0.1);
  color: var(--color-text-mid);
  border-color: rgba(100, 100, 120, 0.2);
}
.modal-stage-status__badge[data-stage="development"] {
  background: color-mix(in srgb, var(--color-amber) 12%, transparent);
  color: var(--color-amber-dark);
  border-color: color-mix(in srgb, var(--color-amber) 30%, transparent);
}
.modal-stage-status__badge[data-stage="financialClose"],
.modal-stage-status__badge[data-stage="financial-close"] {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-indigo-hover);
  border-color: rgba(99, 102, 241, 0.25);
}
.modal-stage-status__badge[data-stage="construction"] {
  background: rgba(234, 88, 12, 0.1);
  color: var(--color-stage-construction);
  border-color: rgba(234, 88, 12, 0.25);
}
.modal-stage-status__badge[data-stage="commissioning"] {
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-stage-commissioning);
  border-color: rgba(124, 58, 237, 0.25);
}
.modal-stage-status__badge[data-stage="operations"] {
  background: color-mix(in srgb, var(--color-teal) 10%, transparent);
  color: var(--teal-600, var(--color-teal));
  border-color: color-mix(in srgb, var(--color-teal) 25%, transparent);
}
.modal-stage-status__badge[data-stage="decommissioning"] {
  background: rgba(100, 100, 100, 0.1);
  color: var(--color-text-muted);
  border-color: rgba(100, 100, 100, 0.2);
}

/* "Stage N of 7" fraction text */
.modal-stage-status__fraction {
  font-size: 0.75rem;
  color: var(--color-text-hint, #696862);
  font-weight: 500;
  white-space: nowrap;
  margin-left: auto;
}

/* Thin progress bar — full width beneath badge row */
.modal-stage-status__bar {
  width: 100%;
  height: 4px;
  background: var(--color-border, #e0e0e0);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.5rem;
  flex-basis: 100%; /* force onto its own line when flex-wrap fires */
}

.modal-stage-status__fill {
  height: 100%;
  background: var(--color-amber, #F8A61F);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* Green fill for completed stages */
.modal-stage-status__fill[data-stage="operations"],
.modal-stage-status__fill[data-stage="commissioning"] {
  background: var(--teal-600, var(--color-teal));
}

/* ── Portfolio Note (kept — still used for multi-site projects) ── */
.modal-portfolio-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: color-mix(in srgb, var(--color-amber) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-amber) 15%, transparent);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--color-text-muted, #5F5E5A);
}

.modal-portfolio-note i {
  color: var(--color-amber, #F8A61F);
  font-size: 0.85rem;
}

/* ── Deliverables ── */
.modal-deliverables {
  margin: 1.25rem 0 0.5rem;
}

.modal-deliverables__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-hint, #696862);
  display: block;
  margin-bottom: 0.5rem;
}

.modal-deliverable-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.modal-deliverable-chip {
  font-size: 0.67rem;
  font-weight: 500;
  padding: 0.18rem 0.62rem;
  background: var(--color-off-white, #f4f6f9);
  border: 1px solid var(--color-border-soft, color-mix(in srgb, black 7%, transparent));
  border-radius: 99px;
  color: var(--color-text-muted, #5F5E5A);
}

/* ── Role Pill ── */
.modal-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal-600, var(--color-teal));
  background: var(--teal-50, #dff2ec);
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  margin: 0.75rem 0 0.25rem;
}

.modal-role-pill i {
  font-size: 0.68rem;
}

/* ── Related Projects ── */
.modal-project-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--color-teal) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-teal) 18%, transparent);
  border-radius: 8px;
  margin-top: 1.5rem;
}

.modal-project-links__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-600, var(--color-teal));
}

.modal-project-links__label i {
  font-size: 0.75rem;
}

.modal-project-links__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal-600, var(--color-teal));
  text-decoration: none;
  border-bottom: 1.5px solid var(--teal-600, var(--color-teal));
  padding-bottom: 1px;
  transition: opacity 0.15s;
}

.modal-project-links__cta:hover {
  opacity: 0.75;
}

.modal-project-links__cta i {
  font-size: 0.7rem;
}

/* ── Share Row ── */
.modal-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.25rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--color-border-soft, color-mix(in srgb, black 7%, transparent));
}

.modal-share-row__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-share-row__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-hint, #696862);
}

.modal-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}

.modal-share-btn:hover {
  transform: translateY(-2px);
}

.modal-share-btn--linkedin {
  background: #0A66C2;
  color: #fff;
}

.modal-share-btn--linkedin:hover {
  background: #084e96;
}

.modal-share-btn--copy {
  background: var(--color-off-white, #f0f0f0);
  color: var(--color-navy, #122C4B);
}

.modal-share-btn--copy:hover {
  background: var(--color-border-soft, #e0e0e0);
}

.modal-share-btn:focus-visible {
  outline: 2px solid var(--color-amber, #F8A61F);
  outline-offset: 2px;
}

/* ── Modal CTA ── */
.modal-cta-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-amber, #F8A61F);
  color: var(--color-navy, #122C4B);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.5rem 1.1rem;
  text-decoration: none;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
  flex-shrink: 0;
}

.modal-cta-inline:hover {
  background: var(--color-amber-hover, #E09310);
  transform: translateY(-2px);
}

.modal-cta-inline:focus-visible {
  outline: 2px solid var(--color-navy, #122C4B);
  outline-offset: 2px;
}

.modal-cta-inline i {
  font-size: 0.7rem;
}

/* ── Similar Projects Row (projects only — between body and share row) ── */
.sd-similar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--color-teal) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-teal) 15%, transparent);
  border-radius: 8px;
  margin: 1.25rem 0 0;
}

.sd-similar-row__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-600, var(--color-teal));
}

.sd-similar-row__label i {
  font-size: 0.75rem;
}

.sd-similar-row__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal-600, var(--color-teal));
  text-decoration: none;
  border-bottom: 1.5px solid var(--teal-600, var(--color-teal));
  padding-bottom: 1px;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.sd-similar-row__cta:hover { opacity: 0.7; }
.sd-similar-row__cta i { font-size: 0.7rem; }

/* ── Spec Pills (project modal — capacity + key facts) ── */
.sd-spec-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}

.sd-spec-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  background: var(--color-off-white, #f4f6f9);
  border: 1px solid var(--color-border-soft, color-mix(in srgb, black 7%, transparent));
  border-radius: 99px;
  color: var(--color-text-muted, #5F5E5A);
}

.sd-spec-pill i { font-size: 0.68rem; }

/* Tech-coloured primary pill */
.sd-spec-pill--tech.solar  { background: color-mix(in srgb, var(--color-amber) 10%, transparent); color: var(--color-amber-dark); border-color: color-mix(in srgb, var(--color-amber) 30%, transparent); }
.sd-spec-pill--tech.wind   { background: color-mix(in srgb, var(--color-teal) 10%, transparent);  color: var(--color-teal); border-color: color-mix(in srgb, var(--color-teal) 25%, transparent); }
.sd-spec-pill--tech.storage { background: color-mix(in srgb, var(--color-purple) 10%, transparent); color: var(--color-purple); border-color: color-mix(in srgb, var(--color-purple) 25%, transparent); }
.sd-spec-pill--tech.biogas { background: color-mix(in srgb, var(--color-teal) 10%, transparent);  color: var(--color-teal); border-color: color-mix(in srgb, var(--color-teal) 25%, transparent); }
.sd-spec-pill--tech.hybrid { background: color-mix(in srgb, var(--color-amber) 10%, transparent); color: var(--color-amber-dark); border-color: color-mix(in srgb, var(--color-amber) 30%, transparent); }
.sd-spec-pill--tech.csp    { background: rgba(29,100,170,0.1); color: #185FA5; border-color: rgba(29,100,170,0.25); }
.sd-spec-pill--tech.coal,
.sd-spec-pill--tech.gas    { background: rgba(100,100,100,0.1); color: var(--color-text-muted);   border-color: rgba(100,100,100,0.2); }

/* ── Share Pills (sd-share-pill) ── */
/* Used in both #searchDetailOverlay and #articleDialog share rows.
   Replaces old .share-btn and .article-share-btn classes. */
.sd-share-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.9rem;
  border-radius: 99px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
  border: none;
}

.sd-share-pill:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.sd-share-pill:focus-visible {
  outline: 2px solid var(--color-amber, #F8A61F);
  outline-offset: 2px;
}

.sd-share-pill--linkedin {
  background: #0A66C2;
  color: #fff;
}

.sd-share-pill--copy {
  background: var(--color-off-white, #f0f2f5);
  color: var(--color-navy, #122C4B);
  border: 1px solid var(--color-border-soft, color-mix(in srgb, black 8%, transparent));
}

.sd-share-pill--copy:hover {
  background: var(--color-border-soft, #e4e6ea);
}

.sd-share-pill i {
  font-size: 0.72rem;
}

/* ── Article Lead Paragraph ── */
/* Option B summary treatment: amber left-border, italic, larger text.
   Replaces the old .modal-summary plain paragraph. */
.article-lead-paragraph {
  font-size: 0.97rem;
  font-style: italic;
  color: var(--color-text, #333);
  line-height: 1.8;
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--color-amber, #F8A61F);
  border-radius: 0;
}

/* ── Project CTA Group (Similar projects + Discuss this) ── */
.sd-cta-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* "Similar projects" secondary CTA — outlined, navy */
.sd-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-navy, #122C4B);
  background: var(--color-off-white, #f0f2f5);
  border: 1px solid var(--color-border-soft, color-mix(in srgb, black 10%, transparent));
  padding: 0.42rem 1rem;
  border-radius: 99px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}

.sd-cta-secondary:hover {
  background: var(--color-border-soft, #e4e6ea);
  transform: translateY(-1px);
}

.sd-cta-secondary:focus-visible {
  outline: 2px solid var(--color-amber, #F8A61F);
  outline-offset: 2px;
}

.sd-cta-secondary i {
  font-size: 0.7rem;
}

@media (max-width: 480px) {
  .sd-cta-group {
    flex-direction: column;
    align-items: stretch;
  }
  .sd-cta-secondary,
  .sd-cta-group .modal-cta-inline {
    justify-content: center;
  }
}
  .article-modal {
    animation: none;
  }
  .modal-share-btn {
    transition: none;
  }
  .modal-cta-inline {
    transition: none;
  }
  .modal-stage-dot .fp-dot {
    transition: none;
  }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .article-modal-body {
    padding: 1.25rem;
  }
  .article-modal-header {
    height: 220px;
    padding: 1.25rem;
  }
  .article-modal-header-text h2 {
    font-size: 1.2rem;
  }
  .modal-share-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .modal-share-row__left {
    flex-wrap: wrap;
  }
  .modal-cta-inline {
    justify-content: center;
  }
  .modal-top-badges {
    top: 0.85rem;
    left: 0.85rem;
  }
  .modal-bottom-badge {
    bottom: 0.85rem;
    left: 0.85rem;
  }
}

@media (max-width: 480px) {
  .article-modal {
    max-width: 100%;
    max-height: 95dvh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
}