/*
Theme Name: Astra Child - Optimized
Template: astra
Author: Allkoenner.de
Version: 2.0
Description: Optimized styles with Dark Mode, Hover Effects, Lazy Load & Sticky Sidebar
*/

/* ==========================
   SAFE IMAGE DISPLAY (NO HIDDEN IMAGES)
============================ */

/* Ensure images always visible */
img {
  opacity: 1 !important;
  max-width: 100%;
  height: auto;
  display: block;
  transition: none !important;
}

/* Optional smooth fade for modern lazy load */
img[loading="lazy"] {
  opacity: 1 !important;
  transition: opacity 0.4s ease-in-out !important;
}

/* Remove old hidden lazyloaded selector */
img.lazyloaded {
  opacity: 1 !important;
}


/* ==========================
   DARK MODE SUPPORT
============================ */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #0d0d0f;
    color: #e1e1e1;
  }
  a {
    color: #79b8ff;
  }
  .news-item,
  .news-portal {
    background-color: #121212;
    color: #ddd;
  }
  .breaking-bar {
    background: #222;
    color: #fff;
  }
  .news-card-content {
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
  }
}

/* ==========================
   ALLKOENNER HOME LAYOUT FIX
============================ */
body.page-template-allkoenner-home-suche .site-content,
body.page-template-allkoenner-home-suche .content-area {
  display: flex;
  justify-content: center;
}
body.page-template-allkoenner-home-suche .content-area {
  width: 100%;
}
body.page-template-allkoenner-home-suche .container,
body.page-template-allkoenner-home-suche .ast-container {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ==========================
   NEWS PORTAL LAYOUT
============================ */
/* Container */
.news-portal {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Sticky Sidebar */
.news-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 80px;
  align-self: flex-start;
}

/* Breaking Bar */
.breaking-bar {
  background: #111827;
  color: #fff;
  padding: 12px 20px;
  font-weight: 600;
  margin-bottom: 30px;
  border-radius: 8px;
}
.breaking-bar span {
  color: #facc15;
  margin-right: 10px;
}

/* Hero Grid */
.news-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 260px 260px;
  gap: 20px;
  margin-bottom: 50px;
}

/* News Card */
.news-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  transition: transform .3s ease, box-shadow .3s ease;
}
.news-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 45px rgba(0,0,0,.12);
}

/* Card Images */
.news-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Content Overlay */
.news-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff;
  transition: background 0.3s ease;
}
.news-card:hover .news-card-content {
  background: linear-gradient(transparent, rgba(0,0,0,.85));
}

.news-card h2 {
  font-size: 22px;
  line-height: 1.2;
  transition: color .3s ease;
}
.news-card:hover h2 {
  color: #facc15;
}

/* Magazin Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}
.news-item {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 25px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.news-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
}
.news-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.news-item-content {
  padding: 18px;
}
.news-item h3 {
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 8px;
}
.news-item p {
  color: #6b7280;
  font-size: 14px;
}

/* Uniform Category & Image Styles */
.news-hero-grid img,
.news-grid img,
.category .news-hero-grid img,
.category .news-grid img {
  height: 280px;
  object-fit: cover;
}

/* Hero größere Höhe */
.news-hero-grid img {
  height: 420px;
}

/* ==========================
   RESPONSIVE BREAKPOINTS
============================ */
@media (max-width: 1024px) {
  .news-hero-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .news-sidebar {
    position: relative;
    top: auto;
    width: 100%;
    margin-bottom: 30px;
  }
}

@media (max-width: 640px) {
  .news-hero-grid {
    grid-template-columns: 1fr;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
}
/* ==========================
   DARK MODE ACTIVE CLASS
============================ */
body.dark-mode {
  background: #0d0d0f;
  color: #e1e1e1;
}
body.dark-mode a {
  color: #79b8ff;
}
body.dark-mode .news-item,
body.dark-mode .news-portal {
  background: #121212;
  color: #ddd;
}
body.dark-mode .breaking-bar {
  background: #222;
  color: #fff;
}
body.dark-mode .news-card-content {
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
/* Dark Mode Toggle */
.dark-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 50px;
  font-size: 14px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: transform .2s ease;
}
.dark-toggle:hover {
  transform: scale(1.1);
}
/* ==========================
   SMOOTH STICKY NAVIGATION
============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
  transition: background .3s ease, box-shadow .3s ease;
}

body.dark-mode .site-header {
  background: #111;
}

.site-header.scrolled {
  background: rgba(255,255,255,.95);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ==========================
   SMOOTH LAZY-LOAD SUPPORT
============================ */
img[loading="lazy"] {
  opacity: 1;
  transition: opacity 0.6s ease-in-out;
}
img.lazyloaded {
  opacity: 1;
}
