/* ═══════════════════════════════════════════════
   APERTUM — Strategic Insights Platform
   Theme: Editorial/magazine with red spiral motif
   ═══════════════════════════════════════════════ */

:root {
  --red-deep: #8B1A1A;
  --red-brand: #C41E1E;
  --red-bright: #E02020;
  --red-accent: #FF3333;
  --charcoal: #1C1C1E;
  --slate: #2C2C2E;
  --ash: #3A3A3C;
  --silver: #8E8E93;
  --pearl: #D1D1D6;
  --bone: #F2F2F7;
  --white: #FFFFFF;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ── NAVIGATION ── */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(28, 28, 30, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196, 30, 30, 0.3);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--pearl);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--red-accent); }
.nav-links a.active { color: var(--red-brand); }

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--pearl);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ── HERO ── */
.hero {
  margin-top: 64px;
  background: var(--charcoal);
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(196, 30, 30, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-brand), transparent);
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-pillar-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-pillar-tag::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--red-brand);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-excerpt {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--pearl);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--silver);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-meta .author { color: var(--pearl); font-weight: 500; }

.hero-read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red-accent);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: gap 0.3s;
}

.hero-read-link:hover { gap: 14px; }

.hero-image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--slate) 0%, var(--ash) 100%);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--silver);
  font-size: 0.85rem;
  font-style: italic;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── SECTION LABELS ── */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-brand);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 2.5rem;
}

/* ── PILLAR GRID ── */
.pillars {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.pillar-card {
  border: 1px solid var(--pearl);
  border-radius: 6px;
  padding: 2rem 1.5rem;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.pillar-card:hover {
  border-color: var(--red-brand);
  box-shadow: 0 8px 32px rgba(196, 30, 30, 0.08);
  transform: translateY(-2px);
}

.pillar-card:hover::before { transform: scaleX(1); }

.pillar-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bone);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.4rem;
}

.pillar-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--charcoal);
}

.pillar-card-desc {
  font-size: 0.88rem;
  color: var(--silver);
  line-height: 1.6;
}

.pillar-count {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--red-brand);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── LATEST INSIGHTS SECTION ── */
.latest {
  background: var(--bone);
  border-top: 1px solid var(--pearl);
  border-bottom: 1px solid var(--pearl);
}

.latest-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3.5rem;
}

/* ── ARTICLE CARDS ── */
.article-list { display: flex; flex-direction: column; gap: 1.5rem; }

.article-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  text-decoration: none;
  color: inherit;
  padding: 1.25rem;
  background: var(--white);
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.25s;
}

.article-card:hover {
  border-color: var(--pearl);
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.article-thumb {
  aspect-ratio: 3/2;
  background: linear-gradient(135deg, var(--slate) 0%, var(--ash) 100%);
  border-radius: 4px;
  overflow: hidden;
}

.article-thumb img { width: 100%; height: 100%; object-fit: cover; }

.article-card-pillar {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-brand);
  margin-bottom: 0.4rem;
}

.article-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.article-card-excerpt {
  font-size: 0.88rem;
  color: var(--silver);
  line-height: 1.6;
}

.article-card-meta {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--silver);
}

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--pearl);
  border-radius: 6px;
  padding: 1.75rem;
}

.sidebar-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--charcoal);
}

.sidebar-text {
  font-size: 0.88rem;
  color: var(--silver);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.sidebar-text strong { color: var(--charcoal); }

/* ── POLLS ── */
.poll-question {
  font-size: 0.95rem;
  color: var(--charcoal);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.poll-option {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--pearl);
  border-radius: 4px;
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--charcoal);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  min-height: 44px;
}

.poll-option:hover {
  border-color: var(--red-brand);
  background: rgba(196, 30, 30, 0.03);
}

.poll-option.selected {
  border-color: var(--red-brand);
  background: rgba(196, 30, 30, 0.06);
  font-weight: 600;
}

.poll-option:disabled {
  cursor: default;
  opacity: 0.8;
}

.poll-responses {
  font-size: 0.75rem;
  color: var(--silver);
  margin-top: 0.5rem;
}

/* Inline poll (in articles) */
.inline-poll {
  margin: 2.5rem 0;
  padding: 2rem;
  background: var(--bone);
  border-radius: 6px;
  border-left: 3px solid var(--red-brand);
}

.inline-poll-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-brand);
  margin-bottom: 0.75rem;
}

/* ── SUBSCRIBE ── */
.subscribe-form { display: flex; gap: 0.5rem; }

.subscribe-input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1px solid var(--pearl);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: var(--bone);
  transition: border-color 0.2s;
  min-height: 44px;
}

.subscribe-input:focus {
  outline: none;
  border-color: var(--red-brand);
}

.subscribe-btn {
  padding: 0.65rem 1.25rem;
  background: var(--red-brand);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  min-height: 44px;
}

.subscribe-btn:hover { background: var(--red-deep); }

.subscribe-msg {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: var(--silver);
}

.subscribe-msg.success { color: #2d7d46; }
.subscribe-msg.error { color: var(--red-brand); }

/* ── ARTICLE PAGE ── */
.article-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
}

.article-page .pillar-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red-brand);
  text-decoration: none;
  margin-bottom: 1rem;
  display: inline-block;
  transition: color 0.2s;
}

.article-page .pillar-tag:hover { color: var(--red-accent); }

.article-page h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--charcoal);
  margin-bottom: 1rem;
}

.article-page .meta {
  font-size: 0.85rem;
  color: var(--silver);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--pearl);
}

