/*
Theme Name: Figurenfreak
Theme URI: https://figurenfreak.com
Author: figurenfreak.com
Description: Eigenes Theme fuer figurenfreak.com - bildgetrieben, clean/dezent.
Version: 2.0
Text Domain: figurenfreak
*/

:root {
  --bg: #0f1012;
  --bg-elev: #17191c;
  --header-bg: rgba(15, 16, 18, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1eee8;
  --text-muted: #a0a3a8;
  --accent: #d4a85a;
  --accent-hover: #e9c47f;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: var(--font-body);
  --head-weight: 700;
  --head-spacing: -0.015em;
  --radius: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --max-width: 1180px;
  --content-width: 740px;
  --footer-h: 54px;
}

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

/* Weltraum: dunkler Grund mit zwei sehr schwachen Nebelschleiern; Sterne und
   TIE-Fighter zeichnet js/space.js auf einen Canvas hinter allen Inhalten. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background:
    radial-gradient(ellipse 60% 45% at 18% 12%, rgba(88, 70, 150, 0.16), transparent 70%),
    radial-gradient(ellipse 55% 40% at 85% 75%, rgba(40, 90, 140, 0.13), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

body {
  margin: 0;
  /* --footer-space setzt footer.php aus der gemessenen Footer-Hoehe (falls der Footer umbricht) */
  padding-bottom: var(--footer-space, calc(var(--footer-h) + env(safe-area-inset-bottom, 0px)));
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.ff-space {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.ff-fighters {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-spacing);
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.5em;
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-branding a {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  font-size: 1.35rem;
  letter-spacing: var(--head-spacing);
  color: var(--text);
}
.site-branding a:hover { color: var(--accent); }

.primary-nav > ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
}
.primary-nav li { position: relative; }
.primary-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.93rem;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a {
  color: var(--text);
  background: var(--bg-elev);
}
.primary-nav ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  flex-direction: column;
  list-style: none;
  margin: 6px 0 0;
  padding: 6px;
  min-width: 260px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
}
.primary-nav ul ul::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.primary-nav li:hover > ul,
.primary-nav li:focus-within > ul { display: flex; }
.primary-nav ul ul a { white-space: nowrap; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .site-header-inner { flex-wrap: wrap; }
  .menu-toggle { display: block; }
  .primary-nav { display: none; width: 100%; }
  .primary-nav.is-open { display: block; }
  .primary-nav > ul { flex-direction: column; }
  .primary-nav ul ul {
    display: flex;
    position: static;
    margin: 0;
    padding: 0 0 0 14px;
    min-width: 0;
    border: none;
    box-shadow: none;
    background: none;
  }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg-elev);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.78) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 96px;
}
.hero .eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin: 0 0 0.25em;
}
.hero p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0;
}

/* ============ Rubrik-Kacheln ============ */
.teasers {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  max-width: var(--max-width);
  margin: -56px auto 64px;
  padding: 0 24px;
}
.teaser-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.teaser-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.teaser-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.82) 100%);
}
.teaser-card .label {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 1;
  color: #fff;
}
.teaser-card .label strong {
  display: block;
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  font-size: 1.2rem;
  line-height: 1.25;
}
.teaser-card .label span { font-size: 0.86rem; color: rgba(255, 255, 255, 0.78); }
.teaser-card:hover img { transform: scale(1.06); }
.teaser-card:hover { color: #fff; }

/* ============ Abschnittstitel ============ */
.section-head {
  max-width: var(--max-width);
  margin: 0 auto 24px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.section-head h2 { margin: 0; font-size: 1.5rem; white-space: nowrap; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ============ Beitragskarten ============ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  max-width: var(--max-width);
  margin: 0 auto 48px;
  padding: 0 24px;
}
.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}
.post-card:hover { transform: translateY(-4px); }
.post-card .thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card .body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 22px 24px 24px; }
.post-card .meta {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 600;
}
.post-card h2 { margin: 0; font-size: 1.3rem; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--accent); }
.post-card .excerpt { flex: 1; color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
.post-card .excerpt p { margin: 0; }
.post-card .more { align-self: flex-start; font-size: 0.9rem; font-weight: 600; }

/* ============ Pagination ============ */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 0 0 64px; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
}
.pagination .current { background: var(--bg-elev); color: var(--text); }

/* ============ Archive ============ */
.archive-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 32px;
}
.archive-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0; }
.archive-desc { color: var(--text-muted); max-width: 640px; }

