/*
Theme Name: Apple Minimal
Theme URI: https://marco-stankowitz.de
Author: Marco Stankowitz
Version: 1.3
Text Domain: apple-minimal
*/

/* ═══════════════════════════════════════════════════════════
   VARIABLEN – HELL
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg:          #f5f5f7;
  --bg-card:     #ffffff;
  --text:        #1d1d1f;
  --muted:       #6e6e73;
  --border:      rgba(0,0,0,0.08);
  --accent:      #0071e3;
  --nav-bg:      rgba(0,0,0,0.82);
  --nav-text:    rgba(255,255,255,0.85);
  --nav-hover:   rgba(255,255,255,0.12);
  --nav-h:       48px;
  --radius-lg:   18px;
  --radius-md:   12px;
}

/* ═══════════════════════════════════════════════════════════
   VARIABLEN – DUNKEL
   ═══════════════════════════════════════════════════════════ */
body.dark-mode {
  --bg:      #1c1c1e;
  --bg-card: #2c2c2e;
  --text:    #f5f5f7;
  --muted:   #98989d;
  --border:  rgba(255,255,255,0.08);
  --accent:  #4ca3ff;
  --nav-bg:  rgba(28,28,30,0.88);
}

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

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.8; }
img { max-width: 100%; display: block; }

/* ═══════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════ */
.apple-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  height: var(--nav-h);
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.admin-bar .apple-nav               { top: 32px; }
@media screen and (max-width: 782px){
  .admin-bar .apple-nav             { top: 46px; }
}

