/* ============================================================
   Rynex Design System - built from farbsystem.md + bausteine
   ============================================================ */

/* --- :root - 10 Farben aus farbsystem.md --- */
:root {
  --lead: #2c3f84;
  --accent: #872a8f;
  --accent-dark: #5f1d64;
  --highlight: #00e8ff;
  --dark-bg: #2d343b;
  --ink: #2d343b;
  --light-bg: #dde3e8;
  --grey: #dde3e8;
  --soft-line: #dde3e8;
  --line: #2d343b;
  --paper: #ffffff;
  --gold: #e2b64f;
  --error: #b71c1c;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", sans-serif;
  font-size: clamp(15px, 14px + 0.25vw, 17px);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Montserrat", sans-serif;
  line-height: 1.2;
  color: var(--lead);
}

h1 { font-size: clamp(1.7rem, 1.05rem + 2.7vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 0.95rem + 1.6vw, 2rem); font-weight: 700; }
h3 { font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.5rem); font-weight: 700; }

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

ul, ol { list-style: none; }

a { text-decoration: none; color: inherit; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 0.6rem + 1.5vw, 2rem);
}

.section {
  padding: clamp(3rem, 2rem + 4vw, 5rem) 0;
}

.section.grey {
  background: var(--grey);
}

/* --- O1 - Buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 260px;
  padding: 0.64rem 1.15rem;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: var(--paper);
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: transparent;
  border-color: var(--lead);
  color: var(--lead);
}

.button.secondary:hover {
  background: var(--lead);
  color: var(--paper);
}

.button.secondary-dark {
  background: transparent;
  border-color: var(--paper);
  color: var(--paper);
}

.button.secondary-dark:hover {
  background: rgba(255,255,255,0.1);
}

/* --- G1 - Navigation --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--dark-bg);
  height: 80px;
}

.site-nav .container {
  display: flex;
  height: 100%;
  gap: 2rem;
  align-items: flex-end;
  padding-bottom: 0;
}

/* Shared bottom alignment for all nav elements */
.site-nav .container > * {
  margin-bottom: 16px;
}

/* Logo and CTA-Button: vertically centered instead of bottom-aligned */
.nav-logo,
.nav-cta {
  margin-bottom: auto;
  margin-top: auto;
}

.nav-logo {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
}

.nav-logo img {
  height: 44px;
  width: auto;
}

.primary-nav {
  display: flex;
  align-items: flex-end;
  gap: 1.8rem;
  flex: 1;
  list-style: none;
}

.primary-nav > li {
  position: relative;
}

.primary-nav > li > a,
.primary-nav > li > span {
  color: var(--light-bg);
  font-size: 0.92rem;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms ease;
}

.primary-nav > li > a:hover,
.primary-nav > li > span:hover,
.primary-nav > li.active > a,
.primary-nav > li.active > span {
  border-bottom-color: var(--light-bg);
}

/* Dropdown panel */
.dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: -1rem;
  background: var(--dark-bg);
  padding: 1.5rem 2rem;
  padding-top: calc(20px + 1.5rem);
  min-width: 280px;
  z-index: 100;
}

.primary-nav > li:hover > .dropdown-panel,
.primary-nav > li.dropdown-open > .dropdown-panel {
  display: block;
}

.dropdown-panel .dropdown-item {
  display: block;
  padding: 0.5rem 0;
  text-decoration: none;
}

.dropdown-panel .dropdown-item strong {
  display: block;
  color: var(--highlight);
  font-weight: 700;
  font-size: 0.95rem;
}

.dropdown-panel .dropdown-item span {
  display: block;
  color: var(--light-bg);
  font-size: 0.85rem;
  font-weight: 400;
  margin-top: 0.15rem;
}

.dropdown-panel .dropdown-item:hover strong {
  text-decoration: underline;
}

/* O4 - Language Toggle */
.lang-toggle {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  margin-left: auto;
}

