/*
Theme Name: Astra Child
Template: astra
Version: 5.0
*/

/* ========== LIGHT (Standard) ========== */
:root, html[data-theme="light"] {
  --bg: #F4F4F5;
  --surface: #FFFFFF;
  --surface2: #E4E4E7;
  --border: #D4D4D8;
  --text: #18181B;
  --text2: #3F3F46;
  --muted: #71717A;
  --accent: #16A34A;
  --accent-light: rgba(22,163,74,0.08);
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --sidebar-bg: #FFFFFF;
  --radius: 10px;
}

/* ========== DARK ========== */
html[data-theme="dark"] {
  --bg: #09090B;
  --surface: #18181B;
  --surface2: #27272A;
  --border: #3F3F46;
  --text: #FAFAFA;
  --text2: #D4D4D8;
  --muted: #A1A1AA;
  --accent: #22C55E;
  --accent-light: rgba(34,197,94,0.1);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --sidebar-bg: #18181B;
}

/* ========== GLOBAL ========== */
* { box-sizing: border-box; }
body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif !important;
  font-size: 16px !important;
  line-height: 1.7 !important;
  -webkit-font-smoothing: antialiased !important;
  margin: 0 !important;
  transition: background 0.15s, color 0.15s;
}

a { color: var(--accent) !important; }
h1, h2, h3, h4, h5, h6 { color: var(--text) !important; font-weight: 700 !important; line-height: 1.3 !important; }
p { color: var(--text2) !important; }
strong { color: var(--text) !important; }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
img { max-width: 100%; height: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
table th { background: var(--surface2); padding: 0.6rem 1rem; text-align: left; font-size: 0.85rem; font-weight: 600; color: var(--text); border-bottom: 2px solid var(--border); }
table td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); color: var(--text2); }
table tr:hover td { background: var(--surface); }
ul, ol { color: var(--text2); }
li { margin-bottom: 0.3rem; }

/* ========== SIDEBAR ========== */
.m3d-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  z-index: 1000; display: flex; flex-direction: column;
  overflow-y: auto; transition: background 0.15s, transform 0.3s;
}
.m3d-sidebar-logo { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.m3d-sidebar-logo a { text-decoration: none !important; }
.m3d-sidebar-logo .logo-name { font-size: 1.15rem; font-weight: 800; color: var(--text) !important; }
.m3d-sidebar-logo .logo-name span { color: var(--accent) !important; }
.m3d-sidebar-logo .logo-tag { font-size: 0.78rem; color: var(--muted) !important; margin-top: 2px; }
.m3d-sidebar-nav { flex: 1; padding: 0.5rem 0; }
.m3d-sidebar-section { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted) !important; padding: 1rem 1.25rem 0.4rem; opacity: 0.6; }
.m3d-sidebar-nav a { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 1.25rem; font-size: 0.88rem; font-weight: 500; color: var(--muted) !important; text-decoration: none !important; border-left: 2px solid transparent; transition: all 0.1s; }
.m3d-sidebar-nav a:hover { color: var(--text) !important; background: var(--accent-light); border-left-color: var(--accent); }
.m3d-sidebar-nav a svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.m3d-sidebar-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); }
.m3d-theme-toggle { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.78rem; color: var(--muted); background: none; border: 1px solid var(--border); padding: 0.3rem 0.6rem; border-radius: 6px; width: 100%; justify-content: center; transition: all 0.1s; }
.m3d-theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.m3d-theme-toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.m3d-mobile-toggle { display: none; position: fixed; top: 0.75rem; left: 0.75rem; z-index: 1001; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; cursor: pointer; }
.m3d-mobile-toggle svg { width: 20px; height: 20px; stroke: var(--text); fill: none; stroke-width: 1.5; }
.m3d-sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 999; }
.m3d-sidebar-overlay.open { display: block; }

/* ========== CONTENT ========== */
body.has-sidebar #page, body.has-sidebar .site, body.has-sidebar .ast-container {
  margin-left: 240px !important;
  width: calc(100% - 240px) !important;
  max-width: calc(100% - 240px) !important;
}
.site-content, .entry-content, .ast-single-post, .page .entry-content {
  max-width: 820px !important;
  margin: 0 auto !important;
  padding: 2rem !important;
}

/* ========== ASTRA OVERRIDES ========== */
.ast-separate-container .site-main { background: var(--bg) !important; }
.ast-separate-container .ast-article-single, .ast-separate-container .ast-article-post { background: var(--bg) !important; padding: 0 !important; }
.ast-container { background: var(--bg) !important; }
#primary { background: var(--bg) !important; }
.entry-title { font-size: 2rem !important; margin-bottom: 0.5rem !important; }
.entry-header { margin-bottom: 1.5rem !important; }

/* Tip/Info Boxen */
.tip { background: var(--accent-light) !important; border: 1px solid rgba(22,163,74,0.15); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.tip strong { color: var(--accent) !important; }
.info { background: rgba(59,130,246,0.06) !important; border: 1px solid rgba(59,130,246,0.15); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.info strong { color: #3B82F6 !important; }

/* Cards */
.cd { background: var(--surface) !important; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin: 0.75rem 0; box-shadow: var(--shadow); }
.cd:hover { border-color: var(--accent); }

/* Rechner */
.cw { background: var(--surface) !important; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.fld input { background: var(--bg) !important; border: 1px solid var(--border) !important; border-radius: 6px !important; padding: 0.5rem 0.75rem; color: var(--text) !important; }
.fld label { color: var(--muted) !important; font-size: 0.85rem !important; }
.cbtn { background: var(--accent) !important; color: #fff !important; border: none; border-radius: 6px; padding: 0.6rem 1.2rem; cursor: pointer; font-weight: 600; }

/* Cookie Banner */
#cookie-notice { position: fixed !important; bottom: 0 !important; left: 240px !important; right: 0 !important; top: auto !important; z-index: 99999 !important; background: var(--surface) !important; border-top: 1px solid var(--border) !important; padding: 1rem 1.5rem !important; }
#cookie-notice .cookie-notice-container { display: flex !important; align-items: center !important; justify-content: center !important; gap: 1.5rem !important; flex-wrap: wrap !important; background: transparent !important; padding: 0 !important; }
#cookie-notice .cn-text-container { color: var(--text) !important; font-size: 0.9rem !important; }
#cookie-notice .cn-text-container a { color: var(--accent) !important; }
#cookie-notice #cn-accept-cookie { background: var(--accent) !important; color: #fff !important; border: none !important; border-radius: 6px !important; padding: 0.5rem 1.2rem !important; font-weight: 600 !important; cursor: pointer !important; }
#cookie-notice #cn-refuse-cookie { background: transparent !important; color: var(--muted) !important; border: 1px solid var(--border) !important; border-radius: 6px !important; padding: 0.5rem 1.2rem !important; cursor: pointer !important; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .m3d-sidebar { transform: translateX(-100%); }
  .m3d-sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.1); }
  .m3d-mobile-toggle { display: block; }
  body.has-sidebar #page, body.has-sidebar .site, body.has-sidebar .ast-container {
    margin-left: 0 !important; width: 100% !important; max-width: 100% !important;
  }
  #cookie-notice { left: 0 !important; }
}
