/* Index Seite Styles - KOMPLETT ÜBERARBEITET FÜR ZENTRIERUNG */

/* Reset und Basis */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #18589b;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 1001;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Header - ZENTRIERT */
.header-center {
  background: white;
  padding: 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-link {
  display: inline-block;
  transition: transform 0.3s ease;
}

.logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.logo-link:hover {
  transform: scale(1.05);
}

/* Suchformular - ZENTRIERT */
.search-form {
  max-width: 600px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.search-label {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
}

.search-input {
  flex: 1;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #18589b;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-button {
  padding: 0.75rem 1.5rem;
  background: #18589b;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.search-button:hover {
  background: #357ae8;
  transform: translateY(-2px);
}

/* Hauptcontainer - ZENTRIERT */
.main-container {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
}

.page-section {
  width: 100%;
  max-width: 1200px;
  padding: 0 1rem;
}

/* Überschriften - ZENTRIERT */
.headings-wrapper {
  text-align: center;
  margin: 2rem 0 3rem;
  padding: 0 1rem;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: #2c3e50;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.title-sub {
  color: #18589b;
  font-weight: 400;
}

.page-subtitle {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #18589b;
  margin-bottom: 0.5rem;
}

.page-description {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: #7f8c8d;
  margin-bottom: 0;
}

/* Blog Container */
.blog-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Blog Grid - ZENTRIERT */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1100px;
  justify-content: center;
  margin: 0 auto;
}

/* Blog Card - ZENTRIERT */
.blog-card {
  display: flex;
  justify-content: center;
}

.card-inner {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.blog-card:hover .card-inner {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Card Header */
.card-header {
  padding: 1.5rem 1.5rem 0.8rem;
  text-align: center;
}

.card-title {
  font-size: 1.4rem;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-date {
  display: block;
  font-size: 0.9rem;
  color: #7f8c8d;
}

/* Card Image */
.card-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .post-thumbnail {
  transform: scale(1.03);
}

/* Card Content */
.card-content {
  padding: 1.2rem 1.5rem;
  flex: 1;
}

.card-excerpt {
  color: #555;
  line-height: 1.7;
  font-size: 1rem;
  margin: 0;
}

/* Card Footer */
.card-footer {
  padding: 0 1.5rem 1.5rem;
  text-align: center;
}

.read-more-btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: #18589b;
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 150px;
}

.read-more-btn:hover {
  color: #000;
  background: #357ae8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 12px;
  max-width: 600px;
  margin: 2rem auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.empty-state p {
  margin-bottom: 0.5rem;
  color: #666;
}

.empty-state p:first-child {
  font-size: 1.2rem;
  font-weight: 600;
  color: #18589b;
}

/* Pagination - ZENTRIERT */
.pagination-nav {
  width: 100%;
  margin-top: 3rem;
  padding: 0 1rem;
}

.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto;
}

.pagination-btn {
  padding: 0.7rem 1.5rem;
  background: white;
  color: #18589b;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 100px;
  text-align: center;
}

.pagination-btn:hover {
  background: #18589b;
  color: white;
  border-color: #18589b;
  transform: translateY(-2px);
}

.page-numbers {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: white;
  color: #18589b;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.page-link:hover {
  background: #18589b;
  color: white;
  border-color: #18589b;
}

.current-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #18589b;
  color: white;
  border: 2px solid #18589b;
  border-radius: 6px;
  font-weight: 600;
}

/* Scroll-to-Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: #18589b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.scroll-top-btn:hover {
  background: #357ae8;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Footer */
.site-footer {
  background: #2c3e50;
  color: white;
  padding: 2rem 1rem;
  margin-top: 3rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.copyright {
  margin-bottom: 1rem;
  opacity: 0.8;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-link {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: white;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Suchformular */
  .search-form {
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
  }

  .search-input {
    max-width: 100%;
  }

  /* Blog Grid */
  .blog-grid {
    grid-template-columns: 1fr;
    max-width: 450px;
    gap: 1.5rem;
  }

  /* Pagination */
  .pagination-wrapper {
    flex-direction: column;
    gap: 0.75rem;
  }

  .page-numbers {
    order: -1;
  }

  /* Scroll Button */
  .scroll-top-btn {
    width: 45px;
    height: 45px;
    bottom: 1rem;
    right: 1rem;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.6rem;
  }

  .page-subtitle {
    font-size: 1.3rem;
  }

  .page-description {
    font-size: 1.1rem;
  }

  .blog-grid {
    padding: 0 0.5rem;
  }

  .card-inner {
    max-width: 100%;
  }

  .footer-nav {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (min-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
  }
}

/* Spezielle Regel für ungerade Anzahl Cards */
.blog-grid:has(> :only-child) {
  display: flex;
  justify-content: center;
}

.blog-grid:has(> :only-child) > .blog-card {
  width: 100%;
}

/* Wenn 3 Cards, aber nur 2 pro Seite angezeigt werden */
.blog-grid:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr);
  max-width: 900px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
  }

  .header-center,
  .card-inner,
  .empty-state {
    background: #1e1e1e;
  }

  .search-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }

  .page-title {
    color: #f0f0f0;
  }

  .card-title {
    color: #f0f0f0;
  }

  .card-excerpt {
    color: #b0b0b0;
  }

  .pagination-btn,
  .page-link {
    background: #2a2a2a;
    border-color: #444;
  }

  .site-footer {
    background: #1a1a1a;
  }
}