.apple-nav-inner {
  height: 100%;
  width: 95%;
  max-width: 2560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.apple-nav-logo { flex-shrink: 0; line-height: 0; }
.apple-nav-logo a { color: #fff; font-weight: 600; font-size: 0.95rem; text-decoration: none; display: flex; align-items: center; }
.apple-nav-logo img,
.apple-nav-logo .custom-logo-link img {
  height: 26px !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
}
.apple-nav-logo .custom-logo-link { display: block; line-height: 0; }

/* Nav links (Desktop) */
.apple-nav-links { display: flex; }

.apple-nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 0.15rem;
}
.apple-nav-list li { list-style: none; }
.apple-nav-list li a {
  font-size: 0.78rem;
  color: var(--nav-text);
  padding: 5px 11px;
  border-radius: 6px;
  display: block;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.apple-nav-list li a:hover { background: var(--nav-hover); color: #fff; opacity: 1; }

/* Actions (dark toggle + burger) */
.apple-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

/* Dark Mode Toggle */
.darkmode-toggle {
  background: none; border: none; cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; padding: 0;
  transition: background 0.15s;
}
.darkmode-toggle:hover { background: rgba(255,255,255,0.12); }
body:not(.dark-mode) .dm-icon-dark  { display: none; }
body.dark-mode        .dm-icon-light { display: none; }

/* Burger */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 32px; height: 32px; padding: 0;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: rgba(255,255,255,0.9); border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

/* ═══════════════════════════════════════════════════════════
   WRAPPER
   ═══════════════════════════════════════════════════════════ */
.site-wrapper {
  width: 95%;
  max-width: 2560px;
  margin: 0 auto;
  padding-top: calc(var(--nav-h) + 28px);
  padding-bottom: 60px;
}
.admin-bar .site-wrapper { padding-top: calc(var(--nav-h) + 32px + 28px); }

/* ═══════════════════════════════════════════════════════════
   HOMEPAGE GRID
   ═══════════════════════════════════════════════════════════ */
.apple-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Card base */
.apple-blog-post {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.apple-blog-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.13);
}

/* Featured */
.apple-blog-post--featured { grid-column: 1 / -1; }
.apple-blog-post--featured .apple-post-thumbnail img {
  width: 100%; height: 46vh; object-fit: cover;
}
.apple-featured-body { padding: 1.2rem 1.4rem 1.4rem; }
.apple-blog-post--featured .apple-post-title {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  letter-spacing: -0.03em; margin: 0 0 0.4rem; line-height: 1.15;
}

/* Standard cards */
.apple-blog-post--standard { display: flex; flex-direction: column; }
.apple-standard-body { padding: 0.8rem 1rem 1rem; flex: 1; display: flex; flex-direction: column; }
.apple-blog-post--standard .apple-post-title {
  font-size: 0.95rem; font-weight: 600;
  margin: 0 0 0.3rem; line-height: 1.3;
}

.apple-post-thumbnail { overflow: hidden; background: #e5e5ea; }
.apple-post-thumbnail img { width: 100%; height: 180px; object-fit: cover; transition: transform 0.4s ease; }
.apple-blog-post:hover .apple-post-thumbnail img { transform: scale(1.03); }

.apple-post-category {
  font-size: 0.68rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.35rem;
}
.apple-post-meta { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.4rem; }
.apple-post-excerpt { font-size: 0.83rem; color: var(--muted); line-height: 1.5; flex: 1; }
.apple-post-read-more {
  display: inline-flex; align-items: center;
  margin-top: 0.7rem; font-size: 0.82rem; color: var(--accent); font-weight: 500;
}
.apple-post-read-more:hover { text-decoration: underline; opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   SINGLE POST
   ═══════════════════════════════════════════════════════════ */
.apple-single-header {
  max-width: 780px; margin: 0 auto 2rem; text-align: center;
}
.apple-single-meta {
  font-size: 0.78rem; color: var(--muted); margin-bottom: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem; flex-wrap: wrap;
}
.apple-single-meta-sep { opacity: 0.4; }
.apple-single-category {
  color: var(--accent); font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.apple-single-title {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  letter-spacing: -0.04em; line-height: 1.08; margin: 0 0 1rem; font-weight: 700;
}
.apple-single-excerpt { font-size: 1.05rem; color: var(--muted); line-height: 1.55; max-width: 600px; margin: 0 auto; }

.apple-single-thumbnail {
  width: 100%; margin: 0 auto 2.5rem;
  border-radius: var(--radius-lg); overflow: hidden;
  max-height: 40vh;
}
.apple-single-thumbnail img { width: 100%; height: 40vh; object-fit: cover; }

/* Content volle Breite auf Desktop */
.apple-single-content {
  width: 100%; max-width: 780px; margin: 0 auto;
  font-size: 1.05rem; line-height: 1.75; color: var(--text);
}
.apple-single-content p { margin-bottom: 1.4em; }
.apple-single-content h2 { font-size: 1.7rem; letter-spacing: -0.03em; margin: 2.2em 0 0.7em; }
.apple-single-content h3 { font-size: 1.3rem; margin: 1.8em 0 0.5em; }
.apple-single-content img { max-width: 100%; border-radius: var(--radius-md); margin: 1.5rem 0; }
.apple-single-content blockquote {
  border-left: 3px solid var(--border); padding-left: 1.2rem;
  margin-left: 0; color: var(--muted); font-style: italic;
}
.apple-single-content code {
  font-family: "SF Mono", Menlo, monospace; font-size: 0.88em;
  background: var(--bg); padding: 2px 6px; border-radius: 4px;
}
.apple-single-content pre {
  background: var(--bg); border-radius: var(--radius-md);
  padding: 1.4rem; overflow-x: auto; font-size: 0.87rem;
}

.apple-single-footer {
  max-width: 780px; margin: 2.5rem auto 0;
  padding-top: 1.8rem; border-top: 1px solid var(--border);
}
.apple-single-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.8rem; }
.apple-tag {
  font-size: 0.75rem; font-weight: 500; color: var(--accent);
  background: rgba(0,113,227,0.08); padding: 4px 12px; border-radius: 999px;
}
.apple-tag:hover { background: rgba(0,113,227,0.15); opacity: 1; }

.apple-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.apple-post-nav-link {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1rem; background: var(--bg); border-radius: var(--radius-md);
  text-decoration: none; transition: background 0.15s;
}
.apple-post-nav-link:hover { background: var(--bg-card); opacity: 1; }
.apple-post-nav-link--next { text-align: right; }
.apple-post-nav-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.apple-post-nav-title { font-size: 0.9rem; font-weight: 600; color: var(--text); line-height: 1.3; }

/* ═══════════════════════════════════════════════════════════
   PAGE / ARCHIVE / 404
   ═══════════════════════════════════════════════════════════ */
.apple-page-header { max-width: 780px; margin: 0 auto 2rem; text-align: center; }
.apple-page-title  { font-size: clamp(1.8rem, 4vw, 3.2rem); letter-spacing: -0.04em; margin: 0; font-weight: 700; }
.apple-archive-eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 0.4rem; }
.apple-blog-title { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.03em; margin: 0 0 1.2rem; font-weight: 700; }
.apple-404 { min-height: 60vh; display: flex; align-items: center; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.apple-footer { background: var(--bg); border-top: 1px solid var(--border); margin-top: 3rem; }
.apple-footer-inner {
  width: 95%; max-width: 2560px; margin: 0 auto;
  padding: 1.1rem 0; font-size: 0.75rem; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem;
}
.apple-footer-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.2rem; }
.apple-footer-nav li { list-style: none; }
.apple-footer-nav a { font-size: 0.75rem; color: var(--muted); text-decoration: none; transition: color 0.15s; }
.apple-footer-nav a:hover { color: var(--text); opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════ */
.nav-links { display: flex; gap: 0.4rem; margin-top: 2rem; justify-content: center; flex-wrap: wrap; }
.nav-links .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px;
  font-size: 0.82rem; text-decoration: none; color: var(--text); background: var(--bg-card);
}
.nav-links .page-numbers:hover { background: var(--border); opacity: 1; }
.nav-links .page-numbers.current { background: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.apple-button-primary {
  display: inline-flex; align-items: center; padding: 10px 22px;
  border-radius: 999px; font-size: 0.9rem; font-weight: 500;
  background: var(--accent); color: #fff; text-decoration: none; transition: opacity 0.15s;
}
.apple-button-primary:hover { opacity: 0.85; color: #fff; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE – TABLET 1024px
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .apple-blog-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE – TABLET PORTRAIT 768px
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .apple-blog-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .apple-blog-post--featured .apple-post-thumbnail img { height: 36vh; }
  .apple-single-thumbnail,
  .apple-single-thumbnail img { max-height: 30vh !important; height: 30vh !important; }
  .apple-post-nav { grid-template-columns: 1fr; }
  .apple-post-nav-link--next { text-align: left; }
  .apple-footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE – MOBILE 600px  ← BURGER AKTIV
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Burger sichtbar, Nav versteckt */
  .nav-toggle       { display: flex; }
  .apple-nav-links  { display: none; }

  /* Nav geöffnet */
  .apple-nav-links.is-open {
    display: block;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(0,0,0,0.94);
    padding: 0.6rem 1rem 1.5rem;
    z-index: 9998;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .apple-nav-links.is-open .apple-nav-list { flex-direction: column; gap: 0; }
  .apple-nav-links.is-open .apple-nav-list li a {
    font-size: 1rem; padding: 13px 8px; border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07); color: rgba(255,255,255,0.9);
  }

  .admin-bar .apple-nav-links.is-open { top: calc(var(--nav-h) + 46px); }

  /* Layout */
  .site-wrapper { width: 100%; padding-left: 14px; padding-right: 14px; }
  .apple-blog-grid { grid-template-columns: 1fr; gap: 10px; }
  .apple-blog-post--featured { max-height: none; }
  .apple-blog-post--featured .apple-post-thumbnail img { height: 52vw; }
  .apple-post-thumbnail img { height: 52vw; max-height: 220px; }
  .apple-single-thumbnail,
  .apple-single-thumbnail img { max-height: 220px !important; height: 220px !important; }
  .apple-single-title { font-size: clamp(1.4rem, 6vw, 2rem) !important; }
  .apple-post-nav { grid-template-columns: 1fr; }
  .apple-post-nav-link--next { text-align: left; }
  .apple-footer-inner { padding: 1rem 14px; flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE – SMALL PHONE 375px
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 375px) {
  .apple-nav-logo img,
  .apple-nav-logo .custom-logo-link img { height: 22px !important; }
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE – WordPress Content Override
   ═══════════════════════════════════════════════════════════ */
body.dark-mode {
  --wp--preset--color--black: #f5f5f7;
  --wp--preset--color--white: #1c1c1e;
}

/* Alle WordPress-Inline-Farben im Dark Mode überschreiben */
body.dark-mode .entry-content,
body.dark-mode .apple-single-content,
body.dark-mode .apple-single-content * {
  color: var(--text) !important;
}

body.dark-mode .apple-single-content h1,
body.dark-mode .apple-single-content h2,
body.dark-mode .apple-single-content h3,
body.dark-mode .apple-single-content h4,
body.dark-mode .apple-single-content h5,
body.dark-mode .apple-single-content h6 {
  color: #f5f5f7 !important;
}

body.dark-mode .apple-single-content a {
  color: var(--accent) !important;
}

body.dark-mode .apple-single-content p,
body.dark-mode .apple-single-content li,
body.dark-mode .apple-single-content td,
body.dark-mode .apple-single-content span {
  color: #f5f5f7 !important;
}

body.dark-mode .apple-single-content blockquote,
body.dark-mode .apple-single-content blockquote * {
  color: #98989d !important;
}

body.dark-mode .has-black-color          { color: #f5f5f7 !important; }
body.dark-mode .has-white-background-color { background-color: #2c2c2e !important; }
body.dark-mode .has-black-background-color { background-color: #f5f5f7 !important; }

/* ─── Bild kleiner ──────────────────────────────────────── */
.apple-single-thumbnail,
.apple-single-thumbnail img {
  max-height: 280px !important;
  height: 280px !important;
}

/* ─── Pillen-Suche im Header ────────────────────────────── */
.apple-nav-search {
  flex: 1;
  max-width: 240px;
}

.apple-nav-search form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 0 12px;
  height: 30px;
  gap: 6px;
  transition: background 0.2s;
}

.apple-nav-search form:focus-within {
  background: rgba(255,255,255,0.2);
  outline: 2px solid rgba(255,255,255,0.3);
}

.apple-nav-search input[type="search"] {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.78rem;
  width: 100%;
  padding: 0;
  font-family: inherit;
}

.apple-nav-search input[type="search"]::placeholder {
  color: rgba(255,255,255,0.5);
}

.apple-nav-search button[type="submit"] {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.apple-nav-search button[type="submit"]:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .apple-nav-search { display: none; }
}

/* ─── Suche: als Form direkt in actions ─────────────────── */
form.apple-nav-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.13);
  border-radius: 999px;
  padding: 0 12px;
  height: 30px;
  gap: 7px;
  transition: background 0.2s, outline 0.2s;
  border: none;
  max-width: 220px;
  min-width: 140px;
}

form.apple-nav-search:focus-within {
  background: rgba(255,255,255,0.22);
  outline: 1.5px solid rgba(255,255,255,0.35);
}

form.apple-nav-search svg {
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
}

form.apple-nav-search input[type="search"] {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.78rem;
  width: 100%;
  padding: 0;
  font-family: inherit;
  -webkit-appearance: none;
}

form.apple-nav-search input[type="search"]::placeholder {
  color: rgba(255,255,255,0.45);
}

/* Entferne alte .apple-nav-search div-Regel */
.apple-nav-search:not(form) { display: none !important; }

@media (max-width: 600px) {
  form.apple-nav-search { display: none; }
}
