/* ========================================
   CIVIC FORECAST — GLOBAL DESIGN SYSTEM v1.0
   civicforecast.com unified brand layer
   Loads on ALL pages via WPCode or theme
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ===== DESIGN TOKENS ===== */
:root {
  --cf-bg: #07070B;
  --cf-surface: #111118;
  --cf-surface-2: #16161F;
  --cf-panel: #13131A;
  --cf-amber: #D4A243;
  --cf-amber-bright: #E8B955;
  --cf-amber-deep: #B8862D;
  --cf-amber-glow: rgba(212,162,67,0.12);
  --cf-amber-glass: rgba(212,162,67,0.05);
  --cf-amber-subtle: rgba(212,162,67,0.18);
  --cf-text: #F5F0E8;
  --cf-text-primary: #E2DED6;
  --cf-text-secondary: #9E9A92;
  --cf-text-muted: #5E5C58;
  --cf-text-dim: #3A3936;
  --cf-text-faint: rgba(242,242,245,0.55);
  --cf-border: rgba(242,242,245,0.12);
  --cf-border-subtle: rgba(255,255,255,0.04);
  --cf-border-card: rgba(255,255,255,0.05);
  --cf-border-frame: rgba(212,162,67,0.12);
  --cf-shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 8px 32px rgba(0,0,0,0.18);
  --cf-shadow-md: 0 8px 24px rgba(0,0,0,0.35), 0 24px 64px rgba(0,0,0,0.2);
  --cf-shadow-lg: 0 14px 40px rgba(0,0,0,0.38), 0 32px 80px rgba(0,0,0,0.22);
  --cf-shadow-inset: inset 0 1px 0 rgba(255,255,255,0.025), inset 0 -1px 0 rgba(0,0,0,0.15);
  --cf-font-display: 'Cormorant Garamond', Georgia, serif;
  --cf-font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --cf-radius: 14px;
  --cf-radius-sm: 10px;
  --cf-radius-xs: 6px;
  --cf-max: 1100px;
  --cf-ease: cubic-bezier(0.4,0,0.2,1);
  --cf-ease-out: cubic-bezier(0,0,0.2,1);
  --cf-transition: 0.2s ease;
}

