/* ============================================
   KidsLab.de — Tech & Kreativ Enhancement CSS
   Code-Editor trifft kreativen Spielplatz
   ============================================ */

/* --- Agave Nerd Font: Self-hosted --- */
@font-face {
  font-family: 'Agave';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/agave-regular.woff2) format('woff2');
}
@font-face {
  font-family: 'Agave';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/agave-bold.woff2) format('woff2');
}

/* --- ASCII Terminal Body Font Override --- */
body,
body p,
body li,
body td,
body th,
body span,
body .paragraph,
body .content {
  font-family: 'Agave', monospace !important;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0;
}

/* --- Design Tokens (CSS Custom Properties) --- */
:root {
  --kl-primary: #0F7AE5;
  --kl-secondary: #06D6A0;
  --kl-accent: #FF6B35;
  --kl-dark: #0A1628;
  --kl-bg: #F7F8FC;
  --kl-gradient: linear-gradient(135deg, #0F7AE5, #06D6A0);
  --kl-gradient-accent: linear-gradient(135deg, #0F7AE5, #FF6B35);
  --kl-shadow-sm: 0 2px 8px rgba(15, 122, 229, 0.08);
  --kl-shadow-md: 0 4px 16px rgba(15, 122, 229, 0.12);
  --kl-shadow-lg: 0 8px 32px rgba(15, 122, 229, 0.16);
  --kl-radius: 16px;
  --kl-radius-sm: 12px;
  --kl-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Card Shadows + Hover Lift --- */
.post,
.product,
article.post-card,
.block-infocard {
  box-shadow: var(--kl-shadow-sm);
  transition: transform var(--kl-transition), box-shadow var(--kl-transition);
}

.post:hover,
.product:hover,
article.post-card:hover,
.block-infocard:hover {
  transform: translateY(-4px);
  box-shadow: var(--kl-shadow-lg);
}

/* --- Button Glow + Hover --- */
.button.primary,
a.button.primary,
button.primary,
input[type="submit"] {
  transition: box-shadow var(--kl-transition), transform var(--kl-transition);
}

.button.primary:hover,
a.button.primary:hover,
button.primary:hover,
input[type="submit"]:hover {
  box-shadow: 0 4px 20px rgba(15, 122, 229, 0.4);
  transform: translateY(-2px);
}

/* --- Animated Link Underline (Gradient) --- */
.content a:not(.button):not(.post):not(.product) {
  text-decoration: none;
  background-image: linear-gradient(135deg, var(--kl-primary), var(--kl-secondary));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size var(--kl-transition);
  padding-bottom: 2px;
}

.content a:not(.button):not(.post):not(.product):hover {
  background-size: 100% 2px;
}

/* --- Code Blocks: Dark IDE Style --- */
pre,
code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

pre {
  background: var(--kl-dark) !important;
  color: #e4e8f0 !important;
  border-radius: var(--kl-radius-sm);
  padding: 2rem 1.5rem 1.5rem !important;
  position: relative;
  overflow-x: auto;
  border: 1px solid rgba(6, 214, 160, 0.15);
}

/* Terminal Dots Decoration */
pre::before {
  content: '';
  display: block;
  position: absolute;
  top: 12px;
  left: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #28ca41;
}

code {
  background: rgba(15, 122, 229, 0.08);
  color: var(--kl-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* --- Hero Banner Grid Pattern Overlay --- */
.block-herobanner {
  position: relative;
}

.block-herobanner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  border-radius: inherit;
}

/* --- Footer Enhancement --- */
footer,
.footer {
  background-color: var(--kl-dark) !important;
}

footer a,
.footer a {
  transition: color var(--kl-transition);
}

footer a:hover,
.footer a:hover {
  color: var(--kl-secondary) !important;
}

/* --- Image Zoom on Hover --- */
.content img:not(.logo img) {
  transition: transform var(--kl-transition);
  border-radius: var(--kl-radius-sm);
}

.post img:hover,
.product img:hover {
  transform: scale(1.03);
}

/* --- Focus Styles (Accessibility + Tech Feel) --- */
:focus-visible {
  outline: 2px solid var(--kl-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--kl-primary);
  outline-offset: 3px;
}

/* --- Selection Color --- */
::selection {
  background: rgba(15, 122, 229, 0.2);
  color: inherit;
}

::-moz-selection {
  background: rgba(15, 122, 229, 0.2);
  color: inherit;
}

/* --- Smooth Scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- CTA Block Enhancement --- */
.block-cta {
  position: relative;
  overflow: hidden;
}

.block-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* --- Newsletter Section --- */
.newsletter input[type="email"],
.newsletter input[type="text"] {
  border: 2px solid rgba(15, 122, 229, 0.2);
  border-radius: var(--kl-radius-sm);
  transition: border-color var(--kl-transition), box-shadow var(--kl-transition);
}

.newsletter input[type="email"]:focus,
.newsletter input[type="text"]:focus {
  border-color: var(--kl-primary);
  box-shadow: 0 0 0 4px rgba(15, 122, 229, 0.1);
}

/* --- Header / Navigation: Mac OS 9 Platinum Menu Bar --- */

/* Chicago-Style Pixel-Font für die gesamte Menüleiste */
.header-main,
.header-main a,
.header-main .button,
.header-main .header-listed li a,
.header-main ul li.submenu > ul li a {
  font-family: "Pixelify Sans", "Chicago", "Geneva", monospace !important;
}

/* Platinum Rillen-Textur als Hintergrund */
.header-main {
  background:
    #e0e0e0
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.45) 0px,
      rgba(255,255,255,0.45) 1px,
      transparent 1px,
      transparent 2px
    ) !important;
  border-top: 1px solid #fff !important;
  border-bottom: 1px solid #888 !important;
  box-shadow: 0 1px 0 #000 !important;
}

/* Logo: Immer begrenzt (Mobil + Desktop) */
.header-main .logo svg,
.header-main .logo img {
  height: 28px !important;
  width: auto !important;
  image-rendering: pixelated;
}

/* Nav: Kompakt wie die echte Menüleiste (nur Desktop) */
@media (min-width: 861px) {
  .header-main {
    height: auto !important;
  }

  .header-main nav {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }

  .header-main nav > div {
    height: auto !important;
    display: flex !important;
    align-items: center !important;
  }

  .header-main a:not(.button) {
    height: auto !important;
    line-height: inherit !important;
  }

  /* Logo: Kompakt passend zur Menüleiste */
  .header-main .logo {
    width: auto !important;
    float: left;
  }

  .header-main .logo svg,
  .header-main .logo img {
    height: 40px !important;
    width: auto !important;
    display: block;
    image-rendering: pixelated;
  }

  /* Controls (Search, Dark-Mode Toggle) kompakt */
  .header-main ul.header-controls label.switch {
    margin: 4px 0 !important;
  }

  .header-main .header-social li a {
    padding: 2px 6px !important;
  }
}

/* Menü-Items */
.header-main .header-listed li {
  padding: 0 !important;
}

.header-main .header-listed li a {
  display: block;
  padding: 4px 14px !important;
  font-size: 14px;
  line-height: 22px;
  color: #000 !important;
  border-radius: 0 !important;
  transition: none;
  font-weight: 600;
}

/* Hover: Das blaue OS9-Highlight */
.header-main .header-listed li a:hover,
.header-main .header-listed li.active a {
  background: #3160D6 !important;
  color: #fff !important;
}

/* Dropdown-Menüs: Exakt wie OS9 */
@media (min-width: 861px) {
  .header-main ul li.submenu {
    overflow: visible !important;
    height: auto !important;
  }

  .header-main ul li.submenu > ul {
    background: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.35);
    padding: 3px 0 !important;
    min-width: 200px;
    right: auto !important;
    left: 0;
  }

  .header-main ul li.submenu > ul li {
    display: block;
    padding: 0 !important;
  }

  .header-main ul li.submenu > ul li a {
    display: block;
    padding: 2px 18px !important;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
    height: auto !important;
    color: #000 !important;
    opacity: 1 !important;
    border-radius: 0 !important;
    white-space: nowrap;
  }

  /* OS9 Blue Highlight auf Hover */
  .header-main ul li.submenu > ul li a:hover {
    background: #3160D6 !important;
    color: #fff !important;
  }

  /* Gepunktete Trennlinie zwischen Items — wie im Screenshot */
  .header-main ul li.submenu > ul li + li::before {
    content: '';
    display: block;
    height: 1px;
    margin: 2px 4px;
    background: repeating-linear-gradient(
      90deg,
      #999 0px, #999 1px,
      transparent 1px, transparent 3px
    );
  }

  /* Submenu-Pfeil ▶ */
  .header-main ul li.submenu > ul li a .icon-external-link {
    float: right;
    margin-left: 16px;
  }
}

/* Social-Icons im Platinum-Stil */
.header-main .header-social li a {
  transition: none;
  padding: 4px 6px !important;
}

.header-main .header-social li a:hover {
  background: #3160D6;
  color: #fff !important;
}

/* Kontakt-Button: Klassischer Mac OS Push-Button */
.header-main .header-buttons .button {
  border-radius: 4px !important;
  border: 1px solid #000 !important;
  background:
    linear-gradient(180deg, #fff 0%, #ddd 45%, #bbb 55%, #ccc 100%) !important;
  color: #000 !important;
  font-weight: 700;
  font-size: 13px !important;
  padding: 3px 20px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    1px 1px 0 rgba(0,0,0,0.2);
  transition: none;
  text-shadow: none;
  line-height: 20px !important;
}

.header-main .header-buttons .button:hover {
  background:
    linear-gradient(180deg, #eee 0%, #ccc 45%, #aaa 55%, #bbb 100%) !important;
  color: #000 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    1px 1px 0 rgba(0,0,0,0.2);
}

.header-main .header-buttons .button:active {
  background:
    linear-gradient(180deg, #aaa 0%, #999 100%) !important;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.3);
}

/* Dark mode: Dunklere Platinum-Variante */
body.dark .header-main {
  background:
    #333
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.08) 0px,
      rgba(255,255,255,0.08) 1px,
      transparent 1px,
      transparent 2px
    ) !important;
  border-top: 1px solid #555 !important;
  border-bottom: 1px solid #111 !important;
  box-shadow: 0 1px 0 #000 !important;
}

body.dark .header-main .header-listed li a {
  color: #e0e0e0 !important;
}

body.dark .header-main .header-listed li a:hover,
body.dark .header-main .header-listed li.active a {
  background: #3160D6 !important;
  color: #fff !important;
}

body.dark .header-main .header-buttons .button {
  background: linear-gradient(180deg, #555 0%, #3a3a3a 100%) !important;
  color: #eee !important;
  border-color: #222 !important;
}

body.dark .header-main .header-buttons .button:hover {
  background: linear-gradient(180deg, #4a4a4a 0%, #333 100%) !important;
}

@media (min-width: 861px) {
  body.dark .header-main ul li.submenu > ul {
    background: #2a2a2a !important;
    border-color: #555 !important;
  }

  body.dark .header-main ul li.submenu > ul li a {
    color: #ddd !important;
  }

  body.dark .header-main ul li.submenu > ul li a:hover {
    background: #3160D6 !important;
    color: #fff !important;
  }

  body.dark .header-main ul li.submenu > ul li + li::before {
    background: repeating-linear-gradient(
      90deg,
      #555 0px, #555 1px,
      transparent 1px, transparent 3px
    );
  }
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  pre::before {
    top: 8px;
    left: 12px;
    width: 10px;
    height: 10px;
    box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #28ca41;
  }

  pre {
    padding: 1.8rem 1rem 1rem !important;
  }
}

/* --- 1. Tag-Filter Buttons (Blog) --- */
.tags-filter .button.button-style-secondary {
  font-family: 'Agave', monospace !important;
  font-size: 12px;
  padding: 4px 12px !important;
  border: 1px solid #ccc !important;
  background: #f0f0f0 !important;
  color: #333 !important;
  border-radius: 4px !important;
  line-height: 18px;
  margin-bottom: 6px;
}

.tags-filter .button.button-style-secondary:hover {
  background: var(--kl-primary) !important;
  color: #fff !important;
  border-color: var(--kl-primary) !important;
}

/* --- 2. Spacing reduzieren --- */

/* Content-Sektionen: 80px → 40px Padding */
.blocks.padding,
section.padding,
section.blocks.padding,
section.blocks.blocks-content.padding {
  padding: 40px 48px !important;
}

@media (max-width: 768px) {
  .blocks.padding,
  section.padding,
  section.blocks.padding,
  section.blocks.blocks-content.padding {
    padding: 32px 24px !important;
  }
}

/* Hero-Bereich (Seiten-Überschriften): Genug Platz lassen */
.hero.padding {
  padding: 48px 48px 32px !important;
}

@media (max-width: 768px) {
  .hero.padding {
    padding: 32px 24px 24px !important;
  }
}

/* Sections die nur eine Überschrift enthalten → kompakt */
section.blocks .block-type-heading:only-child {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* H2-Überschriften: kompakter */
.title-h2 {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}

/* --- 3. Footer: OS9 "About This Mac" Style --- */

/* Footer-Grundlayout: Alles zentriert, kompakt */
.footer {
  padding: 28px 24px 16px !important;
  text-align: center;
}

/* Alle Rows/Cols → zentrierter Stack statt Spalten */
.footer .row {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0 !important;
  text-align: center;
}

.footer .col-1-3,
.footer .col-2-3 {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  text-align: center;
}

/* Innere Row (Menü-Spalten) auch flach */
.footer .col-2-3 .row {
  flex-direction: row !important;
  justify-content: center !important;
  flex-wrap: wrap;
  gap: 0 !important;
}

/* Menü-Überschrift ausblenden (nur "Info", brauchen wir nicht) */
.footer h4 {
  display: none !important;
}

/* Menü-Links: Horizontale Zeile mit Trennpunkten */
.footer ul.list {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  padding: 0;
  margin: 8px 0 !important;
}

.footer ul.list li {
  display: inline-flex !important;
  align-items: center;
}

.footer ul.list li::after {
  content: '·';
  margin: 0 10px;
  opacity: 0.4;
  font-size: 14px;
}

.footer ul.list li:last-child::after {
  display: none;
}

.footer ul.list li a {
  font-family: 'Agave', monospace !important;
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer ul.list li a:hover {
  opacity: 1;
}

/* Logo: Groß, zentriert, Pixel-Art-Rendering */
.footer .paragraph {
  margin: 0 0 4px !important;
  padding: 0 !important;
  text-align: center;
}

.footer img {
  height: 100px !important;
  width: auto !important;
  image-rendering: pixelated;
  opacity: 0.85 !important;
  display: inline-block;
  transition: opacity 0.3s;
}

.footer img:hover {
  opacity: 1 !important;
}

/* Spacing zwischen Logo-Bereich und Menü reduzieren */
.footer .space-top {
  margin-top: 4px !important;
}

.footer .space-bottom,
.footer .space-bottom-075x,
.footer .space-bottom-05x {
  margin-bottom: 0 !important;
}

/* Footer-Bottom: Social + Copyright kompakt */
.footer .footer-bottom {
  margin-top: 12px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(255,255,255,0.08);
  width: 100%;
}

/* Social Icons zentriert */
.footer .footer-social {
  justify-content: center;
  margin-bottom: 8px;
}

.footer .footer-social li a {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.footer .footer-social li a:hover {
  opacity: 1;
}

/* Copyright: Klein, zentriert, gedimmt */
.footer .footer-copyright {
  font-family: 'Agave', monospace !important;
  font-size: 11px;
  opacity: 0.4;
  text-align: center !important;
}

.footer .footer-copyright a {
  opacity: 0.6;
}

/* Align-Right auf Copyright-Spalte aufheben */
.footer .align-right {
  text-align: center !important;
}

/* --- Blog-Karten: Titel-Span im Bild-Bereich verstecken --- */
a.bg-cover > span:not([class]) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
