/* css/blog.css - Wersja "Magazynowa" (Split View) */

/* 1. Import czcionki */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap");

/* 2. Zmienne */
:root {
  --bg-color: #1e1e26;
  --nav-color: #24252a;
  --box-color: #4a4a5a;
  --cta-color: #e10600;
  --text-color: #edf0f1;
  --nav-h: 76px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  scroll-behavior: smooth;
}

body {
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5 {
  color: #fff;
}

/* 3. Nawigacja */
header.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background-color: var(--nav-color) !important;
  z-index: 2000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.navbar-brand a {
  color: #edf0f1 !important;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.2rem;
}
.navbar-nav .nav-link {
  color: #fff !important;
  font-weight: 500;
  padding: 0.6rem 0.8rem;
  transition: color 0.3s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--cta-color) !important;
}

/* 4. Sekcja Bloga */
.blog-page-section {
  padding: 3rem 0;
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.blog-page-section .container {
  position: relative;
  z-index: 2;
  width: 100%;
}
.blog-intro {
  text-align: center;
  color: #bbb;
  max-width: 600px;
  margin: 0 auto 3rem auto;
  line-height: 1.6;
}

/* 5. Kontener kafelków */
.blog-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  width: 100%;
  padding-bottom: 2rem;
}

/* 6. Kafelki (Lista wpisów) */
.blog-card {
  background-color: var(--box-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
  height: auto;
  position: relative;
  z-index: 2;
}
.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border-color: var(--cta-color);
}

.blog-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.3s;
}
.blog-card:hover .blog-card-img {
  opacity: 0.9;
}

.blog-card-body {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.blog-date {
  color: var(--cta-color);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.blog-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: #fff;
}
.blog-summary {
  font-size: 0.95rem;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}
.blog-read-more {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
  margin-top: auto;
}
.blog-card:hover .blog-read-more {
  color: var(--cta-color);
}

/* 7. Stopka */
footer {
  background-color: var(--nav-color);
  text-align: center;
  padding: 2rem;
  color: #888;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
  position: relative;
  z-index: 2;
}

/* =========================================
   8. MODAL BLOGOWY (LAYOUT MAGAZYNOWY)
   ========================================= */

.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

/* Kontener modala - definiujemy CSS Grid */
.blog-modal-content {
  background-color: var(--bg-color);
  width: 95%;
  max-width: 1100px; /* Szerszy modal dla układu poziomego */
  height: 85vh; /* Wysokość okna */
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  overflow: hidden;

  /* GRID - Domyślnie (Mobile) jedna kolumna */
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr auto; /* Img | Header | Content | Footer */
  position: relative;
}

/* Obrazek - Na mobile jest paskiem na górze */
.blog-hero-img {
  width: 100%;
  height: 200px; /* Mała wysokość na mobile */
  object-fit: cover;
  display: block;
}

/* Nagłówek (Data i Tytuł) */
.blog-header {
  padding: 1.5rem 2rem 0.5rem 2rem;
  background-color: var(--bg-color);
}

/* Treść - Scrollowana */
.blog-text-content {
  padding: 0 2rem 2rem 2rem;
  overflow-y: auto; /* Scrolluje się tylko tekst */
  color: #ddd;
  line-height: 1.8;
  font-size: 1.05rem;
  background-color: var(--bg-color);
}

/* Przycisk na dole - POPRAWKA: Wyśrodkowany na mobile */
.modal-footer-btn {
  padding: 1rem;
  background-color: var(--bg-color);
  text-align: center; /* Domyślnie środek (dla telefonów) */
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Stylizacja treści */
.blog-text-content h3 {
  color: #fff;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
  border-left: 4px solid var(--cta-color);
  padding-left: 15px;
}
.blog-text-content p {
  margin-bottom: 1.2rem;
}
.blog-text-content ul {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}
.blog-text-content li {
  margin-bottom: 0.5rem;
}

/* Przycisk X */
.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 32px;
  cursor: pointer;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border: none;
  z-index: 20;
  transition: 0.3s;
}
.close-btn:hover {
  background-color: var(--cta-color);
}

.btn-submit {
  padding: 10px 30px;
  background-color: var(--cta-color);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.btn-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* --- UKŁAD DLA KOMPUTERÓW (SPLIT VIEW) --- */
@media (min-width: 900px) {
  .blog-modal-content {
    /* Dwie kolumny: Zdjęcie (40%) | Treść (reszta) */
    grid-template-columns: 40% 1fr;
    grid-template-rows: auto 1fr auto; /* Header | Content | Footer */
  }

  /* Zdjęcie zajmuje całą lewą kolumnę (od góry do dołu) */
  .blog-hero-img {
    grid-column: 1; /* Pierwsza kolumna */
    grid-row: 1 / -1; /* Od pierwszej do ostatniej linii wierszy */
    height: 100%; /* Pełna wysokość */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Elementy tekstowe idą do prawej kolumny */
  .blog-header {
    grid-column: 2;
    grid-row: 1;
    padding-top: 3rem; /* Więcej oddechu od góry */
  }

  .blog-text-content {
    grid-column: 2;
    grid-row: 2;
    padding-right: 3rem; /* Margines dla scrollbara */
  }

  .modal-footer-btn {
    grid-column: 2;
    grid-row: 3;
    text-align: right; /* Na komputerze guzik wraca na prawo */
  }

  /* Przycisk X na desktopie może być przezroczysty */
  .close-btn {
    background: transparent;
    color: #aaa;
    top: 10px;
    right: 15px;
  }
  .close-btn:hover {
    color: var(--cta-color);
    background: transparent;
  }
}
