/*
 * Theme for beratung-fuer-elektromobilitaet.de
 *
 * Pure CSS on top of t3sbootstrap: no template or content changes,
 * so everything stays editable in the TYPO3 backend.
 * Brand colour is the crimson of the logo; the "red" class set on
 * content elements in the backend renders as the crimson panel.
 */

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fileadmin/templates/OpenSansLatin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Self-hosted on purpose: no request to Google Fonts (GDPR). */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fileadmin/templates/BricolageGrotesque.woff2) format('woff2');
}

:root {
  --brand: #c80043;
  --brand-dark: #a30036;
  --brand-tint: #fdeef3;
  --ink: #1b1d29;
  --slate: #596073;
  --mist: #f2f3f7;
  --line: #dfe2ea;
  --radius: 22px;
  --font-display: 'Bricolage Grotesque', 'Open Sans', Helvetica, Arial, sans-serif;
  --font-text: 'Open Sans', Helvetica, Arial, sans-serif;
}

/* ---------- Base ---------- */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--mist);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#page-wrapper {
  flex: 1 0 auto;
  padding-bottom: 72px;
}

/* t3sbootstrap pins the footer with position:absolute; keep it in the flow */
body #page-footer {
  position: static;
}

h1, h2, h3, h4, .h3 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  color: var(--ink);
}

b, strong {
  font-weight: 700;
}

a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.15s, color 0.15s;
}

a:hover {
  color: var(--brand-dark);
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.container,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
  max-width: 1180px;
}

/* ---------- Header / navigation ---------- */

#main-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 14px 0 !important;
  background-color: #fff !important;
  border-bottom: 1px solid var(--line);
}

#main-navbar > .container {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

#main-navbar .navbar-brand {
  margin: 0;
  flex: 0 0 auto;
}

#main-navbar .navbar-brand img {
  width: auto;
  height: 64px;
  max-width: none;
}

#main-navbar .navbar-collapse {
  flex-grow: 0;
}

.navbar-nav {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 !important;
  width: auto !important;
}

.navbar-nav .nav-item {
  flex: 0 0 auto;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  padding: 9px 16px !important;
  width: auto !important;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.nav-link:hover {
  color: var(--brand);
  background-color: var(--brand-tint);
}

.nav-link.active {
  color: #fff !important;
  background-color: var(--brand);
}

.navbar-toggler {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background-color: #fff;
}

.navbar-toggler:hover {
  background-color: var(--brand-tint);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
}

@media (max-width: 767px) {
  #main-navbar .navbar-brand img {
    height: 52px;
  }

  #main-navbar .navbar-collapse {
    flex-basis: 100%;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 2px;
    padding-top: 12px !important;
    width: 100% !important;
  }

  .navbar-nav .nav-link {
    padding: 12px 16px !important;
    border-radius: 12px;
  }
}

/* Empty jumbotron from the template only adds blank space */
.jumbotron {
  display: none;
}

/* ---------- Layout of content pages ---------- */

#page-content {
  padding-top: 48px;
}

.main-content > div > .row {
  --bs-gutter-x: 2.5rem;
  align-items: flex-start;
}

/* Left column: illustration + claim */
.main-content .row > [class*='col-']:first-child:not(:only-child) .ce-textpic {
  display: flex;
  flex-direction: column;
}

.main-content .row > [class*='col-']:first-child:not(:only-child) .ce-textpic .bodytext {
  order: 2;
  margin-top: 8px;
}

.main-content .row > [class*='col-']:first-child:not(:only-child) .bodytext h3,
.main-content .row > [class*='col-']:first-child:not(:only-child) .bodytext p {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: left !important;
}

.main-content .gallery > div {
  float: none !important;
}

.main-content figure.image {
  margin-left: 0 !important;
}

.main-content .row > [class*='col-']:first-child:not(:only-child) .gallery {
  margin-bottom: 24px;
}

.main-content figure.image img {
  border-radius: 16px;
}

/* The wide column keeps the crimson panel, the identity of the old site */
.red,
.red small {
  background-color: var(--brand);
  color: #fff;
}

.red {
  padding: 44px 48px;
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.7;
  /* long German compounds must not break out of the panel */
  hyphens: auto;
  overflow-wrap: break-word;
}

.red a {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.55);
}

.red a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

/* Many editors wrap whole paragraphs in one link: keep those quiet */
.red p a {
  text-decoration-color: rgba(255, 255, 255, 0.28);
}

.red p a:hover {
  text-decoration-color: #fff;
}

.red header a,
.red h2 a,
.red h3 a {
  text-decoration: none;
}

