/* ========================================
   Wohngeld Berlin — Main Stylesheet
   Mobile-first, conversion-optimized, accessible
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: #0057a3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover, a:focus {
  color: #003d73;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #0057a3;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* --- Container --- */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 48rem) {
  .container {
    padding: 0 2rem;
  }
}

/* --- Header --- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  gap: 0.5rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1a1a;
  text-decoration: none;
  white-space: nowrap;
}

.logo:hover, .logo:focus {
  color: #0057a3;
}

/* --- Navigation --- */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  font-weight: 600;
  color: #333;
  padding: 0.25rem 0;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav .active a {
  color: #0057a3;
  border-bottom: 2px solid #0057a3;
}

/* --- Language Switcher --- */
.lang-switcher {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.lang-switcher a {
  text-decoration: none;
  color: #666;
  padding: 0.125rem 0.25rem;
}

.lang-switcher a[aria-current="page"] {
  color: #0057a3;
  font-weight: 700;
}

.lang-switcher a:hover,
.lang-switcher a:focus {
  color: #0057a3;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, #0057a3 0%, #003d73 100%);
  color: #fff;
  text-align: center;
  padding: 3rem 1rem;
}

.hero--compact {
  padding: 2rem 1rem;
}

.hero--compact h1 {
  font-size: 1.5rem;
}

@media (min-width: 48rem) {
  .hero--compact {
    padding: 3rem 2rem;
  }
  .hero--compact h1 {
    font-size: 2rem;
  }
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-sub {
  font-size: 1.125rem;
  max-width: 36rem;
  margin: 0 auto 2rem;
  opacity: 0.95;
}

@media (min-width: 48rem) {
  .hero {
    padding: 5rem 2rem;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero-sub {
    font-size: 1.25rem;
  }
}

/* --- Sections --- */
.section {
  padding: 2.5rem 0;
}

.section--alt {
  background: #f5f7fa;
}

.section--narrow {
  max-width: 48rem;
  margin: 0 auto;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #003d73;
  margin-bottom: 1rem;
}

.section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.section p {
  margin-bottom: 1rem;
  max-width: 48rem;
}

@media (min-width: 48rem) {
  .section {
    padding: 4rem 0;
  }
  .section h2 {
    font-size: 1.875rem;
  }
}

/* --- CTA Section --- */
.cta-section {
  background: #003d73;
  color: #fff;
  text-align: center;
}

.cta-section h2 {
  color: #fff;
}

/* --- CTA Buttons --- */
.cta-button {
  display: inline-block;
  background: #f5a623;
  color: #1a1a1a;
  font-weight: 800;
  font-size: 1.125rem;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, transform 0.1s;
  border: none;
  cursor: pointer;
  line-height: 1.3;
  min-width: 12rem;
}

.cta-button:hover,
.cta-button:focus {
  background: #e89910;
  color: #1a1a1a;
  transform: translateY(-1px);
  outline: 3px solid #f5a623;
  outline-offset: 2px;
}

.cta-button--hero {
  background: #fff;
  color: #0057a3;
  font-size: 1.25rem;
  padding: 1rem 2rem;
}

.cta-button--hero:hover,
.cta-button--hero:focus {
  background: #f5f5f5;
  color: #003d73;
  outline-color: #fff;
}

.cta-button--large {
  font-size: 1.25rem;
  padding: 1.125rem 2.5rem;
}

.cta-button--footer {
  background: #f5a623;
  font-size: 1.125rem;
}

.cta-button + .cta-button {
  margin-left: 0.5rem;
}

/* --- Checklist --- */
.checklist {
  list-style: none;
  margin-bottom: 1.5rem;
}

.checklist li {
  padding: 0.5rem 0 0.5rem 2rem;
  position: relative;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #0057a3;
  font-weight: 800;
}

/* --- Steps (numbered list) --- */
.steps {
  list-style: none;
  counter-reset: step-counter;
  margin-bottom: 1.5rem;
}

.steps li {
  counter-increment: step-counter;
  padding: 1rem 0 1rem 3rem;
  position: relative;
  border-left: 3px solid #0057a3;
  margin-left: 1rem;
}

.steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: -1rem;
  top: 1rem;
  background: #0057a3;
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
}

.steps li:last-child {
  border-left-color: transparent;
}

/* --- Table --- */
.table {
  width: 100%;
  max-width: 36rem;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  caption-side: bottom;
}

.table caption {
  font-size: 0.875rem;
  color: #666;
  padding: 0.5rem;
  text-align: left;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.table th {
  background: #003d73;
  color: #fff;
  font-weight: 700;
}

.table tr:nth-child(even) td {
  background: #f5f7fa;
}

/* --- FAQ --- */
.faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h2, .faq-item h3 {
  margin-bottom: 0.5rem;
}

.link-more {
  font-weight: 700;
  display: inline-block;
  margin-top: 1rem;
}

/* --- Calculator Card --- */
.calculator-card {
  background: #f5f7fa;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  max-width: 36rem;
  margin: 2rem auto;
}

/* --- Footer --- */
.site-footer {
  background: #1a1a1a;
  color: #ccc;
  padding: 2rem 0;
  margin-top: auto;
  text-align: center;
}

.footer-cta {
  margin-bottom: 1.5rem;
}

.footer-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-nav a {
  color: #ccc;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus {
  color: #fff;
  text-decoration: underline;
}

.footer-disclaimer {
  font-size: 0.8125rem;
  color: #888;
  max-width: 40rem;
  margin: 0 auto;
  padding-bottom: 4rem;
}

/* --- Sticky Mobile CTA Bar --- */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #e0e0e0;
  padding: 0.75rem 0;
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.sticky-cta-inner {
  display: flex;
  justify-content: center;
}

.cta-button--sticky {
  width: 100%;
  max-width: 24rem;
  font-size: 1.125rem;
  padding: 0.875rem 1.5rem;
}

@media (max-width: 48rem) {
  .sticky-cta {
    display: block;
  }
  .footer-disclaimer {
    padding-bottom: 5rem;
  }
}

/* --- Focus Indicator (Accessibility) --- */
:focus-visible {
  outline: 3px solid #0057a3;
  outline-offset: 2px;
}

/* --- Two-column list --- */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
}

@media (max-width: 36rem) {
  .two-columns {
    grid-template-columns: 1fr;
  }
}

.district-list {
  margin-bottom: 1.5rem;
}

/* --- Blog --- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-preview {
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 1.5rem;
}

.blog-preview:last-child {
  border-bottom: none;
}

.blog-preview h2 {
  font-size: 1.375rem;
  margin-bottom: 0.25rem;
}

.blog-preview h2 a {
  color: #1a1a1a;
  text-decoration: none;
}

.blog-preview h2 a:hover,
.blog-preview h2 a:focus {
  color: #0057a3;
  text-decoration: underline;
}

.blog-meta {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.blog-meta + h1 {
  margin-top: 0.5rem;
}

/* --- Lead paragraph --- */
.lead {
  font-size: 1.125rem;
  color: #555;
}

/* --- Main content clearing --- */
#main-content {
  flex: 1;
}

/* --- Print --- */
@media print {
  .site-header,
  .site-footer,
  .lang-switcher,
  .cta-button {
    display: none;
  }
  body {
    font-size: 12pt;
  }
}