.article-hero-img {
  margin-bottom: 2.5rem;
  border-radius: 6px;
  overflow: hidden;
}

.article-hero-img img { width: 100%; }

/* Article body content */
.content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--slate);
}

.content p { margin-bottom: 1.5rem; }

.content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 2.5rem 0 1rem;
}

.content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 2rem 0 0.75rem;
}

.content blockquote {
  border-left: 3px solid var(--red-brand);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--ash);
}

.content ul, .content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.content li { margin-bottom: 0.5rem; }

.content a {
  color: var(--red-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content a:hover { color: var(--red-deep); }

.content code {
  font-size: 0.9em;
  background: var(--bone);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.content pre {
  background: var(--charcoal);
  color: var(--pearl);
  padding: 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.content pre code {
  background: none;
  padding: 0;
}

/* Article footer */
.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--pearl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-author-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silver);
}

.article-author-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--charcoal);
}

.article-nav { display: flex; gap: 1.5rem; }

.article-nav-link {
  font-size: 0.85rem;
  color: var(--red-brand);
  text-decoration: none;
  transition: color 0.2s;
}

.article-nav-link:hover { color: var(--red-deep); }

/* ── PILLAR HEADER (listing page) ── */
.pillar-header {
  margin-top: 64px;
  background: var(--charcoal);
  border-bottom: 1px solid rgba(196, 30, 30, 0.3);
}

.pillar-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.pillar-header .section-label { color: var(--red-accent); }
.pillar-header .section-title { color: var(--white); margin-bottom: 1rem; }

.pillar-header-desc {
  font-size: 1.05rem;
  color: var(--pearl);
  line-height: 1.7;
  max-width: 640px;
}

.pillar-listing { background: var(--bone); }

.pillar-listing-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.pillar-empty {
  text-align: center;
  padding: 3rem;
  color: var(--silver);
  font-size: 1rem;
}

.pillar-empty a { color: var(--red-brand); }

/* ── STATIC PAGES (about, subscribe, surveys) ── */
.static-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
}

.static-page h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 1.5rem;
}

.static-page .content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--slate);
}

/* ── FOOTER ── */
.footer {
  background: var(--charcoal);
  color: var(--silver);
  border-top: 1px solid rgba(196, 30, 30, 0.3);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--pearl);
  letter-spacing: 0.06em;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--silver);
  margin-top: 0.25rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--silver);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--red-accent); }

.footer-copy { font-size: 0.75rem; color: var(--ash); }

/* ═══════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════ */

/* Tablet landscape / small desktop */
@media (max-width: 1024px) {
  .nav-links { gap: 1.25rem; }
  .nav-links a { font-size: 0.75rem; }
  .pillar-grid { gap: 1rem; }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(28, 28, 30, 0.98);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 0;
    border-bottom: 1px solid rgba(196, 30, 30, 0.3);
  }

  .nav-links.open { display: flex; }

  .nav-links li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    font-size: 0.9rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3.5rem 2rem;
  }

  .hero-image { display: none; }
  .hero h1 { font-size: 2.2rem; }
  .pillar-grid { grid-template-columns: repeat(3, 1fr); }

  .latest-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .article-card { grid-template-columns: 140px 1fr; }
  .article-page h1 { font-size: 2rem; }
}

/* Mobile */
@media (max-width: 600px) {
  .nav-inner { padding: 0 1.25rem; }
  .pillar-grid { grid-template-columns: 1fr; }

  .article-card {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .article-thumb { display: none; }

  .hero h1 { font-size: 1.8rem; }
  .hero-inner { padding: 2.5rem 1.25rem; }
  .hero-excerpt { font-size: 0.95rem; }

  .pillars { padding: 3rem 1.25rem; }
  .latest-inner { padding: 3rem 1.25rem; }

  .subscribe-form { flex-direction: column; }

  .article-page {
    padding: 5rem 1.25rem 3rem;
  }

  .article-page h1 { font-size: 1.7rem; }
  .content { font-size: 1rem; }
  .content h2 { font-size: 1.35rem; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links { justify-content: center; }

  .section-title { font-size: 1.6rem; }

  .pillar-header-inner { padding: 3rem 1.25rem; }
  .pillar-listing-inner { padding: 2rem 1.25rem; }
  .static-page { padding: 5rem 1.25rem 3rem; }
}

/* Ensure touch targets on mobile */
@media (pointer: coarse) {
  .poll-option { min-height: 48px; padding: 0.75rem 1rem; }
  .nav-links a { padding: 0.9rem 0; }
  .subscribe-btn { min-height: 48px; }
  .subscribe-input { min-height: 48px; }
}

/* ── Poll Results Display ── */
.poll-results-display {
  margin-top: 0.75rem;
}

.poll-results-count {
  font-size: 0.75rem;
  color: var(--silver);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.poll-result-row {
  display: grid;
  grid-template-columns: 1fr 120px 45px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.poll-result-label {
  color: var(--charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poll-result-bar-bg {
  height: 8px;
  background: var(--bone);
  border-radius: 4px;
  overflow: hidden;
}

.poll-result-bar {
  height: 100%;
  background: var(--red-brand);
  border-radius: 4px;
  transition: width 0.6s ease-out;
  min-width: 2px;
}

.poll-result-pct {
  text-align: right;
  font-weight: 600;
  color: var(--charcoal);
  font-size: 0.75rem;
}

/* Responsive: stack labels on mobile */
@media (max-width: 600px) {
  .poll-result-row {
    grid-template-columns: 1fr 80px 40px;
  }

  .poll-result-label {
    font-size: 0.75rem;
  }
}
