
/* === TM Service – Global Layout Fix === */

/* Hero-Bereich */
.tm-hero, .tm-hero * {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.tm-hero { padding-top: 0 !important; margin-top: 0 !important; }
.tm-badge img { display: inline-block !important; }

/* Karten-Container */
.tm-cards {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 20px !important;
    margin: 22px auto !important;
    width: 100% !important;
    max-width: 1000px !important;
}
.tm-card {
    flex: 0 1 460px !important;
    max-width: 460px !important;
    min-width: 340px !important;
}

/* Kontaktbox */
.tm-kontakt {
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* Footer-Links nebeneinander */
.tm-footer {
    text-align: center !important;
}
.tm-footer a {
    display: inline-block !important;
    margin: 0 12px !important;
    white-space: nowrap !important;
}
.tm-footer .tm-footer-link {
    color: #555 !important;
}

/* Mobile-Ansicht */
@media (max-width: 980px) {
    .tm-card {
        flex: 1 1 100% !important;
        max-width: 640px !important;
        min-width: 280px !important;
    }
    .tm-hero { padding-top: 0 !important; margin-top: 0 !important; }
}

/* =============================================================
   TMS THEME PATCH v2 — Zero top spacing aggressively (scoped)
   Targets: 'sichere-praxis-it', 'test', 'test2'
   ============================================================= */

/* 0) Root/page wrappers: nuke any top gap */
html, body {
  /* don't force globally; overridden below per-page */
}
body[class*="sichere-praxis-it"],
body[class*="test"],
body[class*="test2"]{
  margin-top:0 !important;
  padding-top:0 !important;
  --wp--style--root--padding-top: 0 !important; /* WP block themes var */
}

/* 1) Common wrappers in classic/Avada/Astra/Elementor */
body[class*="sichere-praxis-it"] #page,
body[class*="sichere-praxis-it"] main,
body[class*="sichere-praxis-it"] article,
body[class*="sichere-praxis-it"] #main,
body[class*="sichere-praxis-it"] .site,
body[class*="sichere-praxis-it"] .site-content,
body[class*="sichere-praxis-it"] .content,
body[class*="sichere-praxis-it"] .content-area,
body[class*="sichere-praxis-it"] .entry-header,
body[class*="sichere-praxis-it"] .entry-content,
body[class*="sichere-praxis-it"] #content,
body[class*="sichere-praxis-it"] #primary,
body[class*="sichere-praxis-it"] .primary,
body[class*="sichere-praxis-it"] .container,
body[class*="sichere-praxis-it"] .ast-container,
body[class*="sichere-praxis-it"] .fusion-main-wrapper,
body[class*="sichere-praxis-it"] .elementor-location-content,
body[class*="sichere-praxis-it"] .wp-site-blocks,
/* test pages */
body[class*="test"] #page,
body[class*="test"] main,
body[class*="test"] article,
body[class*="test"] #main,
body[class*="test"] .site,
body[class*="test"] .site-content,
body[class*="test"] .content,
body[class*="test"] .content-area,
body[class*="test"] .entry-header,
body[class*="test"] .entry-content,
body[class*="test"] #content,
body[class*="test"] #primary,
body[class*="test"] .primary,
body[class*="test"] .container,
body[class*="test"] .ast-container,
body[class*="test"] .fusion-main-wrapper,
body[class*="test"] .elementor-location-content,
body[class*="test"] .wp-site-blocks,
body[class*="test2"] #page,
body[class*="test2"] main,
body[class*="test2"] article,
body[class*="test2"] #main,
body[class*="test2"] .site,
body[class*="test2"] .site-content,
body[class*="test2"] .content,
body[class*="test2"] .content-area,
body[class*="test2"] .entry-header,
body[class*="test2"] .entry-content,
body[class*="test2"] #content,
body[class*="test2"] #primary,
body[class*="test2"] .primary,
body[class*="test2"] .container,
body[class*="test2"] .ast-container,
body[class*="test2"] .fusion-main-wrapper,
body[class*="test2"] .elementor-location-content,
body[class*="test2"] .wp-site-blocks {
  margin-top:0 !important;
  padding-top:0 !important;
}

/* 2) Ensure the hero wrapper itself has no top offset on these pages */
body[class*="sichere-praxis-it"] .tm-hero,
body[class*="test"] .tm-hero,
body[class*="test2"] .tm-hero{
  margin-top:0 !important;
  padding-top:0 !important;
}

/* 3) First visible block protection */
body[class*="sichere-praxis-it"] .entry-content > *:first-child,
body[class*="sichere-praxis-it"] .wp-site-blocks > *:first-child,
body[class*="sichere-praxis-it"] main > *:first-child,
/* test pages */
body[class*="test"] .entry-content > *:first-child,
body[class*="test"] .wp-site-blocks > *:first-child,
body[class*="test"] main > *:first-child,
body[class*="test2"] .entry-content > *:first-child,
body[class*="test2"] .wp-site-blocks > *:first-child,
body[class*="test2"] main > *:first-child {
  margin-top:0 !important;
  padding-top:0 !important;
}

/* 4) Guard for headings/groups as first child */
body[class*="sichere-praxis-it"] .entry-content h1:first-child,
body[class*="sichere-praxis-it"] .entry-content .wp-block-group:first-child,
/* test pages */
body[class*="test"] .entry-content h1:first-child,
body[class*="test"] .entry-content .wp-block-group:first-child,
body[class*="test2"] .entry-content h1:first-child,
body[class*="test2"] .entry-content .wp-block-group:first-child {
  margin-top:0 !important;
  padding-top:0 !important;
}
