/**
 * DEFCON Level, Share & Footer
 * Share header bar, share buttons, social sharing, footer grid, footer sections, platform cards, and donate section.
 *
 * Part of the Defcon site CSS (builds on engine base theme).
 * Load order managed by config/site.php → site_css array.
 */

/* ================================================================
   ALERTS
   ================================================================ */
/* Note: Main alert-card styles are defined earlier in Alerts Page section */
/* These additional styles are for priority-based border coloring */

/* Removed duplicate .alert-card hover that was causing movement */

.alert-card.priority-critical {
  border-left-color: var(--priority-critical);
}

.alert-card.priority-high {
  border-left-color: var(--priority-high);
}

.alert-card.priority-elevated {
  border-left-color: var(--priority-elevated);
}

.alert-card.priority-standard {
  border-left-color: var(--priority-standard);
}

.alert-card.priority-low {
  border-left-color: var(--priority-low);
}

/* ================================================================
   SHARE BUTTONS
   ================================================================ */
.share-section {
  margin-top: var(--space-6);
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.share-section h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
  text-align: center;
}

/* Alert Topics / Topic Tags, styles moved to engine-views.css (S215) */

.share-buttons {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
  cursor: pointer;
}

.share-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.share-twitter:hover {
  color: #1DA1F2;
}

.share-facebook:hover {
  color: #4267B2;
}

.share-whatsapp:hover {
  color: #25D366;
}

.share-reddit:hover {
  color: #FF4500;
}

.share-telegram:hover {
  color: #0088cc;
}

.share-substack:hover {
  color: #FF6719;
}

.share-email:hover {
  color: #ea4335;
}

