/* ============================================
 * Behavioral Strategy Wiki - Dark Green Theme
 * ============================================ */

:root {
  --bg-dark: #0a1f1a;
  --bg-card: #0d2b23;
  --bg-header: #0a1f1a;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-heading: #ffffff;
  --accent: #2ecc71;
  --accent-hover: #27ae60;
  --link-color: #5dade2;
  --link-hover: #85c1e9;
  --nav-bg: rgba(10, 31, 26, 0.95);
  --border-color: #1a3d32;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header / Hero ---- */
.site-header {
  background: linear-gradient(135deg, #0a1f1a 0%, #0d3525 50%, #0a1f1a 100%);
  padding: 2rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.site-title {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--text-heading);
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.site-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.site-logos img {
  height: 45px;
  opacity: 0.9;
}

/* ---- Navigation ---- */
.site-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

.site-nav li a {
  display: block;
  padding: 0.85rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: color 0.2s, background 0.2s;
}

.site-nav li a:hover,
.site-nav li a.active {
  color: var(--accent);
  background: rgba(46, 204, 113, 0.08);
}

/* ---- Main Content ---- */
main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  width: 100%;
}

h2 {
  font-size: 1.8rem;
  color: var(--text-heading);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

h3 {
  font-size: 1.3rem;
  color: var(--text-heading);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

h6 {
  font-size: 1.1rem;
  color: var(--text-heading);
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.3rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

strong {
  color: var(--text-heading);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--accent);
}

.site-footer a.contribute-cta {
  color: #000;
}

.contribute-cta {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.contribute-cta:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: #000;
}

/* ---- Literature Matrix ---- */
.matrix-container {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.matrix-table {
  border-collapse: collapse;
  font-size: 0.7rem;
  min-width: 700px;
}

.matrix-table th {
  background: #0d3525;
  color: var(--text-heading);
  padding: 0.5rem 0.4rem;
  font-weight: 700;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid var(--border-color);
  text-align: center;
  min-width: 35px;
}


.matrix-table th.col-header {
  height: 280px;
  min-width: 36px;
  padding: 0;
  vertical-align: bottom;
  background: #0d3525;
  font-size: inherit;
  text-align: center;
}

.matrix-table th.col-header .header-wrapper {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  padding-bottom: 10px;
}

.matrix-table th.col-header span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 700;
}

.matrix-table th.row-header {
  text-align: right;
  padding: 0.4rem 0.6rem;
  min-width: 130px;
  white-space: nowrap;
  font-size: 0.65rem;
}

.matrix-table th.corner {
  background: #0a1f1a;
  vertical-align: bottom;
  text-align: right;
  padding-right: 0.6rem;
  padding-bottom: 0.4rem;
}

.matrix-table td {
  text-align: center;
  padding: 0.3rem;
  border: 1px solid var(--border-color);
  font-weight: 700;
  min-width: 35px;
  transition: transform 0.1s;
}

.matrix-table td a {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.matrix-table td:hover {
  transform: scale(1.1);
  z-index: 10;
  position: relative;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

/* Color scale for matrix cells */
/* 0: dark background */
.cell-0  { background: #1a3d32; color: #4a6a5e; }
/* 1-5: green */
.cell-1  { background: #2ecc71; color: #000; }
.cell-2  { background: #2ecc71; color: #000; }
.cell-3  { background: #2ecc71; color: #000; }
.cell-4  { background: #2ecc71; color: #000; }
.cell-5  { background: #2ecc71; color: #000; }
/* 6-10: yellow */
.cell-6  { background: #f1c40f; color: #000; }
.cell-7  { background: #f1c40f; color: #000; }
.cell-8  { background: #f1c40f; color: #000; }
.cell-9  { background: #f1c40f; color: #000; }
.cell-10 { background: #f1c40f; color: #000; }
/* 11-15: orange */
.cell-11 { background: #e67e22; color: #000; }
.cell-12 { background: #e67e22; color: #000; }
.cell-13 { background: #e67e22; color: #000; }
.cell-14 { background: #e67e22; color: #000; }
.cell-15 { background: #e67e22; color: #000; }
/* 16-20: red */
.cell-16 { background: #e74c3c; color: #fff; }
.cell-17 { background: #e74c3c; color: #fff; }
.cell-18 { background: #e74c3c; color: #fff; }
.cell-19 { background: #e74c3c; color: #fff; }
.cell-20 { background: #e74c3c; color: #fff; }
/* 21+: dark red */
.cell-21 { background: #7b241c; color: #fff; }
.cell-22 { background: #7b241c; color: #fff; }
.cell-23 { background: #7b241c; color: #fff; }
.cell-24 { background: #7b241c; color: #fff; }
.cell-25 { background: #7b241c; color: #fff; }
.cell-26 { background: #7b241c; color: #fff; }
.cell-27 { background: #7b241c; color: #fff; }
.cell-28 { background: #7b241c; color: #fff; }
.cell-29 { background: #7b241c; color: #fff; }
.cell-30 { background: #7b241c; color: #fff; }

/* ---- Videos ---- */
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.2rem;
}

.video-card h3 {
  margin-top: 0;
  font-size: 1rem;
}

.video-card iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* ---- Contact Form ---- */
.contact-form {
  max-width: 600px;
}

.contact-form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  color: var(--text-heading);
  font-weight: 600;
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form button {
  margin-top: 1.2rem;
  padding: 0.7rem 2rem;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.contact-form button:hover {
  background: var(--accent-hover);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .site-title { font-size: 2rem; }
  .site-nav ul { flex-wrap: wrap; }
  .site-nav li a { padding: 0.6rem 1rem; font-size: 0.8rem; }
  main { padding: 1.5rem 1rem; }
  .video-grid { grid-template-columns: 1fr; }
}

/* ============================================
 * FINAL SPECIFICITY OVERRIDES
 * ============================================ */

/* Force Phenomena & Concepts labels to match and ignore global constraints */
html body .matrix-table thead tr th.concepts-label,
html body .matrix-table thead tr th.phenomena-label-large {
  font-size: 1.8rem !important;
  font-weight: 900 !important;
  color: #2ecc71 !important;
  text-transform: uppercase !important;
  letter-spacing: 2px !important;
  background: transparent !important;
  border: none !important;
  padding: 20px !important;
  height: auto !important;
  writing-mode: horizontal-tb !important;
  transform: none !important;
  visibility: visible !important;
}

/* Align Phenomena label to bottom right corner of its cell */
html body .matrix-table thead tr th.phenomena-label-large {
  text-align: right !important;
  vertical-align: bottom !important;
  padding-right: 15px !important;
}

/* Center Concepts label over its columns */
html body .matrix-table thead tr th.concepts-label {
  text-align: center !important;
  padding-bottom: 30px !important;
}

/* Fix Contribute button text visibility */
.contribute-cta,
.site-footer a.contribute-cta {
  background-color: #2ecc71 !important;
  color: #000000 !important;
  opacity: 1 !important;
}


