/* ============================================
   RESPONSIVE.CSS - Najświętsze Serce Jezusa
   Dodaje responsywność bez zmiany treści
   ============================================ */

/* ---- Viewport & Box reset ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  min-width: 0 !important;
}

/* ---- Główny wrapper - pełna szerokość ---- */
/* Wszystkie tabele 770px rozciągamy do 100% */
table[width="770"],
table[width="770px"] {
  width: 100% !important;
  max-width: 100% !important;
}

/* Obrazek nagłówkowy strony głównej */
img[width="770"] {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  display: block;
}

/* Tablice wewnętrzne - elastyczne */
table {
  max-width: 100%;
}

/* Obrazki wewnątrz treści nie wylewają się */
td img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   HAMBURGER MENU
   ============================================ */

/* Przycisk hamburger - domyślnie ukryty */
#hamburger-btn {
  display: none;
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 9999;
  background: #8B0000;
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

#hamburger-btn span {
  display: block;
  width: 26px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

/* Szuflada z menu bocznym */
#mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  box-shadow: -3px 0 12px rgba(0,0,0,0.25);
  z-index: 9998;
  overflow-y: auto;
  transition: right 0.3s ease;
  padding: 60px 0 20px;
}

#mobile-nav.open {
  right: 0;
}

/* Overlay za menu */
#nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9997;
}

#nav-overlay.open {
  display: block;
}

#mobile-nav h3 {
  background: #8B0000;
  color: #fff;
  margin: 0;
  padding: 10px 16px;
  font-size: 13px;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  letter-spacing: 0.5px;
}

#mobile-nav a {
  display: block;
  padding: 10px 18px;
  color: #1a1a7c;
  text-decoration: none;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;
  border-bottom: 1px solid #eee;
}

#mobile-nav a:hover {
  background: #f5e8e8;
  color: #8B0000;
}

#mobile-nav .nav-section {
  background: #7F9CE5;
  color: #fff;
  padding: 8px 16px;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ============================================
   MEDIA QUERIES - Tablet i Mobile
   ============================================ */

/* Tablet: 768px i mniej */
@media (max-width: 768px) {

  /* Pokaż hamburger */
  #hamburger-btn {
    display: flex;
  }

  /* Pokaż szufladę menu */
  #mobile-nav {
    display: block;
  }

  /* Pasek górny z linkami - zmniejsz i zawijaj */
  p.RBOX {
    font-size: 11px !important;
    line-height: 1.8 !important;
    text-align: center !important;
    padding: 6px !important;
    word-break: break-word;
  }

  p.RBOX a {
    display: inline-block;
    margin: 2px 3px;
  }

  /* Ukryj panel prawy (nawigacja) na mobile - jest w hamburger menu */
  /* Panel prawy to ostatnia td w 3-kolumnowej tabeli index.php */
  td:has(> p.RBOXH) {
    display: none;
  }

  /* Lewa kolumna index.php - ukryj na małych ekranach */
  td:has(> p.LBOXH) {
    display: none;
  }

  /* Tabela 3-kolumnowa - layout pionowy */
  table[width="770"] tr {
    display: flex;
    flex-direction: column;
  }

  table[width="770"] td {
    width: 100% !important;
    display: block !important;
  }

  /* Odejmij od td[width] atrybuty inline */
  td[width="204"],
  td[width="174"],
  td[width="390"] {
    width: 100% !important;
  }

  /* Dekoracyjne td z black.gif - ukryj */
  td[width="1"],
  td[background="black.gif"],
  img[src="black.gif"] {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* Obrazek baner strony głównej */
  center > a > img[src="serce_jezusa.jpg"] {
    width: 100% !important;
    height: auto !important;
  }

  /* Obrazki sklepiku i banery */
  img[width="370"] {
    width: 100% !important;
    height: auto !important;
  }

  img[width="279"], img[width="430"] {
    max-width: 90% !important;
    height: auto !important;
  }

  /* iframe facebook - dopasuj szerokość */
  iframe {
    width: 100% !important;
    max-width: 100%;
  }

  /* Czcionki trochę większe na mobile */
  p, font.LBOX, .LBOX {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }

  /* Zwiększ padding treści */
  td.ramka, td.ramka2, .ramka, .ramka2 {
    padding: 10px !important;
  }

  /* Buttony - pełna szerokość */
  .button {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }

  /* Pasek górny - dodaj padding żeby hamburger nie zasłaniał */
  table[width="770"]:first-of-type {
    padding-right: 50px;
  }

  /* Tytuły stron */
  CENTER > STRONG > FONT[SIZE="+2"],
  center > strong > font {
    font-size: 18px !important;
  }
}

