/*
 Theme Name:   twentytwentyfive Child
 Description:  twentytwentyfive Child Theme
 Author:       Kai von Essen
 Author URI:   kve-it.de
 Template:     twentytwentyfive
 Version:      1.0.0
Text Domain:   twentytwentyfive-child
*/

:root {
    --primary: #1E5631; /* Medizinisches Dunkelgrün */
    --primary-light: #E8F5E9; /* Sehr helles Salbeigrün für Sektionen */
    --secondary: #4C9A2A; /* Frisches Akzent-Grün für Buttons */
    --dark: #23392E; /* Dunkles Tannengrün für Fließtext */
    --light: #F4F7F5; /* Softes Off-White mit Grünstich */
    --white: #FFFFFF;
}

@media screen and (min-width: 768px) {
  .mobil-only {
    display: none !important;
  }
}

@media screen and (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
  .home .dt-input {
    outline-style: solid;
    outline-width: 2px;
  }
}

/* Fixiert den gesamten Header-Bereich von Twenty Twenty-Five am oberen Rand */
header.wp-block-template-part,
header.wp-block-template-part > div {
  position: sticky !important;
  top: var(--wp-admin--admin-bar--height, 0px) !important;
  z-index: 9999 !important;
  background-color: #ffffff !important; /* Verhindert, dass der Header transparent wird */
  width: 100% !important;
}


/* 1. Tabellenstruktur aufbrechen */
.tablepress-id-1,
.tablepress-id-1 tbody,
.tablepress-id-1 tr,
.tablepress-id-1 td {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box;
  border: none !important;
}

/* 2. Den klassischen Tabellenkopf verstecken */
.tablepress-id-1 thead {
  display: none !important;
}
/* 2,5. Den Tabelleninhalt als Grid darstellen, sobald die Suche aktiv ist */
#tablepress-1 tbody {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important;
    grid-gap: 20px !important;
    width: 100% !important;
}

/* 3. Jede Zeile als Karte (Visitenkarte) stylen */
.tablepress-id-1 tbody tr {
  background-color: var(--primary-light) !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
  margin-bottom: 20px !important;
  padding: 0 10px !important;
}

/* 4. Die einzelnen Zellen innerhalb der Karte stylen (Flexbox-Aktivierung) */
.tablepress-id-1 tbody td {
  display: flex !important;       /* Aktiviert das zweispaltige Layout pro Zelle */
  align-items: flex-start;       /* Richtet Text und Label oben bündig aus */
  padding: 10px 0 !important;
  border-bottom: 1px solid var(--primary) !important;
  background: none !important;
}

/* 5. Spaltenbeschriftungen als feste linke Spalte definieren */
.tablepress-id-1 td::before {
  font-weight: bold;
  color: #333;
  /* Diese beiden Zeilen sorgen für die feste Breite und verhindern das Stauchen */
  flex: 0 0 186px;               /* 120px feste Breite für das Label (bei Bedarf anpassen) */
  text-align: right;
  margin-right: 6px;            /* Abstand zwischen Label und Inhalt */
}
/* 6. Suchfenster zentrieren und Absstand nach oebn und unten setzen */
.dt-container .dt-layout-cell.dt-layout-end {
  margin: 20px auto;
}

@media screen and (max-width: 767px) {
    .tablepress-id-1 tbody tr {
        font-size: medium; /* Schriftgröße für mobile Ansicht */
    }
    .tablepress-id-1 td::before {
        flex: 0 0 135px;               /* 120px feste Breite für das Label (bei Bedarf anpassen) */
    }
}
/* Letzte Linie in der Karte entfernen */
.tablepress-id-1 tbody td:last-child {
  border-bottom: none !important;
}

/* 6. Spaltenbeschriftungen automatisiert per CSS hinzufügen */
.tablepress-id-1 td:nth-of-type(1)::before { content: "Name, Vorname: "; font-weight: bold; color: #333; display: inline-block; width: 186px; }
.tablepress-id-1 td:nth-of-type(2)::before { content: "Adresse: "; font-weight: bold; color: #333; display: inline-block; width: 186px; }
.tablepress-id-1 td:nth-of-type(3)::before { content: "Tel. Praxis: "; font-weight: bold; color: #333; display: inline-block; width: 186px; }
.tablepress-id-1 td:nth-of-type(4)::before { content: "Fax: "; font-weight: bold; color: #333; display: inline-block; width: 186px; }
.tablepress-id-1 td:nth-of-type(5)::before { content: "Fachausrichtung: "; font-weight: bold; color: #333; display: inline-block; width: 186px; }

/* Suche zentrieren
div.dt-layout-row:nth-child(1) > div:nth-child(2) {
    margin:auto
}

/* Diese Regeln greifen NUR auf der Startseite (.home) */

/* 1. Versteckt standardmäßig den gesamten Tabellen-Inhalt beim ersten Laden */
.home #tablepress-1 tbody {
    display: none !important;
}

/* 2. Zeigt den Tabellen-Inhalt an, sobald das JavaScript die Klasse "search-active" vergibt */
.home #tablepress-1.search-active tbody {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important;
    grid-gap: 20px !important;
    width: 100% !important;
}

/* 3. Versteckt die standardmäßigen Hinweistexte ("Keine Einträge vorhanden") im leeren Zustand */
.home #tablepress-1 .dataTables_empty,
.home #tablepress-1 .dt-empty {
    display: none !important;
}

/* Zentriert die Suchmaske und das Inputfeld horizontal */
.home .dt-search,
.home .dt-layout-end {
    display: flex !important;
    justify-content: center !important;
    float: none !important;
    text-align: center !important;
    margin: 20px auto !important;
    width: 100% !important;
}
/* Zentriert den Text und Placeholder im Suchfeld selbst */
.home .dt-input {
  font-size: medium;
  min-width: 300px;
  width: 100%;
  border: none;
  background: var(--primary-light);
  text-align: center;
  padding: 40px;
  border-radius: 8px;
}
.home .dt-search > label:nth-child(1) {
    display: none !important; /* Versteckt das Label "Suchen:" */
}
@media screen and (max-width: 767px) {
   /* Den langen Platzhalter-Text im Suchfeld unsichtbar machen */
  .home input.dt-input::placeholder {
    color: transparent !important;
    opacity: 0 !important;
  }

  /* Browser-Kompatibilität (Safari, Firefox, Edge) */
  .home input.dt-input::-webkit-input-placeholder { color: transparent !important; }
  .home input.dt-input::-moz-placeholder { color: transparent !important; }
  .home input.dt-input:-ms-input-placeholder { color: transparent !important; }
}