/*
Theme Name: KFZ-Technik Kestel v4.2 (Clean + Footer fix)
Template: twentytwentyfour
Text Domain: kfztechnik-kestel
Version: 6.2.0
*/

/* --- General --- */
.hide-title .wp-block-post-title { display:none !important; }
:where(.wp-site-blocks) { scroll-behavior: smooth; }

/* --- Hero --- */
.kfz-hero { 
  min-height: 72vh; 
  display:flex; align-items:center; justify-content:center;
  background: #181818; 
  padding: 60px 0;
}
.kfz-card {
  position: relative;
  max-width: 1000px;
  width: min(94vw, 1000px);
  border-radius: 22px;
  padding: clamp(36px, 4.4vw, 56px);
  background: rgba(34,34,34,0.92);
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
  overflow: hidden;
}
.kfz-card::before {
  content:"";
  position:absolute; inset:0;
  background-image: url('./assets/overlay-logo.png');
  background-repeat: no-repeat;
  background-position: center 52%;
  /* ensure full logo is visible without cropping */
  background-size: clamp(320px, 58%, 740px);
  opacity: .22;
  pointer-events: none;
  filter: grayscale(100%);
}
.kfz-card h1, .kfz-card p { color: #fff; position: relative; z-index: 1; text-align:center; }
.kfz-card h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 12px; }
.kfz-card p { font-size: clamp(15px, 2vw, 18px); margin-bottom: 22px; }
.wp-block-button__link {
  border-radius: 12px; padding: 14px 28px; font-weight: 700; letter-spacing:.2px;
}
.wp-block-button__link:hover { filter: brightness(1.06); transform: translateY(-2px); transition: .18s ease; }

/* --- Services --- */
.kfz-services {
  background: #ececec;
  padding: 60px 0 40px;
}
.kfz-services h2 {
  text-align: center;
  margin-bottom: 32px;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: .3px;
}
.kfz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  align-items: stretch;
}
.kfz-grid > .kfz-card-sm { height: 100%; }