.lang-toggle a,
.lang-toggle span {
  font-family: "Inter", sans-serif;
  font-size: 10px !important;
  line-height: 1;
  letter-spacing: 0.03em;
  padding-bottom: 4px;
}

.lang-toggle .active-lang {
  color: var(--highlight);
  font-weight: 700;
}

.lang-toggle .inactive-lang {
  color: var(--light-bg);
  font-weight: 400;
  text-decoration: none;
}

.lang-toggle .inactive-lang:hover {
  text-decoration: underline;
}

.lang-toggle .separator {
  color: var(--light-bg);
  font-weight: 400;
}

/* Nav CTA */
.nav-cta {
  flex-shrink: 0;
}

.nav-cta .button {
  min-width: auto;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  min-height: 38px;
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  margin-left: auto;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--light-bg);
  transition: transform 200ms ease, opacity 200ms ease;
}

/* --- G2 - Hero --- */
.hero {
  background: var(--dark-bg);
  overflow: hidden;
}

.hero .container {
  position: relative;
  height: 320px;
}

.hero.hero-home .container {
  height: 540px;
}

.hero-text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 3.5rem 0;
}

.hero-eyebrow {
  color: var(--light-bg);
  font-size: 0.78rem;
  margin-bottom: 1rem;
  max-width: 65%;
}

.hero-divider {
  width: 150px;
  height: 3px;
  min-height: 3px;
  flex-shrink: 0;
  background: var(--accent);
  margin-bottom: 1.5rem;
}

.hero h1 {
  color: var(--highlight);
  margin-bottom: 1rem;
  max-width: 20ch;
  text-wrap: balance;
}

.hero-body {
  color: var(--light-bg);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 60ch;
}

