/* ===================================================
   Family Care Lemke UG – Shared Styles
   =================================================== */

/* More Sugar – lokal */
@font-face {
  font-family: 'More Sugar';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/more-sugar.woff') format('woff');
}

/* Lato – lokal */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lato-regular.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;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lato-regular-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lato-bold.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;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lato-bold-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

:root {
  --pink:        #F553A0;
  --green:       #6DB89A;
  --yellow:      #F5B730;
  --indigo:      #5267D4;
  --bg:          #F7F6F2;
  --text:        #2D2D2D;
  --circle-text: #F8F5EA;
  --orbit-r:     330px;
  --circle-size: 320px;
  --logo-size:   276px;
  --container:   980px;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  overflow-x: hidden;
}

/* ===================================================
   HERO
   =================================================== */

#hero {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 7rem 2rem 2rem;
  text-align: center;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#hero.fade-out {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

.hero-content > * {
  opacity: 0;
  transform: translateY(28px);
  animation: heroFadeUp 0.7s ease forwards;
}

.hero-title {
  font-family: 'More Sugar', cursive;
  font-size: clamp(3.2rem, 10vw, 6.5rem);
  font-weight: 400;
  color: var(--pink);
  animation-delay: 0.15s;
  line-height: 1.05;
}

.hero-subtitle {
  font-family: 'More Sugar', cursive;
  font-size: clamp(1.3rem, 3.5vw, 2.1rem);
  font-weight: 400;
  color: var(--green);
  animation-delay: 0.55s;
  margin-top: 0.6rem;
}

.hero-body {
  font-family: 'Lato', sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: var(--text);
  animation-delay: 0.95s;
  margin-top: 1.6rem;
  line-height: 1.6;
}

.hero-tagline {
  font-family: 'Lato', sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 800;
  color: var(--text);
  animation-delay: 1.3s;
}

@keyframes heroFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   SERVICES SECTION
   =================================================== */

#services {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 5rem;
}

#services.visible {
  display: flex;
}

/* Scaler wrapper keeps container centered and responsive */
.services-scaler {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.services-container {
  position: relative;
  width: var(--container);
  height: var(--container);
  flex-shrink: 0;
}

/* SVG dashed connecting lines */
.orbit-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.orbit-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 14 10;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.orbit-line.visible {
  opacity: 1;
}

/* Logo center */
.logo-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: var(--logo-size);
  height: var(--logo-size);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  scale: 0;
  transition: opacity 0.5s ease, scale 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  mix-blend-mode: multiply;
}

.logo-center.animate-in {
  opacity: 1;
  scale: 1;
}

.logo-center img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===================================================
   CIRCLE WRAPPERS (radial positioning)
   =================================================== */

.circle-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--circle-size);
  height: var(--circle-size);
  /* Radial placement: rotate → move up by orbit-r → counter-rotate */
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translateY(calc(-1 * var(--orbit-r)))
    rotate(calc(-1 * var(--angle)));
  z-index: 5;
  transform-style: preserve-3d;
}

/* Float animation layer */
.circle-float {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: floatOrbit var(--float-dur, 5s) ease-in-out infinite var(--float-delay, 0s);
}

.circle-float:hover {
  animation-play-state: paused;
}

/* Keep paused & flipped state for touch devices */
.circle-float.flipped {
  animation-play-state: paused;
}

@keyframes floatOrbit {
  0%,  100% { transform: translate(  0px,   0px); }
  20%        { transform: translate(  5px,  -8px); }
  40%        { transform: translate( -4px,  -5px); }
  60%        { transform: translate(  5px,   7px); }
  80%        { transform: translate( -5px,   3px); }
}

/* Flip card */
.circle-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.5s ease,
              scale     0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  opacity: 0;
  scale: 0;
}

.circle-card.animate-in {
  opacity: 1;
  scale: 1;
}

/* Hover-Flip nur auf echten Pointer-Geräten (nicht auf Touch-Mobile) */
@media (hover: hover) {
  .circle-float:hover .circle-card {
    transform: rotateY(180deg);
  }
}

/* Flip via JS-Klasse funktioniert auf allen Geräten */
.circle-float.flipped .circle-card {
  transform: rotateY(180deg);
}

/* Card faces */
.card-front,
.card-back {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.4rem;
  text-align: center;
  color: var(--circle-text);
}

.card-front {
  font-family: 'More Sugar', cursive;
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1.15;
  padding: 1.5rem;
}

.card-back {
  transform: rotateY(180deg);
  font-family: 'Lato', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.55;
  padding-top: 2.4rem;
}

.card-back p { margin-bottom: 0; }

