/* =========================================================
   kp-ratgeber-fixes.css
   Bridges the gap between Astro staging and OO live site.
   Provides: CSS variables, H1 sizing, FAQ accordion styles.
   ========================================================= */

/* CSS variables (from custom_css.min.css on live) */
:root {
  --main-bg-color: #ffffff;
  --font-color: #2B2B2B;
  --naviumbruch: 1000px;
  --font1: 'Montserrat', sans-serif;
  --font2: 'Roboto', sans-serif;
  --page-color1: #2B2B2B;
  --page-color2: #ffffff;
  --page-color3: #f4943e;
  --page-color4: #ffffff;
  --maxwidth: 1500px;
}

/* H1 sizing (from style.min.css on live: h1{font-size:2.7em} at 16px base = 43.2px) */
.ai-article h1,
.ratgeber__title,
.ai-expert__name {
  font-size: clamp(30px, 4vw, 43px);
  font-weight: 600;
  line-height: 1.15;
}

/* H2 styling for ratgeber__body (rueckbau page uses this wrapper instead of .content) */
.ratgeber__body h2 {
  font-size: 26px;
  line-height: 1.2;
  position: relative;
  padding-left: 14px;
  margin: 0 0 clamp(14px, 1.2vw, 22px);
}
.ratgeber__body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 4px;
  height: 26px;
  background: var(--page-color1, #2B2B2B);
  border-radius: 999px;
}

/* FAQ accordion styles (from live inline <style> in ratgeber-rueckbau) */
.faq {
  margin: 40px 0 0;
  color: var(--font-color);
}
.faq__title {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 22px;
  position: relative;
  padding-left: 14px;
}
.faq__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 4px;
  height: 26px;
  background: var(--page-color1, #2B2B2B);
  border-radius: 999px;
}
.faq__content {
  display: grid;
  gap: 0;
}
.faq__item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.faq__question {
  display: block;
  width: 100%;
  padding: 18px 40px 18px 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  list-style: none;
  color: var(--font-color, #2B2B2B);
}
.faq__question::-webkit-details-marker {
  display: none;
}
.faq__question::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 300;
  transition: transform 0.3s ease;
  color: var(--page-color1, #2B2B2B);
}
details[open] .faq__question::after {
  content: "\2212";
  transform: translateY(-50%) rotate(0deg);
}
.faq__panel {
  padding: 0 0 18px;
}
.faq__answer,
.faq__panel div[itemprop="text"] {
  font-size: 15px;
  line-height: 1.7;
  opacity: 0.92;
}

/* Paragraph spacing — live has margin 16px top/bottom, staging resets to 0 */
.ratgeber__body p,
.content-section p,
.ai-article p {
  margin: 16px 0;
  line-height: 1.7;
}

/* Lists — proper bullets, spacing, indentation (global for all content areas) */
.ratgeber__body ul,
.ratgeber__body ol,
.content-section ul,
.content-section ol,
.ai-article ul,
.ai-article ol,
.stat-card ul,
.stat-card ol,
.cost-example ul,
.cost-example ol,
.tip-box ul,
.tip-box ol {
  margin: 16px 0;
  padding-left: 26px;
  list-style: none;
}
.ratgeber__body ol,
.content-section ol,
.ai-article ol {
  list-style: decimal;
}
.ratgeber__body li,
.content-section li,
.ai-article li,
.stat-card li,
.cost-example li,
.tip-box li {
  margin-bottom: 10px;
  line-height: 1.65;
  padding-left: 6px;
  position: relative;
}
/* Orange bullet for unordered lists */
.ratgeber__body ul > li::before,
.content-section ul > li::before,
.ai-article ul > li::before,
.stat-card ul > li::before,
.cost-example ul > li::before,
.tip-box ul > li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--page-color3, #f4943e);
}

/* Stat card (Das Wichtigste in Kürze) — needs breathing room */
.stat-card__text ul {
  margin: 10px 0 0;
}
.stat-card__text li {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.55;
}

/* H2 sizing on ratgeber pages */
.ratgeber__body h2,
.content-section h2 {
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 20px;
}

/* H3 sub-headings — need more breathing room */
.ratgeber__body h3 {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--font-color, #2B2B2B);
}

/* Cost example boxes */
.cost-example {
  background: #f8f9fa;
  border-left: 4px solid var(--page-color3, #f4943e);
  padding: 24px 28px;
  margin: 28px 0;
  border-radius: 0 10px 10px 0;
}
.cost-example h4 {
  margin: 0 0 12px;
  color: var(--page-color1, #2B2B2B);
  font-size: 1.15em;
}
.cost-example .cost-range {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--page-color3, #f4943e);
  margin: 14px 0;
  padding: 8px 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.cost-example p {
  margin: 10px 0;
}
.cost-example ul {
  margin: 8px 0 12px;
}
.cost-example li {
  margin-bottom: 6px;
  font-size: 0.95em;
}

/* Tip box */
.tip-box {
  background: #fffbe6;
  border-left: 4px solid #d4a017;
  padding: 18px 24px;
  margin: 24px 0;
  border-radius: 0 10px 10px 0;
  line-height: 1.65;
}
.tip-box strong {
  color: #8b6914;
}

/* Tables — more padding and cleaner look */
.services-table {
  margin: 20px 0 28px;
}
.services-table th,
.services-table td {
  padding: 14px 16px;
}

/* =========================================================
   Nav dropdown orange border (from live site)
   Live uses: border on left/bottom/right = 1px solid #f4943e
   ========================================================= */
nav .parent > ul,
nav li.parent > ul {
  border-left: 1px solid #f4943e;
  border-right: 1px solid #f4943e;
  border-bottom: 1px solid #f4943e;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =========================================================
   Mobile dropdown toggle — sub-menus open on tap
   ========================================================= */
@media (max-width: 1000px) {
  /* Override Astro's fixed 200px nav height to allow submenus to expand */
  .navbar nav {
    height: auto !important;
    max-height: calc(100vh - 80px) !important;
    overflow-y: auto !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
  }
  .navbar nav > ul {
    height: auto !important;
  }
  nav .parent > ul,
  nav li.parent > ul {
    position: static !important;
    display: none !important;
    visibility: visible !important;
    border: none;
    box-shadow: none;
    background: #f5f5f5;
    padding: 0;
    margin: 0;
  }
  nav .parent.submenu-open > ul,
  nav li.parent.submenu-open > ul {
    display: block !important;
  }
  nav .parent > ul > li,
  nav li.parent > ul > li {
    border-bottom: 1px solid #eee;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
  }
  nav .parent > ul > li > a,
  nav li.parent > ul > li > a {
    padding: 12px 15px 12px 35px !important;
    font-size: 14px !important;
    display: block !important;
    color: #555 !important;
    height: auto !important;
    line-height: 1.4 !important;
    border-left: 3px solid var(--page-color3, #f4943e);
  }
  /* Arrow indicator for parent items */
  nav .parent > a::after,
  nav li.parent > a::after {
    content: "›";
    float: right;
    margin-right: 15px;
    font-size: 22px;
    font-weight: 300;
    transition: transform 0.3s;
    color: var(--page-color3, #f4943e);
  }
  nav .parent.submenu-open > a::after,
  nav li.parent.submenu-open > a::after {
    transform: rotate(90deg);
  }
}
