/* =====================================================
   Schwangerschafts-Rechner.de — Main Stylesheet
   Mobile-first, accessible, performance-focused
   ===================================================== */

:root {
  --primary: #d6336c;
  --primary-dark: #a61e4d;
  --primary-light: #fce4ec;
  --secondary: #495057;
  --accent: #ffb4c1;
  --bg: #fff8fa;
  --bg-card: #ffffff;
  --text: #2b2d42;
  --text-light: #6c757d;
  --border: #e9d5dd;
  --success: #2b8a3e;
  --shadow-sm: 0 1px 3px rgba(214, 51, 108, 0.08);
  --shadow-md: 0 4px 12px rgba(214, 51, 108, 0.12);
  --shadow-lg: 0 10px 30px rgba(214, 51, 108, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --max-width: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover, a:focus { color: var(--primary-dark); text-decoration: underline; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

/* Skip link */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--primary); color: #fff;
  padding: 8px 16px; z-index: 1000;
}
.skip-link:focus { top: 0; }

/* =================== HEADER =================== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.brand-icon { font-size: 1.75rem; }
.brand-text { display: flex; align-items: baseline; }
.brand-name { font-size: 1.1rem; color: var(--text); }
.brand-tld { color: var(--primary); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }

.nav-toggle {
  display: flex; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span {
  width: 26px; height: 3px; background: var(--text);
  border-radius: 2px; transition: .25s;
}

.primary-nav {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; box-shadow: var(--shadow-md);
  max-height: 0; overflow: hidden; transition: max-height .25s;
}
.primary-nav.open { max-height: 600px; }
.primary-nav ul { list-style: none; padding: .5rem 0; }
.primary-nav li a {
  display: block; padding: .75rem 1.25rem;
  color: var(--text); font-weight: 500;
}
.primary-nav li a:hover { background: var(--primary-light); text-decoration: none; }
.primary-nav .dropdown { padding-left: 1rem; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static; max-height: none; overflow: visible;
    box-shadow: none; background: transparent;
  }
  .primary-nav ul { display: flex; gap: .5rem; padding: 0; }
  .primary-nav .has-dropdown { position: relative; }
  .primary-nav .dropdown {
    position: absolute; top: 100%; right: 0; min-width: 280px;
    background: #fff; box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
    display: none; padding: .5rem 0; flex-direction: column;
  }
  .primary-nav .has-dropdown:hover .dropdown,
  .primary-nav .has-dropdown:focus-within .dropdown { display: flex; }
}

/* =================== HERO =================== */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
  padding: 3rem 0 2rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.2;
}
.hero p { font-size: 1.15rem; max-width: 700px; margin: 0 auto 2rem; color: var(--text-light); }

