/* --- Fonturi locale --- */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/figtree-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/figtree-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/figtree-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/figtree-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Red Hat Display';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/redhat-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Red Hat Display';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/redhat-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Red Hat Display';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/redhat-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Red Hat Display';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/redhat-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('../fonts/robotomono-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('../fonts/robotomono-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto Mono';
  font-style: italic;
  font-weight: 100 700;
  font-display: swap;
  src: url('../fonts/robotomono-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto Mono';
  font-style: italic;
  font-weight: 100 700;
  font-display: swap;
  src: url('../fonts/robotomono-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================
   WRITTEN WHISPER - Public site stylesheet
   ========================================================== */

/* --- Focus vizibil (navigare cu tastatura) --- */
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 9999;
  padding: 0.4rem 0.9rem;
  background: var(--bg);
  color: var(--link);
  border: 2px solid var(--link);
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 3px;
}
.skip-link:focus { left: 0.5rem; }

/* --- Teme --- */
:root {
  --bg:     #f9f9f7;
  --fg:     #343434;
  --muted:  #5a5a5a;
  --border: #d8d8d4;
  --link:   #1a5276;
  --code-bg:#f0f0ec;
  --max:    960px;

  --font-body:    'Figtree', sans-serif;
  --font-heading: 'Red Hat Display', sans-serif;
  --font-mono:    'Roboto Mono', ui-monospace, monospace;
}

/* Auto dark (OS preference) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:     #181816;
    --fg:     #e4e4e0;
    --muted:  #999;
    --border: #2e2e2a;
    --link:   #7db8d8;
    --code-bg:#222220;
  }
}

/* Teme manuale */
[data-theme="light"]    { --bg:#f9f9f7; --fg:#343434; --muted:#5a5a5a; --border:#d8d8d4; --link:#1a5276; --code-bg:#f0f0ec; }
[data-theme="warm"]     { --bg:#fdf6e3; --fg:#2d2005; --muted:#7a6040; --border:#e0d2b0; --link:#8b4513; --code-bg:#f5ead0; }
[data-theme="paper"]    { --bg:#f0ebe0; --fg:#1c1c10; --muted:#6b6050; --border:#cdc5b0; --link:#003580; --code-bg:#e4dece; }
[data-theme="dark"]     { --bg:#181816; --fg:#e4e4e0; --muted:#999;    --border:#2e2e2a; --link:#7db8d8; --code-bg:#222220; }
[data-theme="deep"]     { --bg:#0d1117; --fg:#c9d1d9; --muted:#8b949e; --border:#21262d; --link:#58a6ff; --code-bg:#161b22; }
[data-theme="terminal"] { --bg:#001100; --fg:#00cc44; --muted:#007722; --border:#003311; --link:#00ff88; --code-bg:#001a00; }
[data-theme="ink"]      { --bg:#ffffff; --fg:#000000; --muted:#444444; --border:#000000; --link:#000000; --code-bg:#eeeeee; }
[data-theme="ink"] body { filter: grayscale(1); }

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }

body {
  background:               var(--bg);
  color:                    var(--fg);
  font-family:              var(--font-body);
  font-size:                clamp(1rem, 0.92rem + 0.5vw, 1.25rem);
  font-weight:              400;
  letter-spacing:           -0.02ch;
  line-height:              1.65;
  text-rendering:           optimizeLegibility;
  -webkit-font-smoothing:   antialiased;
  -moz-osx-font-smoothing:  grayscale;
  padding:                  clamp(1.2rem, 5vw, 2rem) 1rem;
}

h1, h2, h3, h4, h5, h6,
.site-name, .entry-title, .post-title, .page-title {
  font-family: var(--font-heading);
  font-weight: 800;
}

code, pre, kbd, blockquote, table {
  font-family: var(--font-mono);
}

a               { color: var(--link); }
a:hover         { opacity: 0.8; }
img             { max-width: 100%; height: auto; display: block; }
.wrap           { max-width: var(--max); margin: 0 auto; }

/* --- Header --- */
header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
}

.header-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.site-logo     { display: block; flex-shrink: 0; }
.site-logo img { height: clamp(36px, 8vw, 64px); width: auto; }

.site-center {
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  pointer-events: none;
}
.site-center a,
.site-center p { pointer-events: auto; }

.site-name   { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: bold; line-height: 1.2; text-align: center; }
.site-name a { color: var(--fg); text-decoration: none; }

.site-desc { color: var(--muted); font-size: 0.88rem; margin-top: 0.3rem; text-align: center; }

.header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
nav a:hover { color: var(--fg); opacity: 1; }

/* --- Controale tema --- */
.theme-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
}
.theme-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.theme-btn:hover { color: var(--fg); border-color: var(--muted); }

.theme-picker-wrap { position: relative; }
.theme-picker {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.5rem;
  z-index: 200;
  gap: 0.35rem;
  flex-wrap: wrap;
  width: 160px;
}
.theme-picker.open { display: flex; }

.ts {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 2px;
  user-select: none;
  appearance: none;
  padding: 0;
}
.ts:hover, .ts.active { border-color: var(--fg); }
.ts[data-set-theme="auto"]     { background: linear-gradient(135deg, #f9f9f7 50%, #181816 50%); color: #888; }
.ts[data-set-theme="light"]    { background: #f9f9f7; color: #1a1a1a; border-color: #d8d8d4; }
.ts[data-set-theme="warm"]     { background: #fdf6e3; color: #2d2005; border-color: #e0d2b0; }
.ts[data-set-theme="paper"]    { background: #f0ebe0; color: #1c1c10; border-color: #cdc5b0; }
.ts[data-set-theme="dark"]     { background: #181816; color: #e4e4e0; border-color: #2e2e2a; }
.ts[data-set-theme="deep"]     { background: #0d1117; color: #c9d1d9; border-color: #21262d; }
.ts[data-set-theme="terminal"] { background: #001100; color: #00cc44; border-color: #003311; }
.ts[data-set-theme="ink"]      { background: #ffffff; color: #000000; border-color: #000000; }

/* --- Feed --- */
.feed { list-style: none; }

.entry {
  padding: clamp(1rem, 3vw, 1.4rem) 0;
  border-bottom: 1px solid var(--border);
}
.entry:last-child { border-bottom: none; }

.entry-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }

.entry-permalink { color: var(--muted); text-decoration: none; }
.entry-permalink:hover { color: var(--fg); opacity: 1; }

.entry-note-link { display: block; }

.entry-title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 0.5rem; line-height: 1.15; font-weight: 800; }
.entry-title a { color: var(--fg); text-decoration: none; }
.entry-title a:hover { text-decoration: underline; }

.entry-body p          { margin-bottom: 0.7rem; }
.entry-body p:last-child { margin-bottom: 0; }
.entry-body img        { margin: 0.5rem 0; }
.entry-body h1 { font-size: 1.35rem; margin: 1rem 0 0.4rem; line-height: 1.3; }
.entry-body h2 { font-size: 1.15rem; margin: 0.8rem 0 0.3rem; line-height: 1.3; }
.entry-body h3 { font-size: 1.05rem; margin: 0.6rem 0 0.3rem; line-height: 1.3; }
.entry-body ul, .entry-body ol { padding-left: 1.5rem; margin-bottom: 0.6rem; }
.entry-body li { margin-bottom: 0.2rem; }
.entry-body blockquote {
  border-left: 3px solid var(--border);
  padding: 0.4rem 0.85rem;
  color: var(--muted);
  margin: 0.75rem 0;
}
.entry-body h4, .entry-body h5, .entry-body h6 { margin: 0.6rem 0 0.25rem; line-height: 1.3; }
.entry-body h4 { font-size: 1rem; }
.entry-body h5 { font-size: 0.95rem; }
.entry-body h6 { font-size: 0.9rem; }
.entry-body pre {
  background: var(--code-bg);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0.6rem 0;
  font-size: 0.88rem;
  border: 1px solid var(--border);
}
.entry-body code {
  background: var(--code-bg);
  padding: 0.1rem 0.3rem;
  font-size: 0.88rem;
  border: 1px solid var(--border);
}
.entry-body pre code { background: none; padding: 0; border: none; }
.entry-body hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.entry-body table { width: 100%; border-collapse: collapse; margin: 0.8rem 0; font-size: 0.88rem; display: block; overflow-x: auto; }
.entry-body th { background: var(--code-bg); border: 1px solid var(--border); padding: 0.35rem 0.6rem; text-align: left; font-weight: bold; }
.entry-body td { border: 1px solid var(--border); padding: 0.3rem 0.6rem; vertical-align: top; }
.entry-body tr:nth-child(even) td { background: var(--code-bg); }
.entry-body mark { background: rgba(255,210,0,0.35); color: inherit; padding: 0 0.15rem; }
.entry-body .task-item { list-style: none; margin-left: -1.5rem; padding-left: 0; }
.entry-body .task-item input[type=checkbox] { margin-right: 0.4rem; accent-color: var(--link); cursor: default; }
.entry-body figure { margin: 0.8rem 0; }

.entry-note {
}
.entry-note p { margin-bottom: 0.7rem; }
.entry-note-link[data-href] {
  cursor: pointer;
  display: block;
  transition: opacity 0.15s;
}
.entry-note-link[data-href]:hover { opacity: 0.75; }

.entry-photo a img     { transition: opacity 0.15s; }
.entry-photo a:hover img { opacity: 0.88; }
.entry-photo .caption  { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 0.4rem; }
.entry-photo-link { position: relative; display: block; max-width: 65%; margin-left: auto; margin-right: auto; }
.entry-photo-count {
  position: absolute; top: 0.6rem; right: 0.6rem;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 1.15rem; font-weight: 700;
  padding: 0.4rem 0.9rem; border-radius: 6px;
  pointer-events: none; letter-spacing: 0.03em;
}

figure       { margin: 1rem 0; }
figcaption   { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 0.35rem; }

/* --- Post individual --- */
.post-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; }
.post-title { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 1.2rem; }
.post-body p           { margin-bottom: 0.85rem; }
.post-body p:last-child { margin-bottom: 0; }
.post-body figure      { margin: 1.2rem 0; }
.post-body h1, .post-body h2, .post-body h3,
.post-body h4, .post-body h5, .post-body h6 {
  margin: 1.5rem 0 0.6rem;
  line-height: 1.3;
}
.post-body h1 { font-size: 1.35rem; }
.post-body h2 { font-size: 1.15rem; }
.post-body h3 { font-size: 1.05rem; }
.post-body h4 { font-size: 1rem; }
.post-body h5 { font-size: 0.95rem; }
.post-body h6 { font-size: 0.9rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 0.8rem; }
.post-body li { margin-bottom: 0.2rem; }
.post-body blockquote {
  border-left: 3px solid var(--border);
  padding: 0.5rem 1rem;
  color: var(--muted);
  margin: 1rem 0;
}
.post-body pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.92rem;
  border: 1px solid var(--border);
}
.post-body code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  font-size: 0.92rem;
  border: 1px solid var(--border);
}
.post-body pre code { background: none; padding: 0; border: none; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.post-photo img { margin-bottom: 0.5rem; }
.post-caption { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 0.4rem; }
.post-video { text-align: center; }
.post-video video { max-width: 720px; width: 100%; max-height: 75vh; background: #000; display: block; margin: 0 auto 0.5rem; }
.entry-video .video-wrap { margin: 0.5rem auto 0; }
.entry-video { text-align: center; }
.entry-video .caption { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 0.4rem; text-align: left; }

/* --- Galerie imagini --- */
.post-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.4rem;
  margin: 1.25rem 0;
}
.post-gallery .gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.post-gallery .gallery-item img:hover { opacity: 0.9; }

/* --- Video embeds --- */
.video-wrap {
  margin: 1.5rem auto;
  max-width: 720px;
}
.video-wrap iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}
.video-wrap--vertical {
  max-width: 340px;
}
.video-wrap--vertical iframe {
  aspect-ratio: 9 / 16;
}

.back-link { display: inline-block; margin-top: 2rem; font-size: 0.88rem; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--fg); opacity: 1; }
.back-link + .archive-group { margin-top: 2.5rem; }

/* --- Tabele markdown (post + pagini) --- */
.post-body table, .page-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.92rem;
  overflow-x: auto;
  display: block;
}
.post-body th, .page-body th {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  text-align: left;
  font-weight: bold;
}
.post-body td, .page-body td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  vertical-align: top;
}
.post-body tr:nth-child(even) td,
.page-body tr:nth-child(even) td { background: var(--code-bg); }

/* --- Task lists --- */
.post-body .task-item,
.page-body .task-item { list-style: none; margin-left: -1.5rem; padding-left: 0; }
.post-body .task-item input[type=checkbox],
.page-body .task-item input[type=checkbox] {
  margin-right: 0.4rem;
  accent-color: var(--link);
  cursor: default;
}

/* --- Mark / highlight --- */
.post-body mark, .page-body mark {
  background: rgba(255, 210, 0, 0.35);
  color: inherit;
  padding: 0 0.15rem;
}
[data-theme="dark"] .post-body mark,
[data-theme="deep"] .post-body mark,
[data-theme="terminal"] .post-body mark,
[data-theme="dark"] .page-body mark,
[data-theme="deep"] .page-body mark,
[data-theme="terminal"] .page-body mark {
  background: rgba(200, 160, 0, 0.3);
}

/* --- Pagini custom --- */
.page-title { font-size: clamp(1.55rem, 2.8vw, 1.7rem); font-weight: bold; line-height: 1.2; margin-bottom: 1.2rem; }
.page-body p           { margin-bottom: 0.85rem; }
.page-body p:last-child { margin-bottom: 0; }
.page-body h1, .page-body h2, .page-body h3,
.page-body h4, .page-body h5, .page-body h6 {
  margin: 1.5rem 0 0.6rem;
  line-height: 1.3;
}
.page-body h1 { font-size: 1.35rem; }
.page-body h2 { font-size: 1.15rem; }
.page-body h3 { font-size: 1.05rem; }
.page-body ul, .page-body ol { padding-left: 1.5rem; margin-bottom: 0.8rem; }
.page-body li { margin-bottom: 0.2rem; }
.page-body blockquote {
  border-left: 3px solid var(--border);
  padding: 0.5rem 1rem;
  color: var(--muted);
  margin: 1rem 0;
}
.page-body pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.92rem;
  border: 1px solid var(--border);
}
.page-body code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  font-size: 0.92rem;
  border: 1px solid var(--border);
}
.page-body pre code { background: none; padding: 0; border: none; }
.page-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.page-body figure { margin: 1.2rem 0; }

/* Card-uri: blockquote cu titlu h3 (pagina Proiecte etc.) */
.page-body blockquote:has(h3) {
  border-left: none;
  border: 1px solid var(--border);
  background: var(--code-bg);
  color: var(--fg);
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
}
.page-body blockquote:has(h3) h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.page-body blockquote:has(h3) p  { margin-bottom: 0.3rem; color: var(--muted); font-size: 0.93rem; }
.page-body blockquote:has(h3) p:last-child { margin-bottom: 0; }
.page-body blockquote:has(h3) a {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.85rem;
}
.page-body blockquote:has(h3) a:hover { opacity: 0.8; }

/* --- Paginare --- */
/* --- Pagina galerie publică (/galerie) --- */
.gallery-page-total {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.gallery-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 3px;
  margin-bottom: 2rem;
}
.gallery-page-item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--code-bg);
  text-decoration: none;
}
.gallery-page-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}
.gallery-page-item:hover img { opacity: 0.82; }
.gallery-page-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  font-size: 0.72rem;
  padding: 1.2rem 0.4rem 0.35rem;
  line-height: 1.3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.gallery-page-item:hover .gallery-page-caption { opacity: 1; }
.pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.88rem;
}
.pag-btn {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}
.pag-btn:hover { border-color: var(--muted); color: var(--fg); opacity: 1; }
.pag-info { color: var(--muted); font-size: 0.82rem; }

/* --- Cautare --- */
.search-form { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-form input[type=search] {
  flex: 1; min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg);
  font: inherit; font-size: 0.95rem; color: var(--fg);
  -webkit-appearance: none; appearance: none;
}
.search-form input[type=search]:focus { outline: 2px solid var(--link); outline-offset: -1px; }
.search-form button {
  padding: 0.5rem 1rem;
  background: var(--fg); color: var(--bg);
  border: none; font: inherit; font-size: 0.9rem;
  cursor: pointer; min-height: 44px;
}
.search-form button:hover { opacity: 0.8; }
.search-count  { font-size: 0.88rem; color: var(--muted); margin-bottom: 1rem; }
.search-excerpt { font-size: 0.92rem; color: var(--muted); margin-top: 0.3rem; }
.search-thumb   { max-height: 200px; width: auto; display: block; }

/* --- Comentarii --- */
.comments {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.comments-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
}
.comment-list { list-style: none; }
.comment {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.comment-author { font-size: 0.92rem; font-weight: bold; }
.comment-author.is-admin { color: var(--link); }
.comment-date   { font-size: 0.75rem; color: var(--muted); }
.comment-body   { font-size: 0.95rem; line-height: 1.65; }
.comment-body p { margin-bottom: 0.3rem; }

/* Raspunsuri */
.comment-replies { margin-left: 1.5rem; border-left: 2px solid var(--border); padding-left: 1rem; margin-top: 0.5rem; }
.comment-replies .comment { border-bottom: none; padding: 0.6rem 0; }

.reply-details {
  margin-top: 0.4rem;
}
.reply-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  list-style: none;
  display: inline;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.reply-details summary::-webkit-details-marker { display: none; }
.reply-details summary::marker { display: none; }
.reply-details summary:hover { color: var(--fg); }

.reply-form { margin-top: 0.75rem; }
.reply-form textarea {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--bg);
  font: inherit;
  font-size: 0.93rem;
  color: var(--fg);
  resize: vertical;
  min-height: 80px;
}
.reply-form textarea:focus { outline: 2px solid var(--link); outline-offset: -1px; }
.reply-submit {
  margin-top: 0.4rem;
  padding: 0.3rem 0.8rem;
  background: var(--fg);
  color: var(--bg);
  border: none;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.reply-submit:hover { opacity: 0.8; }
.reply-name-row { margin-top: 0.4rem; display: flex; gap: 0.5rem; align-items: center; }
.reply-name-input { flex: 1; padding: 0.3rem 0.5rem; border: 1px solid var(--border); background: var(--bg); font: inherit; color: var(--fg); }

.comment-notice {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0,128,0,0.08);
  border: 1px solid rgba(0,128,0,0.2);
  font-size: 0.9rem;
}
.comment-error {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.9rem;
  background: rgba(200,0,0,0.06);
  border: 1px solid rgba(200,0,0,0.2);
  font-size: 0.88rem;
}

.comment-form    { margin-top: 1.5rem; }
.comment-fields  { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.cfield          { display: flex; flex-direction: column; gap: 0.25rem; }
.cfield label    { font-size: 0.8rem; color: var(--muted); }
.cfield .opt     { font-weight: normal; }
.cfield input,
.cfield textarea {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--bg);
  font: inherit;
  font-size: 0.93rem;
  color: var(--fg);
  -webkit-appearance: none; appearance: none;
}
.cfield input:focus,
.cfield textarea:focus { outline: 2px solid var(--link); outline-offset: -1px; }
.cfield textarea { resize: vertical; min-height: 110px; }
.comment-submit {
  margin-top: 0.75rem;
  padding: 0.45rem 1.1rem;
  background: var(--fg);
  color: var(--bg);
  border: none;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
}
.comment-submit:hover { opacity: 0.8; }

/* --- Buton sus --- */
#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { color: var(--fg); border-color: var(--muted); }

/* --- Empty / errors --- */
.empty { color: var(--muted); }
.e404  { color: var(--muted); margin-top: 2rem; }

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  margin-top: clamp(2rem, 6vw, 3rem);
  padding-top: 1rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
footer a { color: var(--muted); }

/* --- Timp de citire --- */
.read-time { font-variant-numeric: tabular-nums; }

/* --- Badge status programat --- */
.badge-scheduled {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,100,200,0.12);
  color: #004080;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 0.3rem;
}
[data-theme="dark"] .badge-scheduled,
[data-theme="deep"] .badge-scheduled,
[data-theme="terminal"] .badge-scheduled {
  background: rgba(100,180,255,0.15);
  color: #7db8d8;
}