/* ============ Einzelbeitrag / Seite ============ */
.content-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 64px 24px 72px;
}
.entry-header { margin-bottom: 2em; }
.entry-header h1 { font-size: clamp(2.1rem, 4.5vw, 3.1rem); margin: 0; }
.entry-meta {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.entry-content { font-size: 1.06rem; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content p:empty { display: none; }
.entry-content strong { color: var(--text); }
.entry-content h2, .entry-content h3 { margin-top: 1.8em; }
.entry-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content img { border-radius: 8px; }
.entry-content .ff-figure { margin: 2.4em 0; }
.entry-content .ff-figure > a { display: block; }
.entry-content .ff-figure img { width: 100%; height: auto; box-shadow: var(--shadow); }
.entry-content .ff-figure.is-portrait img { width: auto; max-width: 100%; max-height: 80vh; margin: 0 auto; }
.entry-content li .ff-figure { margin: 1.2em 0; }
.ff-zoom { cursor: zoom-in; }
.site-main { overflow-x: clip; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.post-nav div:last-child { text-align: right; }

/* ============ Bilder-Raster im Inhalt ============
   Raster duerfen breiter als die Lesespalte sein (zentriert, max. 1100 px). */
.entry-content .gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-block: 2.4em;
  width: min(1100px, 100vw - 48px);
  margin-left: calc(50% - min(550px, 50vw - 24px));
}
.entry-content .gallery-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(920px, 100vw - 48px);
  margin-left: calc(50% - min(460px, 50vw - 24px));
}
.entry-content .gallery-grid .ff-figure { margin: 0; }
.entry-content .gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}
.entry-content .gallery-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.5s ease;
}
.entry-content .gallery-grid.is-portrait img { aspect-ratio: 3 / 4; }
.entry-content .gallery-grid a:hover img { transform: scale(1.04); }

@media (max-width: 640px) {
  .entry-content .gallery-grid,
  .entry-content .gallery-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* ============ Lightbox ============ */
.ff-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 56px 80px;
  background: rgba(8, 8, 9, 0.95);
}
.ff-lightbox.is-open { display: flex; }
.ff-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.ff-lightbox-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ff-lightbox-btn:hover { background: rgba(255, 255, 255, 0.2); }
.ff-lightbox-btn.prev { left: 16px; top: 50%; transform: translateY(-50%); }
.ff-lightbox-btn.next { right: 16px; top: 50%; transform: translateY(-50%); }
.ff-lightbox-btn.close { right: 16px; top: 16px; font-size: 1.8rem; }
.ff-lightbox.is-single .prev,
.ff-lightbox.is-single .next { display: none; }
.ff-lightbox-count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}
@media (max-width: 640px) {
  .ff-lightbox { padding: 64px 8px 80px; }
  .ff-lightbox-btn.prev, .ff-lightbox-btn.next { top: auto; bottom: 12px; transform: none; }
}

/* ============ Footer (fixiert) ============ */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max-width);
  min-height: var(--footer-h);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-groups { display: flex; align-items: center; gap: 10px; min-width: 0; }
.footer-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.fb-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.fb-pill:hover { border-color: #1877f2; background: rgba(24, 119, 242, 0.14); color: var(--text); }
.fb-pill svg { width: 20px; height: 20px; flex-shrink: 0; color: #1877f2; }
.ig-pill:hover { border-color: #e4405f; background: rgba(228, 64, 95, 0.14); }
.ig-pill svg { color: #e4405f; }
.footer-links ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; white-space: nowrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 1000px) {
  .footer-label { display: none; }
  .ig-pill { padding: 5px; }
  .ig-pill span { display: none; }
}

@media (max-width: 760px) {
  :root { --footer-h: 82px; }
  .footer-inner { flex-direction: column; justify-content: center; gap: 6px; padding: 8px 12px; }
  .footer-groups { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .fb-pill { gap: 5px; padding: 3px 8px 3px 4px; font-size: 0.72rem; }
  .ig-pill { padding: 3px; }
  .fb-pill svg { width: 16px; height: 16px; }
  .footer-links ul { gap: 14px; font-size: 0.76rem; }
}

/* ============ Kommentare ============ */
.comments-area { max-width: var(--content-width); margin: 0 auto; padding: 0 24px 64px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list li { border-top: 1px solid var(--border); padding: 16px 0; }
