/*
Theme Name: PKD-INK (Director's Cut)
Version: 8.0.0
Author: Adam Porkolab
Text Domain: pkd-ink
*/
:root {
  --ink-bg: #02040a;
  --ink-grid: #102542;
  --ink-fg: #d0e1ff;
  --ink-accent: #00f7ff;
  --ink-violet: #a78bfa;
  --ink-muted: #8b9bb1;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --neon-glow: 0 0 5px color-mix(in srgb, var(--ink-accent) 50%, transparent),
    0 0 10px color-mix(in srgb, var(--ink-accent) 40%, transparent);
  --wp--preset--spacing--40: 1.5rem;
  --wp--preset--spacing--50: 2rem;
  --wp--preset--spacing--60: 3rem;
  --wp--preset--spacing--70: 4rem;
  --wp--preset--spacing--80: 5rem;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}
@keyframes glitch {
  0% {
    clip-path: inset(25% 0 25% 0);
    transform: translate(-10px, 0);
  }
  20% {
    clip-path: inset(50% 0 10% 0);
    transform: translate(10px, 5px);
  }
  40% {
    clip-path: inset(10% 0 55% 0);
    transform: translate(-5px, -5px);
  }
  60% {
    clip-path: inset(45% 0 45% 0);
    transform: translate(5px, 10px);
  }
  80% {
    clip-path: inset(30% 0 20% 0);
    transform: translate(-10px, 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
    transform: translate(0, 0);
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--ink-bg);
  color: var(--ink-fg);
  font-family: var(--font-mono);
  line-height: 1.7;
  overflow-x: hidden;
  padding-bottom: 80px;
}

#datastream-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* === ÁLTALÁNOS "FROSTED GLASS" STÍLUS === */
.site-header,
.site-footer,
.pkd-card,
.hero-console,
.main-menu .sub-menu {
  background: color-mix(in srgb, var(--ink-bg) 75%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--ink-grid);
}

/* --- FŐMENÜ --- */
.site-header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--ink-grid);
  margin-bottom: var(--wp--preset--spacing--60);
  position: sticky;
  top: 0;
  z-index: 101;
}
.header-container {
  display: flex;
  justify-content: center;
  position: relative;
  align-items: center;
}
.mobile-menu-toggle {
  display: none;
}
.main-navigation {
  display: flex;
  justify-content: center;
}
.main-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-menu li {
  position: relative;
}
.main-menu a {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  text-decoration: none;
  display: inline-block;
  position: relative;
}
.main-menu a:hover,
.main-menu .current-menu-item > a {
  color: var(--ink-accent);
  text-shadow: var(--neon-glow);
}
.main-menu .sub-menu {
  list-style: none;
  padding: 0.5rem;
  margin: 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  border-top: 1px solid var(--ink-accent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}
.main-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-menu .sub-menu a:hover {
  background-color: var(--ink-grid);
  color: var(--ink-accent);
}

/* --- HERO SZEKCIÓ --- */
.hero-console {
  padding: 2rem;
  border-radius: 8px;
  max-width: 800px;
  margin: 5vh auto;
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
h1,
h2,
h3,
h4,
.wp-block-post-title a {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: var(--neon-glow);
  line-height: 1.2;
}
.hero-console h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 1rem;
}
.hero-console h1::after {
  content: '█';
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: var(--ink-accent);
  margin-left: 0.5em;
  text-shadow: none;
}
.hero-console .wp-block-button__link:hover {
  border-color: var(--ink-accent);
  color: var(--ink-accent) !important;
  box-shadow: 0 0 15px color-mix(in srgb, var(--ink-accent) 40%, transparent);
}

/* --- KEZDŐOLDAL EXTRA STÍLUSOK --- */
.front-page-main {
  padding-top: var(--wp--preset--spacing--50);
}
.content-panel {
  background: color-mix(in srgb, var(--ink-bg) 75%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--ink-grid);
  padding: 1.5rem 2rem;
  border-radius: 8px;
}
.fp-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: var(--wp--preset--spacing--70);
  margin-bottom: var(--wp--preset--spacing--70);
}
.content-panel h2 {
  color: var(--ink-accent);
  margin-top: 0;
  font-size: 1.5rem;
}
.fb-embed-wrapper {
  overflow: hidden;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.fb-embed-wrapper iframe {
  max-width: 100%;
}
.system-status-panel {
  padding: 1rem 1.5rem;
  border-color: var(--ink-grid);
}
.system-status-panel .panel-title {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  margin: 0 0 1rem;
}
.system-status-panel .status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5rem 1.5rem;
}
.system-status-panel .status-item {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.system-status-panel .status-label {
  color: var(--ink-muted);
}
.system-status-panel .status-value {
  color: var(--ink-fg);
  font-weight: 600;
}
.system-status-panel .status-ok {
  color: #4ade80;
}
.system-status-panel .status-secure {
  color: var(--ink-accent);
}

/* --- KÁRTYÁK ÉS RÁCSOK --- */
.pkd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.pkd-card-link-wrapper {
  text-decoration: none;
  display: flex;
}
.pkd-card {
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: relative;
  border: 1px solid var(--ink-accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
body.js-loaded .pkd-card {
  opacity: 1; /* Legyen látható alapból */
  transform: translateY(30px);
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.pkd-card:hover {
  transform: translateY(-5px);
  border-color: var(--ink-grid);
  box-shadow: 0 10px 40px rgba(0, 247, 255, 0.1);
}
.pkd-card-background {
  position: absolute;
  inset: 0;
}
.pkd-card-background img,
.pkd-card-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.pkd-card:hover .pkd-card-background img {
  transform: scale(1.05);
  animation: glitch 0.3s ease-in-out;
}
.pkd-card-placeholder {
  background-color: var(--ink-grid);
}
.pkd-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(2, 4, 10, 1) 0%,
    rgba(2, 4, 10, 0.9) 30%,
    rgba(2, 4, 10, 0) 70%
  );
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.pkd-card:hover .pkd-card-overlay {
  opacity: 0;
}
.pkd-card .wp-block-post-excerpt {
  display: none;
}
.pkd-card .wp-block-post-title {
  padding: 1rem;
  margin-top: auto;
  position: relative;
  z-index: 2;
  color: var(--ink-accent);
  transition: color 0.3s ease;
}
.pkd-card:hover .wp-block-post-title {
  color: var(--ink-fg);
}
.pkd-card .wp-block-post-title,
.pkd-card .wp-block-post-title a {
  font-size: 1.25rem;
  text-decoration: none;
}
body.js-loaded .pkd-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: glitch-reveal 0.6s ease-out forwards;
}
@keyframes glitch-reveal {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  20% {
    clip-path: inset(85% 0 5% 0);
  }
  40% {
    clip-path: inset(15% 0 75% 0);
  }
  60% {
    clip-path: inset(50% 0 30% 0);
    transform: translateY(0) scale(1);
  }
  80% {
    clip-path: inset(5% 0 90% 0);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0) scale(1);
  }
}

/* --- HUD MODAL ABLAK --- */
#hud-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(2, 4, 10, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}
#hud-modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}
#hud-modal-panel {
  position: absolute;
  background: color-mix(in srgb, var(--ink-bg) 85%, transparent);
  border: 1px solid var(--ink-grid);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 90vw;
  width: 450px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
  align-items: start;
  transform: scale(0.98);
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
}
#hud-modal-overlay.is-visible #hud-modal-panel {
  transform: scale(1);
}
.hud-modal-image {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--ink-grid);
}
.hud-modal-image.placeholder {
  background-color: var(--ink-grid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}
.hud-modal-content {
  display: flex;
  flex-direction: column;
  min-height: 0; /* Flexbox bug elkerülésére */
  position: relative;
}
.hud-modal-content > h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--ink-accent);
  padding-right: 3.2rem;
}
.hud-modal-content h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--ink-accent);
}
.hud-modal-content .meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.hud-modal-content .meta span {
  display: block;
}
.hud-modal-content .content-full {
  max-height: 40vh;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.7;
  padding-right: 1rem;
}
.hud-modal-content .content-full::-webkit-scrollbar {
  width: 6px;
}
.hud-modal-content .content-full::-webkit-scrollbar-track {
  background: var(--ink-grid);
}
.hud-modal-content .content-full::-webkit-scrollbar-thumb {
  background-color: var(--ink-accent);
  border-radius: 6px;
}
.hud-modal-content .wp-block-button__link {
  text-decoration: none;
  border: 1px solid var(--ink-muted);
  color: var(--ink-muted);
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}
.hud-modal-content .wp-block-button__link:hover {
  border-color: var(--ink-accent);
  color: var(--ink-accent);
  box-shadow: 0 0 15px color-mix(in srgb, var(--ink-accent) 40%, transparent);
}

