/*
Theme Name: HomeLabNext
Theme URI: https://homelabnext.com
Author: HomeLabNext
Description: Schlankes, dunkles Blog-Theme für HomeLabNext.
Version: 0.8.2
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: homelabnext
*/

:root {
  --hln-bg: #0B0F14;
  --hln-surface: #111821;
  --hln-surface-2: #151E28;
  --hln-border: #223041;
  --hln-text: #F4F7FA;
  --hln-muted: #8FA2B5;
  --hln-accent: #2F8CFF;
  --hln-cyan: #26D9E8;
  --hln-max: 1180px;
  --hln-radius: 18px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--hln-bg);
  color: var(--hln-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--hln-cyan);
  text-decoration: none;
}

a:hover { color: var(--hln-accent); }

img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.container {
  width: min(calc(100% - 32px), var(--hln-max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(11, 15, 20, .88);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--hln-text);
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 1.15rem;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--hln-accent), var(--hln-cyan));
  color: #05101b;
  font-weight: 900;
}

.site-nav ul {
  display: flex;
  gap: 22px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-nav a {
  color: var(--hln-muted);
  font-weight: 600;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
  color: var(--hln-text);
}

.hero {
  padding: 88px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 42px;
  align-items: end;
}

.eyebrow {
  color: var(--hln-cyan);
  font-size: .84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.hero h1 {
  margin: 12px 0 18px;
  font-size: clamp(2.5rem, 7vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.055em;
  max-width: 11ch;
}

.hero p {
  color: var(--hln-muted);
  max-width: 62ch;
  font-size: 1.1rem;
}

.hero-note {
  padding: 22px;
  background: linear-gradient(180deg, rgba(47,140,255,.11), rgba(38,217,232,.04));
  border: 1px solid var(--hln-border);
  border-radius: var(--hln-radius);
  color: var(--hln-muted);
}

.section {
  padding: 30px 0 72px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  letter-spacing: -.035em;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 22px;
}

.post-card {
  background: var(--hln-surface);
  border: 1px solid var(--hln-border);
  border-radius: var(--hln-radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: #36506c;
}

.post-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(47,140,255,.18), transparent 35%),
    linear-gradient(135deg, #101820, #0b1118);
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}

.post-card-body { padding: 20px; }

.post-meta {
  color: var(--hln-muted);
  font-size: .86rem;
}

.post-card h3 {
  margin: 8px 0 10px;
  font-size: 1.25rem;
  line-height: 1.25;
}

.post-card h3 a { color: var(--hln-text); }

.post-card p {
  color: var(--hln-muted);
  margin: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}

.category-card {
  padding: 24px;
  background: var(--hln-surface);
  border: 1px solid var(--hln-border);
  border-radius: var(--hln-radius);
}

.category-card h3 { margin-top: 0; }

.category-card p {
  color: var(--hln-muted);
  margin-bottom: 0;
}

.content-wrap {
  width: min(calc(100% - 32px), 860px);
  margin-inline: auto;
  padding: 62px 0 80px;
}

.entry-header h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -.045em;
  margin: 12px 0 18px;
}

.entry-meta {
  color: var(--hln-muted);
  margin-bottom: 28px;
}

.entry-content {
  font-size: 1.08rem;
}

.entry-content h2,
.entry-content h3 {
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-top: 2em;
}

.entry-content code {
  background: #091018;
  border: 1px solid var(--hln-border);
  padding: .12em .35em;
  border-radius: 6px;
}

.entry-content pre {
  overflow-x: auto;
  padding: 18px;
  background: #091018;
  border: 1px solid var(--hln-border);
  border-radius: 12px;
}

.site-footer {
  border-top: 1px solid var(--hln-border);
  padding: 34px 0;
  color: var(--hln-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.pagination {
  margin-top: 34px;
}

.pagination .nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-numbers {
  padding: 8px 12px;
  border: 1px solid var(--hln-border);
  border-radius: 8px;
}

@media (max-width: 860px) {
  .hero-grid,
  .posts-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .site-nav { display: none; }

  .hero { padding-top: 56px; }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v0.5 */
.brand-logo img {
  display: block;
  width: auto;
  max-height: 42px;
  border-radius: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--hln-border);
  border-radius: 10px;
  color: var(--hln-text);
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, var(--hln-accent), var(--hln-cyan));
  border-color: transparent;
  color: #06111c;
}

.featured-post {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  background: var(--hln-surface);
  border: 1px solid var(--hln-border);
  border-radius: var(--hln-radius);
}

.featured-post-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 30%, rgba(47,140,255,.22), transparent 35%),
    linear-gradient(135deg, #101820, #0b1118);
}

.featured-post-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}

.featured-post-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 54px);
}

