/* Header icon and toggle text styles for CSP compliance */
.icon {
  font-size: 1.2em;
  vertical-align: middle;
  margin: 0 2px;
}
.toggle-text {
  font-weight: 500;
  margin-left: 6px;
}
/* Error message styles for CSP compliance */
.error-msg {
  color: red;
}
/* Card grid and item styles for CSP compliance */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap, 1rem);
  padding: 2rem;
}
.card-item {
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
/* TLDR and IOC details styles for CSP compliance */
.tldr {
  font-size: 1.15em;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: 4px;
}
.ioc-details {
  margin-top: 1em;
}

/* Metadata tags styles */
.metadata-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.metadata-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: calc(var(--radius) * 0.75);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.metadata-tag strong {
  margin-right: 0.375rem;
  font-weight: 600;
}

.metadata-tag.severity-critical {
  background: #dc2626;
  color: white;
}

.metadata-tag.severity-high {
  background: #ea580c;
  color: white;
}

.metadata-tag.severity-medium {
  background: #d97706;
  color: white;
}

.metadata-tag.severity-low {
  background: #16a34a;
  color: white;
}

.metadata-tag.tag-item {
  background: #6b7280;
  color: white;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.metadata-tag.tag-item:hover {
  background: #4b5563;
  text-decoration: none;
  color: white;
}

.metadata-tag.metadata-link {
  background: #3b82f6;
  color: white;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.metadata-tag.metadata-link:hover {
  background: #2563eb;
  text-decoration: none;
  color: white;
}
/* Footer styles for CSP compliance */
.site-footer {
  background: var(--card-bg);
  color: var(--muted);
  padding: 1rem;
  text-align: center;
}
/* Header styles for CSP compliance */
.site-header {
  position: relative;
  padding: 2rem 1rem 1.5rem 1rem;
  background: var(--card-bg);
  color: var(--text);
  z-index: 10;
}
.site-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}
/* Theme selector dropdown styles */
#themeSelector {
  margin-left: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
}
/* Body styles for CSP compliance */
.site-body {
  font-family: system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background: var(--card-bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}
body.dark-mode.site-body {
  background: var(--card);
  color: var(--text);
}
/* CSP-compliant visibility classes */
.show { display: inline !important; }
.hide { display: none !important; }
/* Theme CSS variables and built-in themes */
:root {
  --card: #fff;
  --text: #222;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --gap: 1.5rem;
  --link: #0645ad;
  --muted: #666;
  --rule: #eee;
  --chip: #f5f5f5;
  --card-bg: #f9f9f9;
  --accent: #007cba;
  --accent-text: #fff;
  --accent-hover: #005a87;
}
body.dark-mode {
  --card: #222;
  --text: #eee;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.18);
  --gap: 1.5rem;
  --link: #7abaff;
  --muted: #aaa;
  --rule: #444;
  --chip: #333;
  --card-bg: #222;
  --accent: #007cba;
  --accent-text: #fff;
  --accent-hover: #005a87;
}
/* Theme switcher button styles */
.theme-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.theme-switcher:focus {
  outline: 2px solid var(--link);
}

/* Card component */
.card {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.card:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
.card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: var(--card-bg);
}
.card-body {
  padding: 0.9rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card-body h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.card-body h3 a,
.card-title a {
  color: #000000;
  text-decoration: none;
}

.card-body h3 a:hover,
.card-title a:hover {
  color: #000000;
  text-decoration: none;
}

/* Dark mode card links */
body.dark-mode .card-body h3 a,
body.dark-mode .card-title a {
  color: #ffffff;
}

body.dark-mode .card-body h3 a:hover,
body.dark-mode .card-title a:hover {
  color: #ffffff;
}
.card-body .meta {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  border: 1px solid var(--rule);
  font-size: 0.8rem;
  line-height: 1.4;
}
.badge-High, .badge-high, .severity[data-level="high"] { background: #ffebee; border-color: #f44336; color: #b71c1c; }
.badge-Medium, .badge-medium, .severity[data-level="medium"] { background: #fff8e1; border-color: #ff9800; color: #e65100; }
.badge-Low, .badge-low, .severity[data-level="low"] { background: #e8f5e9; border-color: #4caf50; color: #1b5e20; }
.badge-cve { background: #e3f2fd; border-color: #2196f3; color: #0d47a1; }
.badge-actor { background: #ede7f6; border-color: #673ab7; color: #311b92; }
.badge-sector { background: #f1f8e9; border-color: #8bc34a; color: #33691e; }
.badge-region { background: #fff3e0; border-color: #ffb74d; color: #e65100; }

/* Ensure the grid pairs well with cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap, 1rem);
  padding: 2rem;
}

/* Case Study styles */
.case-study-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.case-study-section h2 {
  margin: 0 0 1.5rem 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
}

.case-study-content {
  margin-bottom: 1.5rem;
}

.case-study-section-item {
  margin-bottom: 1.5rem;
}

.case-study-section-item h3 {
  margin: 0 0 0.75rem 0;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
}

.case-study-text {
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
}

.case-study-text ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.case-study-text li {
  margin-bottom: 0.5rem;
}

.case-study-placeholder,
.case-study-error {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.case-study-actions {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--muted);
  color: white;
}

.btn-secondary:hover {
  background: #666;
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Header menu styles moved to header.css */


.dark-toggle {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px 8px;
  height: 32px;
  min-width: 32px;
  display:flex;
  align-items:center;
  gap:4px;
  text-decoration: none;
}


