/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
  --bg:         #121212;
  --surface:    #121212;
  --ink:        #e8e8e8;
  --ink-muted:  #6b6760;
  --accent:     #b85c2c;
  --border:     #6a6a66;
  --gap:        2.5rem;
  --radius:     4px;
  --max-width:  900px;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  padding: 3rem var(--gap);
}

/* ── Grid ── */
.grid {
  display: flex;
  flex-direction: row;
  gap: var(--gap);
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: flex-start;
}

.column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.cell {
  background: var(--surface);
  border: 0.2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  border-radius: 15px;
}

/* ── Markdown cell ── */
.cell-md {
  padding: 2rem 2.25rem;
}

/* Typography inside md cells */
.cell-md h1,
.cell-md h2,
.cell-md h3,
.cell-md h4 {
  font-family: 'Lora', serif;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

.cell-md h1 { font-size: 1.75rem; margin-top: 0; }
.cell-md h2 { font-size: 1.35rem; }
.cell-md h3 { font-size: 1.1rem; }

.cell-md p {
  margin-bottom: 1rem;
  color: var(--ink);
}

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

.cell-md a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cell-md a:hover {
  opacity: 0.75;
}

.cell-md strong {
  font-weight: 500;
}

.cell-md em {
  font-family: 'Lora', serif;
  font-style: italic;
}

.cell-md ul,
.cell-md ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.cell-md li {
  margin-bottom: 0.3rem;
}

.cell-md blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.25rem 0;
  color: var(--ink-muted);
  font-family: 'Lora', serif;
  font-style: italic;
}

.cell-md code {
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  background: var(--bg);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  color: var(--accent);
}

.cell-md pre {
  background: var(--ink);
  color: #e8e4dc;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.cell-md pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.cell-md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.cell-md table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.25rem 0;
}

.cell-md th {
  background: var(--bg);
  font-weight: 500;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
}

.cell-md td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink-muted);
}

/* ── Image cell ── */
.cell-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Video cell ── */
.cell-video video {
  width: 100%;
  height: auto;
  display: block;
}

/* ── YouTube cell ── */
.youtube-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
}

.youtube-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Tweet cell ── */
.cell-tweet {
  padding: 0.5rem;
}

.cell-tweet .twitter-tweet {
  margin: 0 auto !important;
}

/* ── Error state ── */
.error {
  color: #c0392b;
  font-size: 0.85rem;
  font-style: italic;
}

/* ── Responsive: tighten spacing on small screens ── */
@media (max-width: 640px) {
  :root { --gap: 0.75rem; }
  body  { padding: 1rem 0.75rem; }
}