/* ===== Finanzierungsseite (Schlossberginstitut) ===== */
:root {
  --red: #d60525;
  --pink: #fbb7a5;
  --text: #111;
  --muted: #6b6b6b;
  --bg: #ffffff;
}
body { font-family: Verdana, Arial, sans-serif; line-height: 1.65; color: var(--text); background: var(--bg); margin: 0; }
.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }

/* Basics */
h1, h2, h3 { margin: 0 0 .5rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.05rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1rem; border-radius: .75rem; border: 2px solid transparent;
  text-decoration: none; font-weight: bold; transition: transform .08s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  line-height: 1.2; text-align: center; color: #fff; /* Weißschrift fix */
  cursor: pointer;
}
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(214,5,37,.3); }
.btn--primary { background: var(--red); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(214,5,37,.25); }
.btn--secondary { background: var(--pink); }
.btn--secondary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(251,183,165,.35); }
.btn--ghost { background: transparent; border-color: var(--red); color: var(--red); }
.btn--ghost:hover { background: rgba(214,5,37,.07); color: var(--red); }

/* Hero */
.hero { padding: 1rem 0 0; }
.trust-badges { display: flex; gap: .5rem; list-style: none; padding: 0; margin: .5rem 0 1rem 0; }
.trust-badges li { background: var(--pink); color: #fff; padding: .25rem .5rem; border-radius: 999px; font-size: .85rem; white-space: nowrap; }
.note { color: var(--muted); }
.hero-ctas { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 1.25rem; }
.hero-figure { margin: 1rem 0; }
.responsive-img { max-width: 100%; height: auto; display: block; border-radius: .75rem; }
.no-shimmer { position: relative; z-index: 2; } /* Bilder vom Schimmer ausnehmen */

/* Cards */
.options { margin-top: 1.5rem; }
.options h2 { margin-bottom: .75rem; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.card {
  position: relative; border-radius: 1rem; background: #fff; border: 1px solid #eee;
  box-shadow: 0 2px 10px rgba(0,0,0,.03); overflow: hidden; isolation: isolate;
  transition: box-shadow .25s ease; min-height: 100%;
}
.card::before { content: ""; position: absolute; inset: 0; background: rgba(251,183,165,.18); opacity: 0; transition: opacity .25s ease; z-index: 1; }
.card:hover::before { opacity: 1; } /* Rosa Schimmer auf der Karte selbst */
.card:hover { box-shadow: 0 10px 26px rgba(0,0,0,.10); } /* leichter grauer Schatten dahinter */
.card__content { position: relative; z-index: 2; padding: 1rem; display: flex; flex-direction: column; min-height: 100%; }
.subtitle { color: var(--muted); margin-top: -.25rem; margin-bottom: .5rem; }
.list { padding-left: 1.1rem; margin: 0 0 .75rem; }
.howto { background: #faf7f6; border: 1px dashed var(--pink); padding: .6rem .7rem; border-radius: .5rem; margin-bottom: .9rem; }
.howto__title { display: inline-block; font-weight: bold; color: var(--red); margin-bottom: .15rem; }
.card__cta { margin-top: auto; padding-top: .75rem; border-top: 1px solid #eee; display: flex; gap: .5rem; flex-wrap: wrap; }

/* Accordion (details) */
details.accordion { background: #fff; border: 1px solid #eee; border-radius: .5rem; padding: .6rem .7rem; margin-bottom: .6rem; }
details.accordion summary { cursor: pointer; font-weight: bold; color: var(--red); outline: none; }
details.accordion[open] { border-color: var(--pink); background: #fff9f7; }

/* Beispiel / Bildunterschrift */
.example figure { margin: 1.5rem 0; }
figcaption { color: var(--muted); font-size: .9rem; }

/* Kontaktbox */
.contact { padding: 1.25rem 0 2rem; }
.contact__box { border: 1px solid #eee; border-radius: 1rem; padding: 1rem; background: linear-gradient(180deg, #fff, #fff9f7); }
.contact__cta { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 1100px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .card-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; } /* Buttons dürfen umbrechen und bleiben großflächig klickbar */
  .hero-figure { margin-top: .5rem; }
  .responsive-img { max-width: 92%; margin: 0 auto; } /* Bilder etwas kleiner auf Mobile */
}

/* Fixes aus der Preview (beibehalten) */
.card{ display:flex; flex-direction:column; }
.card__content{ display:flex; flex-direction:column; flex:1; }
.card__cta{ margin-top:auto; padding-top:.75rem; border-top:1px solid #eee; display:flex; gap:.5rem; flex-wrap:wrap; }

/* Mobile-Preview-Styles sind hier bewusst NICHT enthalten */

/* Zusätzlicher Schutz (Joomla-Template überschreibt oft Links) */
a.btn, .btn.btn--primary, .btn.btn--secondary { color:#fff !important; text-decoration:none !important; }
/* === Layout-Guard: nie breiter als die Joomla-Spalte === */
.finance-page { width: 100%; max-width: 100%; margin: 0; }
.finance-page * { box-sizing: border-box; }
.finance-page h1, .finance-page h2, .finance-page h3, .finance-page p { max-width: 100%; overflow-wrap: anywhere; }

/* Bilder deutlich kleiner, linksbündig, beide gleich groß */
.finance-page .hero-figure .responsive-img,
.finance-page .example .responsive-img {
  max-width: 520px !important;   /* gewünschte Zielgröße */
  width: 100%;
  height: auto;
  margin: 0 !important;          /* linksbündig */
  display: block;
}

/* Karten-Gitter passt sich der Spaltenbreite an (kein Überlauf) */
.finance-page .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* 1–4 Spalten, je nach Platz */
  gap: 1rem;
}

/* Karten-Inhalt füllt die Höhe, CTA bleibt unten – innerhalb der Karte */
.finance-page .card { display: flex; flex-direction: column; overflow: hidden; }
.finance-page .card__content { display: flex; flex-direction: column; flex: 1; padding: 1rem; }
.finance-page .card__cta { margin-top: auto; padding-top: .75rem; border-top: 1px solid #eee; display: flex; gap: .5rem; flex-wrap: wrap; background: #fff; }
.finance-page .card:hover .card__cta { background: transparent; }

/* Sicherheit: Buttons immer mit Weißschrift */
.finance-page .btn--primary,
.finance-page .btn--secondary,
.finance-page a.btn--primary,
.finance-page a.btn--secondary { color:#fff !important; text-decoration:none !important; }
.finance-page .btn--primary *, .finance-page .btn--secondary * { color: inherit !important; }

/* Mobile: Einspaltig, ausreichend Abstand */
@media (max-width: 640px){
  .finance-page .card-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .finance-page .btn { width: 100%; }
}