.kfz-card-sm {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0,0,0,.08);
  padding: 26px 24px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height: 230px; /* unify heights across rows */
  transition: transform .18s ease, box-shadow .18s ease;
}
.kfz-card-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(0,0,0,.14);
}
.kfz-card-sm h3 { font-size: 20px; line-height:1.25; margin:0 0 10px; }
.kfz-card-sm p { color:#3f3f3f; margin:0; font-size:15px; }

/* --- Footer --- */
.kfz-footer { background:#111; color:#fff; padding:48px 0; }
.kfz-footer a { color:#fff; text-decoration: underline; }
.kfz-footer .wp-block-columns { gap: 24px; }
.kfz-footer p { margin: 0 0 8px; font-size: 15px; }


/* v4.3 equal-height enforcement */
.kfz-grid { align-items: stretch; }
.kfz-grid > .kfz-card-sm { height: 100%; }
.kfz-card-sm { display:flex; flex-direction:column; }
.kfz-card-sm > *:last-child { margin-top: auto; } /* push last element down for balance */


/* v4.3.1 Equal Height Fix */
@media (min-width: 1200px){
  .kfz-grid { align-items: stretch; }
  .kfz-card-sm{
    height: 260px !important;
    display:flex; flex-direction:column; justify-content:space-between;
  }
}
@media (min-width: 900px) and (max-width: 1199px){
  .kfz-card-sm{
    height: 300px !important;
    display:flex; flex-direction:column; justify-content:space-between;
  }
}
@media (max-width: 899px){
  .kfz-card-sm{ height:auto !important; }
}
.kfz-card-sm h3{ margin:0 0 10px; line-height:1.25; }
.kfz-card-sm p{ margin:0; }


/* ========================
   v5 FINAL – Cards equal height (bulletproof)
   ======================== */
.kfz-services{ background:#ececec; padding: 64px 0 44px; }
.kfz-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap:28px;
  align-items: stretch; /* stretch grid items */
}
/* ensure every immediate child stretches and its inner card fills */
.kfz-grid > * { height:100%; }
.kfz-grid > * > .kfz-card-sm { height:100%; }

.kfz-card-sm{
  background:#fff;
  border-radius:16px;
  box-shadow:0 16px 36px rgba(0,0,0,.08);
  padding:26px 24px;
  display:flex; flex-direction:column;
}
.kfz-card-sm h3{ margin:0 0 10px; font-size:20px; line-height:1.25; }
.kfz-card-sm p{ margin-top:auto; color:#3f3f3f; font-size:15px; } /* push text to bottom for alignment */

/* Desktop fixed min height for perfect alignment */
@media (min-width: 1200px){
  .kfz-card-sm{ min-height: 260px; }
}
@media (min-width: 900px) and (max-width: 1199px){
  .kfz-card-sm{ min-height: 300px; }
}

/* Hero watermark fully visible */
.kfz-card::before{
  background-position: center 52% !important;
  background-size: clamp(360px, 58%, 760px) !important;
  opacity:.22 !important;
}

/* Footer centered copyright line */
.kfz-footer .has-text-align-center{ margin-top: 14px; opacity:.95; }

/* v5.1: prepare cards for JS equalizer */
.kfz-grid > * { height:auto; } 
.kfz-card-sm{ overflow:hidden; }


/* ===== v5.2 FINAL: rock-solid equal heights ===== */
@media (min-width: 1200px){
  .kfz-grid { align-items: stretch; }
  .kfz-card-sm{
    height: 300px !important;
    display:flex !important;
    flex-direction:column !important;
    justify-content:space-between !important;
  }
}
@media (min-width: 900px) and (max-width: 1199px){
  .kfz-card-sm{
    height: 330px !important;
    display:flex !important;
    flex-direction:column !important;
    justify-content:space-between !important;
  }
}
@media (max-width: 899px){
  .kfz-card-sm{ height: auto !important; }
}
/* Tidy spacing */
.kfz-card-sm h3{ margin:0 0 10px; line-height:1.25; }
.kfz-card-sm p{ margin:0; }

/* v6 FINAL: image-based service cards with overlay text */
.kfz-svc-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(0,0,0,.16);
  height: 300px; /* desktop default */
  background-size: cover;
  background-position: center;
}
@media (max-width: 1199px){ .kfz-svc-card{ height: 330px; } }
@media (max-width: 899px){ .kfz-svc-card{ height: 240px; } }

.kfz-svc-card .kfz-svc-overlay{
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 75%);
  display:flex; align-items:flex-end; padding:22px;
}
.kfz-svc-title{
  color:#fff; margin:0; font-size:22px; line-height:1.2;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.kfz-svc-sub{ color:#eaeaea; margin:6px 0 0; font-size:14px; }
.kfz-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap:26px; }
/* tidy section heading */
.kfz-services h2{ text-align:center; margin-bottom:28px; }

/* v6.1: unified card heights */
.kfz-svc-card{ height: 320px; }
@media (max-width: 1199px){ .kfz-svc-card{ height: 320px; } }
@media (max-width: 899px){ .kfz-svc-card{ height: 240px; } }


/* ===== v6.2 FINAL-LOCKED: force equal heights on all service cards ===== */
.kfz-grid{ align-items: stretch !important; gap: 26px; }
.kfz-grid > *{ height: 100% !important; }

/* Image cards */
.kfz-svc-card{
  height: 320px !important;
  display: block !important;
  position: relative !important;
  border-radius: 18px;
  overflow: hidden;
}
@media (max-width: 899px){ .kfz-svc-card{ height: 240px !important; } }

/* Legacy white cards (falls noch aktiv) */
.kfz-card-sm{
  height: 320px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}
@media (max-width: 899px){ .kfz-card-sm{ height: auto !important; } }
