/*
Theme Name: AlfiTheo
Theme URI: https://alfitheo.ch
Author: AlfiTheo
Description: Responsives Finanzblog-Theme (Child von Twenty Twenty-Five)
Template: twentytwentyfive
Version: 2.0.0
*/

/* === HEADER MIT LOGO === */
.alfitheo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  border-bottom: 2px solid #1a1a2e;
  background: #fff;
  flex-wrap: wrap;
  gap: 15px;
}
.alfitheo-header .alfitheo-logo img {
  max-height: 90px;
  width: auto;
  display: block;
}
.alfitheo-nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
}
.alfitheo-nav a {
  text-decoration: none;
  color: #1a1a2e;
  font-weight: 600;
  font-size: 1rem;
}

/* === WERBE-SLOTS === */
.ad-slot {
  text-align: center;
  margin: 20px auto;
  padding: 10px;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.8rem;
  border-radius: 4px;
}
.ad-slot.ad-rectangle { max-width: 300px; min-height: 250px; }
.ad-slot.ad-skyscraper { max-width: 160px; min-height: 600px; }
.ad-slot.ad-inline-mobile { max-width: 100%; min-height: 50px; }
.ad-slot.ad-sidebar { display: flex; }

/* === STARTSEITE: GRID === */
.alfitheo-home-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}
.alfitheo-home-main { min-width: 0; }
.alfitheo-home-sidebar { min-width: 0; }

/* === BEITRAGS-RASTER === */
.alfitheo-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* KOMPLETT ANKLICKBARE ARTIKELBLÖCKE */
.alfitheo-posts-grid .wp-block-post {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.alfitheo-posts-grid .wp-block-post:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}
.alfitheo-posts-grid .wp-block-post img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.alfitheo-posts-grid .wp-block-post h3 {
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0 0 8px;
  padding: 16px 16px 0;
}
.alfitheo-posts-grid .wp-block-post h3 a {
  text-decoration: none;
  color: #1a1a2e;
}
.alfitheo-posts-grid .wp-block-post .wp-block-post-date {
  font-size: 0.8rem;
  color: #888;
  padding: 0 16px 8px;
}
.alfitheo-posts-grid .wp-block-post .wp-block-post-excerpt {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #444;
  padding: 0 16px 16px;
  flex: 1;
}
.alfitheo-posts-grid .wp-block-post .wp-block-post-excerpt a {
  color: #c0392b;
  font-weight: 600;
}

}