/* ===== GLOBAL CANVAS ===== */
body.cf-dark {
  background: var(--cf-bg) !important;
  color: var(--cf-text) !important;
  font-family: var(--cf-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Force Genesis theme elements dark */
body.cf-dark .site-container,
body.cf-dark .site-inner,
body.cf-dark .content-sidebar-wrap,
body.cf-dark .content {
  background: var(--cf-bg) !important;
  color: var(--cf-text) !important;
}

body.cf-dark .site-header {
  background: rgba(7,7,11,0.92) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--cf-border-subtle) !important;
  padding: 0 !important;
}

/* Cap logo height so header stays compact */
body.cf-dark .site-header .site-title img,
body.cf-dark .site-header .custom-logo,
body.cf-dark .site-header img.custom-logo,
body.cf-dark .header-image img,
body.cf-dark .title-area img {
  max-height: 56px !important;
  width: auto !important;
  display: block;
}

body.cf-dark .title-area,
body.cf-dark .site-header .widget-area {
  padding: 10px 20px !important;
}

@media (max-width: 600px) {
  body.cf-dark .site-header .site-title img,
  body.cf-dark .site-header .custom-logo,
  body.cf-dark .site-header img.custom-logo,
  body.cf-dark .header-image img,
  body.cf-dark .title-area img {
    max-height: 40px !important;
  }
  body.cf-dark .title-area,
  body.cf-dark .site-header .widget-area {
    padding: 8px 16px !important;
  }
}

body.cf-dark .site-header .site-title a,
body.cf-dark .site-header .genesis-nav-primary a,
body.cf-dark .nav-primary a,
body.cf-dark .genesis-responsive-menu a,
body.cf-dark .menu-item a {
  color: var(--cf-text-secondary) !important;
  transition: color 0.2s ease;
}

body.cf-dark .site-header .site-title a:hover,
body.cf-dark .genesis-nav-primary a:hover,
body.cf-dark .nav-primary a:hover,
body.cf-dark .menu-item a:hover {
  color: var(--cf-amber) !important;
}

body.cf-dark .site-footer,
body.cf-dark .footer-widgets {
  background: var(--cf-bg) !important;
  color: var(--cf-text-muted) !important;
  border-top: 1px solid var(--cf-border-subtle) !important;
}

body.cf-dark .site-footer a,
body.cf-dark .footer-widgets a {
  color: var(--cf-text-secondary) !important;
}

body.cf-dark .site-footer a:hover,
body.cf-dark .footer-widgets a:hover {
  color: var(--cf-amber) !important;
}

/* Genesis widget areas */
body.cf-dark .sidebar,
body.cf-dark .widget-area {
  background: transparent !important;
  color: var(--cf-text-secondary) !important;
}

body.cf-dark .widget-area .widget-title {
  color: var(--cf-text) !important;
}

/* ===== FILM GRAIN (global) ===== */
body.cf-dark::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.022;
  pointer-events: none;
  z-index: 99999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ===== TYPOGRAPHY ===== */
body.cf-dark h1, body.cf-dark h2, body.cf-dark h3,
body.cf-dark h4, body.cf-dark h5, body.cf-dark h6 {
  font-family: var(--cf-font-display);
  color: var(--cf-text) !important;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

body.cf-dark h1 { font-size: clamp(30px, 4.5vw, 48px); }
body.cf-dark h2 { font-size: clamp(22px, 3vw, 34px); }
body.cf-dark h3 { font-size: clamp(17px, 2vw, 22px); }

body.cf-dark p, body.cf-dark li, body.cf-dark td {
  font-family: var(--cf-font-body);
  color: var(--cf-text-secondary);
  line-height: 1.65;
}

body.cf-dark a:not(.cf-btn):not(.cf-card-cta):not(.cf-banner-cta):not(.cf-link) {
  color: var(--cf-amber);
  text-decoration: none;
  transition: color 0.2s ease;
}

body.cf-dark a:not(.cf-btn):not(.cf-card-cta):not(.cf-banner-cta):not(.cf-link):hover {
  color: var(--cf-amber-bright);
}

body.cf-dark strong, body.cf-dark b {
  color: var(--cf-text);
}

body.cf-dark em {
  color: var(--cf-amber);
  font-style: italic;
}

/* ===== SHARED COMPONENTS ===== */

/* Wrap container */
body.cf-dark .entry-content {
  max-width: var(--cf-max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) clamp(16px, 4vw, 24px);
}

/* WP block overrides */
body.cf-dark .wp-block-columns {
  gap: 24px;
}

body.cf-dark .wp-block-column {
  background: var(--cf-surface);
  border: 1px solid var(--cf-border-subtle);
  border-radius: var(--cf-radius);
  padding: clamp(20px, 2.5vw, 28px);
  box-shadow: var(--cf-shadow-sm);
  transition: transform 0.35s var(--cf-ease), box-shadow 0.35s var(--cf-ease), border-color 0.25s ease;
}

body.cf-dark .wp-block-column:hover {
  transform: translateY(-2px);
  box-shadow: var(--cf-shadow-md);
  border-color: var(--cf-border-frame);
}

/* WP separator */
body.cf-dark hr,
body.cf-dark .wp-block-separator {
  border: none !important;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cf-border-frame), transparent) !important;
  opacity: 0.6;
  margin: 32px auto;
}

/* WP buttons */
body.cf-dark .wp-block-button__link,
body.cf-dark .wp-block-button a {
  font-family: var(--cf-font-body) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: 0.5px;
  padding: 12px 24px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(212,162,67,0.5) !important;
  background: transparent !important;
  color: var(--cf-text) !important;
  text-transform: uppercase;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body.cf-dark .wp-block-button__link:hover,
body.cf-dark .wp-block-button a:hover {
  background: var(--cf-amber-subtle) !important;
  border-color: rgba(212,162,67,0.75) !important;
  color: #fff !important;
}

/* WP images */
body.cf-dark .wp-block-image {
  border-radius: var(--cf-radius);
  overflow: hidden;
  box-shadow: var(--cf-shadow-sm);
}

body.cf-dark .wp-block-image img {
  border-radius: var(--cf-radius);
}

/* Lists */
body.cf-dark .entry-content ul,
body.cf-dark .entry-content ol {
  padding-left: 20px;
  color: var(--cf-text-secondary);
}

body.cf-dark .entry-content li {
  margin: 6px 0;
}

body.cf-dark .entry-content li::marker {
  color: var(--cf-amber);
}

/* Tags / pill badges */
.cf-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--cf-border);
  background: rgba(255,255,255,0.025);
  color: var(--cf-text-secondary);
  margin: 0 4px 6px 0;
}