/* --- FIX HUD LÁBLÉC --- */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.5rem 0;
  z-index: 100;
  border-top: 1px solid var(--ink-grid);
}
.system-log-container {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  width: 100%;
  padding: 0 5%;
}

/* --- FÓKUSZ MÓD (EGYSZERŰSÍTETT) --- */
/* Csak elrejtjük a felesleges elemeket, a layoutot és a görgetést nem befolyásoljuk. */
body.focus-mode-active .site-header,
body.focus-mode-active #datastream-canvas {
  transition: opacity 0.5s ease;
  opacity: 0;
  pointer-events: none;
}

.focus-mode-toggle {
  background: none;
  border: 1px solid var(--ink-muted);
  color: var(--ink-muted);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: auto;
  flex-shrink: 0;
}
.focus-mode-toggle:hover {
  border-color: var(--ink-accent);
  color: var(--ink-accent);
}
.focus-mode-toggle svg {
  width: 20px;
  height: 20px;
}
.focus-mode-toggle.is-active {
  border-color: var(--ink-accent);
  color: var(--ink-accent);
  box-shadow: 0 0 10px var(--ink-accent);
}
.system-log-container {
  align-items: center;
}

/* ÚJ: Modal bezárás gomb stílusa */
.modal-close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: 1px solid var(--ink-muted);
  color: var(--ink-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.8rem;
  font-family: var(--font-mono);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 99;
  transition: all 0.3s ease-in-out;
}