/* Featured (erster Beitrag gross) */
.alfitheo-posts-grid .wp-block-post:first-child {
  grid-column: span 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.alfitheo-posts-grid .wp-block-post:first-child img {
  height: 100%;
  min-height: 280px;
}
.alfitheo-posts-grid .wp-block-post:first-child h3 {
  font-size: 1.5rem;
  padding: 24px 24px 0;
}
.alfitheo-posts-grid .wp-block-post:first-child .wp-block-post-date,
.alfitheo-posts-grid .wp-block-post:first-child .wp-block-post-excerpt {
  padding-left: 24px;
  padding-right: 24px;
}

/* === SIDEBAR === */
.alfitheo-sidebar-widget { margin-bottom: 30px; }
.alfitheo-sidebar-widget h3 {
  font-size: 1.1rem;
  border-bottom: 2px solid #1a1a2e;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* === UNTERTITEL KLEINER === */
.entry-content h2, .wp-block-post-content h2, h2.wp-block-heading {
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  color: #2c2c2c !important;
  margin-top: 1.5em !important;
  margin-bottom: 0.5em !important;
  padding-bottom: 4px;
  border-bottom: 1px solid #e0e0e0;
}
.entry-content h1, .wp-block-post-content h1, h1.wp-block-heading {
  font-size: 2rem !important;
  font-weight: 800 !important;
  color: #1a1a2e !important;
  margin-bottom: 1em !important;
}
.entry-content p, .wp-block-post-content p {
  line-height: 1.7 !important;
  font-size: 1rem !important;
  margin-bottom: 1.2em !important;
}

/* === DESKTOP SIDEBAR-WERBUNG AUF ARTIKELN === */
.alfitheo-desktop-ad-sidebar {
  position: fixed;
  right: 10px;
  top: 130px;
  z-index: 100;
  display: none;
}

/* === FOOTER === */
footer.wp-block-template-part {
  background: #1a1a2e !important;
  color: #ccc !important;
  padding: 30px 20px !important;
}
footer.wp-block-template-part a { color: #fff !important; }

/* === RESPONSIVE BREAKPOINTS === */

/* 21:9 Ultrawide (ab 1920px) */
@media (min-width: 1920px) {
  .alfitheo-home-grid { max-width: 1800px; grid-template-columns: 1fr 340px; }
  .alfitheo-posts-grid { grid-template-columns: repeat(4, 1fr); }
  .alfitheo-posts-grid .wp-block-post:first-child { grid-column: span 4; }
  .alfitheo-header { padding: 20px 40px; }
  .alfitheo-header .alfitheo-logo img { max-height: 100px; }
}

/* 16:9 Desktop (1024px - 1919px) */
@media (min-width: 1024px) and (max-width: 1919px) {
  .alfitheo-home-grid { max-width: 1400px; grid-template-columns: 1fr 320px; }
  .alfitheo-posts-grid { grid-template-columns: repeat(3, 1fr); }
  .alfitheo-posts-grid .wp-block-post:first-child { grid-column: span 3; }
  .ad-slot.ad-sidebar { display: flex; }
  .ad-slot.ad-inline-mobile { display: none; }
  .alfitheo-desktop-ad-sidebar { display: block; }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .alfitheo-home-grid { grid-template-columns: 1fr; }
  .alfitheo-home-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .alfitheo-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .alfitheo-posts-grid .wp-block-post:first-child { grid-column: span 2; }
  .ad-slot.ad-sidebar { display: none; }
  .ad-slot.ad-inline-mobile { display: flex; }
  .alfitheo-desktop-ad-sidebar { display: none; }
  .alfitheo-nav ul { gap: 15px; }
}

/* Mobile (unter 768px) */
@media (max-width: 767px) {
  .alfitheo-home-grid { grid-template-columns: 1fr; padding: 10px; gap: 15px; }
  .alfitheo-home-sidebar { display: none; }
  .alfitheo-posts-grid { grid-template-columns: 1fr; }
  .alfitheo-posts-grid .wp-block-post:first-child {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
  .alfitheo-posts-grid .wp-block-post:first-child img { min-height: 180px; }
  .ad-slot.ad-sidebar { display: none; }
  .ad-slot.ad-inline-mobile { display: flex; }
  .alfitheo-desktop-ad-sidebar { display: none; }
  .alfitheo-posts-grid .wp-block-post img { height: 140px; }
  .alfitheo-posts-grid .wp-block-post h3 { font-size: 1rem; }
  .alfitheo-header { flex-direction: column; text-align: center; padding: 12px; }
  .alfitheo-header .alfitheo-logo img { max-height: 60px; margin: 0 auto; }
  .alfitheo-nav ul { gap: 10px; flex-wrap: wrap; justify-content: center; }
}

/* Sehr kleine Geräte (unter 480px) */
@media (max-width: 479px) {
  .alfitheo-posts-grid .wp-block-post h3 { font-size: 0.95rem; padding: 12px 12px 0; }
  .alfitheo-posts-grid .wp-block-post .wp-block-post-excerpt { padding: 0 12px 12px; font-size: 0.85rem; }
  .alfitheo-nav ul { gap: 8px; font-size: 0.85rem; }
}

/* === LOGO GROESSER ERZWINGEN === */
.alfitheo-header .alfitheo-logo img,
.alfitheo-logo img {
  max-height: 90px !important;
  height: auto !important;
  width: auto !important;
  max-width: 300px !important;
}
@media (min-width: 1920px) {
  .alfitheo-header .alfitheo-logo img,
  .alfitheo-logo img { max-height: 110px !important; max-width: 350px !important; }
}
@media (max-width: 767px) {
  .alfitheo-header .alfitheo-logo img,
  .alfitheo-logo img { max-height: 65px !important; }
}

/* === PARENT-THEME ELEMENTE AUSBLENDEN === */
/* "Finanzblog" Text im Parent-Header */
header .wp-block-site-title,
header .wp-block-site-title a,
.wp-block-site-title {
  display: none !important;
}

/* Parent-Header Navigation ausblenden (wir haben eigene) */
header .wp-block-navigation,
header nav:not(.alfitheo-nav) {
  display: none !important;
}

/* Parent-Footer komplett ausblenden (wir haben eigenen) */
footer .wp-block-group:not(.alfitheo-footer) {
  display: none !important;
}

/* "Twenty Twenty-Five" und "Gestaltet mit WordPress" */
footer p,
footer .wp-block-paragraph {
  display: none !important;
}

/* Footer-Links: Blog, About, FAQs, Authors, Events, Shop, Patterns, Themes */
footer .wp-block-navigation,
footer nav,
footer .wp-block-social-links {
  display: none !important;
}

/* Unser Footer anzeigen */
.alfitheo-footer-clean {
  display: block !important;
  background: #1a1a2e;
  color: #ccc;
  padding: 30px 20px;
  text-align: center;
}
.alfitheo-footer-clean a { color: #fff !important; }

/* News-Link aus Parent-Header ausblenden */
header a[href*="/news/"] { display: none !important; }
/* Alle Parent-Header-Links ausser unsere eigenen ausblenden */
header .wp-block-navigation a,
header .wp-block-page-list a,
header nav:not(.alfitheo-nav) a {
  display: none !important;
}
