/* CRITICAL CSS RESET - zapobieganie białym paskom */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  background-color: #f8f9fa;
  min-height: 100vh;
  height: auto;
}

/* Zapobieganie białym paskom na mobile */
@media (max-width: 768px) {
  html, body {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: relative;
  }
  
  body {
    padding-bottom: 80px; /* Miejsce na mobilny pasek nawigacyjny */
  }
  
  /* KLUCZOWA POPRAWKA: Wszystkie główne kontenery bez własnego scrolla */
  * {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
  }
  
  *::-webkit-scrollbar {
    display: none; /* WebKit */
  }
  
  .container,
  .sections,
  .main-content,
  .cards,
  .cards-horizontal {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
}

/* CRITICAL: Force full width na kategoriach mobile - Complete Override */
@media (max-width: 768px) {
  body.category .container,
  body[class*="category"] .container,
  body.search .container {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body.category .main-content,
  body[class*="category"] .main-content,
  body.search .main-content {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 10px !important;
    margin: 0 !important;
  }
  body.category .cards,
  body[class*="category"] .cards,
  body.search .cards {
    width: 100vw !important;
    max-width: 100vw !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 10px !important;
    gap: 20px !important;
  }
  body.category .card,
  body[class*="category"] .card,
  body.category #category-cards .card,
  body[class*="category"] #category-cards .card,
  body.search .card {
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    width: calc(100vw - 20px) !important;
    flex: none !important;
    margin: 0 0 20px 0 !important;
    box-sizing: border-box !important;
  }
}

/* Sidebar fix: ogranicz szerokość i overflow na mobile */
.sidebar {
  max-width: 350px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.sidebar * {
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
@media (max-width: 900px) {
  .sidebar {
    max-width: calc(100vw - 40px);
    width: calc(100vw - 40px);
    min-width: 0;
    overflow-x: hidden;
    word-break: break-word;
    padding: 0 10px;
  }
  .sidebar * {
    max-width: 100%;
    word-break: break-word;
  }
}
/* Poprawka: wyniki wyszukiwania na mobile - karty idealnie dopasowane bez overflow */
.search-results .cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  overflow-x: hidden !important;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
.search-results .card {
  flex: 1 1 calc(50% - 8px);
  min-width: 280px;
  max-width: calc(50% - 8px);
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .search-results {
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100vw;
  }
  .search-results .cards,
  body.search .cards {
    gap: 15px;
    padding: 0 10px;
    width: 100vw;
    max-width: 100vw;
    display: block !important;
    margin: 0;
  }
  .search-results .card,
  body.search .card {
    flex: none !important;
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    width: calc(100vw - 20px) !important;
    margin: 0 0 15px 0 !important;
    box-sizing: border-box;
  }
  .search-results .card img,
  body.search .card img {
    max-width: 100%;
    width: 100%;
  }
  
  /* Override container width for search page */
  body.search .container {
    max-width: 100vw;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  body.search .main-content {
    max-width: 100%;
    width: 100%;
    padding: 0;
  }
}
@media (max-width: 900px) and (min-width: 769px) {
  .search-results .cards {
    gap: 12px;
  }
  .search-results .card {
    flex: 1 1 100%;
    min-width: 100%;
    max-width: 100%;
  }
}
/* Tytuł na zdjęciu z rozmytym tłem pod spodem */
.cover-title-blur-bg {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 110px;
  z-index: 2;
  background: rgba(30,30,30,0.7);
  filter: blur(16px) brightness(1.05);
  pointer-events: none;
}
.cover-title-on-img {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 20px 38px 28px 38px;
  min-height: 100%;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 28px 28px 28px 28px;
}
/* --- COVER HERO Z IMG I OVERLAY --- */
.cover-tile--overlay-img {
  position: relative;
  min-height: 320px;
  width: 100%;
  max-width: 900px;
  margin: 30px auto 40px auto;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.15), 0 8px 32px rgba(59, 130, 246, 0.1);
}
.cover-tile--overlay-img .cover-image-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
}
.cover-tile--overlay-img .cover-blur-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(30,30,30,0.92) 60%, rgba(30,30,30,0.7) 90%, transparent 100%);
  filter: blur(8px) brightness(1);
/* Meta sekcja pod okładką */
.meta-row {
  display: flex;
  gap: 24px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto 18px auto;
  padding: 0 32px;
  font-size: 1.08rem;
  color: #23272f;
}
.meta-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.meta-date, .meta-readtime {
  color: #6b7280;
  font-size: 0.98em;
}
}
.cover-tile--overlay-img .cover-title-box {
  display: none;
}
.cover-title-new {
  color: #f7f7fa;
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
  line-height: 1.1;
  width: 100%;
  text-align: left;
}
@media (min-width: 600px) {
  .cover-title-new {
    font-size: 3rem;
  }
  .cover-tile--overlay-img .cover-title-box {
    padding: 64px 54px 48px 54px;
    min-height: 240px;
  }
}
/* --- NOWY COVER HERO DLA SINGLE --- */
.cover-tile--overlay-new {
  position: relative;
  min-height: 320px;
  width: 100%;
  max-width: 900px;
  margin: 30px auto 40px auto;
  border-radius: 28px;
  overflow: hidden;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.15), 0 8px 32px rgba(59, 130, 246, 0.1);
}
.cover-tile--overlay-new .cover-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(0,0,0,0.92) 60%, rgba(0,0,0,0.5) 95%, transparent 100%);
  pointer-events: none;
  filter: blur(0px);
}
.cover-tile--overlay-new::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: inherit;
  filter: blur(14px) brightness(0.82);
  pointer-events: none;
}
.cover-tile--overlay-new .cover-title-box {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 36px 38px 32px 38px;
  display: flex;
  align-items: flex-end;
  min-height: 160px;
}
.cover-title-new {
  color: #fff;
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  text-shadow: 0 4px 24px rgba(0,0,0,0.95), 0 2px 8px rgba(0,0,0,0.7);
  line-height: 1.1;
  width: 100%;
  text-align: left;
}
@media (min-width: 600px) {
  .cover-title-new {
    font-size: 3rem;
  }
  .cover-tile--overlay-new .cover-title-box {
    padding: 64px 54px 48px 54px;
    min-height: 240px;
  }
}
/* --- Nowy overlay na okładce w single.php --- */
.cover-tile--overlay {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  overflow: hidden;
}
.cover-tile--overlay .cover-bg-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}
.cover-tile--overlay .cover-bg-blur .cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px) brightness(0.85);
  transform: scale(1.07);
}
.cover-tile--overlay .cover-bg-blur .cover-image--placeholder {
  width: 100%;
  height: 100%;
  filter: blur(6px) brightness(0.85);
  transform: scale(1.07);
}
.cover-tile--overlay .cover-title-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 48px 38px 38px 38px;
  background: linear-gradient(0deg, rgba(0,0,0,0.88) 70%, rgba(0,0,0,0.5) 95%, transparent 100%) !important;
  display: flex;
  align-items: flex-end;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  min-height: 220px;
}
.cover-tile--overlay .cover-title {
  color: #fff;
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  text-shadow: 0 4px 24px rgba(0,0,0,0.95), 0 2px 8px rgba(0,0,0,0.7);
  line-height: 1.1;
  width: 100%;
  text-align: left;
}
@media (min-width: 600px) {
  .cover-tile--overlay .cover-title {
    font-size: 3rem;
  }
  .cover-tile--overlay .cover-title-overlay {
    padding: 64px 54px 48px 54px;
    min-height: 300px;
  }
}
/* --- Tytuł pod zdjęciem w single.php --- */
.cover-title-section {
  max-width: 900px;
  margin: 25px auto 0 auto;
  padding: 0 25px;
}
.cover-title-standalone {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1f2937;
  margin: 0;
  line-height: 1.2;
  text-align: center;
}
@media (min-width: 600px) {
  .cover-title-standalone {
    font-size: 3rem;
  }
  .cover-title-section {
    padding: 0 45px;
  }
}
/* --- Overlay na okładce w single.php --- */
.cover-tile--overlay {
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.cover-tile--overlay .cover-image,
.cover-tile--overlay .cover-image--placeholder {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1 !important;
}
.cover-tile--overlay .cover-image--blur {
  filter: blur(4px);
  transform: scale(1.05);
  z-index: 1 !important;
}
.cover-tile--overlay .cover-title-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 20 !important;
  padding: 38px 38px 32px 38px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 60%, rgba(0,0,0,0.4) 90%, transparent 100%) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  pointer-events: none;
}
.cover-tile--overlay .cover-title {
  position: relative;
  z-index: 25 !important;
  color: #ffffff !important;
  text-shadow: 0 4px 24px rgba(0,0,0,0.95), 0 2px 8px rgba(0,0,0,0.7) !important;
  font-size: 2.2rem !important;
  font-weight: 800;
  margin: 0;
  pointer-events: auto;
}
@media (min-width: 600px) {
  .cover-tile--overlay .cover-title {
    font-size: 3rem;
  }
  .cover-tile--overlay .cover-title-overlay {
    padding: 54px 54px 40px 54px;
  }
}
/* --- Kafelek okładki i meta --- */
.cover-tile {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 30px auto 40px auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.15), 0 8px 32px rgba(59, 130, 246, 0.1);
  background: linear-gradient(145deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cover-tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 80px rgba(139, 92, 246, 0.25), 0 15px 50px rgba(59, 130, 246, 0.15);
}

.cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #222;
  z-index: 1;
  transition: all 0.4s ease;
  border-radius: 28px;
}
.cover-image--placeholder {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 320px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 28px;
}

.placeholder-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
              radial-gradient(circle at 40% 80%, rgba(255,255,255,0.06) 0%, transparent 50%);
  animation: float 6s ease-in-out infinite;
}

.placeholder-icon {
  font-size: 4rem;
  opacity: 0.3;
  z-index: 2;
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}
.cover-title-wrap {
  position: relative;
  z-index: 2;
  padding: 35px 35px 30px 35px;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0.4) 60%, transparent 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}
.cover-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
  letter-spacing: -0.02em;
}
@media (min-width: 600px) {
  .cover-tile { min-height: 400px; }
  .cover-image--placeholder { min-height: 400px; }
  .cover-title { font-size: 2.8rem; }
  .cover-title-wrap { padding: 45px 45px 40px 45px; }
  .placeholder-icon { font-size: 5rem; }
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 25px;
  margin: 35px auto 40px auto;
  max-width: 900px;
  padding: 0 25px;
  font-size: 1rem;
  color: #6b7280;
  flex-wrap: wrap;
  justify-content: center;
}
.meta-author {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}
.meta-author:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
.meta-author img { 
  border-radius: 50%; 
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
  width: 36px;
  height: 36px; 
}
.meta-date, .meta-readtime { 
  font-size: 0.9em;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
  transition: all 0.3s ease;
}
.meta-date:hover, .meta-readtime:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 25px;
  line-height: 1.8;
  font-size: 1.1rem;
  color: #2d3748;
  background: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(247,250,252,0.9) 100%);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* --- Kafelek okładki i meta --- */
