/* ==========================================================================
   Doorvlinderen — publieke stylesheet
   ========================================================================== */

:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --ink: #2d2733;
  --muted: #756d80;
  --line: #eae2d8;

  --lila: #8b7bb8;
  --lila-deep: #63549b;
  --lila-tint: #efeaf8;

  --c-columns: #bf6247;
  --c-columns-tint: #f8e5dd;
  --c-hersens: #7c6bb4;
  --c-hersens-tint: #ece7f7;
  --c-gedicht: #47836f;
  --c-gedicht-tint: #dfeee7;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(45, 39, 51, .05), 0 8px 28px -12px rgba(45, 39, 51, .14);
  --shadow-lift: 0 2px 4px rgba(45, 39, 51, .06), 0 18px 44px -16px rgba(45, 39, 51, .22);

  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Karla", "Segoe UI", sans-serif;
}

/* Donkere modus: alleen wanneer de bezoeker er zelf voor kiest (toggle in de header). */
:root[data-theme="dark"] {
  --bg: #1d1a24;
  --surface: #27222f;
  --ink: #ece7f2;
  --muted: #a89fb8;
  --line: #383144;

  --lila: #a795d6;
  --lila-deep: #c3b4ea;
  --lila-tint: #322b45;

  --c-columns: #e08a6c;
  --c-columns-tint: #402d26;
  --c-hersens: #a795d6;
  --c-hersens-tint: #322b45;
  --c-gedicht: #7cbca6;
  --c-gedicht-tint: #24352f;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px -12px rgba(0, 0, 0, .5);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 44px -16px rgba(0, 0, 0, .6);
}

:root[data-theme="dark"] { color-scheme: dark; }

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--lila-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--lila); }

::selection { background: var(--lila); color: #fff; }

:focus-visible { outline: 2px solid var(--lila); outline-offset: 3px; border-radius: 4px; }

.skiplink {
  position: absolute; left: -9999px; top: 0;
  background: var(--lila-deep); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skiplink:focus { left: 0; }

/* ----- Header ----- */

.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }

.site-head-inner {
  max-width: 1120px; margin: 0 auto; padding: 1.1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }

.brand-butterfly { width: 30px; height: 30px; color: var(--lila); transition: transform .4s ease; }
.brand:hover .brand-butterfly { transform: rotate(-10deg) translateY(-2px); }

.brand-name { font-family: var(--font-head); font-size: 1.45rem; font-weight: 600; letter-spacing: .01em; }

.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }

.site-nav a {
  text-decoration: none; color: var(--muted); font-weight: 500;
  padding: .35rem .85rem; border-radius: 999px; font-size: .95rem;
  transition: background .2s, color .2s;
}
.site-nav a:hover { color: var(--ink); background: var(--lila-tint); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

.site-nav a.cat-columns:hover        { color: var(--c-columns); background: var(--c-columns-tint); }
.site-nav a.cat-hersenspinsels:hover { color: var(--c-hersens); background: var(--c-hersens-tint); }
.site-nav a.cat-gedichten:hover      { color: var(--c-gedicht); background: var(--c-gedicht-tint); }

/* Licht/donker-knopje */
.theme-toggle {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  width: 38px; height: 38px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  transition: color .2s, border-color .2s, transform .3s;
}
.theme-toggle:hover { color: var(--lila-deep); border-color: var(--lila); transform: rotate(-12deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ----- Hero ----- */

.hero {
  position: relative; text-align: center;
  padding: 4.5rem 1.5rem 3.5rem; overflow: hidden;
}

.hero-title {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.8rem); letter-spacing: -.01em;
}

.hero-tagline {
  font-family: var(--font-head); font-style: italic;
  color: var(--muted); font-size: clamp(1.05rem, 2.5vw, 1.3rem); margin-top: .5rem;
}

.hero-small { padding: 3rem 1.5rem 2.2rem; }
.hero-small .hero-title { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.hero-small.cat-columns .hero-title        { color: var(--c-columns); }
.hero-small.cat-hersenspinsels .hero-title { color: var(--c-hersens); }
.hero-small.cat-gedichten .hero-title      { color: var(--c-gedicht); }

.hero-butterflies { position: absolute; inset: 0; pointer-events: none; color: var(--lila); }

.flutter { position: absolute; opacity: .3; }
.flutter-1 { width: 38px; left: 14%; top: 18%; animation: flutter 7s ease-in-out infinite alternate; }
.flutter-2 { width: 26px; right: 16%; top: 30%; animation: flutter 9s ease-in-out 1.2s infinite alternate-reverse; }
.flutter-3 { width: 20px; left: 30%; bottom: 8%; animation: flutter 8s ease-in-out .6s infinite alternate; }

@keyframes flutter {
  0%   { transform: translate(0, 0) rotate(-10deg); }
  50%  { transform: translate(10px, -16px) rotate(8deg); }
  100% { transform: translate(-6px, -30px) rotate(-6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .flutter { animation: none; }
  html { scroll-behavior: auto; }
}

/* ----- Layout-schil ----- */

.shell {
  max-width: 1120px; margin: 0 auto; padding: 0 1.5rem 4rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem;
  align-items: start;
}

.shell-post { padding-top: 3rem; }

/* ----- Kaarten ----- */

.cards { display: grid; gap: 1.5rem; }

.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; border-left: 4px solid var(--lila);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.card.cat-columns        { border-left-color: var(--c-columns); }
.card.cat-hersenspinsels { border-left-color: var(--c-hersens); }
.card.cat-gedichten      { border-left-color: var(--c-gedicht); }

.card-image { flex: 0 0 220px; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 1.6rem 1.8rem; flex: 1; min-width: 0; }

.card-meta {
  display: flex; align-items: center; gap: .8rem;
  font-size: .82rem; color: var(--muted); margin-bottom: .55rem;
}

.pill {
  display: inline-block; text-decoration: none; font-weight: 700;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  padding: .22rem .7rem; border-radius: 999px;
  background: var(--lila-tint); color: var(--lila-deep);
}
.cat-columns .pill, .pill.cat-columns               { background: var(--c-columns-tint); color: var(--c-columns); }
.cat-hersenspinsels .pill, .pill.cat-hersenspinsels { background: var(--c-hersens-tint); color: var(--c-hersens); }
.cat-gedichten .pill, .pill.cat-gedichten           { background: var(--c-gedicht-tint); color: var(--c-gedicht); }

.card-title { font-family: var(--font-head); font-size: 1.45rem; font-weight: 600; line-height: 1.3; }
.card-title a { color: var(--ink); text-decoration: none; }
.card:hover .card-title a { color: var(--lila-deep); }
.card.cat-columns:hover .card-title a        { color: var(--c-columns); }
.card.cat-hersenspinsels:hover .card-title a { color: var(--c-hersens); }
.card.cat-gedichten:hover .card-title a      { color: var(--c-gedicht); }

.card-excerpt { color: var(--muted); margin-top: .5rem; font-size: .98rem; }

.card-poem .card-body { text-align: center; }
.card-poem .card-meta { justify-content: center; }
.card-poem-preview {
  font-family: var(--font-head); font-style: italic; font-size: 1.05rem;
  color: var(--muted); margin-top: .7rem; line-height: 1.75;
}

.card-more {
  display: inline-block; margin-top: .8rem; font-weight: 700; font-size: .9rem;
  text-decoration: none;
}

.empty { color: var(--muted); font-style: italic; padding: 2rem 0; }

/* ----- Paginering ----- */

.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 1.2rem; margin-top: 2.5rem;
}

.page-btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: .95rem;
  background: var(--surface); border: 1px solid var(--line);
  padding: .5rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow);
}
.page-btn:hover { border-color: var(--lila); }

.page-status { color: var(--muted); font-size: .9rem; }

/* ----- Zijbalk ----- */

.sidebar { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; }

.profile-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2rem 1.6rem; text-align: center;
}

.profile-photo-wrap { display: flex; justify-content: center; margin-bottom: 1rem; }

.profile-photo {
  width: 140px; height: 140px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--lila-tint); outline: 2px solid var(--lila); outline-offset: 2px;
}

.profile-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--lila-tint); color: var(--lila);
}
.placeholder-butterfly { width: 64px; height: 64px; }

.profile-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; }

.profile-bio { color: var(--muted); font-size: .93rem; margin-top: .6rem; line-height: 1.65; }

.sidebar-block {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem;
}

