/**
 * WP-Simple Theme Haupt-Styles
 * 
 * Beinhaltet Layout-Container, Top-Bar, Hauptheader, Mobile Drawer,
 * Search Modal, Footer-Spalten mit Prozentbreiten und Unterzeile.
 */

/* ==========================================================================
   1. LAYOUT & CONTAINER
   ========================================================================== */
.site-container {
  width: 100%;
  max-width: var(--site-max-width, 1200px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-padding, 24px);
  padding-right: var(--site-padding, 24px);
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1 0 auto;
  padding-top: 40px;
  padding-bottom: 60px;
}

.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ==========================================================================
   2. HEADER ZEILE 1 (TOP-BAR - OPTIONAL & SCHMAL)
   ========================================================================== */
.site-topbar {
  background-color: var(--topbar-bg, #1e293b);
  color: var(--topbar-color, #f8fafc);
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.topbar-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.topbar-content a {
  color: inherit;
  text-decoration: none;
  opacity: 0.9;
}

.topbar-content a:hover {
  opacity: 1;
  text-decoration: underline;
}

.topbar-search {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.topbar-search .search-form {
  display: flex;
  align-items: center;
}

.topbar-search .search-field {
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 140px;
  transition: width 0.2s ease, background 0.2s ease;
}

.topbar-search .search-field:focus {
  width: 200px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.topbar-search .search-submit {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   3. HEADER ZEILE 2 (HAUPTHEADER)
   ========================================================================== */
.site-header {
  background-color: var(--header-bg, #ffffff);
  color: var(--header-color, #0f172a);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  position: relative;
  z-index: 99;
  transition: box-shadow 0.2s ease;
}

.site-header.is-sticky {
  position: sticky;
  top: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

/* Logo & Website-Titel (Desktop: Linksbündig) */
.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-logo img {
  display: block;
  max-height: 60px;
  width: auto;
  height: auto;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-title a {
  color: var(--header-color, #0f172a);
  text-decoration: none;
}

.site-description {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--color-text, #64748b);
}

/* Header Rechtsbereich (Menü & Suche) */
.header-right-area {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

/* Navigation Desktop */
.main-navigation ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 22px;
}

.main-navigation li {
  position: relative;
}

.main-navigation a {
  display: block;
  padding: 8px 0;
  color: var(--header-color, #0f172a);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--color-primary, #2563eb);
}

/* Submenüs (Dropdowns) */
.main-navigation ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  min-width: 200px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  padding: 8px 0;
  display: none;
  flex-direction: column;
  gap: 0;
  z-index: 100;
}

.main-navigation ul li:hover > ul {
  display: flex;
}

.main-navigation ul ul a {
  padding: 8px 18px;
  font-size: 0.9rem;
  color: var(--color-heading, #0f172a);
}

.main-navigation ul ul a:hover {
  background-color: #f8fafc;
  color: var(--color-primary, #2563eb);
}

/* Header Suche */
.header-main-search {
  display: flex;
  align-items: center;
}

.search-toggle-btn {
  background: transparent;
  border: none;
  color: var(--header-color, #0f172a);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.search-toggle-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--color-primary, #2563eb);
}

.site-topbar .search-toggle-btn {
  color: var(--topbar-color, #f8fafc);
}

.site-topbar .search-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ==========================================================================
   4. MOBILE HEADER & OFF-CANVAS SLIDE-IN MENÜ
   ========================================================================== */
@media (max-width: 991px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  /* Handy: Logo exakt in der Mitte */
  .header-container {
    position: relative;
    justify-content: center;
    min-height: 64px;
  }

  .site-branding {
    margin: 0 auto;
    text-align: center;
  }

  /* Handy: Menüsymbol rechtsbündig */
  .mobile-menu-trigger-wrapper {
    position: absolute;
    right: var(--site-padding, 20px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .mobile-menu-toggle {
    background: transparent;
    border: none;
    color: var(--header-color, #0f172a);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
  }

  .mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
  }
}

/* Backdrop */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* Drawer: Klappt von rechts ein */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background-color: var(--color-bg, #ffffff);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer.is-active {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.mobile-drawer-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-heading, #0f172a);
}

.mobile-drawer-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  color: var(--color-text, #64748b);
  display: flex;
  align-items: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.mobile-drawer-close:hover {
  color: var(--color-heading, #0f172a);
  background: #f1f5f9;
}

.mobile-drawer-body {
  padding: 20px;
  flex: 1 1 auto;
}

.mobile-drawer-search {
  margin-bottom: 22px;
}

.mobile-drawer-search .search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.mobile-drawer-search .search-field {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #cbd5e1);
  font-size: 0.95rem;
}

.mobile-drawer-search .search-submit {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-list li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-menu-list a {
  display: block;
  padding: 12px 6px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-heading, #0f172a);
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.mobile-menu-list a:hover {
  color: var(--color-primary, #2563eb);
  padding-left: 10px;
}

.mobile-menu-list ul {
  list-style: none;
  padding-left: 16px;
  margin: 0;
  background: #f8fafc;
  border-radius: 4px;
}

.mobile-menu-list ul a {
  font-size: 0.95rem;
  padding: 9px 8px;
}

/* ==========================================================================
   5. SEARCH MODAL OVERLAY
   ========================================================================== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.search-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
}

.search-modal-content {
  position: relative;
  width: 90%;
  max-width: 620px;
  background: #ffffff;
  border-radius: 12px;
  padding: 36px 32px 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.search-modal.is-active .search-modal-content {
  transform: translateY(0);
}

.search-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
}

.search-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.search-modal-title {
  margin: 0 0 20px;
  font-size: 1.4rem;
  color: var(--color-heading, #0f172a);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-modal-input {
  width: 100%;
  padding: 14px 50px 14px 18px;
  font-size: 1.15rem;
  border: 2px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-modal-input:focus {
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.search-modal-submit {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--color-primary, #2563eb);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 6px;
}

.search-modal-hint {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* ==========================================================================
   6. FOOTER (SPALTEN MIT PROZENTBREITEN & UNTERZEILE)
   ========================================================================== */
.site-footer {
  background-color: var(--footer-bg, #0f172a);
  color: var(--footer-color, #94a3b8);
  margin-top: auto;
}

.site-footer a {
  color: var(--footer-color, #94a3b8);
  transition: color 0.15s ease;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.site-footer-widgets {
  padding: 60px 0 40px;
}

.footer-columns-container {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-column {
  box-sizing: border-box;
}

/* Dynamische Spaltenbreiten über CSS Custom Properties */
.footer-col-1 {
  flex: 0 0 calc(var(--footer-col-1-width, 40%) - 24px);
  max-width: calc(var(--footer-col-1-width, 40%) - 24px);
}

.footer-col-2 {
  flex: 0 0 calc(var(--footer-col-2-width, 30%) - 24px);
  max-width: calc(var(--footer-col-2-width, 30%) - 24px);
}

.footer-col-3 {
  flex: 0 0 calc(var(--footer-col-3-width, 30%) - 24px);
  max-width: calc(var(--footer-col-3-width, 30%) - 24px);
}

.footer-col-4 {
  flex: 0 0 calc(var(--footer-col-4-width, 25%) - 24px);
  max-width: calc(var(--footer-col-4-width, 25%) - 24px);
}

/* Responsive Footer Spalten */
@media (max-width: 900px) {
  .footer-col-1,
  .footer-col-2,
  .footer-col-3,
  .footer-col-4 {
    flex: 0 0 calc(50% - 16px) !important;
    max-width: calc(50% - 16px) !important;
  }
}

@media (max-width: 600px) {
  .footer-col-1,
  .footer-col-2,
  .footer-col-3,
  .footer-col-4 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

.footer-widget {
  margin-bottom: 24px;
}

.footer-widget-title {
  color: var(--footer-heading, #f8fafc);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 18px;
}

.footer-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-widget li {
  margin-bottom: 9px;
}

/* Optionale Footer-Unterzeile */
.site-footer-bottom {
  background-color: var(--footer-bottom-bg, #020617);
  color: var(--footer-bottom-color, #64748b);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 18px 0;
}

.footer-bottom-content {
  text-align: center;
}

.footer-bottom-content a {
  color: inherit;
  margin: 0 6px;
}

/* ==========================================================================
   7. INHALTE, BEITRAGS-GRID & FORMULARE
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  margin-bottom: 50px;
}

.post-card {
  background: #ffffff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.post-card-thumbnail img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.post-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.post-card-meta {
  font-size: 0.825rem;
  color: #64748b;
  margin-bottom: 8px;
}

.post-card-title {
  font-size: 1.35rem;
  margin-top: 0;
  margin-bottom: 12px;
}

.post-card-title a {
  color: var(--color-heading, #0f172a);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--color-primary, #2563eb);
}

.post-card-excerpt {
  font-size: 0.95rem;
  color: var(--color-text, #334155);
  margin-bottom: 18px;
}

.post-card-footer {
  margin-top: auto;
}

.read-more-link {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Standard Sucheingabe Formulare */
.search-form {
  display: flex;
  align-items: center;
}

.search-form label {
  flex: 1;
}

.search-form .search-field {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 6px 0 0 6px;
  font-size: 0.95rem;
  outline: none;
}

.search-form .search-submit {
  padding: 9px 14px;
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  border: 1px solid var(--color-primary, #2563eb);
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pagination */
.pagination-wrapper {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.pagination-wrapper .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  margin: 0 4px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-heading, #0f172a);
  text-decoration: none;
  font-weight: 500;
}

.pagination-wrapper .page-numbers.current {
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  border-color: var(--color-primary, #2563eb);
}

/* Single / Page Post Meta & Thumbnail */
.entry-header {
  margin-bottom: 24px;
}

.entry-title {
  margin-bottom: 12px;
}

.entry-meta {
  font-size: 0.9rem;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.entry-thumbnail {
  margin-bottom: 30px;
}

.entry-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.entry-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.entry-content img {
  max-width: 100%;
  height: auto;
}

.post-navigation {
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid var(--color-border, #e2e8f0);
}

.post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
