/*
Theme Name: Kachel Child
Theme URI: https://bausteine-medienbildung.de/
Description: Child-Theme fuer bausteine-medienbildung.de. Erweitert das Kachel-Theme ohne Aenderungen am Parent-Theme.
Author: Blickwechsel e.V.
Template: kachel
Version: 1.0.0
Text Domain: kachel-child
*/

/* ============================================================
   Footer-Erweiterung
   ============================================================ */
.site-footer .kachel-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  flex-wrap: wrap;
}

.kachel-footer-brand {
  order: 2;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  width: auto;
  padding-top: 0;
  border: 0;
  border-top: none;
  box-shadow: none;
  text-decoration: none;
}

.kachel-footer-logo {
  display: block;
  width: clamp(132px, 12vw, 156px);
  height: auto;
  margin: 0;
}

.kachel-footer-meta {
  order: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px 28px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.site-footer .kachel-footer-copyright {
  white-space: nowrap;
}

/* ============================================================
   Seiten-Animationen auf Unterseiten
   ============================================================ */
@keyframes kachel-heading-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes kachel-page-element-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

body:not(.home):not(.front-page) .kachel-back-nav {
  animation: kachel-page-element-enter 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) 0.02s backwards;
}

body:not(.home):not(.front-page) .seiten-kopf {
  animation: kachel-heading-enter 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s both;
  will-change: opacity, transform;
}

body:not(.home):not(.front-page) .eintrag-inhalt > *,
body:not(.home):not(.front-page) .kachel-content-empty,
body:not(.home):not(.front-page) .kachel-content-grid > .kachel-content-card {
  animation: kachel-page-element-enter 0.52s cubic-bezier(0.2, 0.8, 0.2, 1) var(--kachel-element-delay, 0.18s) backwards;
}

body:not(.home):not(.front-page) .eintrag-inhalt > *:nth-child(2) {
  --kachel-element-delay: 0.23s;
}

body:not(.home):not(.front-page) .eintrag-inhalt > *:nth-child(3) {
  --kachel-element-delay: 0.28s;
}

body:not(.home):not(.front-page) .eintrag-inhalt > *:nth-child(4) {
  --kachel-element-delay: 0.33s;
}

body:not(.home):not(.front-page) .eintrag-inhalt > *:nth-child(n+5) {
  --kachel-element-delay: 0.38s;
}

body:not(.home):not(.front-page) .kachel-content-grid > .kachel-content-card:nth-child(1) {
  --kachel-element-delay: 0.22s;
}

body:not(.home):not(.front-page) .kachel-content-grid > .kachel-content-card:nth-child(2) {
  --kachel-element-delay: 0.27s;
}

body:not(.home):not(.front-page) .kachel-content-grid > .kachel-content-card:nth-child(3) {
  --kachel-element-delay: 0.32s;
}

body:not(.home):not(.front-page) .kachel-content-grid > .kachel-content-card:nth-child(4) {
  --kachel-element-delay: 0.37s;
}

body:not(.home):not(.front-page) .kachel-content-grid > .kachel-content-card:nth-child(n+5) {
  --kachel-element-delay: 0.42s;
}

/* ============================================================
   Zurueck-Navigation auf Unterseiten
   ============================================================ */
.kachel-back-nav {
  padding: clamp(28px, 4vw, 44px) 44px 0;
}

body:not(.home):not(.front-page) .kachel-back-nav + .seiten-kopf {
  padding-top: clamp(20px, 3vw, 30px);
}

.kachel-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--kachel-content-akzent, var(--kachel-orange));
  font-family: var(--schrift-display);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease;
}

.kachel-back-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.12rem;
  line-height: 1;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.kachel-back-link:hover,
.kachel-back-link:focus-visible {
  color: var(--kachel-content-akzent, var(--kachel-orange-alt));
  transform: translateX(-3px);
}

.kachel-back-link:hover .kachel-back-link-icon,
.kachel-back-link:focus-visible .kachel-back-link-icon {
  background: rgba(var(--kachel-content-akzent-rgb, 247, 148, 29), 0.13);
}

.kachel-back-link:focus-visible {
  outline: 3px solid rgba(var(--kachel-content-akzent-rgb, 247, 148, 29), 0.28);
  outline-offset: 5px;
  border-radius: 999px;
}

@media (max-width: 1024px) {
  .kachel-back-nav {
    padding: clamp(22px, 4vw, 34px) 28px 0;
  }
}

@media (max-width: 640px) {
  .site-footer .kachel-footer-inner,
  .kachel-footer-meta {
    align-items: center;
  }

  .kachel-footer-meta {
    justify-content: flex-start;
    flex-direction: row;
  }

  .kachel-footer-brand {
    margin-left: auto;
  }

  .kachel-footer-logo {
    width: min(140px, 46vw);
  }

  .site-footer .kachel-footer-copyright {
    white-space: normal;
  }

  .kachel-back-nav {
    padding: 20px 18px 0;
  }

  body:not(.home):not(.front-page) .kachel-back-nav + .seiten-kopf {
    padding-top: 20px;
  }

  .kachel-back-link-icon {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.home):not(.front-page) .kachel-back-nav,
  body:not(.home):not(.front-page) .seiten-kopf,
  body:not(.home):not(.front-page) .eintrag-inhalt > *,
  body:not(.home):not(.front-page) .kachel-content-empty,
  body:not(.home):not(.front-page) .kachel-content-grid > .kachel-content-card {
    animation: none;
    will-change: auto;
  }

  .kachel-back-link,
  .kachel-back-link-icon {
    transition: none;
  }

  .kachel-back-link:hover,
  .kachel-back-link:focus-visible {
    transform: none;
  }
}
