/* ==========================================================================
   BrickHacks Universal Stylesheet
   Site: https://brickhacks.com
   ========================================================================== */

/* 1. Base Setup & Resets */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hyperlinks (Blue text at rest -> White text on Blue fill on mouseover) */
a {
  color: #004b9b;
  text-decoration: none !important;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  text-decoration: none !important;
  color: #ffffff !important;
  background-color: #004b9b !important;
}

/* Accessible Focus Visible Indicator across all interactives */
a:focus-visible,
table.nav-grid td:focus-within {
  outline: 2px solid #0284c7 !important;
  outline-offset: 2px !important;
}

/* 2. Unified Master Boundary (92% / 980px max) */
hr,
img.top-beam,
img.bottom-beam,
img[src*="bluebeam"],
img[src*="blue_beam"],
.site-header-logo,
.site-notice,
.part-spotlight,
.content-body,
table.nav-grid,
.matrix-section-header,
.table-container,
.mobile-table-hint,
.boycott-box {
  width: 92% !important;
  max-width: 980px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: left;
}

hr {
  margin-top: 30px;
  margin-bottom: 12px;
  border: 0;
  border-top: 1px solid #cbd5e1;
}

/* 3. Header & Structural Beams */
img.top-beam,
img.bottom-beam,
img[src*="bluebeam"],
img[src*="blue_beam"] {
  display: block !important;
  height: auto !important;
}

img.top-beam {
  margin-bottom: 0 !important;
}

img.bottom-beam,
img[src*="bluebeam"],
img[src*="blue_beam"] {
  margin-top: 14px !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.site-header-logo {
  text-align: center !important;
  margin-top: 6px;
  margin-bottom: 4px;
}

.site-header-logo img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

.site-header-logo a,
.site-header-logo a:hover {
  background-color: transparent !important;
}

h1.site-title {
  text-align: center;
  margin: 4px 0 8px 0;
  font-size: 2.2rem;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.02em;
}

h1.site-title a {
  color: #004b9b;
  background-color: transparent !important;
}

h1.site-title a:hover {
  color: #0284c7 !important;
  background-color: transparent !important;
}

.sub-nav {
  text-align: center;
  margin: 4px 0 10px 0;
  font-size: 0.95rem;
}

.site-notice {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #64748b;
  font-style: italic;
  text-align: center !important;
}

/* 4. Capsule Pill Navigation (Header Sub-nav & Footer) */
.subnav-pills,
.footer-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 10px;
  text-align: center;
}

.subnav-pills {
  margin-top: 8px;
  margin-bottom: 16px;
}

.footer-pills {
  margin-top: 6px;
  margin-bottom: 6px;
}

.footer-pills:first-of-type {
  margin-top: 20px;
}

.footer-pills:last-of-type {
  margin-bottom: 10px;
}

/* Pills Rest: Dark Slate background (#0f172a) with White text */
.subnav-pills a,
.footer-pills a {
  display: inline-block;
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid #334155;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Pills Mouseover: Inverts to Crisp White background with Dark Slate border & text */
.subnav-pills a:hover,
.footer-pills a:hover {
  background-color: #ffffff !important;
  border-color: #0f172a !important;
  color: #0f172a !important;
}

/* Active Pill State Indicator */
.subnav-pills a.active,
.footer-pills a.active {
  background-color: #004b9b !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  cursor: default;
}

.footer-copyright {
  text-align: center;
  margin: 12px auto 8px auto;
  font-size: 0.85em;
  color: #64748b;
  font-weight: 500;
}

/* 5. Spotlight Frame, Media & General Content Body */
.part-spotlight {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 24px 30px;
  margin-top: 18px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.spotlight-badge {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 6px;
}

.spotlight-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #004b9b;
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}

.spotlight-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin-bottom: 0;
}

.part-spotlight p {
  margin: 16px 0 0 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: #334155;
}

.spotlight-media {
  margin-top: 18px;
  text-align: center;
}

.spotlight-media img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.content-body {
  margin-top: 20px;
  margin-bottom: 25px;
  padding: 0 10px;
}

.content-body p,
.content-body ul,
.content-body ol {
  font-size: 1rem;
  line-height: 1.65;
  color: #1e293b;
  margin: 0 0 14px 0;
}

.content-body ul,
.content-body ol {
  padding-left: 28px;
}

.content-body li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.content-body li:last-child,
.content-body p:last-child,
.content-body ul:last-child,
.content-body ol:last-child {
  margin-bottom: 0;
}

/* Roganti Memorial Gallery */
.memorial-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 16px 0 20px 0;
}

