/* CRT-Theme für /articles/crt
 * Einbindung: page file crt.css via header.php (extension=css).
 */

/* --- Fonts --------------------------------------------------------------- */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/css/fonts/geistmono/or3nQ6H-1_WfwkMZI_qYFrkdmhHkjkotbA.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: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/css/fonts/geistmono/or3nQ6H-1_WfwkMZI_qYFrcdmhHkjko.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;
}

/* --- Tokens -------------------------------------------------------------- */
html {
  --crt-bg: #000;
  --crt-fg: #22c55e;
  --crt-fg-dim: rgba(34, 197, 94, 0.75);
  --crt-on-fg: #000;
  --crt-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --crt-glow: 0 0 2px currentColor, 0 0 4px rgba(0, 255, 0, 0.6), 1px 1px rgba(255, 0, 255, 0.3), -1px -1px rgba(0, 255, 255, 0.2);
  --crt-glow-strong: 0 0 3px var(--crt-fg), 0 0 2px rgba(255, 0, 255, 0.9), 0 0 4px rgba(0, 255, 255, 0.9);
  --crt-scanlines:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));

  background: var(--crt-bg);
  color: var(--crt-fg);
}

/* --- Motion -------------------------------------------------------------- */
@keyframes crtCursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Original: brightness/contrast auf dem Text — Overlay-Opacity war unsichtbar */
@keyframes crtFlicker {
  0%   { filter: brightness(1) contrast(1); }
  50%  { filter: brightness(1.06) contrast(1.03); }
  100% { filter: brightness(0.96) contrast(1.04); }
}

/* Scanlines als festes Vollbild-Overlay */
html::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: var(--crt-scanlines);
  background-size: 100% 2px, 3px 100%;
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  a.logo,
  h1.note-title,
  p.note-meta,
  time.note-date,
  div.note.text.e-content,
  article.note blockquote,
  div.note blockquote,
  footer.footer,
  .footer ul,
  .footer p,
  .note-tags a,
  .note-action,
  .note-action__label,
  .note-footer-context,
  .note-syndication-link,
  details.beilage-section > summary,
  .isso-wrap,
  .isso-comments-host,
  #isso-thread,
  input,
  textarea,
  img,
  .toast-count,
  .toast-button {
    animation: none !important;
    filter: none !important;
  }
}

/* --- Shared CRT text ----------------------------------------------------- */
a.logo,
h1.note-title,
p.note-meta,
time.note-date,
div.note.text.e-content,
article.note blockquote,
div.note blockquote,
footer.footer,
.footer ul,
.footer p,
.note-tags a,
.note-action,
.note-action__label,
.note-footer-context,
.note-syndication-link,
details.beilage-section > summary,
.isso-wrap,
.isso-comments-host,
#isso-thread,
input,
textarea,
img,
.toast-count,
.toast-button {
  color: var(--crt-fg) !important;
  font-family: var(--crt-mono);
  text-shadow: var(--crt-glow);
  position: relative;
  animation: crtFlicker 0.3s ease-in-out infinite alternate;
}

img {
  color: inherit !important;
  font-family: inherit;
  text-shadow: none;
}

a.logo {
  font-size: 2em;
}

.logo span:first-of-type::after {
  content: '.';
  margin-left: 0.1ch;
}

/* Icons aus, Labels reichen (Terminal-Look) */
svg,
nav.blog-prevnext,
#blocks {
  display: none !important;
}

header span.reaction-count::after {
  content: ' reaktionen';
}

span.category-break::after,
a.artikel-beilage .note-action__label::after {
  content: ',';
}

span.toast-count:first-of-type::before {
  content: '\2605';
  margin-right: 0.1ch;
  font-size: 1.6em;
}

.cursor {
  display: inline-block;
  color: var(--crt-fg);
  text-shadow: 0 0 4px rgba(34, 197, 94, 0.8);
  animation: crtCursorBlink 0.5s infinite normal;
}

::selection {
  background: var(--crt-fg);
  color: var(--crt-on-fg);
  text-shadow: var(--crt-glow);
}

/* --- Links & Tags -------------------------------------------------------- */
.text a:not(:has(img)):not(:has(svg)):not(:has(video)),
a.underline:not(:has(img)):not(:has(svg)):not(:has(video)),
.note-tags a {
  text-decoration: underline;
  text-underline-offset: 0.4em;
  text-decoration-color: var(--crt-fg);
  text-decoration-thickness: 2px;
  text-shadow: var(--crt-glow);
  background: transparent;
  border-radius: 0;
}

.footer a:hover,
.note-meta a:hover,
.note.text a:hover,
.note-title a:hover,
.note-tags a:hover,
.note-action:hover,
.note-action:focus-visible,
.note-syndication-link:hover,
.note-syndication-link:focus-visible {
  text-decoration: none;
  color: var(--crt-on-fg) !important;
  background-color: var(--crt-fg) !important;
  border-color: var(--crt-fg);
  border-radius: 0.025em;
  box-shadow: var(--crt-glow-strong);
  filter: brightness(1.15);
  text-shadow: none;
}

/* --- Blockquote ---------------------------------------------------------- */
article.note blockquote,
div.note blockquote {
  position: relative;
  color: var(--crt-fg);
  margin: 1em 0;
  padding: 0 0 0 1em;
  border-left: none;
  font-size: 1em;
  max-width: 90%;
}

article.note blockquote::before,
div.note blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--crt-fg);
  box-shadow:
    0 0 4px var(--crt-fg),
    0 0 10px rgba(255, 0, 255, 1),
    0 0 18px rgba(0, 255, 255, 1);
}