/* --- Footnotes --- */
.footnotes {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}
.footnotes ol {
  padding-left: 1.5rem;
}
.footnotes li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}
.footnote-back {
  margin-left: 0.4rem;
  font-size: 0.9em;
  text-decoration: none;
  color: var(--muted);
}
.footnote-back:hover { color: var(--fg); }
sup a {
  font-size: 0.75em;
  text-decoration: none;
  vertical-align: super;
  line-height: 0;
  color: var(--link);
}

/* --- Syntax highlighting --- */
.tok-kw  { color: #0070bb; }
.tok-str { color: #1a7240; }
.tok-cmt { color: #888; font-style: italic; }
.tok-num { color: #c0392b; }
.tok-fn  { color: #7d4a8d; }
.tok-var { color: #d35400; }
.tok-op  { color: var(--fg); }

[data-theme="dark"] .tok-kw,
[data-theme="deep"] .tok-kw,
[data-theme="terminal"] .tok-kw   { color: #79b8ff; }
[data-theme="dark"] .tok-str,
[data-theme="deep"] .tok-str,
[data-theme="terminal"] .tok-str  { color: #85e89d; }
[data-theme="dark"] .tok-cmt,
[data-theme="deep"] .tok-cmt,
[data-theme="terminal"] .tok-cmt  { color: #6a737d; }
[data-theme="dark"] .tok-num,
[data-theme="deep"] .tok-num,
[data-theme="terminal"] .tok-num  { color: #f97583; }
[data-theme="dark"] .tok-fn,
[data-theme="deep"] .tok-fn,
[data-theme="terminal"] .tok-fn   { color: #b392f0; }
[data-theme="dark"] .tok-var,
[data-theme="deep"] .tok-var,
[data-theme="terminal"] .tok-var  { color: #ffab70; }

/* --- Webmentions (public) --- */
.webmentions {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.webmentions-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}
.wm-list { list-style: none; }
.wm-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.wm-item:last-child { border-bottom: none; }
.wm-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.wm-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 0.3rem; }
.wm-author { font-size: 0.9rem; font-weight: bold; color: var(--fg); }
.wm-type-badge { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border: 1px solid var(--border); padding: 0.05rem 0.4rem; vertical-align: middle; }
.wm-date   { font-size: 0.75rem; color: var(--muted); }
.wm-excerpt { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.3rem; line-height: 1.6; }
.wm-source { font-size: 0.8rem; color: var(--muted); text-decoration: none; }
.wm-source:hover { color: var(--fg); }

/* --- Arhiva --- */
.archive-title { font-size: clamp(1.55rem, 2.8vw, 1.7rem); font-weight: bold; line-height: 1.2; margin-bottom: 1.5rem; }
.archive-group { margin-bottom: 2rem; }
.archive-month { font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.archive-list { list-style: none; }
.archive-item { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.2rem 0; font-size: 0.93rem; }
.archive-date { color: var(--muted); font-size: 0.82rem; white-space: nowrap; min-width: 5rem; }
.archive-type { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); min-width: 3rem; }
.archive-item a { color: var(--fg); text-decoration: none; }
.archive-item a:hover { text-decoration: underline; }

/* --- Honeypot anti-spam (invizibil garantat) --- */
.ww-hp { display: none !important; }

/* --- Scrollbar --- */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* --- Progress bar --- */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: var(--link);
  z-index: 999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* --- Lightbox --- */
.lightbox-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.92); z-index: 1000;
  align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 94vw; max-height: 92vh; object-fit: contain; display: block; cursor: default; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.2rem;
  color: #fff; font-size: 2rem; cursor: pointer;
  line-height: 1; background: none; border: none; padding: 0.3rem 0.6rem;
}
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 3rem; line-height: 1;
  background: rgba(0,0,0,0.35); border: none; cursor: pointer;
  padding: 0.4rem 0.8rem; border-radius: 4px;
  transition: background 0.15s; user-select: none;
}
.lightbox-prev { left: 0.8rem; }
.lightbox-next { right: 0.8rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(0,0,0,0.65); }
.lightbox-counter {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 0.9rem; background: rgba(0,0,0,0.45);
  padding: 0.2rem 0.7rem; border-radius: 3px; pointer-events: none;
}
@media (max-width: 480px) {
  .lightbox-prev { left: 0.3rem; }
  .lightbox-next { right: 0.3rem; }
}

/* --- Copy link --- */
.copy-link-btn {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 0.72rem;
  padding: 0; margin-left: 0.6rem;
  vertical-align: middle;
  transition: color 0.15s;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.copy-link-btn:hover { color: var(--fg); }
.copy-link-btn.copied { color: var(--fg); text-decoration: none; }

/* --- Responsive --- */
@media (max-width: 480px) {
  nav { gap: 0 0.8rem; }
  .comment-fields { grid-template-columns: 1fr; }
  #back-to-top { bottom: 1rem; right: 1rem; }
}

/* --- Comentarii Fediverse --- */
.comment-fedi-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.35rem;
  border: 1px solid var(--border);
}
.comment-fedi-badge {
  font-size: 0.68rem;
  background: var(--border);
  color: var(--muted);
  border-radius: 3px;
  padding: 0 0.3rem;
  margin-left: 0.3rem;
  vertical-align: middle;
}

/* --- Media grid (cărți / filme / muzică) --- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.4rem 1rem;
  margin: 1.2rem 0;
}
.media-item {
  display: flex; flex-direction: column;
  text-decoration: none; color: var(--fg);
  gap: 0.35rem;
}
.media-item:hover .media-item-title { text-decoration: underline; }
.media-item-cover {
  aspect-ratio: 2/3;
  background: var(--code-bg);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.media-item-cover img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.media-item-no-cover {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--muted);
}
.media-item-title { font-size: 0.83rem; font-weight: 600; line-height: 1.3; }
.media-item-creator { font-size: 0.75rem; color: var(--muted); }
.media-item-meta { font-size: 0.72rem; color: var(--muted); display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.media-rating-stars { color: var(--link); letter-spacing: -0.05em; }

/* Entry media (homepage feed) */
.entry-media {
  display: flex; flex-direction: column; gap: 0.7rem;
  text-decoration: none; color: var(--fg);
  max-width: 260px; margin-left: auto; margin-right: auto;
}
.entry-media-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--code-bg);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.entry-media-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry-media-cover-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--muted);
}
.entry-media-info { min-width: 0; }
.entry-media-title { font-size: 1rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.2rem; }
.entry-media-creator { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.2rem; }
.entry-media-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.4rem; }
.entry-media-rating { color: var(--link); }
.entry-media-excerpt { font-size: 0.88rem; color: var(--fg); opacity: 0.85; line-height: 1.5; }

/* Post media (pagina individuală) */
.post-media-layout {
  display: flex; flex-direction: column; gap: 0.8rem;
  max-width: 260px; margin-left: auto; margin-right: auto;
  margin-bottom: 1.5rem;
}
.post-media-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--code-bg);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-media-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-media-cover-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--muted);
}
.post-media-info { min-width: 0; }
.post-media-creator { color: var(--muted); margin-bottom: 0.5rem; }
.post-media-fields { font-size: 0.85rem; color: var(--muted); line-height: 1.8; }
.post-media-rating { font-size: 1.2rem; color: var(--link); letter-spacing: -0.05em; margin: 0.4rem 0; }
.post-media-status {
  display: inline-block; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.05em; background: var(--code-bg);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0.1rem 0.45rem; color: var(--muted); margin-bottom: 0.5rem;
}

/* Admin: cover preview inline */
.media-cover-preview {
  width: 70px; aspect-ratio: 2/3;
  object-fit: cover; border-radius: 4px;
  border: 1px solid var(--border);
  display: block; margin-top: 0.4rem;
}
/* Admin lookup widget */
.lookup-wrap { position: relative; }
.lookup-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; z-index: 50;
  max-height: 320px; overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.lookup-item {
  display: flex; gap: 0.6rem; align-items: center;
  padding: 0.5rem 0.7rem; cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.lookup-item:last-child { border-bottom: none; }
.lookup-item:hover, .lookup-item:focus { background: var(--code-bg); outline: none; }
.lookup-item img { width: 32px; aspect-ratio: 2/3; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.lookup-item-no-img { width: 32px; aspect-ratio: 2/3; background: var(--border); border-radius: 2px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: var(--muted); }
.lookup-item-title { font-weight: 600; }
.lookup-item-sub { color: var(--muted); font-size: 0.78rem; }