/* Image as background layer, right-aligned, shifted 70px right with soft edge fades */
.hero-image {
  position: absolute;
  top: 0;
  right: 0;
  width: 55%;
  height: 100%;
  transform: translateX(70px);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

/* Hero without image */
.hero.no-image .hero-image {
  display: none;
}

/* --- G3 - Contact Section --- */
.contact-section {
  background: var(--dark-bg);
  padding: 5rem 0;
}

.contact-section .container {
  display: flex;
  gap: 4rem;
}

.contact-info {
  width: 45%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info h2 {
  color: var(--highlight);
  font-size: 3.1rem;
}

.contact-info .contact-body {
  color: var(--light-bg);
  font-size: 1rem;
  line-height: 1.7;
}

.contact-badge img {
  max-width: 160px;
  margin-top: 0.5rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.contact-details a {
  color: var(--light-bg);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.contact-details a:hover {
  text-decoration: underline;
}

.contact-icon {
  height: 1em;
  width: auto;
  flex-shrink: 0;
}

/* Contact form */
.contact-form-wrap {
  width: 55%;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  color: var(--light-bg);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
  background: transparent;
  border: 1px solid var(--light-bg);
  border-radius: 6px;
  color: var(--paper);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  transition: border-color 160ms ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.form-checkbox input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.form-checkbox label {
  color: var(--light-bg);
  font-size: 0.82rem;
  font-weight: 400;
}

.form-checkbox a {
  color: var(--light-bg);
  text-decoration: underline;
}

.form-checkbox a:hover {
  color: var(--accent);
}

.form-submit {
  display: flex;
  justify-content: flex-end;
}

.form-status {
  color: var(--highlight);
  font-size: 0.9rem;
  text-align: right;
  min-height: 1.4rem;
}

.form-status.error {
  color: var(--error);
}

/* Persistent notice above the contact form (form not connected) */
.form-notice {
  background: rgba(0, 232, 255, 0.08);
  border-left: 3px solid var(--highlight);
  color: var(--paper);
  font-size: 0.92rem;
  line-height: 1.55;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 4px;
}

.form-notice a {
  color: var(--highlight);
  font-weight: 700;
  text-decoration: underline;
}

.form-notice a:hover {
  text-decoration: none;
}

/* --- G4 - Footer --- */
.site-footer {
  background: var(--dark-bg);
  height: 80px;
}

.site-footer .container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  padding-bottom: 0;
}

.site-footer .container > * {
  margin-bottom: 16px;
}

.footer-logo img {
  height: 44px;
  width: auto;
}

.footer-legal {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  font-size: 0.82rem;
}

.footer-legal a {
  color: var(--light-bg);
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

.footer-legal span {
  color: var(--light-bg);
}

/* --- C1 - Text-Block --- */

/* C1a: Text left 65%, Image right 35% */
.text-block-c1a .container {
  display: flex;
  align-items: stretch;
  gap: 3rem;
}

.text-block-c1a .text-side {
  width: 65%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.text-block-c1a .image-side {
  width: 35%;
}

.text-block-c1a .image-side img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* C1b: Image left 35%, Text right 65% */
.text-block-c1b .container {
  display: flex;
  align-items: stretch;
  gap: 3rem;
}

.text-block-c1b .image-side {
  width: 35%;
}

.text-block-c1b .image-side img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.text-block-c1b .text-side {
  width: 65%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* C1c: Single column text */

/* Shared text-block styles */
.text-side h2 {
  margin-bottom: 1.2rem;
}

.text-side p {
  text-align: justify;
  margin-bottom: 1rem;
}

.text-side p:last-of-type {
  margin-bottom: 1.5rem;
}

.text-side .button {
  align-self: flex-start;
}

.text-block-c1b .text-side .button {
  align-self: flex-end;
}

.text-block-c1c h2 {
  margin-bottom: 1.2rem;
}

.text-block-c1c p {
  text-align: justify;
  margin-bottom: 1rem;
}

/* --- C2 - Card-Grid --- */
.card-grid .section-header {
  margin-bottom: 2.5rem;
}

.card-grid .section-header h2 {
  margin-bottom: 0.5rem;
}

.card-grid .section-header p {
  color: var(--ink);
  max-width: 720px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.card {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 160ms ease;
}

.card:hover {
  border-color: var(--accent);
}

/* On grey background, card border = white */
.grey .card {
  border-color: var(--paper);
}

.grey .card:hover {
  border-color: var(--accent);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* O3 - Badge */
.badge {
  display: inline-block;
  font-size: 0.585rem;
  font-weight: 700;
  padding: 0.11rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.45rem;
  align-self: flex-start;
}

/* O3a - on cards: magenta text, transparent bg */
.badge-card {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* O3b - everywhere else (C5): dark blue text, transparent bg, dark blue border */
.badge-info {
  background: transparent;
  color: var(--lead);
  border: 1px solid var(--lead);
}

.card-content h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--lead);
}

.card-content p {
  font-size: 0.92rem;
  color: var(--ink);
  text-align: justify;
}

/* --- C8 - Info-Grid (plain, no border, no link) --- */
.card-grid.plain .cards {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid.plain.cols-2 .cards {
  grid-template-columns: repeat(2, 1fr);
}

.card-grid.plain .card {
  border: none;
  background: transparent;
}

.card-grid.plain .card-content h3 {
  text-align: center;
  font-size: 1.5rem;
}

.card-grid.plain .card:hover {
  border-color: transparent;
}

/* --- C9 - Tab-Content --- */
.tab-content-section {
  padding: 4rem 0;
}

.tab-content-section .section-header {
  margin-bottom: 2.5rem;
}

.tab-content-section .section-header h2 {
  margin-bottom: 0.5rem;
}

.tab-content-section .section-header p {
  color: var(--ink);
  max-width: 720px;
}

.tab-content-layout {
  display: flex;
  gap: 2rem;
  min-height: 360px;
}

.tab-content-layout.tabs-right {
  flex-direction: row-reverse;
}

.tab-content-tabs {
  flex: 0 0 25%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.tab-content-tab {
  padding: 1rem 1.25rem;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: "Montserrat", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lead);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: border-color 160ms ease;
}

.tab-content-tab:hover {
  border-color: var(--accent);
}

.tab-content-tab.active {
  border-color: var(--accent);
}

.grey .tab-content-tab {
  border-color: var(--paper);
}

.grey .tab-content-tab:hover,
.grey .tab-content-tab.active {
  border-color: var(--accent);
}

.tab-content-panels {
  flex: 0 0 75%;
  overflow: hidden;
}

.tab-content-panel {
  display: none;
  height: 100%;
  flex-direction: column;
}

.tab-content-panel.active {
  display: flex;
}

.tab-content-panel.active {
  display: block;
}

.tab-content-panel img {
  width: 100%;
  height: 60%;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.tab-content-panel .tab-content-text {
  height: 40%;
  overflow: hidden;
  padding-top: 1.5rem;
}

.tab-content-panel .tab-content-text:only-child {
  height: 100%;
  padding-top: 0;
}

.tab-content-panel h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--lead);
}

.tab-content-panel p {
  color: var(--ink);
  text-align: justify;
}

.tab-content-panel-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.tab-content-panel-link:hover .tab-content-link {
  text-decoration: underline;
}

.tab-content-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 600;
}

/* --- C3 - Testimonials + Kennzahlen --- */
.testimonials-section .section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.testimonials-layout {
  display: flex;
  gap: 3rem;
  align-items: stretch;
}

.testimonials-quotes {
  width: 65%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.testimonial-slide {
  display: none;
}

.testimonial-slide.active {
  display: block;
}

.testimonial-stars {
  color: var(--gold);
  font-size: 1.4rem;
  letter-spacing: 0.15rem;
  margin-bottom: 1rem;
}

.testimonial-text {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  color: var(--ink);
}

.testimonial-author {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.9rem;
}

.testimonial-role {
  font-weight: 400;
  color: var(--ink);
  font-size: 0.9rem;
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soft-line);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 160ms ease;
}

.carousel-dot.active {
  background: var(--accent);
}

.grey .carousel-dot {
  background: var(--paper);
}

.grey .carousel-dot.active {
  background: var(--accent);
}

.testimonials-stats {
  width: 35%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 2px solid var(--gold);
}

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

.stat-number {
  font-family: "Montserrat", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--lead);
  border-left: 3px solid var(--lead);
  padding-left: 1rem;
  line-height: 1.2;
}

.stat-desc {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.5;
  padding-top: 0.3rem;
}

.testimonials-cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* --- C5 - Intro-Block --- */
.intro-block .container {
  display: flex;
  gap: 3rem;
  flex-direction: row;
}

.intro-sidebar {
  width: 33.333%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.intro-sidebar .badge {
  align-self: flex-start;
}

.contributor {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contributor img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.contributor-info {
  font-size: 0.85rem;
}

.contributor-name {
  font-weight: 700;
  color: var(--ink);
}

.contributor-role {
  color: var(--ink);
  font-weight: 400;
}

.intro-date {
  font-size: 0.72rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.intro-divider {
  border: none;
  border-top: 1px solid var(--soft-line);
  margin: 0.25rem 0;
}

.intro-question {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lead);
}

.intro-main {
  width: 66.666%;
}

.intro-main h2 {
  margin-bottom: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intro-teaser {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink);
  text-align: justify;
}

/* --- C4 - Team-Grid --- */
.team-grid {
  display: flex;
  justify-content: space-between;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1 1 240px;
  min-width: 0;
}

.team-card > img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.team-card h3 {
  font-size: 1.2rem;
  color: var(--lead);
  margin-bottom: 0.15rem;
}

.team-card .team-role {
  color: var(--ink);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.team-card a {
  color: var(--lead);
  font-weight: 800;
  text-decoration: none;
}

.team-card a .contact-icon {
  height: 0.8rem;
  width: auto;
}

.team-card a:hover {
  text-decoration: underline;
}

/* --- C6 - Fakten-Reihe --- */
.facts-section .section-title {
  margin-bottom: 2.5rem;
}

.facts-section .section-subtitle {
  margin-top: -1.75rem;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  color: var(--ink);
  max-width: 720px;
}

.facts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.fact-item {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
}

.fact-item + .fact-item {
  border-top: none;
}

/* C6b: with heading */
.fact-item h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--lead);
}

.fact-item p {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.6;
  text-align: justify;
}

/* Stars variant */
.fact-item .fact-stars {
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0.1rem;
  margin-bottom: 0.4rem;
}

/* C6 carousel (>3 facts): sliding window */
.facts-carousel {
  position: relative;
  overflow: hidden;
}

.facts-track {
  display: flex;
  gap: 2rem;
  transition: transform 500ms ease;
}

.facts-track > .fact-item {
  flex: 0 0 auto;
  box-sizing: border-box;
  min-width: 0;
  overflow-wrap: break-word;
}

/* Horizontal dividers between facts on mobile - on desktop, just columns */

/* --- C7 - CTA-Band --- */
.cta-band {
  background: var(--dark-bg);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.cta-band .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.cta-band .cta-eyebrow {
  color: var(--highlight);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.cta-band h2 {
  color: var(--paper);
  margin-bottom: 1.5rem;
}

/* Decorative circles */
.cta-band::before,
.cta-band::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.08);
}

.cta-band::before {
  width: 300px;
  height: 300px;
  top: -80px;
  left: -60px;
}

.cta-band::after {
  width: 220px;
  height: 220px;
  bottom: -60px;
  right: -40px;
}

/* --- Links --- */

/* Inline links (in content) */
.article-body a,
.legal-content a,
.text-side a {
  color: var(--ink);
  text-decoration: underline;
}

.article-body a:hover,
.legal-content a:hover,
.text-side a:hover {
  color: var(--accent);
}

/* --- Legal --- */
.legal-content {
  margin: 0 auto;
}

.legal-content h2 {
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  text-align: left;
  margin-bottom: 1rem;
}

/* --- Article flow (T4 compact section spacing) --- */
.article-flow .section {
  padding: 0;
}

.article-flow .section:first-child {
  padding-top: 5rem;
}

.article-flow .section:last-child {
  padding-bottom: 5rem;
}

/* --- Article body --- */
.article-body {
}

.article-body h4 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--lead);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body h5 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lead);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-body p {
  text-align: justify;
  margin-bottom: 1rem;
}

.article-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-body ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.4rem;
}

.article-body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 50%;
  background: var(--highlight);
}

/* --- Responsive - 3 Breakpoints --- */

/* Breakpoint 1: 1100px */
@media (max-width: 1100px) {
  .hero .container { height: 320px; }
  .hero.hero-home .container { height: 440px; }

  .contact-section .container {
    flex-direction: column;
    gap: 2.5rem;
  }

  .contact-info,
  .contact-form-wrap {
    width: 100%;
  }

  .contact-info h2 {
    font-size: 2.5rem;
  }
}

/* Breakpoint 2: 900px */
@media (max-width: 900px) {
  /* G1: modern hamburger drawer (slides in from right) */
  .menu-toggle {
    display: flex;
    margin-left: auto;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    border-radius: 8px;
    transition: background-color 160ms ease;
    position: relative;
    z-index: 1001;
  }

  .menu-toggle:hover,
  .menu-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.08);
  }

  .menu-toggle span {
    position: absolute;
    left: 50%;
    width: 26px;
    height: 2px;
    background: var(--paper);
    transform: translateX(-50%);
    transition: transform 240ms ease, opacity 200ms ease, top 240ms ease;
  }

  .menu-toggle span:nth-child(1) { top: 14px; }
  .menu-toggle span:nth-child(2) { top: 21px; }
  .menu-toggle span:nth-child(3) { top: 28px; }

  body.nav-open .menu-toggle span:nth-child(1) {
    top: 21px;
    transform: translateX(-50%) rotate(45deg);
  }

  body.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .menu-toggle span:nth-child(3) {
    top: 21px;
    transform: translateX(-50%) rotate(-45deg);
  }

  /* Backdrop behind the open drawer */
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(45, 52, 59, 0.55);
    z-index: 998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body.nav-open {
    overflow: hidden;
  }

  .primary-nav {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(86vw, 360px);
    background: var(--dark-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 6rem 1.75rem 2rem;
    gap: 0.25rem;
    overflow-y: auto;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }

  .primary-nav.is-open {
    transform: translateX(0);
  }

  .primary-nav > li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .primary-nav > li:last-child {
    border-bottom: none;
  }

  .primary-nav > li > a,
  .primary-nav > li > span {
    display: block;
    width: 100%;
    padding: 0.95rem 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-bottom: none;
    color: var(--paper);
  }

  .primary-nav > li.has-dropdown > a::after,
  .primary-nav > li.has-dropdown > span::after {
    content: "+";
    float: right;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--highlight);
    transition: transform 200ms ease;
  }

  .primary-nav > li.has-dropdown.dropdown-open > a::after,
  .primary-nav > li.has-dropdown.dropdown-open > span::after {
    content: "−";
  }

  /* Language toggle stays visible inside the drawer */
  .lang-toggle {
    display: flex;
    width: 100%;
    margin-left: 0;
    padding: 1.25rem 0.25rem 0.5rem;
    gap: 0.5rem;
    align-items: center;
    border-bottom: none;
  }

  .lang-toggle a,
  .lang-toggle span {
    font-size: 0.95rem !important;
    padding-bottom: 0;
  }

  /* Hide the nav bar CTA on mobile - JS moves a copy inside the drawer */
  .site-nav > .container > .nav-cta {
    display: none;
  }

  /* The CTA inside the drawer (moved by JS) */
  .primary-nav .nav-cta {
    display: block;
    width: 100%;
    padding-top: 1.5rem;
    margin-bottom: 0;
    margin-top: auto;
  }

  .primary-nav .nav-cta .button {
    width: 100%;
    padding: 0.75rem 1.1rem;
    font-size: 0.95rem;
    min-height: 48px;
    min-width: auto;
  }

  /* G2: hero - image right, text left, horizontal scrim (matches desktop pattern) */
  .hero:not(.no-image) .container {
    height: auto;
    min-height: 360px;
  }

  .hero:not(.no-image).hero-home .container {
    min-height: 440px;
  }

  .hero.no-image .container {
    height: auto;
  }

  .hero-text {
    padding: 2.5rem 0;
    max-width: 100%;
  }

  .hero:not(.no-image) .hero-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 70%;
    height: 100%;
    transform: none;
    z-index: 0;
  }

  .hero:not(.no-image) .hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 30%, #000 100%);
            mask-image: linear-gradient(to right, transparent 0%, #000 30%, #000 100%);
  }

  /* Horizontal scrim - dark on the left fading to transparent on the right */
  .hero:not(.no-image) .hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to right,
      var(--dark-bg) 0%,
      rgba(45, 52, 59, 0.85) 30%,
      rgba(45, 52, 59, 0.35) 65%,
      rgba(45, 52, 59, 0) 100%
    );
    pointer-events: none;
  }

  /* Hero text stays readable on the dark left side */
  .hero-eyebrow,
  .hero-body {
    max-width: 75%;
  }

  /* Force the title to wrap earlier — character-relative width */
  .hero h1 {
    max-width: 16ch;
  }

  /* Contact form: stack first/last name on tablets too */
  .form-row {
    flex-direction: column;
  }

  /* C9: tabs become an accordion (header + collapsible panel) */
  .tab-content-section .tab-content-layout,
  .tab-content-section .tab-content-layout.tabs-right {
    display: block;
    flex-direction: column;
    max-height: none;
  }

  .tab-content-section .tab-content-tabs,
  .tab-content-section .tab-content-panels {
    display: block;
    overflow: visible;
    flex: none;
    width: 100%;
  }

  .tab-content-section .tab-content-tab {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .tab-content-section .tab-content-tab::after {
    content: "+";
    margin-left: 1rem;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--accent);
    transition: transform 200ms ease;
    flex-shrink: 0;
  }

  .tab-content-section .tab-content-tab.active::after {
    content: "−";
  }

  .tab-content-section .tab-content-panel {
    display: none;
    margin-bottom: 1rem;
    padding: 0.5rem 0 1rem;
  }

  .tab-content-section .tab-content-panel.active {
    display: block;
  }

  .tab-content-section .tab-content-panel img {
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
    margin-bottom: 1rem;
  }

  .tab-content-section .tab-content-panel .tab-content-text {
    height: auto;
    overflow: visible;
    padding-top: 0;
  }

  /* C1: stack */
  .text-block-c1a .container,
  .text-block-c1b .container {
    flex-direction: column;
  }

  .text-block-c1a .text-side,
  .text-block-c1a .image-side,
  .text-block-c1b .text-side,
  .text-block-c1b .image-side {
    width: 100%;
  }

  .text-block-c1b .container {
    flex-direction: column-reverse;
  }

  .text-block-c1b .text-side .button {
    align-self: flex-start;
  }

  /* C3: stack */
  .testimonials-layout {
    flex-direction: column;
  }

  .testimonials-quotes,
  .testimonials-stats {
    width: 100%;
  }

  /* C5: stack */
  .intro-block .container {
    flex-direction: column;
  }

  .intro-sidebar,
  .intro-main {
    width: 100%;
  }

  /* Dropdown: block on mobile */
  .dropdown-panel {
    position: static;
    padding: 0.5rem 0 0.5rem 1rem;
  }

  .primary-nav > li:hover > .dropdown-panel {
    display: none;
  }

  .primary-nav > li.dropdown-open > .dropdown-panel {
    display: block;
  }
}