/* Małe telefony: 480px i mniej */
@media (max-width: 480px) {

  p.RBOX {
    font-size: 10px !important;
  }

  p, font.LBOX {
    font-size: 13px !important;
  }

  img[width="279"], img[width="430"] {
    max-width: 100% !important;
  }

  /* Tabela nawigacyjna górna - jeden wiersz wrapping */
  table[width="770"] tr {
    flex-wrap: wrap;
  }
}

/* ============================================
   DESKTOP: szerokość 100%
   ============================================ */

@media (min-width: 769px) {

  /* Rozciągnij główne kontenery do 100% */
  center {
    max-width: 100%;
  }

  /* Tabele - pełna szerokość */
  table[width="770"] {
    width: 100% !important;
  }

  /* Kolumny desktop - proporcjonalnie */
  td[width="204"] {
    width: 22% !important;
  }

  td[width="390"] {
    width: 56% !important;
  }

  td[width="174"] {
    width: 20% !important;
  }

  /* Obrazki banerów - skaluj proporcjonalnie */
  img[width="370"] {
    width: 100% !important;
    height: auto !important;
    max-width: 370px;
  }
}

/* ============================================
   POWIĘKSZONE CZCIONKI - cała strona
   ============================================ */

/* Główny tekst akapitów */
p, P {
  font-size: 13pt !important;
  line-height: 1.7 !important;
}

/* Linki nawigacyjne górnego paska */
p.RBOX, .RBOX {
  font-size: 11pt !important;
}

/* Linki w treści */
a, a:link, a:visited, a:active, a:hover {
  font-size: 11pt !important;
}

/* Linki z klasą .kolor */
a.kolor, a.kolor:link, a.kolor:visited {
  font-size: 12pt !important;
}

/* Nagłówki artykułów (FONT SIZE="+2") */
CENTER > STRONG > FONT,
center > strong > font,
STRONG > FONT[SIZE="+2"],
strong > font[size="+2"] {
  font-size: 20pt !important;
}

/* Tytuły sekcji .naglowek */
.naglowek {
  font-size: 14pt !important;
}

/* Przyciski .button */
.button {
  font-size: 12pt !important;
}

/* Tagi FONT w treści */
font, FONT {
  font-size: inherit !important;
}

font.LBOX, FONT.LBOX {
  font-size: 13pt !important;
  line-height: 1.7 !important;
}

font.LBOXH2, FONT.LBOXH2 {
  font-size: 13pt !important;
}

font.LBOXH, FONT.LBOXH {
  font-size: 12pt !important;
}

/* Nagłówki H1 */
h1, H1 {
  font-size: 18pt !important;
}

/* Podstrony - tytuł sekcji RBOXH */
p.RBOXH, .RBOXH {
  font-size: 12pt !important;
}

/* Linki RBOX nawigacja prawa kolumna */
a.RIGHT, a.RIGHT:link, a.RIGHT:visited {
  font-size: 12pt !important;
}

/* Linki SMALL */
a.SMALL, a.SMALL:link, a.SMALL:visited {
  font-size: 11pt !important;
}

/* Tekst p.title (czerwone nagłówki) */
p.title {
  font-size: 13pt !important;
}

/* Mobile - dodatkowe powiększenie */
@media (max-width: 768px) {
  p, P, font.LBOX, FONT.LBOX {
    font-size: 15pt !important;
    line-height: 1.75 !important;
  }

  a, a:link, a:visited {
    font-size: 13pt !important;
  }

  p.RBOX {
    font-size: 12pt !important;
  }

  #mobile-nav a {
    font-size: 15px !important;
    padding: 12px 18px !important;
  }
}