.memorial-gallery img {
  max-width: 45%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 6. Navigation Matrix (index.php) - Medium Defined Border (1.5px / #38bdf8) */
table.nav-grid {
  table-layout: fixed;
  margin-top: 0 !important;
  margin-bottom: 25px !important;
  border-collapse: separate;
  border-spacing: 12px;
}

/* Base TD: 1.5px defined border with 6px rounded corners */
table.nav-grid td {
  background-color: #e0f2fe;
  border: 1.5px solid #38bdf8;
  border-radius: 6px;
  padding: 0;
  vertical-align: middle;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Entire Cell Clickable */
table.nav-grid td a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 64px;
  padding: 16px 12px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-align: center;
  border-radius: 5px;
  background-color: transparent !important;
  color: #004b9b !important;
  box-sizing: border-box;
}

/* Mouseover: Cell turns solid Blue, border turns solid Blue, text turns White */
table.nav-grid td:hover {
  background-color: #004b9b;
  border-color: #004b9b;
}

table.nav-grid td:hover a {
  background-color: transparent !important;
  color: #ffffff !important;
}

table.nav-grid td.nav-banner a {
  font-size: 1.05rem;
  min-height: 48px;
}

/* 7. Data Matrices Architecture (Shared: table.php & c9.php) */
.mobile-table-hint {
  display: none;
}

.matrix-section-header {
  background-color: #e0f2fe;
  color: #004b9b;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center !important;
  border: 1.5px solid #38bdf8;
  border-bottom: 0;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  padding: 12px 14px;
  margin-top: 24px;
  margin-bottom: 0;
}

.matrix-section-header a {
  color: #004b9b;
  background-color: transparent !important;
}

.matrix-section-header a:hover {
  color: #ffffff !important;
  background-color: #004b9b !important;
  padding: 2px 6px;
  border-radius: 4px;
}

.table-container {
  margin-top: 0;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #ffffff;
  border: 1.5px solid #38bdf8;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  position: relative;
}

table.data-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #0f172a;
}

table.data-matrix:not(.video-matrix-exact) {
  min-width: 780px;
}

table.data-matrix th,
table.data-matrix td {
  padding: 10px 14px;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  vertical-align: top;
  text-align: left;
}

table.data-matrix tr.col-headers th {
  background-color: #0f172a;
  color: #ffffff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  border-right: 1px solid #334155;
  border-bottom: 2px solid #004b9b;
}

table.data-matrix tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

table.data-matrix tbody tr:hover {
  background-color: #f1f5f9;
}

table.data-matrix td strong {
  color: #004b9b;
}

/* c9.php 50/50 Video Grid Specialization */
table.video-matrix-exact {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
}

table.video-matrix-exact th.col-half,
table.video-matrix-exact td.video-card-cell {
  width: 50% !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

table.video-matrix-exact th.col-half {
  text-align: center !important;
  vertical-align: middle !important;
}

table.video-matrix-exact td.video-card-cell {
  vertical-align: top !important;
}

.video-label {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #004b9b;
  margin-bottom: 12px;
}

.video-frame {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  background-color: #0f172a;
  margin: 0 auto;
}

.video-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.placeholder-body {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 180px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  text-align: center;
  box-sizing: border-box;
}

.placeholder-body p {
  color: #64748b;
  font-weight: 600;
  font-style: italic;
  font-size: 1.05rem;
  margin: 0;
}

/* 8. Editorial Callout */
.boycott-box {
  margin-top: 20px;
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #334155;
}

.boycott-box p {
  margin-top: 8px;
  margin-bottom: 0;
}

/* 9. Responsive Mobile Breakpoints (<= 768px) */
@media screen and (max-width: 768px) {
  table.nav-grid {
    border-spacing: 6px;
  }

  table.nav-grid td a {
    padding: 12px 6px;
    font-size: 0.85rem;
    min-height: 52px;
  }

  table.nav-grid td.nav-banner a {
    font-size: 0.9rem;
    padding: 12px 8px;
  }

  .mobile-table-hint {
    display: block !important;
    margin: 12px auto 8px auto !important;
    padding: 10px 14px !important;
    text-align: center !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #004b9b !important;
    background-color: #e0f2fe !important;
    border: 1px solid #bae6fd !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  }

  .matrix-section-header {
    font-size: 0.95rem;
    padding: 10px 12px;
    margin-top: 18px;
  }

  table.data-matrix:not(.video-matrix-exact) {
    font-size: 0.85rem;
  }

  table.data-matrix:not(.video-matrix-exact) th,
  table.data-matrix:not(.video-matrix-exact) td {
    padding: 8px 12px;
  }

  /* Sticky First Column for Wide Data Tables (table.php) */
  table.data-matrix:not(.video-matrix-exact) td:first-child,
  table.data-matrix:not(.video-matrix-exact) tr.col-headers th:first-child {
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 2px solid #004b9b;
  }

  table.data-matrix:not(.video-matrix-exact) tr.col-headers th:first-child {
    background-color: #0f172a;
  }

  table.data-matrix:not(.video-matrix-exact) tbody tr:nth-child(odd) td:first-child {
    background-color: #ffffff;
  }

  table.data-matrix:not(.video-matrix-exact) tbody tr:nth-child(even) td:first-child {
    background-color: #f8fafc;
  }

  table.data-matrix:not(.video-matrix-exact) tbody tr:hover td:first-child {
    background-color: #f1f5f9;
  }

  /* Full Vertical Stacking for Video Matrix (c9.php) */
  table.video-matrix-exact,
  table.video-matrix-exact thead,
  table.video-matrix-exact tbody,
  table.video-matrix-exact tr,
  table.video-matrix-exact td.video-card-cell {
    display: block !important;
    width: 100% !important;
  }

  table.video-matrix-exact thead {
    display: none !important;
  }

  table.video-matrix-exact td.video-card-cell {
    border-right: 0 !important;
    border-bottom: 2px solid #004b9b !important;
    padding: 16px 12px !important;
  }

  .placeholder-body {
    aspect-ratio: auto;
    min-height: 140px;
  }
}