.modal-close-button:hover {
  color: var(--ink-accent);
  border-color: var(--ink-accent);
  transform: rotate(90deg);
  box-shadow: var(--neon-glow);
}

/* === RESZPONZIVITÁSI SZABÁLYOK === */
@media (max-width: 1024px) {
  #hud-modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* Biztonsági távolság a szélektől */
    pointer-events: auto;
  }
  #hud-modal-panel {
    position: static;
    width: 100%;
    max-width: 600px;
    max-height: 85vh; /* Maximum a képernyő magasságának 85%-a lehet */
    overflow-y: auto; /* Ha a tartalom magasabb, a panel görgethetővé válik */
  }
}
@media (max-width: 900px) {
  .fp-grid-container {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 782px) {
  /* Fejléc és gomb pozicionálás */
  .site-header {
    padding: 0;
    min-height: 60px;
    display: flex;
    align-items: center;
  }
  .header-container {
    width: 100%;
  }
  .mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid var(--ink-muted);
    color: var(--ink-muted);
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
  }
  .mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
  }
  .mobile-menu-toggle .icon-close {
    display: none;
  }
  .mobile-menu-toggle.is-active .icon-menu {
    display: none;
  }
  .mobile-menu-toggle.is-active .icon-close {
    display: block;
    color: var(--ink-accent);
  }

  /* Asztali menü elrejtése */
  .main-navigation {
    display: none;
  }

  /* Lenyíló mobilmenü stílusa */
  .main-navigation.is-open {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: color-mix(in srgb, var(--ink-bg) 90%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding-top: 80px;
    overflow-y: auto;
  }
  .main-navigation.is-open .main-menu {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0;
  }
  .main-navigation.is-open .main-menu a {
    font-size: 1.2rem;
    padding: 1rem;
    display: block;
    width: 100%;
    text-align: center;
  }
  .main-navigation.is-open .sub-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: none;
    border: none;
    min-width: auto;
    padding: 0;
    text-align: center;
  }
  .main-navigation.is-open .sub-menu a {
    font-size: 1rem;
    color: var(--ink-muted);
  }

  /* Tartalmi dobozok paddingjének csökkentése */
  .hero-console,
  .content-panel {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Lábléc áthelyezése */
  .site-footer {
    position: static;
    margin-top: var(--wp--preset--spacing--60);
  }
  .system-log-container {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.25rem 1rem;
  }
  body {
    padding-bottom: 0;
  }
  /* JAVÍTÁS: Gombok egymás alá rendezése mobilon */
  .hero-console .wp-block-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  /* JAVÍTÁS: Animáció kikapcsolása mobilon a hibák elkerülése érdekében */
  body.js-loaded .pkd-card {
    opacity: 1;
    transform: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease,
      border-color 0.3s ease;
  }
}