.card-back a {
  color: inherit;
  text-decoration: underline;
}

.card-back .cta-btn {
  text-decoration: none;
}

.wer-wir-sind .card-back {
  padding-top: calc(2.4rem - 5px);
}

.pink .card-back {
  justify-content: flex-start;
  padding-top: calc(7rem - 50px);
  padding-left: calc(1.4rem + 20px);
  padding-right: calc(1.4rem + 20px);
}

.cta-btn {
  display: inline-block;
  margin-top: 9px;
  padding: 5px 13px;
  border: 2px solid var(--circle-text);
  border-radius: 20px;
  color: var(--circle-text);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'More Sugar', cursive;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.cta-btn:hover {
  background: var(--circle-text);
  color: var(--text);
}

/* Color variants */
.pink  .card-front, .pink  .card-back  { background: var(--pink); }
.green .card-front, .green .card-back  { background: var(--green); }
.yellow .card-front, .yellow .card-back { background: var(--yellow); }

/* ===================================================
   FOOTER
   =================================================== */

footer {
  background: #ffffff;
  border-top: 1px solid #e8e6e1;
  padding: 3rem 2rem 2rem;
  margin-top: 2rem;
}

/* Footer slide-in animation (only on main landing page) */
#main-page footer {
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#main-page footer.footer-visible {
  opacity: 1;
  transform: translateY(0);
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.footer-contact h3 {
  font-family: 'More Sugar', cursive;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--pink);
  margin-bottom: 1.2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
  color: var(--indigo);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.contact-item a {
  color: var(--indigo);
  text-decoration: none;
}

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

.contact-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--indigo);
}

.footer-logo {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.footer-logo img {
  max-width: 200px;
  height: auto;
  mix-blend-mode: multiply;
}

.footer-bottom {
  max-width: 900px;
  margin: 2rem auto 0;
  border-top: 1px solid #e8e6e1;
  padding-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #888;
}

.footer-bottom a {
  color: var(--indigo);
  text-decoration: none;
  font-weight: 600;
}

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

/* ===================================================
   SUBPAGE: shared nav bar
   =================================================== */

.sub-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid #e8e6e1;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sub-nav img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.sub-nav a.back-link {
  font-family: 'More Sugar', cursive;
  font-size: 1rem;
  font-weight: 400;
  color: var(--indigo);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.sub-nav a.back-link:hover { color: var(--pink); }

.sub-nav a.back-link::before {
  content: '←';
  font-size: 1.1rem;
}

/* ===================================================
   SUBPAGE: job posting content
   =================================================== */

.job-page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.job-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.job-header-row h1 {
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

.job-header-logo img {
  height: 105px;
  width: auto;
}

.job-divider {
  border: none;
  border-top: 2px solid #ccc;
  margin: 0.8rem 0 1.8rem;
}

.job-title {
  font-family: 'Lato', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.3rem;
}

.job-subtitle {
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2rem;
}

.job-section {
  margin-bottom: 1.6rem;
}

.job-section h2 {
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.job-section p,
.job-section li {
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.7;
}

.job-section ul {
  list-style: disc;
  padding-left: 1.6rem;
}

.job-section ul li { margin-bottom: 0.25rem; }

.job-section a {
  color: var(--indigo);
  text-decoration: none;
}

.job-section a:hover { text-decoration: underline; }

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

.job-contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--indigo);
}

.job-address {
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.6;
  margin-top: 2rem;
}

.beratung-hinweis {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-top: 2rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid #ddd;
}

.job-download {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #ddd;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--indigo);
  color: #fff;
  text-decoration: none;
  font-family: 'More Sugar', cursive;
  font-size: 1.1rem;
  font-weight: 400;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-download:hover {
  background: var(--pink);
  transform: translateY(-2px);
}

/* ===================================================
   SUBPAGE: placeholder pages
   =================================================== */

.placeholder-page {
  max-width: 700px;
  margin: 4rem auto;
  padding: 2rem;
  text-align: center;
}

.placeholder-page h1 {
  font-family: 'More Sugar', cursive;
  font-size: 2rem;
  color: var(--green);
  margin-bottom: 1rem;
}

.placeholder-page p {
  font-size: 1rem;
  color: #888;
  line-height: 1.7;
}

.legal-page {
  max-width: 700px;
  margin: 4rem auto;
  padding: 2rem;
}

.legal-page h1 {
  font-family: 'More Sugar', cursive;
  font-size: 2rem;
  color: var(--green);
  margin-bottom: 2rem;
}

.legal-page section {
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-page p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.8;
}

.legal-page a {
  color: var(--green);
  text-decoration: none;
}

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

.legal-page h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark);
  margin-top: 1.2rem;
  margin-bottom: 0.3rem;
}

