/* === Aktualności (oddzielna sekcja, pełny ekran) === */
.newsDeck-section{
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 40px var(--pad-x);
  color: #f5f5f5;
  text-align: center;
  isolation: isolate;
  overflow: clip;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.55)),
    radial-gradient(1200px 600px at 70% 30%, rgba(255,140,0,.25), transparent 60%),
    url("../Images/QubitBG.png") center / cover no-repeat;
}
.newsDeck-container{
  width: 100%;
  max-width: 1200px;        /* odstęp od lewego/prawego boku na dużych ekranach */
  margin: 0 auto;           /* wyśrodkowanie kontenera */
}
.newsDeck-title{
  margin: 0 0 clamp(22px, 3.5vw, 32px);
  font-size: clamp(30px, 5.2vw, 44px);
  background: linear-gradient(270deg, #b35400, #ff8800, #ffcc33, #b35400);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 8px rgba(179,84,0,.6);
  animation: sectionGradient 7s ease-in-out infinite; /* masz już @keyframes w GradienAndAnimation.css */
}

/* Grid: 1 kolumna mobile, 2 na desktopie */
.newsDeck-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.8vw, 24px);
}
@media (min-width: 900px){
  .newsDeck-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Karta */
.newsDeck-card{
  position: relative;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow:
    0 10px 28px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  cursor: pointer; /* cała karta klikalna (JS poniżej) */
}
.newsDeck-card:hover,
.newsDeck-card:focus-visible{
  transform: translateY(-2px);
  border-color: rgba(255,163,26,.65);
  box-shadow:
    0 12px 32px rgba(0,0,0,.5),
    0 0 0 1px rgba(255,163,26,.15) inset;
  outline: none;
}

/* Media – PNG/SVG z wyciętym tłem */
.newsDeck-media{
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 70% 30%, rgba(255,140,0,0.18), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.15));
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.newsDeck-media img{
  width: min(88%, 520px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.35));
}

/* Treść */
.newsDeck-body{
  padding: clamp(14px, 2.4vw, 18px) clamp(16px, 3vw, 22px) clamp(16px, 3vw, 22px);
  color: #f0f0f0;
  text-align: left;
}
.newsDeck-cardTitle{
  margin: 0 0 6px;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 800;
  background: linear-gradient(270deg, #b35400, #ff8800, #ffcc33, #b35400);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 8px rgba(179,84,0,.45);
  animation: sectionGradient 7s ease-in-out infinite;
}
.newsDeck-excerpt{
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.55;
  color: #e8e8e8;
  opacity: .95;
}


.newsDeck-btn {
  display: inline-block;
  padding: 16px 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff8800, #ffcc33);
  color: #111;
  font-weight: 800;
  text-decoration: none;
  font-size: 18px;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
  text-align: center;
}
.newsDeck-btn:hover {
  background: linear-gradient(135deg, #ffcc33, #ff8800);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}



/* A11y i „kotwica” pod stały header */
.newsDeck-card{ scroll-margin-top: calc(var(--header-h) + 8px); }
@media (prefers-reduced-motion: reduce){
  .newsDeck-card, .newsDeck-btn, .newsDeck-title{ transition:none; animation:none; }
}

/* === FIX: równe media + brak nachodzenia na tekst === */

/* Stały box na grafikę; obraz jest wyśrodkowany i NIE może wyjść poza box */
.newsDeck-media{
  height: clamp(240px, 30vh, 320px);
  aspect-ratio: auto !important;   /* nadpisuje wcześniejsze 16/9 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;                 /* klucz: nic nie wystaje na treść poniżej */
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Obraz dopasowany do boxu – bez rozciągania, bez wychodzenia */
.newsDeck-media img{
  display: block;
  max-width: 90%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;              /* 640×640 i 640×427 mieszczą się elegancko */
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.35));
}

/* Karta = kolumna; treść rozpycha się, a przycisk jest zawsze na dole */
.newsDeck-card{
  display: flex;
  flex-direction: column;
}
.newsDeck-body{
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.newsDeck-excerpt{ flex: 1; }       /* amortyzuje różną długość tekstu */
.newsDeck-btn{ margin-top: auto; }  /* przycisk ląduje przy dolnej krawędzi */

/* W jednym wierszu wszystkie karty mają tę samą wysokość */
.newsDeck-grid{ align-items: stretch; }

/* Opcjonalnie: minimalna wysokość karty na desktopie dla idealnego wyrównania */
@media (min-width: 900px){
  .newsDeck-card{ min-height: 520px; }
}

