/**
 * Custom CSS für Schützenverein Sulzkirchen
 * 
 * Verwendung:
 * - Füge "header-custom" als zusätzliche CSS-Klasse zum Header-Text hinzu
 * - Füge "footer-custom" als zusätzliche CSS-Klasse zum Footer-Text hinzu
 * - Füge "gradient-link" zum Sport-Menüpunkt hinzu (oder wird automatisch erkannt)
 */

/* Sticky Header - bleibt immer oben */
header,
.wp-block-template-part[class*="header"],
body > header,
.site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Footer - Schatten nach oben (nur auf Unterseiten) */
body:not(.home) footer,
body:not(.home) .wp-block-template-part[class*="footer"],
body:not(.home) > footer,
body:not(.home) .site-footer {
    background: white !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Alle Links: Gradient bei Hover statt Unterstreichung */
a {
    text-decoration: none !important;
    transition: all 0.3s ease-in-out;
    position: relative;
}

a:hover {
    background: linear-gradient(90deg, #0D98BA 0%, #0000FF 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Startseite: Titel ausblenden und Abstand reduzieren */
body.home .wp-block-post-title {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Startseite: Nur Spacer direkt vor/nach dem Post-Title ausblenden */
body.home .wp-block-post-title + .wp-block-spacer,
body.home .wp-block-spacer:has(+ .wp-block-post-title),
body.home .wp-block-group:has(> .wp-block-post-title) > .wp-block-spacer:first-child,
body.home .wp-block-group:has(> .wp-block-post-title) > .wp-block-spacer:last-child {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Startseite: Abstand nach dem Titel reduzieren */
body.home .wp-block-post-content,
body.home article,
body.home main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.home .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Gradient-Link für "Sport" Menüpunkt */
/* Zielt direkt auf den Link mit href="/sport/" */
a.wp-block-navigation-item__content[href*="/sport/"],
a.wp-block-navigation-item__content[href*="/sport/"] .wp-block-navigation-item__label,
.gradient-link a.wp-block-navigation-item__content,
.gradient-link > .wp-block-navigation-item__content {
    background: linear-gradient(90deg, #0D98BA 0%, #0000FF 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Blog-Posts im Twenty Twenty-Two Stil - NUR für /neuigkeiten mit CSS-Klasse "news-layout" */
/* Verwendung: Füge "news-layout" als zusätzliche CSS-Klasse zum Latest Posts Block hinzu */
/* WICHTIG: Im Block-Editor "Spalten pro Zeile" auf 2 oder 3 setzen! */

/* Grid-Layout beibehalten aber verbessern */
.news-layout.wp-block-latest-posts.is-grid {
    gap: 2rem !important;
    list-style: none !important;
}

/* Einzelner Listeneintrag - flaches Design ohne Card-Effekt */
.news-layout.wp-block-latest-posts > li {
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    list-style: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Beitragsbild (Featured Image) - oben ohne Radius */
.news-layout .wp-block-latest-posts__featured-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    order: -1 !important;
}

.news-layout .wp-block-latest-posts__featured-image a {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

.news-layout .wp-block-latest-posts__featured-image img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 200px !important;
    object-fit: cover !important;
    aspect-ratio: 4/3 !important;
    border-radius: 8px !important;
    margin: 0 !important;
}

/* Content-Bereich - kein extra Padding */
.news-layout.wp-block-latest-posts > li > *:not(.wp-block-latest-posts__featured-image) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.news-layout.wp-block-latest-posts > li > :last-child {
    padding-bottom: 0 !important;
}

/* Beitragstitel */
.news-layout .wp-block-latest-posts__post-title {
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
    color: #000 !important;
}

.news-layout .wp-block-latest-posts__post-title:hover {
    color: #0D98BA !important;
}

/* Beitrags-Autor */
.news-layout .wp-block-latest-posts__post-author {
    font-size: 0.875rem !important;
    color: #666 !important;
    margin-bottom: 0.25rem !important;
}

/* Beitrags-Datum */
.news-layout .wp-block-latest-posts__post-date {
    font-size: 0.875rem !important;
    color: #666 !important;
    margin-bottom: 1rem !important;
}

/* Beitrags-Excerpt/Vorschau */
.news-layout .wp-block-latest-posts__post-excerpt {
    margin-bottom: 1rem !important;
    color: #333 !important;
    line-height: 1.6 !important;
    font-size: 0.95rem !important;
}

/* Weiterlesen-Link */
.news-layout .wp-block-latest-posts__read-more {
    display: inline-block !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    color: #0D98BA !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

.news-layout .wp-block-latest-posts__read-more:hover {
    background: linear-gradient(90deg, #0D98BA 0%, #0000FF 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Responsive: Auf Tablets 2 Spalten, auf Mobil 1 Spalte */
@media (max-width: 768px) {
    .news-layout.wp-block-latest-posts.is-grid.columns-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .news-layout.wp-block-latest-posts.is-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Beitrags-Archiv: "Kalenderjahr" vor der Jahreszahl */
.wp-block-archives-list li a::before,
.wp-block-archives li a::before {
    content: "Kalenderjahr " !important;
}

/* WPForms Input-Felder: Schwarzgraue Border wenn nicht fokussiert */
.wpforms-field input:not(:focus),
.wpforms-field textarea:not(:focus),
input[id*="wpforms"]:not(:focus),
textarea[id*="wpforms"]:not(:focus) {
    border-color: rgba(0, 0, 0, 0.25) !important;
}

/* Königs-Tabelle - ohne sichtbare Umrandungen */
.koenige-tabelle {
  width: 100%;
  max-width: 800px;
  border-collapse: collapse;
  border: none;
}

.koenige-tabelle thead {
  border-bottom: 2px solid #0D98BA;
}

.koenige-tabelle th {
  text-align: left;
  padding: 12px 16px;
  font-weight: bold;
  border: none;
}

.koenige-tabelle td {
  padding: 8px 16px;
  border: none;
  line-height: 1.8;
}

.koenige-tabelle tbody tr {
  transition: all 0.3s ease-in-out;
  border: none;
}

.koenige-tabelle tbody tr:hover {
  background: linear-gradient(90deg, rgba(13, 152, 186, 0.1) 0%, rgba(0, 0, 255, 0.1) 100%);
  cursor: default;
}

/* Spaltenbreiten */
.koenige-tabelle th:nth-child(1),
.koenige-tabelle td:nth-child(1) {
  width: 80px;
}

.koenige-tabelle th:nth-child(2),
.koenige-tabelle td:nth-child(2) {
  width: 280px;
}

.koenige-tabelle th:nth-child(3),
.koenige-tabelle td:nth-child(3) {
  width: 280px;
}

/* Responsive: Auf mobilen Geräten stapeln */
@media (max-width: 768px) {
  .koenige-tabelle,
  .koenige-tabelle thead,
  .koenige-tabelle tbody,
  .koenige-tabelle th,
  .koenige-tabelle td,
  .koenige-tabelle tr {
    display: block;
    width: 100%;
  }
  
  .koenige-tabelle thead tr {
    display: none;
  }
  
  .koenige-tabelle td {
    padding: 4px 16px;
    position: relative;
    padding-left: 120px;
  }
  
  .koenige-tabelle td:before {
    content: attr(data-label);
    position: absolute;
    left: 16px;
    font-weight: bold;
  }
  
  .koenige-tabelle tbody tr {
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
  }
}

/* Vorstandsliste - flaches Design im Twenty Twenty-Four Stil */
ul.vorstand-liste,
.vorstand-liste.wp-block-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 2.5rem auto !important;
  max-width: 900px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0 2rem !important;
}

/* Bei breiten Bildschirmen: 2 Spalten */
@media (min-width: 768px) {
  ul.vorstand-liste,
  .vorstand-liste.wp-block-list {
    grid-template-columns: 1fr 1fr !important;
  }
}

ul.vorstand-liste li,
.vorstand-liste.wp-block-list li {
  background: transparent !important;
  padding: 1.25rem 0 !important;
  border-bottom: 1px solid #e5e5e5 !important;
  list-style: none !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
  transition: padding-left 0.2s ease !important;
}

ul.vorstand-liste li:first-child,
.vorstand-liste.wp-block-list li:first-child {
  border-top: 1px solid #e5e5e5 !important;
}

/* Bei 2 Spalten: auch das zweite Element bekommt einen oberen Strich */
@media (min-width: 768px) {
  ul.vorstand-liste li:nth-child(2),
  .vorstand-liste.wp-block-list li:nth-child(2) {
    border-top: 1px solid #e5e5e5 !important;
  }
}

ul.vorstand-liste li:hover,
.vorstand-liste.wp-block-list li:hover {
  padding-left: 0.5rem !important;
  background: transparent !important;
}

ul.vorstand-liste li strong,
.vorstand-liste.wp-block-list li strong {
  display: block !important;
  color: #666 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

/* Name-Styling - größer und prominent */
ul.vorstand-liste li,
.vorstand-liste.wp-block-list li {
  font-size: 1.15rem !important;
  color: #000 !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

/* Responsive: Auf mobilen Geräten mehr Padding */
@media (max-width: 767px) {
  ul.vorstand-liste,
  .vorstand-liste.wp-block-list {
    margin-left: 1rem !important;
    margin-right: 1rem !important;
  }
}

/* Scroll to Top Button */
#scroll-to-top {
  position: fixed;
  bottom: 60px;
  right: 40px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(90deg, #0D98BA 0%, #0000FF 100%);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#scroll-to-top.show {
  display: flex;
}

#scroll-to-top::before {
  content: "➜";
  color: white;
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
  display: inline-block;
  transform: rotate(-90deg);
}

/* Responsive: Kleinerer Button auf Mobil */
@media (max-width: 768px) {
  #scroll-to-top {
    width: 45px;
    height: 45px;
    bottom: 60px;
    right: 40px;
  }
  
  #scroll-to-top::before {
    font-size: 18px;
  }
}