.cover-tile {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 30px auto 40px auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.15), 0 8px 32px rgba(59, 130, 246, 0.1);
  background: linear-gradient(145deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cover-tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 80px rgba(139, 92, 246, 0.25), 0 15px 50px rgba(59, 130, 246, 0.15);
}

.cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #222;
  z-index: 1;
  transition: all 0.4s ease;
  border-radius: 28px;
}
.cover-image--placeholder {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 320px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 28px;
}

.placeholder-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
              radial-gradient(circle at 40% 80%, rgba(255,255,255,0.06) 0%, transparent 50%);
  animation: float 6s ease-in-out infinite;
}

.placeholder-icon {
  font-size: 4rem;
  opacity: 0.3;
  z-index: 2;
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}
.cover-title-wrap {
  position: relative;
  z-index: 2;
  padding: 35px 35px 30px 35px;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0.4) 60%, transparent 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}
.cover-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
  letter-spacing: -0.02em;
}
@media (min-width: 600px) {
  .cover-tile { min-height: 400px; }
  .cover-image--placeholder { min-height: 400px; }
  .cover-title { font-size: 2.8rem; }
  .cover-title-wrap { padding: 45px 45px 40px 45px; }
  .placeholder-icon { font-size: 5rem; }
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 25px;
  margin: 35px auto 40px auto;
  max-width: 900px;
  padding: 0 25px;
  font-size: 1rem;
  color: #6b7280;
  flex-wrap: wrap;
  justify-content: center;
}
.meta-author {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}
.meta-author:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
.meta-author img { 
  border-radius: 50%; 
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
  width: 36px;
  height: 36px; 
}
.meta-date, .meta-readtime { 
  font-size: 0.9em;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
  transition: all 0.3s ease;
}
.meta-date:hover, .meta-readtime:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 25px;
  line-height: 1.8;
  font-size: 1.1rem;
  color: #2d3748;
  background: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(247,250,252,0.9) 100%);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* --- Kafelek okładki i meta --- */
.cover-tile {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 30px auto 40px auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.15), 0 8px 32px rgba(59, 130, 246, 0.1);
  background: linear-gradient(145deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cover-tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 80px rgba(139, 92, 246, 0.25), 0 15px 50px rgba(59, 130, 246, 0.15);
}

.cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #222;
  z-index: 1;
  transition: all 0.4s ease;
  border-radius: 28px;
}
.cover-image--placeholder {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 320px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 28px;
}

.placeholder-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
              radial-gradient(circle at 40% 80%, rgba(255,255,255,0.06) 0%, transparent 50%);
  animation: float 6s ease-in-out infinite;
}

.placeholder-icon {
  font-size: 4rem;
  opacity: 0.3;
  z-index: 2;
  position: relative;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}
.cover-title-wrap {
  position: relative;
  z-index: 2;
  padding: 35px 35px 30px 35px;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 30%, rgba(0,0,0,0.4) 60%, transparent 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}
