/* ===== Custom Properties ===== */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fa;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-org: #0d9488;
  --color-accent-org-hover: #0f766e;
  --color-border: #e5e7eb;
  --color-editorial-border: #2563eb;
  --color-org-border: #0d9488;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --max-width: 720px;
  --header-height: 64px;
}

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

/* ===== Base ===== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Site Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo:hover {
  text-decoration: none;
}

.site-logo svg {
  width: 28px;
  height: 28px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* ===== Hero ===== */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero .tagline {
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* ===== Search ===== */
.search-bar {
  padding: 0 0 2rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: var(--color-bg-alt);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

/* ===== Issue Cards ===== */
.issue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 3rem;
}

.issue-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.issue-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.issue-card .issue-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.issue-card .issue-number {
  font-weight: 700;
  color: var(--color-accent);
}

.issue-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.issue-card .issue-summary {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.no-results {
  text-align: center;
  padding: 2rem 0;
  color: var(--color-text-muted);
  display: none;
}

/* ===== Issue Page ===== */
.issue-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.issue-header .issue-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.issue-header .issue-number {
  font-weight: 700;
  color: var(--color-accent);
}

.issue-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ===== Section Divider ===== */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 2rem;
  padding: 0;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.section-divider .section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.section-divider .section-label.ai {
  color: var(--color-accent);
}

.section-divider .section-label.org {
  color: var(--color-accent-org);
}

/* ===== Editorial Section ===== */
.editorial {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  padding: 1.5rem 0 1.5rem 1.5rem;
  border-left: 3px solid var(--color-editorial-border);
  margin-bottom: 2.5rem;
  background: var(--color-bg-alt);
  border-radius: 0 8px 8px 0;
  padding-right: 1.5rem;
}

.editorial h2 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.editorial p {
  margin-bottom: 1rem;
}

.editorial p:last-child {
  margin-bottom: 0;
}

/* ===== Org Design Section ===== */
.org-editorial {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  padding: 1.5rem;
  border-left: 3px solid var(--color-org-border);
  margin-bottom: 2.5rem;
  background: #f0fdfa;
  border-radius: 0 8px 8px 0;
}

.org-editorial h2 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent-org);
  margin-bottom: 1rem;
}

.org-editorial p {
  margin-bottom: 1rem;
}

.org-editorial p:last-child {
  margin-bottom: 0;
}

.org-article {
  margin-bottom: 2.5rem;
}

.org-article h3 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--color-text);
}

.org-article h3:first-child {
  margin-top: 0;
}

.org-article p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.org-article p:last-child {
  margin-bottom: 0;
}

.org-article .callout {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  line-height: 1.7;
}

.org-article .callout strong {
  color: var(--color-accent-org);
}

.org-article .series-note {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-style: italic;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  margin-top: 1.5rem;
}

/* ===== Curated Links ===== */
.curated-links h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.link-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.link-item:last-child {
  border-bottom: none;
}

.link-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.link-item h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.link-item h3 a {
  color: var(--color-text);
}

.link-item h3 a:hover {
  color: var(--color-accent);
}

.link-item .external-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  opacity: 0.4;
}

.source-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.category-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.category-tag.research { background: #dbeafe; color: #1e40af; }
.category-tag.industry { background: #fce7f3; color: #9d174d; }
.category-tag.policy { background: #fef3c7; color: #92400e; }
.category-tag.open-source { background: #d1fae5; color: #065f46; }
.category-tag.opinion { background: #ede9fe; color: #5b21b6; }
.category-tag.tutorial { background: #ffedd5; color: #9a3412; }
.category-tag.org-design { background: #ccfbf1; color: #115e59; }

.link-item .link-summary {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== Issue Navigation ===== */
.issue-nav {
  display: flex;
  justify-content: space-between;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}

.issue-nav a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== About Page ===== */
.about-content {
  padding: 2.5rem 0 3rem;
}

.about-content h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.about-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.about-content ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.about-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

/* ===== Legal / Privacy pages ===== */
.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.4rem 0 0.5rem;
}

.legal-content .legal-updated {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
}

/* ===== Article Images (figures) ===== */
.article-image {
  margin: 1.5rem 0;
  text-align: center;
}

.article-image img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  margin: 0 auto;
}

.article-image figcaption {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

/* ===== Long-form Essay Emphasis ===== */
/* Inline bold inside the org-article (the long essay body) is rendered
   in the accent color so emphasized passages don't read as headings. */
.org-article p strong,
.org-article li strong {
  color: #047857; /* emerald-700 — distinct from accent blue and from black headings */
}

/* ===== Video Embeds ===== */
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 1.5rem 0;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

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

.video-placeholder {
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

.video-caption {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  font-style: italic;
  text-align: center;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .hero .tagline {
    font-size: 1rem;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 1rem;
  }

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

  .issue-header h1 {
    font-size: 1.4rem;
  }

  .editorial {
    padding: 1rem 1rem 1rem 1rem;
  }

  .org-editorial {
    padding: 1rem;
  }

  .link-item-header {
    flex-direction: column;
    gap: 0.5rem;
  }
}


/* ===== Newsletter subscribe ===== */
.subscribe { text-align: center; max-width: 640px; margin: 1.75rem auto 2.25rem; padding: 1.9rem 1.5rem; background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: 14px; }
.subscribe h2 { margin: 0 0 0.35rem; font-size: 1.5rem; color: var(--color-text); }
.subscribe p { color: var(--color-text-muted); margin: 0 auto 1.2rem; max-width: 460px; }
.subscribe .hs-form-frame { max-width: 460px; margin: 0 auto; text-align: left; }
.subscribe.compact { max-width: 640px; margin: 2.5rem auto 0.5rem; padding: 1.4rem 1.25rem; border-radius: 12px; }
.subscribe.compact h2 { font-size: 1.15rem; }
.subscribe.compact p { font-size: 0.9rem; margin-bottom: 0.9rem; }
