/* =========================================
   The Box Commons — style.css
   ========================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: 'Poppins', sans-serif;
  color: #0F172A;
  background: #FFFFFF;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Utility --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.3s ease;
}

.header.scrolled {
  box-shadow: 0 2px 20px rgba(15, 23, 42, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: #0F172A;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: #0F172A;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 1;
}

/* --- Mobile Toggle --- */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #0F172A;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero --- */
.hero {
  position: relative;
  padding: 180px 0 100px;
  background: #0F172A url('images/hero-bg.png') no-repeat center center;
  background-size: cover;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(15, 23, 42, 0.7) 50%,
    rgba(15, 23, 42, 0.35) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-headline {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 900px;
  margin-bottom: 24px;
  color: #FFFFFF;
}

.hero-subtext {
  font-size: 1.15rem;
  line-height: 1.7;
  opacity: 0.8;
  max-width: 700px;
  color: #FFFFFF;
}

/* --- Sections --- */
.section {
  padding: 100px 0;
}

.section-heading-center {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.section-intro {
  text-align: center;
  font-size: 1.05rem;
  opacity: 0.7;
  max-width: 700px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

/* --- Our Approach (blue gradient) --- */
.section-approach {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 40%, #1D4ED8 70%, #1E40AF 100%);
  color: #FFFFFF;
}

.section-approach .section-heading-center {
  color: #FFFFFF;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 48px;
}

.pillar {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 40px 32px;
  backdrop-filter: blur(4px);
}

.pillar-number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-bottom: 12px;
}

.pillar h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.pillar p {
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.9;
}

/* --- Status Section --- */
.section-status {
  position: relative;
  background: #F1F5F9;
  overflow: hidden;
}

.section-status::after {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 60%;
  height: 120%;
  background: url('images/accent-geometric.png') no-repeat center center;
  background-size: contain;
  opacity: 0.12;
  pointer-events: none;
}

.status-text {
  text-align: center;
  font-size: 1.05rem;
  opacity: 0.7;
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

.callout-card {
  max-width: 500px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 12px;
  border-left: 4px solid #3B82F6;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.callout-card p {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 12px;
  color: #0F172A;
}

.callout-card a {
  font-size: 0.95rem;
  color: #3B82F6;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.callout-card a:hover {
  color: #1D4ED8;
}

/* --- Footer --- */
.footer {
  background: #0F172A;
  color: rgba(255, 255, 255, 0.85);
  padding: 64px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.footer-tagline {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-top: 8px;
  max-width: 400px;
}

.footer-meta {
  font-size: 0.75rem;
  opacity: 0.4;
  margin-top: 8px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}

.footer-nav a {
  font-size: 0.85rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.footer-nav a:hover {
  opacity: 1;
}

.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  margin-top: 16px;
}

.footer-bottom p {
  font-size: 0.75rem;
  opacity: 0.4;
}

/* =========================================
   Publication Pages
   ========================================= */

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 100px 0 0;
  font-size: 0.8rem;
  opacity: 0.5;
}

.breadcrumb a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breadcrumb a:hover {
  opacity: 0.8;
}

.breadcrumb span {
  margin: 0 8px;
}

/* --- Publication Header --- */
.pub-header {
  padding: 32px 0 48px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.pub-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 800px;
  margin-bottom: 24px;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 0.8rem;
  opacity: 0.6;
}

.pub-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pub-meta-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Executive Summary --- */
.pub-summary {
  padding: 48px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.pub-summary h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3B82F6;
  margin-bottom: 16px;
}

.pub-summary p {
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 800px;
  opacity: 0.85;
}

/* --- Publication Body --- */
.pub-body {
  padding: 48px 0;
  max-width: 800px;
}

.pub-body h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.pub-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.pub-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.pub-body p {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 16px;
  opacity: 0.85;
}

.pub-body ul,
.pub-body ol {
  margin: 0 0 16px 24px;
  font-size: 0.95rem;
  line-height: 1.8;
  opacity: 0.85;
}

.pub-body li {
  margin-bottom: 8px;
}

.pub-body strong {
  font-weight: 600;
}

.pub-body em {
  font-style: italic;
}

.pub-body blockquote {
  border-left: 3px solid #3B82F6;
  padding-left: 20px;
  margin: 24px 0;
  opacity: 0.8;
  font-style: italic;
}

.pub-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.85rem;
}

.pub-body th,
.pub-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.pub-body th {
  font-weight: 600;
  background: #F1F5F9;
}

.pub-body hr {
  border: none;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin: 48px 0;
}

/* --- FAQ Section --- */
.pub-faq {
  padding: 48px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #F1F5F9;
}

.pub-faq h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 32px;
}

.faq-item {
  margin-bottom: 24px;
  max-width: 800px;
}

.faq-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #0F172A;
}

.faq-item p {
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.75;
}

/* --- Related Publications --- */
.pub-related {
  padding: 48px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.pub-related h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.related-card {
  display: block;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.related-card:hover {
  border-color: #3B82F6;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.1);
}

.related-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.related-card p {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* =========================================
   Publications Index Page
   ========================================= */

.pub-index-header {
  padding: 120px 0 48px;
}

.pub-index-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.pub-index-header p {
  font-size: 1.05rem;
  opacity: 0.7;
  max-width: 700px;
  line-height: 1.7;
}

/* --- CSS-only filter --- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 24px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.filter-bar label {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.filter-bar label:hover {
  background: #F1F5F9;
}

/* Hide radios (placed as siblings outside filter-bar for ~ selector) */
input[name="filter"] {
  display: none;
}

#filter-all:checked ~ .filter-bar label[for="filter-all"],
#filter-comments:checked ~ .filter-bar label[for="filter-comments"],
#filter-frameworks:checked ~ .filter-bar label[for="filter-frameworks"] {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.pub-list {
  padding: 32px 0 80px;
}

.pub-card {
  display: block;
  padding: 32px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  transition: opacity 0.2s ease;
}

.pub-card:hover {
  opacity: 0.85;
}

.pub-card-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3B82F6;
  margin-bottom: 8px;
}

.pub-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.pub-card p {
  font-size: 0.9rem;
  opacity: 0.65;
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.pub-card-date {
  font-size: 0.75rem;
  opacity: 0.4;
}

/* CSS-only filter visibility */
#filter-all:checked ~ .pub-list .pub-card { display: block; }
#filter-comments:checked ~ .pub-list .pub-card[data-type="framework"] { display: none; }
#filter-frameworks:checked ~ .pub-list .pub-card[data-type="comment"] { display: none; }

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 960px) {
  .pillars-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-nav {
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .mobile-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #FFFFFF;
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }

  .nav.open {
    display: flex;
  }

  .hero {
    padding: 140px 0 72px;
  }

  .hero-headline {
    font-size: 2rem;
  }

  .section {
    padding: 72px 0;
  }

  .section-heading-center {
    font-size: 1.7rem;
  }

  .pub-header h1 {
    font-size: 1.7rem;
  }

  .pub-index-header {
    padding: 100px 0 32px;
  }

  .pub-index-header h1 {
    font-size: 1.7rem;
  }

  .pub-meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* --- Accessibility: reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