.cover-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
  letter-spacing: -0.02em;
}
@media (min-width: 600px) {
  .cover-tile { min-height: 400px; }
  .cover-image--placeholder { min-height: 400px; }
  .cover-title { font-size: 2.8rem; }
  .cover-title-wrap { padding: 45px 45px 40px 45px; }
  .placeholder-icon { font-size: 5rem; }
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 25px;
  margin: 35px auto 40px auto;
  max-width: 900px;
  padding: 0 25px;
  font-size: 1rem;
  color: #6b7280;
  flex-wrap: wrap;
  justify-content: center;
}
.meta-author {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}
.meta-author:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}
.meta-author img { 
  border-radius: 50%; 
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
  width: 36px;
  height: 36px; 
}
.meta-date, .meta-readtime { 
  font-size: 0.9em;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
  transition: all 0.3s ease;
}
.meta-date:hover, .meta-readtime:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 25px;
  line-height: 1.8;
  font-size: 1.1rem;
  color: #2d3748;
  background: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(247,250,252,0.9) 100%);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* --- Moduł reklamowy - uniwersalny */
.ad-module {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  min-height: 120px;
  background: linear-gradient(90deg,#fbbf24 0%,#f59e42 100%);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 2px dashed #f59e42;
  color: #7c3aed;
  font-family: inherit;
  font-size: 1rem;
}
.ad-content {
  padding: 24px 32px;
  text-align: center;
}

/* Reklama na PC - po bokach */
@media (min-width: 900px) {
  .ad-module.ad-side {
    position: fixed;
    top: 120px;
    width: 160px;
    height: 600px;
    min-height: 0;
    z-index: 100;
    background: linear-gradient(135deg,#fbbf24 0%,#f59e42 100%);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-radius: 16px;
    border: 2px dashed #f59e42;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .ad-module.ad-side.left {
    left: 24px;
  }
  .ad-module.ad-side.right {
    right: 24px;
  }
}

/* Reklama na mobile - między postami */
@media (max-width: 600px) {
  .ad-module {
    min-height: 80px;
    margin: 16px 0;
    border-radius: 10px;
    padding: 12px 8px;
  }
  .ad-content {
    padding: 12px 8px;
    font-size: 0.95rem;
  }
}

@media (max-width: 700px) {
  .cover-tile, .page-article { 
    max-width: 95vw; 
    margin-left: auto;
    margin-right: auto;
  }
  .meta-row {
    gap: 8px;
    justify-content: center;
    text-align: center;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .meta-author, .meta-date, .meta-readtime {
    align-self: center;
  }
  .related-list {
    grid-template-columns: 1fr;
  }
  .cover-title-wrap {
    padding: 25px 20px 20px 20px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }
  .cover-image, .cover-image--placeholder {
    border-radius: 18px !important;
  }
  .cover-title {
    font-size: 1.8rem !important;
  }
  .page-content {
    padding: 25px 20px;
  }
  .related-section {
    padding: 30px 20px;
  }
  .container {
    margin: 10px;
    padding: 15px;
  }
  body {
    background-size: 200% 200%;
  }
}

/* Ogólne style dla artykułu */
.page-article {
  background: #fff;
  margin-bottom: 40px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.main-content {
  width: 100%;
}

/* --- Post/Page stylizacja --- */
.page-article {
  background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(247,250,252,0.1) 100%);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  overflow: hidden;
}

/* Tło strony */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  background: rgba(255,255,255,0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.2);
  margin: 20px auto;
  max-width: 1200px;
  padding: 20px;
}

.main-content {
  width: 100%;
}

.featured-image-wrap {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 24px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.featured-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  max-height: 340px;
  background: #e5e7eb;
  transition: box-shadow 0.2s;
}

@media (max-width: 700px) {
  .page-article {
    padding: 12px 2vw 20px 2vw;
    max-width: 98vw;
  }
  .featured-image-wrap {
    /* Unikaj 100vw w kontenerach z paddingiem, bo powoduje overflow */
    max-width: 100%;
    border-radius: 8px;
  }
  .featured-image {
    border-radius: 8px;
    max-height: 38vw;
    aspect-ratio: 16/9;
  }
}

.page-article h1 {
  font-size: 2.1rem;
  margin: 0 0 18px 0;
  font-weight: 700;
  color: #1f2937;
  text-align: center;
}

.page-content {
  font-size: 1.08rem;
  line-height: 1.7;
  color: #222;
  margin-top: 10px;
  word-break: break-word;
}
/*
Theme Name: News Hub
Theme URI: https://example.com/news-hub
Author: Twoje Imię
Description: Nowoczesny, responsywny szablon newsowy inspirowany mockupem.
Version: 1.0
*/

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f7f8fa;
  color: #222;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  box-sizing: border-box;
}

/* CONTAINER MOBILE FIX - zapobieganie overflow */
@media (max-width: 768px) {
  body.home .container,
  body.front-page .container {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  /* KLUCZOWA POPRAWKA: Integreacja header + content */
  body.home,
  body.front-page {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  
  body.home .main-header,
  body.front-page .main-header {
    flex-shrink: 0 !important;
  }
  
  body.home .container,
  body.front-page .container {
    flex-grow: 1 !important;
    margin-top: 0 !important;
  }
}

/* Header */
.main-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1000;
  width: 100%;
  overflow: visible;
}

/* KLUCZOWA POPRAWKA: Header i Content integration */
@media (max-width: 768px) {
  .main-header {
    position: relative !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

/* HEADER CONTAINER MOBILE FIX */
@media (max-width: 768px) {
  .header-container {
    max-width: 100vw !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 16px !important;
    height: 60px !important;
    position: relative !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img img {
  height: 40px;
  width: auto;
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.75rem;
}

.logo-n {
  color: #3b82f6;
  font-size: 2rem;
}

.logo-name {
  color: #1f2937;
  letter-spacing: 1px;
}

.main-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: #374151;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #3b82f6;
  background: #f3f4f6;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-btn, .user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
}

.search-btn:hover, .user-avatar:hover {
  background: #f3f4f6;
  color: #374151;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}

.mobile-menu span {
  width: 24px;
  height: 2px;
  background: #374151;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.mobile-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2000;
}

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

.search-container {
  background: white;
  border-radius: 12px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.search-overlay.active .search-container {
  transform: scale(1);
}

.search-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 10px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.search-close, .search-submit {
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.search-close:hover, .search-submit:hover {
  background: #f3f4f6;
  color: #111827;
}

.search-submit {
  background: #3b82f6;
  color: #fff;
}

.search-submit:hover {
  background: #2563eb;
  color: #fff;
}

.search-close svg, .search-submit svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.search-input-wrapper {
  display: block;
}

.search-input-wrapper input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-input-wrapper input:focus {
  border-color: #3b82f6;
  background: #fff;
}



/* Mobile Search Overlay Styles */
@media (max-width: 768px) {
  .search-overlay {
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
  }
  
  .search-container {
    width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    padding: 20px 15px;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  }
  
  .search-header {
    position: sticky;
    top: 0;
    padding: calc(env(safe-area-inset-top, 0) + 8px) 8px 8px;
    background: #fff;
    z-index: 2;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
    grid-template-columns: 56px 1fr 56px;
  }
  
  .search-input-wrapper {
    min-width: 0;
    flex: 1;
    margin: 0;
  }
  
  .search-input-wrapper input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 8px;
    margin: 0;
  }
  
  .search-close, .search-submit {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }
  
  /* DUŻA LUPA NA MOBILE - bardzo widoczna */
  .search-submit svg {
    width: 56px !important;
    height: 56px !important;
    stroke-width: 3.2 !important;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 16px;
    height: 60px;
  }
  
  .logo-text {
    font-size: 1.4rem;
  }
  
  .logo-n {
    font-size: 1.6rem;
  }
  
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 0;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .main-nav.mobile-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-link {
    padding: 12px 0;
    width: 100%;
    text-align: center;
  }
  
  .mobile-menu {
    display: flex;
  }
  
  .search-container {
    padding: 20px 15px;
    max-width: calc(100vw - 30px);
    width: calc(100vw - 30px);
    margin: 0 15px;
    box-sizing: border-box;
    border-radius: 8px;
  }
  
  .search-container form {
    flex-direction: column;
    gap: 15px;
  }
  
  .search-container input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    box-sizing: border-box;
  }
  
  .search-container button[type="submit"] {
    width: 100%;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
}

.footer {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.hero {
  background: #1a3a5d;
  color: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 32px;
  background-image: url('hero.jpg');
  background-size: cover;
  background-position: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero h1 {
  font-size: 2.2rem;
  margin: 0 0 12px 0;
}

.hero .btn {
  background: #fff;
  color: #1a3a5d;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 1rem;
}

.sections {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

/* CATEGORY SECTIONS - Style przeniesione z inline */
.category-section {
  margin-top: 36px;
  width: 100%;
  box-sizing: border-box;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  word-break: break-word;
  max-width: 70vw;
}

@media (max-width: 768px) {
  .category-section {
    margin-top: 24px !important;
    overflow: visible !important;
    height: auto !important;
  }
  
  .section-header {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .section-title {
    max-width: 60% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
    word-break: break-word !important;
  }
  .see-all-btn {
    min-width: 0 !important;
    max-width: 38vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

/* CARDS-HORIZONTAL - Prawidłowe style dla postów na stronie głównej */
.cards-horizontal {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  width: 100%;
  max-width: 100vw;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  height: auto !important;
  max-height: none !important;
}

.cards-horizontal .card {
  flex: 1 1 25%;
  min-width: 0;
  max-width: 23%;
  box-sizing: border-box;
  height: auto !important;
  overflow: visible !important;
}

@media (max-width: 1200px) {
  .cards-horizontal .card {
    flex: 1 1 calc(50% - 9px);
    max-width: calc(50% - 9px);
  }
}

@media (max-width: 900px) {
  .cards-horizontal .card {
    flex: 1 1 calc(100% - 18px);
    max-width: calc(100% - 18px);
  }
}

@media (max-width: 768px) {
  .cards-horizontal {
    gap: 12px !important;
    overflow: visible !important;
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
    box-sizing: border-box !important;
  }
  .cards-horizontal .card {
  flex: 1 1 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  height: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  }
}

/* SECTIONS MOBILE FIX dla strony głównej */
@media (max-width: 768px) {
  body.home .sections,
  body.front-page .sections {
    display: block !important;
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    height: auto !important;
  }
}

.main-content {
  flex: 2 1 600px;
}

/* MAIN CONTENT MOBILE FIX dla strony głównej */
@media (max-width: 768px) {
  body.home .main-content,
  body.front-page .main-content {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 10px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    height: auto !important;
  }
  
  /* Category sections na stronie głównej */
  body.home .category-section,
  body.front-page .category-section {
    margin-top: 24px !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    height: auto !important;
  }
  
  /* Section headers */
  body.home .section-header,
  body.front-page .section-header {
    margin-bottom: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-wrap: wrap !important;
  }
  
  /* Section titles */
  body.home .section-title,
  body.front-page .section-title {
    margin: 16px 0 12px 0 !important;
    max-width: 100% !important;
    word-break: break-word !important;
    font-size: 1.2rem !important;
  }
  
  /* CARDS CONTAINERS - eliminacja własnego scrolla */
  body.home .cards,
  body.front-page .cards,
  body.home .cards-horizontal,
  body.front-page .cards-horizontal {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
  }
}

.sidebar {
  flex: 1 1 300px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  min-width: 260px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 32px 0 16px 0;
  color: #1a3a5d;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
  flex: 1 1 220px;
  min-width: 220px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
}

/* CRITICAL OVERRIDE: Force full width cards on mobile categories */
@media (max-width: 768px) {
  body.category .card,
  body[class*="category"] .card,
  body.category #category-cards .card,
  body[class*="category"] #category-cards .card {
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    width: calc(100vw - 20px) !important;
    flex: none !important;
    margin: 0 0 20px 0 !important;
    box-sizing: border-box !important;
  }
  
  body.category .cards,
  body[class*="category"] .cards,
  body.category #category-cards,
  body[class*="category"] #category-cards {
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 10px !important;
    margin: 0 !important;
    gap: 0 !important;
  }
}

/* CRITICAL OVERRIDE: Force full width cards on mobile search */
@media (max-width: 768px) {
  body.search .card {
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    width: calc(100vw - 20px) !important;
    flex: none !important;
    margin: 0 0 20px 0 !important;
    box-sizing: border-box !important;
  }
  
  body.search .cards {
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 10px !important;
    margin: 0 !important;
    gap: 0 !important;
  }
}

.card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.card-content {
  padding: 16px;
  flex: 1 1 auto;
}

.card-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.card-meta {
  font-size: 0.9rem;
  color: #888;
}

.footer {
  text-align: center;
  padding: 24px 0;
  margin-top: 40px;
  color: #888;
  font-size: 0.95rem;
}

/* FORCE FULL WIDTH na kategoriach - wszystkie telefony */
@media (max-width: 768px) {
  body.category .cards,
  body[class*="category"] .cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.category #category-cards,
  body[class*="category"] #category-cards {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    gap: 0 !important;
  }
  
  body.category .card,
  body[class*="category"] .card,
  body.category #category-cards .card,
  body[class*="category"] #category-cards .card {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    flex: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-sizing: border-box !important;
  }
  
  body.category #category-cards .card-content,
  body[class*="category"] #category-cards .card-content {
    padding: 16px 12px !important;
  }
  
  /* Tytuł kategorii z paddingiem */
  body.category .main-content h1,
  body[class*="category"] .main-content h1 {
    padding: 16px 12px !important;
    margin: 0 0 16px 0 !important;
    font-size: 1.8rem !important;
  }
}

@media (max-width: 900px) {
  .sections {
    flex-direction: column;
    overflow: visible !important;
    height: auto !important;
  }
  .sidebar {
    min-width: 0;
    overflow: visible !important;
    height: auto !important;
  }
}

/* KRYTYCZNA POPRAWKA: Eliminacja osobnego scrolla postów */
@media (max-width: 768px) {
  body.home .sections,
  body.front-page .sections {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  
  body.home .main-content,
  body.front-page .main-content {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    flex: none !important;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 !important;
  }
  body.category .container,
  body[class*="category"] .container {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  body.category .main-content,
  body[class*="category"] .main-content {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  #category-cards {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    box-sizing: border-box !important;
  }
  #category-cards .card {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-sizing: border-box !important;
    background: #fff !important;
  }
  #category-cards .card-content {
    padding: 16px 12px !important;
  }
  #category-cards .card-image,
  #category-cards .card-image img {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    height: 180px !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
}

/* Zapobieganie poziomemu przewijaniu strony na mobile przez szerokie elementy */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Dodatkowe zabezpieczenia na mobile */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }
  
  .container, .main-content, .page-article, .search-results {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }
  
  /* Specjalne style dla stron kategorii na mobile */
  .main-content h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    word-wrap: break-word;
  }
  
  /* Na stronach kategorii - container na pełnej szerokości */
  body.category .container,
  body[class*="category"] .container {
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
  }
  
  body.category .main-content,
  body[class*="category"] .main-content {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 12px 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
  }
  
  /* Tytuł kategorii z paddingiem */
  body.category .main-content h1,
  body[class*="category"] .main-content h1 {
    padding: 0 12px;
    margin: 0 0 16px 0;
  }
  
  /* Ukryj sidebar na mobile w kategoriach */
  body.category .sidebar,
  body[class*="category"] .sidebar {
    display: none !important;
  }
  
  /* Karty w kategoriach - lepsze dopasowanie na mobile */
  #category-cards {
    width: 100vw;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    position: relative;
  }
  
  #category-cards .card {
    width: 100vw;
    max-width: 100vw;
    min-width: 100vw;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
    background: #fff;
  }
  
  /* Poprawki dla obrazków w kartach na mobile */
  #category-cards .card-image {
  position: relative;
  overflow: hidden;
  height: 180px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  }
  
  #category-cards .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  #category-cards .card-image.no-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
  
  #category-cards .placeholder-image {
    font-size: 3rem;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  
  #category-cards .reading-time {
  position: absolute;
  top: 8px;
  right: 20px;
  left: unset;
  z-index: 2;
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 6px 16px 6px 10px;
  border-radius: 6px 0 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  }
  
  /* Placeholder dla brakujących obrazków */
  #category-cards .no-thumb {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #category-cards .placeholder-image {
    font-size: 3rem;
    color: #94a3b8;
    opacity: 0.7;
  }
  
  #category-cards .card-content {
    padding: 16px 12px;
  }
  
  #category-cards .card-title {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 12px;
  }
  
  #category-cards .card-title a {
    color: #1a3a5d;
    text-decoration: none;
  }
  
  #category-cards .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
  }
  
  #category-cards .card-author {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  #category-cards .author-avatar {
    border-radius: 50%;
    width: 20px;
    height: 20px;
  }
  
  /* Hero sekcje na stronach kategorii też na pełnej szerokości */
  /* Hero sekcje na kategoriach */
  body.category .hero-stocks,
  body[class*="category"] .hero-stocks,
  body.category .hero-weather,
  body[class*="category"] .hero-weather,
  body.category .hero-calendar,
  body[class*="category"] .hero-calendar,
  body.category .hero-sport,
  body[class*="category"] .hero-sport {
    margin: 16px 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    padding: 24px 12px !important;
  }
  
  /* HERO MAIN na stronie głównej - SPECJALNE TRAKTOWANIE */
  body.home .hero-main,
  body.front-page .hero-main {
    margin: 16px 10px 0 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    border-radius: 12px !important;
    padding: 0 !important;
  }
}

