/* FNE design layer over curated Phoenix assets.
   SiteSettings.PrimaryColor is injected as --fne-primary / --fne-primary-rgb in layouts. */

:root {
  /* Scout-adjacent national default when SiteSettings has no color */
  --fne-primary: #0b6e4f;
  --fne-primary-rgb: 11, 110, 79;
  --fne-primary-hover: color-mix(in srgb, var(--fne-primary) 85%, #000);
  --fne-primary-active: color-mix(in srgb, var(--fne-primary) 75%, #000);
  --fne-primary-subtle: color-mix(in srgb, var(--fne-primary) 12%, #fff);
  --fne-primary-border-subtle: color-mix(in srgb, var(--fne-primary) 40%, #fff);
  --fne-primary-soft: color-mix(in srgb, var(--fne-primary) 8%, #fff);

  --fne-radius: 0.75rem;
  --fne-radius-lg: 1rem;
  --fne-shadow-sm: 0 0.125rem 0.375rem rgba(20, 24, 36, 0.06);
  --fne-shadow: 0 0.5rem 1.25rem rgba(20, 24, 36, 0.08);
  --fne-nav-height: 4rem;

  /* Map Phoenix primary tokens to tenant brand */
  --phoenix-primary: var(--fne-primary);
  --phoenix-primary-rgb: var(--fne-primary-rgb);
  --phoenix-primary-text-emphasis: var(--fne-primary-active);
  --phoenix-primary-bg-subtle: var(--fne-primary-subtle);
  --phoenix-primary-border-subtle: var(--fne-primary-border-subtle);
  --phoenix-link-color: var(--fne-primary);
  --phoenix-link-hover-color: var(--fne-primary-hover);
}

/* Phoenix hardcodes .btn-primary bg; rebind to brand token */
.btn-primary {
  --phoenix-btn-bg: var(--fne-primary);
  --phoenix-btn-hover-bg: var(--fne-primary-hover);
  --phoenix-btn-active-bg: var(--fne-primary-active);
  --phoenix-btn-disabled-bg: var(--fne-primary);
  border: none;
  box-shadow: 0 1px 2px rgba(var(--fne-primary-rgb), 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(var(--fne-primary-rgb), 0.28);
}

.btn-outline-primary {
  --phoenix-btn-color: var(--fne-primary);
  --phoenix-btn-border-color: var(--fne-primary);
  --phoenix-btn-hover-bg: var(--fne-primary);
  --phoenix-btn-hover-border-color: var(--fne-primary);
  --phoenix-btn-active-bg: var(--fne-primary-active);
  --phoenix-btn-active-border-color: var(--fne-primary-active);
  --phoenix-btn-disabled-color: var(--fne-primary);
  --phoenix-btn-disabled-border-color: var(--fne-primary);
}

.text-primary {
  color: var(--fne-primary) !important;
}

.bg-primary {
  background-color: var(--fne-primary) !important;
}

.border-primary {
  border-color: var(--fne-primary) !important;
}

/* Focus rings use brand, not default Bootstrap blue */
.btn:focus-visible,
.btn-link.nav-link:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--fne-primary-rgb), 0.25);
}

.form-control:focus,
.form-select:focus {
  border-color: color-mix(in srgb, var(--fne-primary) 55%, #ccc);
}

/* ---- Public shell ---- */
.fne-public-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fafbfc;
}

/* Phoenix grows .container to 1678px at 1540px. Public pages stay on the 1200px column. */
@media (min-width: 1540px) {
  .fne-public-body .container {
    max-width: 1184px;
  }
}

.fne-public-body > .main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.fne-public-nav {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid rgba(20, 24, 36, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 1030;
}

.fne-public-nav.is-scrolled,
.fne-public-nav[data-navbar-shadow-on-scroll] {
  box-shadow: var(--fne-shadow-sm);
}

.fne-public-nav .navbar {
  min-height: var(--fne-nav-height);
}

.fne-public-nav .navbar-brand .logo-text {
  letter-spacing: -0.01em;
  font-weight: 800;
  color: var(--phoenix-emphasis-color, #141824);
  font-size: 1.05rem;
}

.fne-public-nav .nav-link {
  color: var(--phoenix-body-color, #525b75) !important;
  border-radius: 0.4rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.fne-public-nav .nav-link:hover,
.fne-public-nav .nav-link:focus {
  color: var(--fne-primary) !important;
  background: var(--fne-primary-soft);
}

.fne-public-nav .btn-join {
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Header wordmark (FNE_Blue.png); tenant LogoBlobPath may replace src */
.fne-brand-logo {
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.fne-brand-logo-admin {
  height: 32px;
  max-width: 160px;
}

.fne-brand-logo-auth {
  height: 56px;
  max-width: 240px;
}

/* Compact mark / favicon asset (FNE_Logo.png) */
.fne-brand-icon,
.fne-brand-mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 0.35rem;
}

.fne-public-main {
  flex: 1 0 auto;
  /* Allow full-bleed heroes while keeping block content readable */
  overflow-x: clip;
}

.fne-public-main > .cms-page {
  padding-bottom: 2rem;
}

.cms-easy-edit-pill {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  box-shadow: 0 0.5rem 1.5rem rgba(20, 24, 36, 0.18);
}

.fne-public-footer {
  background: #fff;
  border-top: 1px solid rgba(20, 24, 36, 0.08) !important;
  margin-top: auto;
}

.fne-public-footer .fne-footer-brand {
  font-weight: 700;
  color: var(--phoenix-emphasis-color, #141824);
}

.fne-public-footer a {
  text-decoration: none;
  transition: color 0.15s ease;
}

.fne-public-footer a:hover {
  color: var(--fne-primary) !important;
}

.fne-footer-share {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .fne-footer-share {
    justify-content: flex-end;
  }
}

.fne-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(20, 24, 36, 0.14);
  background: #fff;
  color: var(--fne-primary, #0b6e4f);
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
}

.fne-share-icon:hover {
  background: var(--fne-primary, #0b6e4f);
  border-color: var(--fne-primary, #0b6e4f);
  color: #fff;
}

.fne-footer-accent {
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--fne-primary) 0%,
    color-mix(in srgb, var(--fne-primary) 40%, #fff) 55%,
    transparent 100%
  );
}

/* ---- Auth ---- */
.fne-auth-shell {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--fne-primary-subtle), transparent 55%),
    linear-gradient(180deg, #f8faf9 0%, #eef2f0 100%);
}

.fne-auth-card {
  max-width: 26rem;
}

.fne-auth-card .card,
.fne-auth-panel {
  border: 1px solid rgba(20, 24, 36, 0.06);
  border-radius: var(--fne-radius-lg);
  box-shadow: var(--fne-shadow);
  background: #fff;
}

/* ---- Admin content polish ---- */
.fne-admin-page-title {
  letter-spacing: -0.02em;
  font-weight: 700;
}

body .navbar-vertical {
  border-right-color: rgba(20, 24, 36, 0.06);
}

body .navbar-vertical .navbar-vertical-label {
  letter-spacing: 0.06em;
}

body .navbar-vertical .nav-link.active {
  color: var(--fne-primary) !important;
}

body .navbar-vertical .nav-link.active .nav-link-icon {
  color: var(--fne-primary);
}

body .navbar-top {
  border-bottom: 1px solid rgba(20, 24, 36, 0.06);
}

.fne-admin-brand-bar {
  height: 3px;
  background: var(--fne-primary);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
}

/* ---- CMS public blocks ---- */
.cms-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cms-hero {
  position: relative;
  background:
    linear-gradient(
      145deg,
      var(--fne-primary-subtle) 0%,
      #f5f7fa 48%,
      #fff 100%
    );
  border: 1px solid rgba(20, 24, 36, 0.06);
  border-radius: var(--fne-radius-lg);
  box-shadow: var(--fne-shadow-sm);
  overflow: hidden;
}

.cms-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--fne-primary);
  border-radius: var(--fne-radius-lg) 0 0 var(--fne-radius-lg);
}

.cms-hero .cms-hero-inner {
  position: relative;
  max-width: 46rem;
}

.cms-hero-copy {
  min-width: 0;
}

.cms-hero-title {
  margin-bottom: 0.75rem;
}

.cms-hero-lead {
  margin-bottom: 0;
}

.cms-hero-primary,
.cms-hero-secondary {
  display: inline-block;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.cms-hero-primary {
  background: var(--fne-primary, #c4161c);
  border: 1px solid var(--fne-primary, #c4161c);
  color: #fff;
  padding: 0.75rem 1.25rem;
}

.cms-hero-primary:hover {
  color: #fff;
  filter: brightness(0.92);
}

.cms-hero-secondary {
  background: #fff;
  border: 1px solid var(--fne-primary, #1a3354);
  color: var(--fne-primary, #1a3354);
  padding: 0.7rem 1.15rem;
}

.cms-hero-secondary:hover {
  color: var(--fne-primary, #1a3354);
  background: #f7f8fa;
}

.cms-hero-photo {
  margin: 1.25rem 0 0;
}

.cms-hero-photo img {
  width: 100%;
  border-radius: 0.75rem;
  display: block;
}

.cms-hero .display-5,
.cms-hero .cms-hero-title {
  color: var(--phoenix-emphasis-color, #141824);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.cms-hero .lead {
  font-size: 1.125rem;
  line-height: 1.55;
}

.cms-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* First hero on a page: more presence */
.cms-page > .cms-hero:first-child {
  margin-top: 0;
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

@media (min-width: 992px) {
  .cms-page > .cms-hero:first-child {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

  .cms-hero .cms-hero-title {
    font-size: 2.75rem;
  }
}

.cms-richtext {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--phoenix-body-color, #525b75);
}

.cms-richtext--full {
  max-width: none;
}

.cms-richtext--narrow {
  max-width: 30%;
}

.cms-richtext > :first-child {
  margin-top: 0;
}

.cms-richtext h1,
.cms-richtext h2,
.cms-richtext h3,
.cms-richtext h4 {
  color: var(--phoenix-emphasis-color, #141824);
  letter-spacing: -0.02em;
  margin-top: 1.75rem;
}

.cms-richtext a {
  color: var(--fne-primary);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.cms-richtext a:hover {
  color: var(--fne-primary-hover);
}

.cms-richtext ul,
.cms-richtext ol {
  padding-left: 1.25rem;
}

.cms-richtext img {
  max-width: 100%;
  height: auto;
  border-radius: var(--fne-radius);
}

.cms-image {
  margin: 0 auto 1.5rem;
  max-width: 56rem;
}

.cms-image img {
  border-radius: var(--fne-radius);
  box-shadow: var(--fne-shadow-sm);
  width: 100%;
  height: auto;
  display: block;
}

.cms-image figcaption {
  text-align: center;
  margin-top: 0.65rem;
}

.cms-cta-band {
  background: linear-gradient(
    135deg,
    var(--fne-primary-soft) 0%,
    #fff 60%
  );
  border: 1px solid var(--fne-primary-border-subtle);
  border-radius: var(--fne-radius-lg);
  box-shadow: var(--fne-shadow-sm);
  padding: 2rem 1.5rem !important;
}

.cms-cta-band .cms-cta-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--phoenix-emphasis-color, #141824);
}

.cms-section-head {
  margin-bottom: 1.25rem;
}

.cms-section-head .cms-section-title {
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--phoenix-emphasis-color, #141824);
}

.cms-section-head .cms-section-rule {
  width: 2.5rem;
  height: 3px;
  background: var(--fne-primary);
  border-radius: 2px;
  margin-top: 0.5rem;
}

a.cms-program-card,
a.cms-program-card:hover {
  color: inherit;
}

.fne-dir-info {
  width: 2.1rem;
  padding-inline: 0;
}

.cms-program-card,
.fne-dir-card {
  border: 1px solid rgba(20, 24, 36, 0.07) !important;
  border-radius: var(--fne-radius) !important;
  box-shadow: var(--fne-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

/* Top brand color strip (programs + directory cards) */
.cms-program-card::before,
.fne-dir-card::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--fne-primary);
  opacity: 0.85;
}

.cms-program-card:hover,
.fne-dir-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--fne-shadow);
  border-color: var(--fne-primary-border-subtle) !important;
}

.cms-program-card .card-body,
.fne-dir-card .card-body {
  padding: 1.25rem 1.25rem 1.35rem;
}

.cms-program-card .cms-program-name,
.fne-dir-card .fne-dir-card-title {
  letter-spacing: -0.015em;
  font-weight: 700;
}

.cms-blog-placeholder {
  border-radius: var(--fne-radius);
  border: 1px dashed var(--phoenix-border-color, #e3e6ed);
  background: var(--fne-primary-soft);
  color: var(--phoenix-body-color, #525b75);
}

/* CMS editor under Phoenix neutrals */
.cms-block-card {
  border-color: var(--phoenix-border-color, #e3e6ed) !important;
  box-shadow: var(--fne-shadow-sm);
  border-radius: var(--fne-radius) !important;
}

.cms-block-card-header {
  background: var(--phoenix-gray-50, #f5f7fa) !important;
}

.cms-add-block-bar {
  background: var(--phoenix-gray-50, #f5f7fa) !important;
  border-color: var(--phoenix-border-color, #e3e6ed) !important;
  border-radius: var(--fne-radius);
}

.cms-layout-template-bar {
  border-radius: var(--fne-radius);
  border-color: var(--fne-primary-border-subtle) !important;
  background: var(--fne-primary-soft) !important;
}

/* Empty / system states */
.fne-empty-state {
  border-radius: var(--fne-radius-lg);
  border: 1px solid rgba(20, 24, 36, 0.06);
  background: #fff;
  box-shadow: var(--fne-shadow-sm);
  padding: 3rem 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .cms-program-card,
  .fne-dir-card,
  .btn-primary,
  .fne-public-nav .nav-link {
    transition: none;
  }

  .cms-program-card:hover,
  .fne-dir-card:hover {
    transform: none;
  }
}