.legal-page ul {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.8;
  padding-left: 1.4rem;
  margin-bottom: 0.8rem;
}

.legal-page section + section {
  border-top: 1px solid #e8e8e8;
  padding-top: 1.5rem;
}

/* ===================================================
   RESPONSIVE
   =================================================== */

/* Scale down radial layout on smaller viewports */
@media (max-width: 1040px) {
  .services-container {
    transform: scale(0.82);
    margin: -88px auto;
  }
}

@media (max-width: 760px) {
  .services-container {
    transform: scale(0.60);
    margin: -196px auto;
  }
}

@media (max-width: 500px) {
  .services-container {
    transform: scale(0.42);
    margin: -284px auto;
  }
}

/* Mobile: Orbit → Karten-Grid */
@media (max-width: 600px) {
  /* Gleicher Abstand oben wie zwischen Logo und Karten (~21px) */
  #services {
    padding-top: 0;
  }

  .services-scaler {
    height: auto;
    overflow: visible;
    padding: 1.3rem 1rem 2rem;
    align-items: flex-start;
  }

  /* Rückseite soll keine Pointer-Events abfangen solange Karte nicht gedreht ist */
  .card-back {
    pointer-events: none;
  }
  .circle-float.flipped .card-back {
    pointer-events: auto;
  }

  /* Orbit-Scaling komplett deaktivieren */
  .services-container {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    margin: 0 !important;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
  }

  .orbit-svg { display: none; }

  /* Logo im Grid-Flow zentriert */
  .logo-center {
    position: static;
    transform: none;
    width: 200px;
    height: 200px;
    grid-column: 1 / -1;
    margin: 0 auto 0.5rem;
    opacity: 1 !important;
    scale: 1 !important;
    background: transparent;
    mix-blend-mode: multiply;
  }

  /* Kreise als normale Block-Elemente */
  .circle-wrapper {
    position: static !important;
    transform: none !important;
    width: 100%;
    height: 300px;
  }

  /* Reihenfolge im Grid: bunt gemischt */
  /* nth-child zählt alle Kinder von .services-container:
     1=svg, 2=logo-center, 3=Beratung(pink), 4=Ambulante(yellow),
     5=WerWirSind(green), 6=Startup(pink), 7=Begleiteter(yellow), 8=Erinnerung(green) */
  .services-container > .circle-wrapper:nth-child(3) { order: 1; } /* pink   Beratung  → Pos 1 oben links  */
  .services-container > .circle-wrapper:nth-child(5) { order: 2; } /* green  WerWirSind → Pos 2 oben rechts */
  .services-container > .circle-wrapper:nth-child(8) { order: 3; } /* green  Erinnerung → Pos 3 Mitte links  */
  .services-container > .circle-wrapper:nth-child(4) { order: 4; } /* yellow Ambulante  → Pos 4 Mitte rechts */
  .services-container > .circle-wrapper:nth-child(7) { order: 5; } /* yellow Begleiteter→ Pos 5 unten links  */
  .services-container > .circle-wrapper:nth-child(6) { order: 6; } /* pink   Startup    → Pos 6 unten rechts */

  .circle-float {
    width: 100%;
    height: 100%;
    animation: none;
    transform: none !important;
  }

  .circle-card {
    width: 100%;
    height: 100%;
    border-radius: 20px;
  }

  .card-front,
  .card-back {
    border-radius: 20px;
  }

  .card-front span {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  .card-back {
    padding: 0.9rem;
    font-size: 0.75rem;
    line-height: 1.4;
    justify-content: center;
  }

  .card-back p {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  /* Pink: Text mittig wie alle anderen Karten, Button absolut am unteren Rand */
  .pink .card-back {
    padding: 1rem;
    justify-content: center;
  }

  /* Button aus Flex-Flow herausnehmen, absolut am unteren Rand */
  .pink .card-back .cta-btn {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.88rem;
    line-height: 1;
    text-align: center;
    letter-spacing: 0.01em;
  }

  /* Hover-Effekt identisch zum Desktop */
  .pink .card-back .cta-btn:hover {
    background: var(--circle-text);
    color: var(--text);
  }

  .cta-btn {
    font-size: 0.8rem;
    padding: 4px 10px;
    margin-top: 6px;
  }
}

/* Footer */
@media (max-width: 600px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer-logo {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
  }
}

/* Job posting page */
@media (max-width: 600px) {
  .job-header-row {
    flex-direction: column-reverse;
  }

  .job-header-logo img { height: 75px; }

  .job-page-wrap { padding: 1.5rem 1.2rem 3rem; }
}