/* Box sizing reset for predictable sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* MOBILNY PASEK DOLNY - zabezpieczenie przed białymi paskami */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    max-width: 100vw !important;
    width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    left: 0 !important;
    right: 0 !important;
  }
  
  /* Zapewnij, że body ma odpowiednią wysokość */
  body.mobile-nav-visible {
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  /* MOBILE MENU OVERLAY FIX */
  .mobile-menu-overlay {
    position: fixed !important;
    z-index: 9999 !important;
  }
  
  /* NAVIGATION ITEMS ON MOBILE */
  .main-nav {
    position: absolute !important;
    z-index: 1001 !important;
  }
}

/* Media osadzane i obrazki nie wykraczają poza kontener */
img, video, svg {
  max-width: 100%;
  height: auto;
}

/* 📈 HERO STOCKS - Ładne notowania giełdowe */
.hero-stocks {
  margin: 32px auto 0;
  max-width: 1000px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.hero-stocks::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60"><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
  animation: float 20s linear infinite;
  pointer-events: none;
}

@keyframes float {
  0% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
  100% { transform: translateX(-20%) translateY(-20%) rotate(360deg); }
}

.stocks-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}

.stocks-header h2 {
  color: white;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stocks-update {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
}

.stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  position: relative;
  z-index: 2;
}