.sidebar-title {
  font-family: var(--font-head); font-size: 1.02rem; font-weight: 600;
  margin-bottom: .7rem;
}

.cat-list { list-style: none; }
.cat-list a {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink); font-weight: 500;
  padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .95rem;
}
.cat-list li:last-child a { border-bottom: none; }

.cat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lila); flex: none; }
.cat-list a.cat-columns .cat-dot        { background: var(--c-columns); }
.cat-list a.cat-hersenspinsels .cat-dot { background: var(--c-hersens); }
.cat-list a.cat-gedichten .cat-dot      { background: var(--c-gedicht); }

.cat-list a:hover { color: var(--lila-deep); }

.cat-count {
  margin-left: auto; font-size: .8rem; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: 0 .55rem;
}

/* ----- Post ----- */

.post {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(1.8rem, 5vw, 3.5rem);
}

.post-head { margin-bottom: 1.8rem; }

.post-title {
  font-family: var(--font-head); font-weight: 600; line-height: 1.2;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem); margin-top: .7rem; letter-spacing: -.01em;
}

.post-figure { margin: 0 0 1.8rem; }
.post-figure img { border-radius: 12px; width: 100%; }

.post-body { font-size: 1.12rem; line-height: 1.85; max-width: 68ch; }
.post-body p { margin-bottom: 1.2em; }
.post-body p:last-child { margin-bottom: 0; }

/* Sierlijke beginletter bij columns en hersenspinsels */
.post:not(.post-poem) .post-body > p:first-of-type::first-letter {
  font-family: var(--font-head); font-weight: 700;
  font-size: 3.1em; float: left; line-height: .85;
  padding: .04em .12em 0 0; color: var(--lila);
}
.post.cat-columns .post-body > p:first-of-type::first-letter        { color: var(--c-columns); }
.post.cat-hersenspinsels .post-body > p:first-of-type::first-letter { color: var(--c-hersens); }

/* Zwevende afbeelding links/rechts */
.post-float { width: min(46%, 340px); border-radius: 12px; }
.post-float-left  { float: left; margin: .3rem 1.6rem 1rem 0; }
.post-float-right { float: right; margin: .3rem 0 1rem 1.6rem; }

/* Gedichten: gecentreerd en ademend */
.post-poem { text-align: center; }
.post-poem .card-meta { justify-content: center; }
.post-poem .post-body {
  font-family: var(--font-head); font-size: 1.22rem; line-height: 1.9;
  max-width: 46ch; margin: 0 auto;
}
.post-poem .stanza { margin-bottom: 1.6em; }

.post-foot {
  margin-top: 2.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
  text-align: center; clear: both;
}

.post-foot-butterfly svg, .foot-butterfly svg, .notfound-butterfly svg {
  width: 30px; height: 30px; color: var(--lila); opacity: .7;
}
.post-foot-butterfly { margin-bottom: .8rem; }

.back-link { font-weight: 700; font-size: .92rem; text-decoration: none; }

/* ----- 404 ----- */

.notfound {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 3.5rem 2rem; text-align: center;
}
.notfound h1 { font-family: var(--font-head); font-size: 2rem; margin: .8rem 0 .4rem; }
.notfound p { color: var(--muted); margin-bottom: 1rem; }
.notfound-butterfly svg { width: 48px; height: 48px; }

/* ----- Footer ----- */

.site-foot {
  border-top: 1px solid var(--line); text-align: center;
  padding: 2.5rem 1.5rem 3rem; color: var(--muted); font-size: .9rem;
}
.foot-butterfly { margin-bottom: .7rem; }
.foot-links { margin-top: .4rem; }
.foot-links a { color: var(--muted); }

/* ----- Responsief ----- */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 2.2rem; }
  .sidebar { position: static; }
  .card-image { flex-basis: 160px; }
}

@media (max-width: 560px) {
  .card { flex-direction: column; border-left: none; border-top: 4px solid var(--lila); }
  .card.cat-columns        { border-top-color: var(--c-columns); }
  .card.cat-hersenspinsels { border-top-color: var(--c-hersens); }
  .card.cat-gedichten      { border-top-color: var(--c-gedicht); }
  .card-image { flex-basis: auto; max-height: 220px; }
  .post-float { float: none; width: 100%; margin: 0 0 1.2rem; }
  .site-head-inner { justify-content: center; }
}