/* =================== CALCULATOR FORM =================== */
.calc-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 720px;
}
.calc-card h2 { margin-bottom: 1rem; font-size: 1.5rem; color: var(--primary-dark); }
.calc-card p.intro { margin-bottom: 1.5rem; color: var(--text-light); }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-weight: 600; margin-bottom: .4rem; color: var(--text);
}
.form-group input,
.form-group select {
  width: 100%; padding: .75rem 1rem;
  font-size: 1rem; font-family: inherit;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.15);
}
.form-row { display: grid; gap: 1rem; }
@media (min-width: 600px) {
  .form-row.two-col { grid-template-columns: 1fr 1fr; }
}
.checkbox-group { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.checkbox-group input { width: auto; }

.btn {
  display: inline-block;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer;
  padding: .9rem 2rem;
  font-size: 1.05rem; font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background .15s, transform .1s;
  text-align: center;
}
.btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { width: 100%; }
.btn-secondary { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: var(--primary-light); color: var(--primary-dark); }

/* =================== RESULT BOX =================== */
.result-box {
  margin-top: 2rem; padding: 1.75rem;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
}
.result-box h3 { color: var(--primary-dark); margin-bottom: 1rem; font-size: 1.3rem; }
.result-grid { display: grid; gap: 1rem; }
@media (min-width: 600px) { .result-grid { grid-template-columns: 1fr 1fr; } }
.result-item {
  background: #fff; padding: 1rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.result-item .label { display: block; font-size: .85rem; color: var(--text-light); margin-bottom: .25rem; }
.result-item .value { display: block; font-size: 1.15rem; font-weight: 700; color: var(--text); }
.result-item .value.highlight { color: var(--primary); font-size: 1.4rem; }

/* =================== CONTENT SECTIONS =================== */
.content-section {
  background: #fff; padding: 2rem; margin: 2rem auto;
  border-radius: var(--radius); max-width: 880px;
  box-shadow: var(--shadow-sm);
}
.content-section h2 {
  font-size: 1.7rem; margin-bottom: 1rem; color: var(--primary-dark);
  padding-bottom: .5rem; border-bottom: 2px solid var(--primary-light);
}
.content-section h3 { font-size: 1.25rem; margin: 1.5rem 0 .75rem; color: var(--text); }
.content-section p { margin-bottom: 1rem; }
.content-section ul, .content-section ol { margin: 1rem 0 1rem 1.5rem; }
.content-section li { margin-bottom: .5rem; }
.content-section table {
  width: 100%; border-collapse: collapse; margin: 1rem 0;
  background: #fff;
}
.content-section th, .content-section td {
  padding: .75rem; text-align: left; border-bottom: 1px solid var(--border);
}
.content-section th { background: var(--primary-light); font-weight: 600; }

.info-box {
  background: var(--primary-light); border-radius: var(--radius);
  padding: 1.25rem; margin: 1.5rem 0; border-left: 4px solid var(--primary);
}
.info-box.warning { background: #fff3cd; border-left-color: #ffc107; }
.info-box strong { color: var(--primary-dark); }

/* =================== FAQ =================== */
.faq-item {
  background: #fff; border-radius: var(--radius-sm);
  margin-bottom: .75rem; border: 1px solid var(--border);
  overflow: hidden;
}
.faq-item summary {
  padding: 1rem 1.25rem; font-weight: 600; cursor: pointer;
  background: var(--bg-card); list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.5rem; color: var(--primary); transition: transform .2s; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--primary-light); }
.faq-item .faq-answer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

/* =================== HOMEPAGE GRID =================== */
.calc-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin: 2rem 0;
}
.calc-tile {
  background: #fff; border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
}
.calc-tile:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  text-decoration: none;
}
.calc-tile-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.calc-tile h3 { color: var(--primary-dark); margin-bottom: .5rem; font-size: 1.2rem; }
.calc-tile p { color: var(--text-light); font-size: .95rem; margin: 0; flex-grow: 1; }
.calc-tile .arrow {
  margin-top: 1rem; font-weight: 600; color: var(--primary);
}

/* =================== ADS =================== */
.ad-container {
  margin: 2rem auto; max-width: var(--max-width);
  text-align: center; padding: 0 1rem;
}
.ad-label {
  display: block; font-size: .75rem; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: .25rem;
}
.ad-placeholder {
  background: repeating-linear-gradient(45deg, #f5f5f5, #f5f5f5 10px, #ebebeb 10px, #ebebeb 20px);
  border: 1px dashed #ccc; padding: 2rem;
  color: #999; text-align: center;
  border-radius: var(--radius-sm);
  margin: 2rem auto; max-width: var(--max-width);
}

/* =================== FOOTER =================== */
.site-footer { background: #2b2d42; color: #d8d8e0; margin-top: 4rem; }
.footer-grid {
  display: grid; gap: 2rem; padding: 3rem 1rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.footer-col h3 { color: #fff; margin-bottom: 1rem; font-size: 1.05rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: #d8d8e0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { background: #1d1f31; padding: 1.5rem 0; }
.medical-disclaimer { font-size: .9rem; color: #b0b0bf; margin-bottom: .75rem; }
.copyright { font-size: .85rem; color: #909099; text-align: center; }

/* =================== UTILITIES =================== */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.error-msg { color: #c92a2a; padding: .75rem; background: #fff5f5; border-radius: var(--radius-sm); margin: 1rem 0; }

/* Print friendly */
@media print {
  .site-header, .site-footer, .ad-container, .ad-placeholder, .nav-toggle, .primary-nav { display: none; }
  body { background: #fff; }
  .calc-card { box-shadow: none; }
}