@media (max-width: 480px) {
  /* Kártyák egy oszlopba */
  .pkd-grid {
    grid-template-columns: 1fr;
  }
  #hud-modal-panel {
    grid-template-columns: 1fr;
  }
}

/* === ARCHÍVUM SZŰRŐ === */
.publication-matrix {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--wp--preset--spacing--60);
}

.filter-controls .wp-block-button a {
  width: 100%;
  justify-content: flex-start; /* Balra igazítás */
  color: var(--ink-muted);
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.filter-controls .wp-block-button.is-active a {
  color: var(--ink-accent);
  border-color: var(--ink-grid);
  background-color: color-mix(in srgb, var(--ink-grid) 50%, transparent);
}

.pkd-card.is-hidden {
  display: none; /* Vagy használj animációt: opacity: 0; transform: scale(0.95); */
}

/* Mobilon a szűrő a rács fölé kerül */
@media (max-width: 782px) {
  .publication-matrix {
    grid-template-columns: 1fr;
  }
  .filter-controls {
    margin-bottom: var(--wp--preset--spacing--50);
  }
  .filter-controls .wp-block-buttons {
    flex-direction: row; /* Vízszintesen jelenjenek meg a gombok */
    flex-wrap: wrap;
  }
}

/* === IMMERZÍV OLVASÁS MÓD (SINGLE.PHP) === */
.immersive-button {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 102;
  background: color-mix(in srgb, var(--ink-bg) 75%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ink-grid);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.immersive-button:hover {
  color: var(--ink-accent);
  border-color: var(--ink-accent);
}

/* Amikor az immerzív mód aktív... */
body.immersive-mode-active .site-header,
body.immersive-mode-active .site-footer,
body.immersive-mode-active #datastream-canvas,
body.immersive-mode-active .back-to-archive {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

body.immersive-mode-active .wp-block-post-content {
  font-family: 'Lora', serif; /* Olvasóbarátabb betűtípus */
  font-size: 1.1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* === PSZICHO-STATIKUS TORZÍTÁS (GLITCH) === */
body.content-glitching::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  background: var(--ink-bg);
  animation: glitch 0.3s ease-in-out forwards;
}

/* === HACKER SZONÁR HÁTTÉR === */
body::before {
  content: '';
  position: fixed;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle at center,
    rgba(0, 247, 255, 0.05) 0%,
    rgba(0, 247, 255, 0) 50%
  );
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
  transition: top 0.2s ease, left 0.2s ease;
}

/* === KERNELPANIK IHLETTE VIZUÁLIS FELTÖLTÉS === */

/* --- 1. CRT Monitor effekt az egész oldalra --- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  /* Scanlines (képernyőcsíkok) */
  background-image: repeating-linear-gradient(
    0deg,
    rgba(16, 37, 66, 0.15),
    rgba(16, 37, 66, 0.15) 1px,
    transparent 1px,
    transparent 4px
  );
  /* Vignette (képernyő sötétedés a széleken) */
  box-shadow: inset 0 0 150px rgba(2, 4, 10, 0.7);
}

/* --- 2. Analóg szöveg-remegés és vibrálás --- */
@keyframes text-flicker {
  0%,
  100% {
    opacity: 1;
    text-shadow: 0 0 8px var(--ink-accent), 0 0 20px rgba(0, 247, 255, 0.3);
  }
  50% {
    opacity: 0.95;
    text-shadow: 0 0 10px var(--ink-accent), 0 0 25px rgba(0, 247, 255, 0.3);
  }
}

h1,
h2,
h3,
.wp-block-post-title a {
  animation: text-flicker 4s infinite linear;
}

/* --- 3. Intenzívebb Glitch Effektus Hover-re --- */
.main-menu a,
.pkd-card .wp-block-post-title a,
.wp-block-button a {
  position: relative;
}

.main-menu a:hover::before,
.pkd-card .wp-block-post-title a:hover::before,
.main-menu a:hover::after,
.pkd-card .wp-block-post-title a:hover::after {
  content: attr(data-text); /* A szöveg tartalmát használjuk */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--ink-bg);
  overflow: hidden;
}
.main-menu a:hover,
.pkd-card .wp-block-post-title a:hover {
  color: var(--ink-accent);
}