.stock-card {
  background: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

.stock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.stock-card:hover::before {
  left: 100%;
}

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

.stock-card.up {
  border-left: 4px solid #22c55e;
}

.stock-card.down {
  border-left: 4px solid #ef4444;
}

.stock-card.neutral {
  border-left: 4px solid #6b7280;
}

.stock-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.stock-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
  font-family: 'Courier New', monospace;
}

.stock-change {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
}

.trend-icon {
  font-size: 1.2rem;
}

.trend-icon.up {
  color: #22c55e;
  animation: bounce-up 2s infinite;
}

.trend-icon.down {
  color: #ef4444;
  animation: bounce-down 2s infinite;
}

.trend-icon.neutral {
  color: #6b7280;
}

.change-value {
  font-size: 1.1rem;
}

.stock-card.up .change-value {
  color: #22c55e;
}

.stock-card.down .change-value {
  color: #ef4444;
}

.stock-card.neutral .change-value {
  color: #6b7280;
}

@keyframes bounce-up {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
  60% { transform: translateY(-2px); }
}

@keyframes bounce-down {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(4px); }
  60% { transform: translateY(2px); }
}

/* HERO MAIN - MOBILE RESPONSYWNOŚĆ - BACKUP RULES */
@media (max-width: 768px) {
  /* Dodatkowe zabezpieczenia dla hero na mobile - współpracują ze stylami z header.php */
  body.home .hero-main,
  body.front-page .hero-main {
    margin: 16px auto 0 auto !important;
    max-width: calc(100vw - 20px) !important;
    width: calc(100vw - 20px) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }
  
  /* Zapewnij że hero nie ma fixed height */
  body.home .hero-main-big,
  body.front-page .hero-main-big {
    height: auto !important;
    max-height: none !important;
  }
  
  body.home .hero-main-big img,
  body.front-page .hero-main-big img {
    height: 180px !important;
    max-height: 180px !important;
  }
}