.red h2,
.red h3,
.red .mainheader {
  color: #fff;
}

.red h2 {
  font-size: clamp(24px, 2.3vw, 31px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 20px;
}

.red header h2 {
  margin-bottom: 8px;
}

.red h2 + p:empty,
.red p:has(> br:only-child) {
  display: none;
}

.red h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 28px 0 10px;
}

/* A leading h3 acts as the panel title */
.red > h3:first-child {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: clamp(24px, 2.3vw, 31px);
  line-height: 1.2;
}

.red p {
  margin: 0 0 14px;
  max-width: 72ch;
}

/* Sub headings in the text are bold paragraphs: give them structure */
.red p > strong:only-child {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.red p:has(> strong:only-child):not(:first-child) {
  /* editors add empty paragraphs between blocks, so keep this small */
  margin-top: 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.red ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.red ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 8px;
  max-width: 72ch;
}

.red ul li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.75em;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background-color: #fff;
}

.red ul li ul li::before {
  opacity: 0.6;
}

.red .page-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.red input,
.red textarea {
  color: var(--ink);
  border-radius: 10px;
}

.red legend {
  border: 0;
  color: #fff;
}

.red .tx-powermail input[type='submit'] {
  background-color: #fff;
  color: var(--brand);
  border-radius: 999px;
  font-weight: 700;
}

/* Text boxes in the editor ("Textblock") */
.red .textblock__inner {
  margin-bottom: 12px;
}

/* ---------- Home: hero ---------- */

#page-2 #page-content {
  padding-top: 32px;
}

#page-2 .main-content {
  position: relative;
}

#page-2 .main-content > div:last-child {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background-color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(27, 29, 41, 0.45);
}

#page-2 .main-content > div:last-child::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(14, 16, 28, 0.82) 0%,
    rgba(14, 16, 28, 0.38) 38%,
    rgba(14, 16, 28, 0) 62%
  );
}

#page-2 .main-content figure {
  max-width: none !important;
  width: 100%;
}

#page-2 .main-content figure img {
  display: block;
  width: 100%;
  height: clamp(440px, 74vh, 720px);
  object-fit: cover;
  object-position: 50% 62%;
  border-radius: 0;
  animation: hero-settle 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

#page-2 .white-headline {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  max-width: none;
  margin: 0;
  padding: 0 clamp(24px, 5vw, 64px) clamp(28px, 5vw, 56px);
  background: transparent;
  pointer-events: none;
}

#page-2 .white-headline h2 {
  width: auto;
  float: none;
  margin: 0;
  padding: 0;
  max-width: 14ch;
  font-size: clamp(38px, 6.4vw, 84px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  text-align: left !important;
  color: #fff;
  background: transparent;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  animation: hero-rise 0.9s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Crimson rule above the headline: the one signature accent */
#page-2 .white-headline h2::before {
  content: '';
  display: block;
  width: 72px;
  height: 6px;
  margin-bottom: 22px;
  border-radius: 6px;
  background-color: var(--brand);
}

@keyframes hero-settle {
  from { transform: scale(1.05); }
  to { transform: scale(1); }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  #page-2 .main-content figure img,
  #page-2 .white-headline h2 {
    animation: none;
  }
}

@media (max-width: 767px) {
  #page-2 #page-content {
    padding-top: 16px;
  }

  #page-2 .main-content figure img {
    height: 420px;
  }
}

/* ---------- Tables, media ---------- */

.table-striped > tbody > tr:nth-of-type(2n + 1) {
  background-color: #f9f9fb;
  color: var(--ink);
}

audio {
  width: 100%;
  border-radius: 999px;
}

/* ---------- Footer ---------- */

#page-footer {
  background-color: #fff;
  border-top: 1px solid var(--line);
  color: var(--slate);
  padding: 18px 0 !important;
}

#page-footer .container > div {
  max-width: none;
}

#page-footer p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--slate);
}

#page-footer a,
#page-footer.navbar-default a {
  color: var(--slate);
  text-decoration: none;
}

#page-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* ---------- Tablet / phone ---------- */

@media (max-width: 991px) {
  .main-content > div > .row {
    --bs-gutter-x: 1.5rem;
  }

  .red {
    padding: 32px 28px;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 16px;
  }

  #page-content {
    padding-top: 28px;
  }

  .main-content > div > .row > [class*='col-'] {
    margin-bottom: 24px;
  }

  .red {
    padding: 28px 22px;
    border-radius: 18px;
  }

  #page-footer p {
    text-align: center !important;
  }
}