.main-menu a:hover::before {
  left: 2px;
  text-shadow: -1px 0 #a78bfa; /* Violet */
  animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.main-menu a:hover::after {
  left: -2px;
  text-shadow: -1px 0 #4ade80, 1px 0 var(--ink-accent); /* Green & Cyan */
  animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(15% 0 86% 0);
  }
  10% {
    clip-path: inset(54% 0 7% 0);
  }
  20% {
    clip-path: inset(47% 0 47% 0);
  }
  30% {
    clip-path: inset(3% 0 54% 0);
  }
  40% {
    clip-path: inset(28% 0 18% 0);
  }
  50% {
    clip-path: inset(69% 0 23% 0);
  }
  60% {
    clip-path: inset(8% 0 78% 0);
  }
  70% {
    clip-path: inset(45% 0 19% 0);
  }
  80% {
    clip-path: inset(92% 0 3% 0);
  }
  90% {
    clip-path: inset(23% 0 64% 0);
  }
  100% {
    clip-path: inset(58% 0 33% 0);
  }
}
@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(82% 0 6% 0);
  }
  10% {
    clip-path: inset(2% 0 62% 0);
  }
  20% {
    clip-path: inset(21% 0 73% 0);
  }
  30% {
    clip-path: inset(43% 0 51% 0);
  }
  40% {
    clip-path: inset(2% 0 94% 0);
  }
  50% {
    clip-path: inset(84% 0 11% 0);
  }
  60% {
    clip-path: inset(29% 0 42% 0);
  }
  70% {
    clip-path: inset(99% 0 1% 0);
  }
  80% {
    clip-path: inset(63% 0 13% 0);
  }
  90% {
    clip-path: inset(35% 0 53% 0);
  }
  100% {
    clip-path: inset(1% 0 86% 0);
  }
}

/* --- 4. Animált UI Sarokelemek a Kártyákon --- */
.pkd-card {
  position: relative;
  border: 1px solid var(--ink-grid); /* Alap border */
}

.pkd-card::before,
.pkd-card::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  transition: all 0.3s ease-in-out;
}

.pkd-card::before {
  top: -5px;
  left: -5px;
  border-top: 2px solid var(--ink-accent);
  border-left: 2px solid var(--ink-accent);
  transform: scale(0);
}
.pkd-card::after {
  bottom: -5px;
  right: -5px;
  border-bottom: 2px solid var(--ink-accent);
  border-right: 2px solid var(--ink-accent);
  transform: scale(0);
}
.pkd-card:hover::before,
.pkd-card:hover::after {
  transform: scale(1);
}

/* --- 5. A 404-es oldal felturbózása --- */
.error404 main {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}
.error404 h1 {
  font-size: clamp(4rem, 20vw, 10rem);
  animation: glitch-anim-1 1.5s infinite linear alternate-reverse,
    text-flicker 3s infinite linear;
  color: var(--ink-muted);
}
.error404 .error-message {
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--ink-accent);
  letter-spacing: 0.1em;
}
.error404 .error-message::before {
  content: '> ';
}

/* --- MODÁLIS ABLAK TARTALOM JAVÍTÁSA --- */

/* 1. Megakadályozza, hogy a grid cella szétnyomja az elrendezést */
.hud-modal-content {
  min-width: 0; /* Ez a legfontosabb grid/flex túlfolyás elleni trükk */
}

/* 2. Kényszeríti a szöveget a sortörésre, ha az egyetlen hosszú szó lenne */
/* És biztosítja, hogy a formázott HTML (pl. <p> tagek) helyesen jelenjenek meg */
.hud-modal-content .content-full {
  overflow-wrap: break-word;
  word-break: break-word;

  /* Biztosítja, hogy a bekezdéseknek legyen térközük */
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 3. A bezárás gomb ne olvadjon bele semmibe */
.modal-close-button {
  z-index: 10; /* Biztosan felül legyen */
  background: var(--ink-bg); /* Kapjon egy kis hátteret, hogy kiemelkedjen */
}