/* Mobile responsywność dla stocks */
@media (max-width: 768px) {
  .hero-stocks {
    margin: 16px;
    padding: 24px 16px;
  }
  
  .hero-weather {
    margin: 16px 0 0 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 16px 10px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  .hero-calendar {
    margin: 16px 0 0 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 16px 10px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  .hero-sport {
    margin: 16px 0 0 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 16px 10px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  
  .stocks-header h2 {
    font-size: 1.6rem;
  }
  
  .stocks-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
  
  .stock-card {
    padding: 16px 12px;
  }
  
  .stock-price {
    font-size: 1.3rem;
  }
  
  .stock-name {
    font-size: 1rem;
  }
}

/* FINAL OVERRIDE: Ultimate Mobile Category Card Fix */
@media (max-width: 768px) {
  body.category .card,
  body[class*="category"] .card,
  body.category .cards .card,
  body[class*="category"] .cards .card,
  body.category #category-cards .card,
  body[class*="category"] #category-cards .card {
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    width: calc(100vw - 20px) !important;
    flex: none !important;
    margin: 0 0 20px 0 !important;
    box-sizing: border-box !important;
  }
  
  body.category .cards,
  body[class*="category"] .cards,
  body.category #category-cards,
  body[class*="category"] #category-cards {
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 10px !important;
    margin: 0 !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
  }
}

/* FINAL OVERRIDE: Search Results Mobile Fix */
@media (max-width: 768px) {
  body.search .search-results .card,
  body.search .card,
  .search-results .card {
    min-width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    width: calc(100vw - 20px) !important;
    flex: none !important;
    margin: 0 0 15px 0 !important;
    box-sizing: border-box !important;
  }
  
  body.search .search-results .cards,
  body.search .cards,
  .search-results .cards {
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 10px !important;
    margin: 0 !important;
    gap: 0 !important;
    overflow-x: hidden !important;
  }
  
  body.search .container {
    max-width: 100vw !important;
    width: 100vw !important;
    padding: 0 10px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}

/* ULTIMATE MOBILE SEARCH OVERLAY FIX */
@media (max-width: 768px) {
  .search-overlay {
    padding: 20px !important;
  }

  .search-container {
    max-width: calc(100vw - 40px) !important;
    width: calc(100vw - 40px) !important;
    margin: 0 !important;
    padding: 20px 15px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
  }
  
  .search-container form {
    flex-direction: column !important;
    gap: 15px !important;
    width: 100% !important;
  }
  
  .search-container input {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }
  
  .search-container button[type="submit"] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Mobile blur enhancement for cover title */
@media (max-width: 768px) {
  
  .cover-title-blur-bg {
    display: none !important;
  }
  
  .cover-title-new {
    text-shadow: 0 2px 12px rgba(0,0,0,0.9), 0 1px 4px rgba(0,0,0,0.7) !important;
    color: #ffffff !important;
  }
}