/* layout.css */

/* — Featured carousel on homepage — */
.featured-carousel {
  margin-bottom: 20px;
  background: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.carousel-container {
  display: flex;
  overflow: hidden;
}
.carousel-item {
  min-width: 100%;
  text-align: center;
  position: relative;
}
.carousel-item img {
  width: 100%;
  border-radius: 5px;
}
.carousel-title {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.5);
  color: #fff;
  padding: 5px 10px;
  border-radius: 3px;
}

/* — Grid najnowszych wpisów — */
.latest-posts .posts-grid-wrapper {
  width: 940px;
  max-width: 100%;
  margin: 0 auto;
}
.latest-posts .posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  gap: 20px;
  justify-content: center;
}
.latest-posts .post-card {
  display: block;
  width: 300px;
  background: #f8f8f8;
  border-radius: 10px;
  overflow: hidden;
}
.latest-posts .post-card a {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
}
.latest-posts .post-card img {
  width: 100%;
  height: 168.75px;
  object-fit: cover;
  display: block;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}
.latest-posts .post-card-title {
  padding: 10px;
  color: #000;
  font-size: 1em;
  text-align: left;
  box-sizing: border-box;
  font-weight: bold;
}

/* — Reklamy w siatce wpisów (kafelek “ad”) — */
.latest-posts .post-card--ad {
  width: 300px;
  background: #f0f0f0;
  font-style: italic;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-radius: 10px;
}
.latest-posts .post-card--ad .adsense-placeholder {
  width: 300px;
  height: 250px;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}
.latest-posts .post-card--ad .ad-label {
  width: 100%;
  font-size: 0.8em;
  color: #777;
  font-style: italic;
  text-align: center;
  height: 32px;
  line-height: 32px;
}

/* — Duże kafelki (grid-featured) — */
.latest-posts .post-card--large-left,
.latest-posts .post-card--large-right {
  position: relative;
  display: block;
  width: 620px;
  height: 282px;
  overflow: hidden;
  border-radius: 10px;
}
.latest-posts .post-card--large-left a,
.latest-posts .post-card--large-right a {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
  position: relative;
}
.latest-posts .post-card--large-left {
  grid-column: 1 / span 2;
}
.latest-posts .post-card--large-right {
  grid-column: 2 / span 2;
}
.latest-posts .post-card--large-left img,
.latest-posts .post-card--large-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.latest-posts .post-card--large-left .post-card-title,
.latest-posts .post-card--large-right .post-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1em;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: #fff;
  text-align: left;
  font-size: 1.2em;
  box-sizing: border-box;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  font-weight: bold;
}

/* — Responsywność siatki wpisów — */
@media (max-width: 960px) {
  .latest-posts .posts-grid-wrapper {
    width: 100%;
    padding: 0 10px;
  }
  .latest-posts .posts-grid {
    grid-template-columns: 1fr;
  }
  .latest-posts .post-card,
  .latest-posts .post-card--ad,
  .latest-posts .post-card--large-left {
    width: 100%;
  }
}

/* ===== Cognimat Footer (revamped) ===== */
.site-footer {
  background: var(--dark-gray);
  color: #eee;
  margin-top: 48px;
}
.site-footer .footer-inner {
  max-width: calc(var(--post-width) + 2 * var(--sidebar-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 36px 24px 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 32px;
  align-items: start;
  border-top: 1px solid rgba(255,255,255,.08);
}
.site-footer .footer-nav { width: 100%; }

.site-footer .footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px 16px;
}
.site-footer .footer-links li { margin: 0; padding: 0; }

.site-footer .footer-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: background .2s ease, border-color .2s ease, transform .02s ease;
}
.site-footer .footer-links a:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
.site-footer .footer-links a:active {
  transform: translateY(1px);
}
.site-footer .footer-links a:focus {
  outline: 2px solid rgba(255,255,255,.25);
  outline-offset: 2px;
}

.site-footer .footer-copy {
  color: #cfcfcf;
  font-size: .95rem;
  opacity: 0.9;
  align-self: center;
  text-align: right;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 900px) {
  .site-footer .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .site-footer .footer-copy { text-align: left; white-space: normal; }
  .site-footer .footer-links { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 520px) {
  .site-footer .footer-links { grid-template-columns: 1fr; }
}

/* ===================================================================== */
/* ==========  COGNIMAT: Featured carousel v2 — overrides  ============= */
/* ===================================================================== */

/* Ustalanie wysokości i proporcji (desktop <=300px) */
.featured-carousel {
  --carousel-height: 300px;
  --carousel-gap: 20px;
  --carousel-radius: 10px;
}
.featured-carousel .carousel-container {
  display: flex;
  align-items: center;
  gap: var(--carousel-gap);
  will-change: transform;
  transition: transform .45s ease;
  overflow: visible; /* track może „wyjechać” wewnątrz parenta z overflow:hidden */
}
.featured-carousel .carousel-item {
  flex: 0 0 auto;
  height: var(--carousel-height);
  aspect-ratio: 1792 / 1024;            /* dopasowanie do 1792x1024 */
  border-radius: var(--carousel-radius);
  overflow: hidden;
  position: relative;
  filter: blur(.6px);
  opacity: .9;
  transform: scale(.985);
  transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}
.featured-carousel .carousel-item.is-active {
  filter: none;
  opacity: 1;
  transform: scale(1);
}
.featured-carousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* przy zachowaniu aspect-ratio nie ucina */
  display: block;
}

/* Tytuł na czarnym cieniu (zawsze przy dole kafelka) */
.featured-carousel .carousel-item .carousel-title {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  transform: none;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,.35), transparent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 0 0 var(--carousel-radius) var(--carousel-radius);
  text-align: left;
  font-weight: 700;
  line-height: 1.2;
  max-height: 48%;
  overflow: hidden;
}

/* Strzałki nawigacji */
.featured-carousel .carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 20px;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  z-index: 3;
}
.featured-carousel .carousel-arrow:hover { background: rgba(0,0,0,.6); }
.featured-carousel .carousel-arrow.prev { left: 8px; }
.featured-carousel .carousel-arrow.next { right: 8px; }

/* Pasek postępu (licznik sekund) */
.featured-carousel .carousel-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), #ffa64d);
  width: 0%;
  z-index: 2;
}

/* Mobile / tablet: jeden kafelek na pełną szerokość, wysokość do 500px */
@media (max-width: 991.98px) {
  .featured-carousel { --carousel-height: clamp(180px, 56vw, 500px); }
  .featured-carousel .carousel-container { gap: var(--carousel-gap); }
  .featured-carousel .carousel-item {
    flex-basis: 100%;
    max-height: 500px;
    height: auto;                 /* wyliczy się z aspect-ratio */
    aspect-ratio: 1792 / 1024;
  }
}
