:root {
  --bg-main: #0a102e;           /* tło całej strony */
  --bg-dark: #141a3b;           /* sidebar, header, sekcje */
  --bg-content: #141a3b;        /* główna treść */
  --bg-card: #1c234f;           /* karty wpisów */

  --accent-yellow: #ffd447;     /* neonowy żółty akcent */
  --link-color: #7aa2ff;        /* niebieskie linki */
  --text-light: #e0e4f5;        /* zwykły tekst */
  --text-dark: #ffffff;         /* nagłówki */

  --max-width: 1400px;
}

/* ====================== BASE / RESET ====================== */
body {
  font-family: "Courier New", monospace;
  background: var(--bg-main);
  color: var(--text-light);
  margin: 0;
  line-height: 1.5;
}

/* warstwa z gwiazdami */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/imgs/stars.gif");
  background-repeat: repeat;
  background-size: 300px;
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

/* ====================== HEADER ====================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-dark);
  padding: 5px 20px;
}

.site-header img {
    image-rendering: pixelated;
}

.menu {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}

.menu a:hover {
  color: var(--accent-yellow);
}

.menu-toggle {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
}

/* ====================== LAYOUT ====================== */
.layout {
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
}

.layout.two-cols {
  grid-template-columns: 1fr 250px;
}

.sidebar {
  background: var(--bg-dark);
  padding: 15px;
  border: 2px solid var(--accent-yellow);
}

.box {
  margin-bottom: 20px;
}

.box h3 {
  margin: 0 0 10px;
  border-bottom: 1px solid #444;
  padding-bottom: 5px;
  color: var(--accent-yellow);
}

.content {
  background: var(--bg-content);
  padding: 20px;
}

.content img,
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

.page h1 {
  font-size: 2em;
  margin: 0.5em 0 1em;
}

/* ====================== BLOG GRID ====================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.blog-entry {
  background: var(--bg-card);
  color: var(--text-light);
  padding: 15px;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-entry:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 212, 71, 0.3);
}

.blog-entry .title-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  display: block;
  margin-bottom: 10px;
}

.blog-entry h2 {
  margin: 10px 0 5px;
  font-size: 1.4rem;
  color: var(--text-dark);
}

.blog-entry .meta {
  font-size: 0.9rem;
  color: var(--accent-yellow);
  margin-bottom: 10px;
}

/* ====================== PRZEPISY GRID ====================== */
.przepisy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.przepis-entry {
  background: var(--bg-card);
  color: var(--text-light);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.przepis-entry:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(255, 212, 71, 0.3);
}

.przepis-entry img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  margin-bottom: 10px;
}

.przepis-entry h2 {
  font-size: 1.2rem;
  margin: 0;
}

/* ====================== RETRO BANNER ====================== */
.banner-wrapper {
  max-width: var(--max-width);
  margin: 20px auto;
  padding: 0 20px;
}

.retro-banner {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px var(--accent-yellow);
  animation: screenflicker 0.15s infinite;
  aspect-ratio: 960 / 250;
}

.retro-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(110%) saturate(120%);
}

.retro-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.25) 0px,
    rgba(0,0,0,0.25) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  animation: scanmove 6s linear infinite;
  z-index: 1;
}

.retro-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  
  font-size: clamp(1.5rem, 5.3vw, 3.85rem);   /* wcześniej 8vw → teraz 5.8vw */
  padding: 0 7vw;                             /* więcej miejsca po bokach */
  
  color: var(--accent-cyan-bright);
  text-shadow:
    2px 2px 0 magenta,
    -2px -2px 0 yellow,
    0 0 10px cyan;
  
  animation: flicker 3s infinite;
  z-index: 2;
  
  /* white-space: nowrap; */
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.retro-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
}

/* ====================== ANIMATIONS ====================== */
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.4; }
}

@keyframes scanmove {
  from { background-position: 0 0; }
  to   { background-position: 0 100px; }
}

@keyframes screenflicker {
  0%   { opacity: 0.98; }
  50%  { opacity: 1; }
  100% { opacity: 0.99; }
}

/* ====================== FOOTER ====================== */
.site-footer {
  background: var(--bg-dark);
  color: var(--accent-yellow);
  text-align: center;
  padding: 20px;
  border-top: 2px solid var(--accent-yellow);
  margin-top: 40px;
}

.site-footer a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--accent-yellow);
  text-decoration: underline;
}

/* ====================== GENERAL LINKS & COMPONENTS ====================== */
a {
  color: var(--link-color);
  text-decoration: none;
  border-radius: 0.3em;
  transition: color 0.2s, border-color 0.2s;
}

a:visited {
  color: var(--link-color);
}

a:hover {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

.about-photo {
  width: 100%;
  max-width: 180px;
  display: block;
  margin: 0 auto 15px;
  animation: photoTilt 1s infinite steps(1);
  transform-origin: center;
}

@keyframes photoTilt {
  0%   { transform: rotate(-3deg); }
  50%  { transform: rotate(7deg); }
  100% { transform: rotate(-7deg); }
}

/* Goodreads widget */
#gr_custom_widget_1771685601 .gr_custom_container_1771685601 {
  background-color: var(--bg-dark) !important;
  color: var(--text-light) !important;
  width: 95% !important;
}

/* Details / summary */
details {
  background: var(--bg-card);
  border: 2px solid var(--accent-yellow);
  padding: 10px;
  margin: 15px 0;
  border-radius: 4px;
}

summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--accent-yellow);
}

details[open] {
  box-shadow: 0 0 10px var(--accent-yellow);
}

/* Social links */
.social-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-links li {
  margin-bottom: 10px;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s, transform 0.2s;
}

.social-links a:hover {
  color: var(--accent-yellow);
  transform: translateX(4px);
}

.social-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 900px) {
  .layout,
  .layout.two-cols {
    grid-template-columns: 1fr !important;
  }

  .sidebar.left  { order: 2; }
  .content       { order: 1; }
  .sidebar.right { order: 3; }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .przepisy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    background: var(--bg-dark);
    padding: 10px;
    border: 1px solid #333;
    z-index: 1000;
  }

  .menu.show {
    display: flex;
  }

  .menu a {
    margin: 10px 0;
  }

  .menu-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  .przepisy-grid {
    grid-template-columns: 1fr;
  }
}

/* ====================== FOOTER BADGES 88x31 ====================== */
.footer-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0px;
  margin-top: 15px;
}

.footer-badges a {
  display: block;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.footer-badges img {
  display: block;
  width: 88px;
  height: 31px;
  image-rendering: pixelated;        /* super ważne przy retro gifach */
  image-rendering: crisp-edges;
  transition: inherit;
}

.footer-badges a:hover img {
  transform: scale(1.12) translateY(-3px);
  filter: brightness(1.25);
  border-color: var(--accent-yellow);
}