/* --- Note actions (link / .md / beilage / reaktionen) --------------------- */
.note-actions,
.note-actions--secondary {
  font-family: var(--crt-mono);
}

.note-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  border: 1px dotted var(--crt-fg);
  border-radius: 0;
  background: transparent;
  color: var(--crt-fg) !important;
  text-shadow: var(--crt-glow);
  text-decoration: none;
  padding: 0.35em 0.75em;
}

.note-actions--secondary .note-action,
.note-action--edit,
.note-action--osm {
  border-style: dotted;
}

.note-action.is-copied {
  color: var(--crt-on-fg) !important;
  background: var(--crt-fg) !important;
  text-shadow: none;
}

/* --- Tags ---------------------------------------------------------------- */
footer.note-footer ul.note-tags,
footer.note-footer .note-tags a {
  font-family: var(--crt-mono);
}

footer.note-footer .note-tags a {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* --- Beilage details / summaries ----------------------------------------- */
details.beilage-section > summary,
details.beilage-section > summary.section-heading,
details.beilage-section > summary.h2 {
  color: var(--crt-fg) !important;
  font-family: var(--crt-mono) !important;
  font-weight: 500;
  text-shadow: var(--crt-glow);
  list-style: none;
}

details.beilage-section > summary::-webkit-details-marker {
  display: none;
}

details.beilage-section > summary::before {
  content: '▶ ';
  display: inline;
}

details.beilage-section[open] > summary::before {
  content: '▼ ';
}

/* --- Isso / Kommentarform ------------------------------------------------
 * Isso-CSS kommt im Body NACH crt.css und setzt in dark mode u.a.
 * color/#f5f5f5 !important. Deshalb: hohe Spezifität + !important +
 * zusätzlich crt.js hängt dieses Stylesheet nochmal ans Body-Ende.
 */
.isso-avatar,
.isso-avatar img,
.kommentaromat,
[data-kommentaromat] {
  display: none !important;
}

.isso-wrap,
.isso-comments-host,
#isso-thread,
#isso-thread .isso-textarea,
#isso-thread .isso-input-wrapper input,
#isso-thread .isso-post-action > input,
.isso-comments-host .isso-text,
.isso-comments-host .isso-author,
.isso-comment-header,
.isso-comment-header a,
.isso-comment-footer,
.isso-comment-footer a,
.isso-permalink,
.isso-permalink time,
.isso-time,
.isso-spacer,
.isso-federated-platform,
.isso-comments-host .isso-instagram-comments a {
  color: var(--crt-fg) !important;
  font-family: var(--crt-mono) !important;
  text-shadow: var(--crt-glow);
}

#isso-thread .isso-textarea,
#isso-thread .isso-input-wrapper input,
#isso-thread .isso-post-action > input {
  background: var(--crt-bg) !important;
  border: 1px solid var(--crt-fg) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--crt-fg) !important;
  -webkit-text-fill-color: var(--crt-fg) !important;
  caret-color: var(--crt-fg) !important;
  font-family: var(--crt-mono) !important;
  text-shadow: var(--crt-glow);
}

#isso-thread .isso-post-action > input {
  border-style: dotted !important;
  background: transparent !important;
}

#isso-thread .isso-post-action > input:hover {
  background: var(--crt-fg) !important;
  color: var(--crt-on-fg) !important;
  -webkit-text-fill-color: var(--crt-on-fg) !important;
  text-shadow: none;
}

#isso-thread input::placeholder,
#isso-thread textarea::placeholder {
  color: var(--crt-fg-dim) !important;
  -webkit-text-fill-color: var(--crt-fg-dim) !important;
  font-family: var(--crt-mono) !important;
  opacity: 1 !important;
}

#isso-thread .isso-textarea:-webkit-autofill,
#isso-thread .isso-textarea:-webkit-autofill:hover,
#isso-thread .isso-textarea:-webkit-autofill:focus,
#isso-thread .isso-input-wrapper input:-webkit-autofill,
#isso-thread .isso-input-wrapper input:-webkit-autofill:hover,
#isso-thread .isso-input-wrapper input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--crt-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--crt-bg) inset !important;
  -webkit-text-fill-color: var(--crt-fg) !important;
  caret-color: var(--crt-fg) !important;
}

.isso-comments-host .isso-text a,
#isso-thread a {
  color: var(--crt-fg) !important;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--crt-fg);
}

hr.isso-form-rule {
  border-color: var(--crt-fg-dim) !important;
  opacity: 0.6;
}

/* Dark-Mode-Media von isso.css gezielt überstimmen */
@media (prefers-color-scheme: dark) {
  #isso-thread .isso-textarea,
  #isso-thread .isso-input-wrapper input,
  #isso-thread .isso-post-action > input {
    color: var(--crt-fg) !important;
    -webkit-text-fill-color: var(--crt-fg) !important;
    caret-color: var(--crt-fg) !important;
    font-family: var(--crt-mono) !important;
  }

  #isso-thread input::placeholder,
  #isso-thread textarea::placeholder {
    color: var(--crt-fg-dim) !important;
    -webkit-text-fill-color: var(--crt-fg-dim) !important;
  }

  .isso-permalink,
  .isso-permalink time,
  .isso-time,
  .isso-comment-header a,
  .isso-federated-platform {
    color: var(--crt-fg) !important;
    font-family: var(--crt-mono) !important;
  }
}

/* Toast-Button bleibt Text + Stern */
.toast-button {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