/* Breakpoint 3: 768px (tablet) */
@media (max-width: 768px) {
  /* C2 / C8 cards: 2 columns instead of 3 */
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  /* C6 facts row (static, non-carousel): 2 columns */
  .facts-row {
    grid-template-columns: repeat(2, 1fr);
  }

  /* C4 team grid: 2 columns */
  .team-card {
    flex: 1 1 calc(50% - 1.25rem);
    max-width: calc(50% - 1.25rem);
  }

  /* Homepage C3 stats: allow wrap so 3-up becomes 2+1 */
  .testimonials-stats {
    flex-wrap: wrap;
  }

  /* Buttons stretch on tablet - relax desktop min-width */
  .button {
    min-width: auto;
    width: 100%;
  }
}

/* Breakpoint 4: 560px (phone) */
@media (max-width: 560px) {
  /* C4 team grid: single column */
  .team-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .team-grid {
    gap: 2rem;
  }

  .hero:not(.no-image) .container { min-height: 320px; }
  .hero:not(.no-image).hero-home .container { min-height: 380px; }

  .hero-text { padding: 2rem 0; }

  /* Tighter text width since the photo on the right is narrower */
  .hero-eyebrow,
  .hero-body {
    max-width: 88%;
  }

  /* Title: even tighter on phones */
  .hero h1 {
    max-width: 14ch;
  }

  /* Lengthen the dark side so titles stay legible */
  .hero:not(.no-image) .hero-image {
    width: 75%;
  }

  .hero:not(.no-image) .hero-image::after {
    background: linear-gradient(
      to right,
      var(--dark-bg) 0%,
      rgba(45, 52, 59, 0.92) 35%,
      rgba(45, 52, 59, 0.5) 70%,
      rgba(45, 52, 59, 0.1) 100%
    );
  }

  /* Cards: single column */
  .cards {
    grid-template-columns: 1fr;
  }

  /* Facts: single column */
  .facts-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .fact-item {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--accent);
  }

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

  .footer-legal {
    gap: 0.8rem;
    font-size: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}
