/* Clankies Blog Theme
   Matches the main app design system: Fredoka headings, Nunito body, teal+pink+amber accents */

:root {
  --p: oklch(56% 0.12 170);   /* primary teal */
  --s: oklch(60% 0.18 330);   /* secondary pink */
  --a: oklch(65% 0.14 80);    /* accent amber */
  --n: oklch(20% 0.02 240);   /* neutral */
  --b1: #fff;
  --b2: oklch(98% 0.004 240);
  --b3: oklch(90% 0.006 240);
  --bc: oklch(20% 0.02 240);
  --muted: oklch(20% 0.02 240 / 55%);
  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', monospace;
}

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

html {
  font-family: var(--font-body);
  background: var(--b1);
  color: var(--bc);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  color: var(--n);
}

a { color: var(--p); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  padding: 3rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--b3);
  margin-bottom: 2.5rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--n);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

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

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--p);
  border-radius: 0.625rem;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
}

.site-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

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

/* Posts list */
.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.post-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--b3);
}

.post-card:first-child { padding-top: 0; }

.post-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.post-tags { display: flex; gap: 0.375rem; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: oklch(56% 0.12 170 / 12%);
  color: var(--p);
}

.post-title {
  font-size: 1.35rem;
  margin: 0.25rem 0 0.5rem;
}

.post-title a { color: var(--n); }
.post-title a:hover { color: var(--p); text-decoration: none; }

.post-summary {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.read-more {
  font-size: 0.9rem;
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.page-link {
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--b3);
  color: var(--p);
}

.page-link:hover {
  background: var(--b2);
  text-decoration: none;
}

.page-info { color: var(--muted); }

/* Post single */
.post-single { padding-bottom: 3rem; }

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--b3);
}

.post-header .post-title {
  font-size: 2rem;
  margin-top: 0.5rem;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-content h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid oklch(56% 0.12 170 / 25%);
}

.post-content h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.post-content p { margin: 0 0 1.25rem; }

.post-content ul, .post-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.post-content li { margin-bottom: 0.375rem; }

.post-content pre {
  background: oklch(20% 0.02 240);
  color: oklch(85% 0.01 240);
  padding: 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--b2);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Mermaid diagrams — override dark code block styling */
.post-content pre:has(code.language-mermaid),
.post-content pre.mermaid-rendered {
  background: var(--b1);
  color: var(--bc);
  font-family: var(--font-body);
  padding: 0.5rem;
  box-shadow: 0 1px 3px oklch(from var(--n) l c h / 0.06);
}

.post-content blockquote {
  border-left: 3px solid var(--p);
  padding: 0.75rem 1.25rem;
  margin: 0 0 1.5rem;
  background: oklch(56% 0.12 170 / 5%);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--muted);
}

.post-content blockquote p { margin: 0; }

.post-content hr {
  border: none;
  height: 1px;
  background: var(--b3);
  margin: 2rem 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

.post-content th {
  background: var(--b2);
  font-weight: 600;
  text-align: left;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--b3);
}

.post-content td {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--b3);
}

.post-content img {
  border-radius: 0.75rem;
  border: 1px solid var(--b3);
  margin: 1rem 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--b3);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Code syntax highlighting (Chroma) */
/* Background */ .chroma { background-color: oklch(20% 0.02 240); color: oklch(85% 0.01 240); }
/* Error */ .chroma .err { color: #ff6b6b; }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { background-color: oklch(30% 0.02 240); display: block; width: 100%; }
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em; color: oklch(50% 0.02 240); }
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em; color: oklch(50% 0.02 240); }
/* Keyword */ .chroma .k { color: #c792ea; }
/* KeywordConstant */ .chroma .kc { color: #c792ea; }
/* KeywordDeclaration */ .chroma .kd { color: #c792ea; }
/* KeywordNamespace */ .chroma .kn { color: #c792ea; }
/* KeywordPseudo */ .chroma .kp { color: #c792ea; }
/* KeywordReserved */ .chroma .kr { color: #c792ea; }
/* KeywordType */ .chroma .kt { color: #ffcb6b; }
/* NameAttribute */ .chroma .na { color: #ffcb6b; }
/* NameBuiltin */ .chroma .nb { color: #82aaff; }
/* NameClass */ .chroma .nc { color: #ffcb6b; }
/* NameFunction */ .chroma .nf { color: #82aaff; }
/* NameTag */ .chroma .nt { color: #89ddff; }
/* LiteralString */ .chroma .s { color: #c3e88d; }
/* LiteralStringDouble */ .chroma .s2 { color: #c3e88d; }
/* LiteralStringSingle */ .chroma .s1 { color: #c3e88d; }
/* LiteralNumber */ .chroma .m { color: #f78c6c; }
/* Comment */ .chroma .c { color: #546e7a; font-style: italic; }
/* Operator */ .chroma .o { color: #89ddff; }
/* Punctuation */ .chroma .p { color: #89ddff; }

/* ===== Iceberg visualization ===== */
.iceberg-section {
  margin-bottom: 3rem;
}

.iceberg-layout {
  display: flex;
  gap: 2rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.iceberg-viz {
  flex: 0 0 300px;
  border: 1px solid var(--b3);
  border-radius: var(--rounded-box);
  overflow: hidden;
  background: oklch(98% 0.01 240);
  display: flex;
  align-items: center;
}

.iceberg-viz svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Iceberg float animation */
.iceberg-float {
  animation: icebergBob 6s ease-in-out infinite;
}

@keyframes icebergBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Wave animations */
.wave1 {
  animation: waveDrift1 8s ease-in-out infinite;
}

.wave2 {
  animation: waveDrift2 6s ease-in-out infinite;
}

@keyframes waveDrift1 {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(12px); }
}

@keyframes waveDrift2 {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-8px); }
}

.iceberg-labels {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.iceberg-zone {
  padding: 0 0 1.25rem 0;
}

.iceberg-zone h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.iceberg-zone p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem 0;
}

.iceberg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  flex-shrink: 0;
}

.iceberg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.iceberg-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: var(--b2);
  color: var(--bc);
  border: 1px solid var(--b3);
}

.iceberg-zone.below .iceberg-tag {
  opacity: 0.55;
}

.iceberg-caption {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 0.5rem;
  border-top: 1px solid var(--b3);
}

@media (max-width: 680px) {
  .iceberg-layout {
    flex-direction: column;
    align-items: center;
  }
  .iceberg-viz {
    flex: 0 0 auto;
    max-width: 280px;
  }
}

.posts-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid oklch(56% 0.12 170 / 20%);
}

/* Responsive */
@media (max-width: 640px) {
  .site-header { padding: 2rem 0 1.5rem; }
  .site-title { font-size: 1.5rem; }
  .post-header .post-title { font-size: 1.5rem; }
  .post-title { font-size: 1.2rem; }
  .post-nav { flex-direction: column; gap: 0.75rem; }
}