/* Section divider */
.cf-section-rule {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cf-amber), transparent);
  margin: 40px auto;
  opacity: 0.45;
}

/* Eyebrow label */
.cf-eyebrow-global {
  font-family: var(--cf-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cf-amber);
  margin-bottom: 12px;
}

/* Glass panel */
.cf-glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 40%, transparent 72%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--cf-border-frame);
  border-radius: var(--cf-radius);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, var(--cf-shadow-md);
}

/* ===== SHARED MARQUEE ===== */
.cf-marquee-wrap {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 40px) 0;
}

.cf-marquee-wrap::before,
.cf-marquee-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.cf-marquee-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--cf-bg) 0%, transparent 100%);
}

.cf-marquee-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--cf-bg) 0%, transparent 100%);
}

.cf-marquee-track {
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  animation: cfMarqueeGlobal 35s linear infinite;
}

.cf-marquee-wrap:hover .cf-marquee-track {
  animation-play-state: paused;
}

.cf-marquee-track img {
  height: 48px;
  width: auto;
  object-fit: contain;
  opacity: 0.4;
  filter: grayscale(0.3) brightness(1.3);
  transition: opacity 0.35s ease, filter 0.35s ease;
  flex-shrink: 0;
}

.cf-marquee-track img:hover {
  opacity: 0.85;
  filter: grayscale(0) brightness(1);
}

@keyframes cfMarqueeGlobal {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 600px) {
  .cf-marquee-track { gap: 44px; }
  .cf-marquee-track img { height: 36px; }
  .cf-marquee-wrap::before,
  .cf-marquee-wrap::after { width: 40px; }
}

/* ===== SCROLL REVEAL (global) ===== */
.cf-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--cf-ease-out), transform 0.65s var(--cf-ease-out);
}

.cf-reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .cf-reveal, .cf-reveal-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .cf-marquee-track {
    animation: none !important;
  }
}

/* ===== GENESIS OVERRIDES — Magnolia specifics ===== */

/* Hide "Theme by 17th Avenue" footer attribution */
body.cf-dark .site-footer .creds,
body.cf-dark .site-footer .flavor {
  display: none !important;
}

/* Genesis parallax sections — darken */
body.cf-dark .flexible-widgets .widget {
  background-color: var(--cf-bg) !important;
}

body.cf-dark .flexible-widgets .widget.dark-section {
  background: var(--cf-surface) !important;
}

/* Featured page widget text */
body.cf-dark .featured-content .entry-title a,
body.cf-dark .featuredpage .entry-title a {
  color: var(--cf-text) !important;
  font-family: var(--cf-font-display);
}

body.cf-dark .featured-content .entry-content,
body.cf-dark .featuredpage .entry-content {
  color: var(--cf-text-secondary) !important;
}

/* Genesis eNews */
body.cf-dark .enews-widget input[type="email"] {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--cf-border) !important;
  color: var(--cf-text) !important;
  border-radius: var(--cf-radius-sm) !important;
  padding: 12px 14px;
}

body.cf-dark .enews-widget input[type="submit"] {
  background: transparent !important;
  border: 1px solid rgba(212,162,67,0.5) !important;
  color: var(--cf-text) !important;
  border-radius: 999px !important;
  font-family: var(--cf-font-body) !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background 0.2s ease;
}

body.cf-dark .enews-widget input[type="submit"]:hover {
  background: var(--cf-amber-subtle) !important;
  border-color: rgba(212,162,67,0.75) !important;
}

/* Instagram feed dark mode */
body.cf-dark #sb_instagram,
body.cf-dark .sbi_items {
  background: transparent !important;
}