/* ── Share Bar Container (partial: share-bar.php) ── */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  background: rgba(26, 26, 36, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.share-bar--compact {
  padding: var(--space-2) var(--space-3);
  gap: var(--space-1);
}

/* Share label ("Share:") */
.share-bar__label {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-right: var(--space-1);
  white-space: nowrap;
}

.share-bar .share-btn,
.prose .share-bar .share-btn,
.content .share-bar .share-btn {
  width: auto;
  height: auto;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.share-bar--compact .share-btn {
  padding: var(--space-1) var(--space-2);
  font-size: 12px;
}

/* Platform-specific hover colors */
.share-btn--fb:hover { color: #4267B2; border-color: #4267B2; }
.share-btn--x:hover { color: #1DA1F2; border-color: #1DA1F2; }
.share-btn--linkedin:hover { color: #0A66C2; border-color: #0A66C2; }
.share-btn--reddit:hover { color: #FF4500; border-color: #FF4500; }
.share-btn--telegram:hover { color: #0088cc; border-color: #0088cc; }
.share-btn--whatsapp:hover { color: #25D366; border-color: #25D366; }
.share-btn--email:hover { color: #ea4335; border-color: #ea4335; }
.share-btn--substack:hover { color: #FF6719; border-color: #FF6719; }
.share-btn--patreon:hover { color: #FF424D; border-color: #FF424D; }
.share-btn--pocket:hover { color: #EF3F56; border-color: #EF3F56; }
/* Bookmark button emphasized in share bar so it does not drown among platform icons (2026-04-21) */
.share-btn--bookmark {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(14, 165, 233, 0.08);
}
.share-btn--bookmark:hover,
.share-btn--bookmark:focus-visible {
  background: rgba(14, 165, 233, 0.18);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  outline: none;
}

/* Push notification inline bell */
.share-btn--notify { position: relative; }
.share-btn--notify:hover { color: #10b981; border-color: #10b981; }
.share-btn--notify.subscribed { background: linear-gradient(135deg, rgba(16,185,129,.15), rgba(16,185,129,.05)); color: #10b981; border-color: #10b981; }
.share-btn--notify.subscribed .push-inline-icon-off { display: none; }
.share-btn--notify.subscribed .push-inline-icon-on { display: inline !important; }
.share-btn--notify.subscribed .push-inline-label-off { display: none !important; }
.share-btn--notify.subscribed .push-inline-label-on { display: inline !important; }
.share-btn--notify .push-inline-icon { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes bellRingInline { 0% { transform: rotate(0); } 25% { transform: rotate(10deg); } 50% { transform: rotate(-10deg); } 75% { transform: rotate(5deg); } 100% { transform: rotate(0); } }
.share-btn--notify.subscribed .push-inline-icon-on { animation: bellRingInline 0.4s ease; }

/* Share bar hint text */
.share-bar__hint {
  width: 100%;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-1);
}

.share-bar--compact .share-bar__hint {
  display: none;
}

/* ── Share Bar SVG Icons ── */
.share-bar .share-btn {
  gap: 6px;
}

.share-bar .share-btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Compact mode: hide text labels, show icons only */
.share-bar--compact .share-bar__text {
  display: none;
}

.share-bar--compact .share-btn {
  padding: var(--space-1);
  width: 36px;
  height: 36px;
}

/* ── Share Header Bar (sticky bar after hero/header, matches old site) ── */
.share-header-bar {
  background: rgba(26, 26, 36, 0.95);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.625rem 0;
  margin: -0.25rem 0 0.5rem 0;
  z-index: 100;
}

.share-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.share-header-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-right: 0.25rem;
}

.share-buttons-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Reset standalone share-bar styles inside header */
.share-header-bar .share-bar {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  position: static;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: contents;
}

/* Hide duplicate "Share:" label from share-bar.php inside header */
.share-header-bar .share-bar__label {
  display: none;
}

/* Hide share-bar hint (header has its own) */
.share-header-bar .share-bar__hint {
  display: none;
}

/* Button styling, text + icon on desktop (matching old site) */
.share-header-bar .share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
  width: auto;
  height: auto;
}

.share-header-bar .share-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.share-header-bar .share-btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Platform-specific hover colors */
.share-header-bar .share-btn--x:hover { border-color: #1DA1F2; color: #1DA1F2; }
.share-header-bar .share-btn--fb:hover { border-color: #4267B2; color: #4267B2; }
.share-header-bar .share-btn--whatsapp:hover { border-color: #25D366; color: #25D366; }
.share-header-bar .share-btn--reddit:hover { border-color: #FF4500; color: #FF4500; }
.share-header-bar .share-btn--telegram:hover { border-color: #0088cc; color: #0088cc; }
.share-header-bar .share-btn--email:hover { border-color: #ea4335; color: #ea4335; }
.share-header-bar .share-btn--substack:hover { border-color: #FF6719; color: #FF6719; }
.share-header-bar .share-btn--patreon:hover { border-color: #FF424D; color: #FF424D; }
.share-header-bar .share-btn--pocket:hover { border-color: #EF4056; color: #EF4056; }
.share-header-bar .share-btn--copy:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.share-header-bar .share-btn--bookmark:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* Bookmark hint text */
.share-bookmark-hint {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: 0.35rem;
}

/* ── Copy/Share Toast ── */
.share-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--accent-primary);
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.share-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .share-header-bar {
    position: relative;
    padding: 0.5rem 0;
    margin: -0.25rem 0 1.25rem 0;
  }
  .share-header-content {
    justify-content: center;
    padding: 0 0.75rem;
    gap: 0.375rem;
  }
  .share-header-label {
    display: none;
  }
  /* Icon-only on mobile */
  .share-header-bar .share-bar__text {
    display: none;
  }
  .share-header-bar .share-btn {
    padding: 0.375rem;
    min-width: 36px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .share-header-bar .share-btn svg {
    width: 16px;
    height: 16px;
  }
  .share-bookmark-hint {
    display: none;
  }
}

/* ── Regional Menu Bar (partial: regional-menu.php) ── */
.regional-menu-bar {
  background: none;
  border: none;
  border-radius: 0;
  padding: var(--space-4) 0;
  margin: var(--space-4) 0 0;
  box-shadow: none;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.regional-menu-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 0;
}

.regional-menu-link,
.prose .regional-menu-link,
.content .regional-menu-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: none;
  border: none;
  white-space: nowrap;
}

.regional-menu-link:hover,
.prose .regional-menu-link:hover,
.content .regional-menu-link:hover {
  color: var(--accent-primary);
  background: none;
  border: none;
}

.regional-menu-link.active,
.prose .regional-menu-link.active,
.content .regional-menu-link.active {
  color: var(--accent-primary);
  background: none;
  border: none;
  font-weight: 600;
}

.regional-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.regional-level-badge.level-1 {
  background: var(--level-1);
  color: #000;
}

.regional-level-badge.level-2 {
  background: var(--level-2);
  color: #fff;
}

.regional-level-badge.level-3 {
  background: var(--level-3);
  color: #000;
}

.regional-level-badge.level-4 {
  background: var(--level-4);
  color: #000;
}

.regional-level-badge.level-5 {
  background: var(--level-5);
  color: #fff;
}

/* Unread Alert Badge */
.regional-menu-link {
  position: relative;
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 9px;
  line-height: 1;
}

@media (max-width: 768px) {
  .unread-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    font-size: 12px;
    padding: 0 4px;
  }
}

@media (max-width: 768px) {
  .regional-menu-bar {
    padding: 0;
    border-radius: 0;
    margin: 0 0 var(--space-2);
  }

  .regional-menu-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    width: 100%;
  }

  .regional-menu-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    min-height: 40px;
    font-weight: 600;
    text-align: center;
  }

  .regional-link-text {
    font-size: 12px;
    font-weight: 600;
  }

  .share-bar {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .regional-menu-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .regional-menu-link {
    padding: 8px 5px;
    font-size: 12px;
    min-height: 36px;
  }

  .regional-link-text {
    font-size: 12px;
  }

  .share-bar .share-btn {
    padding: var(--space-1) var(--space-2);
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .regional-menu-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .regional-menu-link {
    padding: 7px 4px;
    font-size: 12px;
    min-height: 34px;
  }

  .regional-link-text {
    font-size: 12px;
  }
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  background: #1e293b;
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-6);
  text-align: start;
}

/* Footer Pre-Grid Link Sections (Maps & Live Tools, Learn & Research) */
.footer-link-grid-section {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.footer-link-grid-section__title {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.footer-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-link-grid__item {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: var(--transition);
}

.footer-link-grid__item:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(14, 165, 233, 0.08);
}

@media (max-width: 480px) {
  .footer-link-grid__item {
    padding: 5px 10px;
    font-size: var(--text-xs);
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

/* 5-column footer grid for expanded navigation */
.footer-grid-5 {
  grid-template-columns: 1.5fr repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .footer-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .footer-grid-5 {
    grid-template-columns: 1fr;
  }
}

.footer-section h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.footer-section p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  border-bottom: none;
}

.footer-links a:hover {
  color: var(--text-primary);
  border-bottom: none;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.footer-social a {
  color: var(--text-muted);
  border-bottom: none;
}

.footer-social a:hover {
  color: var(--accent-primary);
  border-bottom: none;
}

/* Footer Updates Notice - Encourages return visits */
.footer-updates-notice {
  text-align: center;
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(14, 165, 233, 0.02));
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 12px;
}

.updates-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: rgba(14, 165, 233, 0.1);
  border-radius: 20px;
  font-size: var(--text-sm);
  color: var(--accent-primary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* pulse keyframes defined in transitions.css (canonical location) */

.footer-updates-notice p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.footer-disclaimer {
  font-size: var(--text-xs);
}

/* Footer Push Notification Link */
.footer-push-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.footer-push-status {
  font-size: var(--text-xs);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  margin-left: 0.25rem;
}

.footer-patreon-note {
  margin-top: var(--space-3);
}

.footer-patreon-note a {
  color: var(--accent-primary);
  text-decoration: underline;
}

.footer-push-link.subscribed {
  color: #10b981;
}

.footer-push-link.subscribed .footer-push-status::before {
  content: 'ON';
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 600;
}

/* ================================================================
   PLATFORM CARDS (Contribute page)
   ================================================================ */
.platform-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.platform-card {
  background: var(--bg-card);
  padding: var(--space-6);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.platform-card h3 {
  margin-bottom: var(--space-3);
}

.platform-card p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* ================================================================
   DONATE SECTION STYLING
   ================================================================ */
.donate-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  margin: var(--space-6) 0;
  padding: var(--space-6);
  background: var(--bg-tertiary);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.donate-qr {
  display: flex;
  justify-content: center;
  margin-top: var(--space-4);
}

.donate-qr img {
  border-radius: 12px;
  background: white;
  padding: var(--space-3);
  box-shadow: var(--shadow-md);
}

.highlight-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-primary);
  border-radius: 8px;
  padding: var(--space-4);
  text-align: center;
  font-size: var(--text-lg);
  margin: var(--space-4) 0;
}

.highlight-box a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.highlight-box a:hover {
  text-decoration: underline;
}