.featured-post-body h2 {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.featured-post-body h2 a { color: var(--hln-text); }

.featured-post-body p {
  color: var(--hln-muted);
  font-size: 1.06rem;
}

.topic-link {
  color: inherit;
  display: block;
}

.topic-link:hover .category-card {
  border-color: #36506c;
  transform: translateY(-2px);
}

.category-card {
  transition: transform .2s ease, border-color .2s ease;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--hln-border);
  border-radius: var(--hln-radius);
  color: var(--hln-muted);
}

@media (max-width: 860px) {
  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-post-media {
    min-height: 220px;
  }
}


/* v0.6 footer links */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.footer-links a {
  color: var(--hln-muted);
}

.footer-links a:hover {
  color: var(--hln-text);
}


/* v0.7 mobile polish + burger menu */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--hln-border);
  border-radius: 10px;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--hln-text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle {
  gap: 4px;
  flex-direction: column;
}

.menu-toggle.is-open span {
  opacity: 0;
}

.menu-toggle.is-open::before {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-open::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 860px) {
  .header-inner {
    min-height: 62px;
  }

  .brand-logo img {
    max-height: 34px;
    max-width: 270px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    background: rgba(17,24,33,.98);
    border: 1px solid var(--hln-border);
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0,0,0,.35);
    padding: 10px;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav li + li {
    border-top: 1px solid rgba(255,255,255,.06);
  }

  .site-nav a {
    display: block;
    padding: 13px 12px;
    color: var(--hln-text);
  }

  .hero {
    padding: 46px 0 38px;
  }

  .hero h1 {
    font-size: clamp(2.25rem, 12vw, 4rem);
    line-height: 1.01;
    max-width: 9ch;
    margin-bottom: 14px;
  }

  .hero p {
    font-size: 1rem;
    line-height: 1.55;
  }

  .hero-actions {
    gap: 10px;
    margin-top: 20px;
  }

  .button {
    min-height: 42px;
    padding-inline: 16px;
  }

  .hero-note {
    margin-top: 8px;
    padding: 18px;
    line-height: 1.55;
  }

  .section {
    padding-bottom: 54px;
  }
}

@media (max-width: 520px) {
  .brand-logo img {
    max-width: 245px;
    max-height: 32px;
  }

  .hero h1 {
    font-size: clamp(2.05rem, 11vw, 3.4rem);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
  }
}


/* v0.8 mobile menu polish */
@media (max-width: 860px) {
  .menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }

  .site-nav {
    left: 20px;
    right: 20px;
    top: calc(100% + 6px);
    padding: 6px 10px;
    border-radius: 12px;
  }

  .site-nav a {
    padding: 11px 10px;
    font-size: 1rem;
  }

  .site-nav ul {
    gap: 0;
  }

  .mobile-extra-links {
    display: block;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid rgba(255,255,255,.08);
  }

  .mobile-extra-links a {
    display: block;
    padding: 11px 10px;
    color: var(--hln-text);
    font-weight: 600;
  }

  .hero-note {
    padding: 16px;
  }
}

@media (min-width: 861px) {
  .mobile-extra-links {
    display: none;
  }
}


/* v0.8.2 featured image handling
 * Keep article artwork fully visible on homepage/archive cards.
 * Dark card backgrounds absorb letterboxing when source ratios differ.
 */
