:root {
  --c-light: #ffeac5;
  --c-med-light: #ffdbb5;
  --c-medium: #6c4e31;
  --c-dark: #603f26;
  --c-bg: #2f1e16;
  --c-overlay: rgba(96, 63, 38, 0.7);
  --texture-bg: url("images/button-bg.jpg");
}

/* Reset stylów */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Akaya Kanadaka", sans-serif;
  text-transform: uppercase;
  color: var(--c-dark);
  background: url("images/tlo1.jpeg") no-repeat center center fixed;
  background-size: cover;
  min-width: 1200px;
  /* Zapobiega poziomym suwakom przy animacjach */
  overflow-x: hidden; 
}

/* --- UKŁAD STRONY (KONTENERY) --- */

/* BLOK 1: GÓRA */
.top-section {
  width: 1200px;
  margin: 50px auto 30px auto; 
  background-color: var(--c-light);
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* BLOK 2: TREŚĆ */
.main-section {
  width: 1200px;
  margin: 0 auto 30px auto; 
  background-color: var(--c-light);
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* BLOK 3: ZEWNĘTRZNY DÓŁ */
.outside-container {
  width: 1200px;
  margin: 0 auto;
}

/* --- NAGŁÓWEK --- */
header {
  height: 250px;
  background: var(--texture-bg) repeat;
  background-size: cover;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.header-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--c-overlay); z-index: 1;
}

.header-content {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0 20px;
}

header h1 {
  color: var(--c-light); font-size: 44px; text-align: center;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}
header h1 span { font-size: 30px; display: block; }

/* OBRAZKI W NAGŁÓWKU */
.header-logo, .header-logo-right {
  width: 205px;
  height: 205px;
  position: relative;
}
.header-logo img, .header-logo-right img {
  width: 100%; height: 100%; object-fit: contain; 
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5));
}

.small-circle {
  position: absolute; bottom: -10px; right: -10px; 
  width: 95px;
  height: 95px;
}
.small-circle img { 
    box-shadow: none; border-radius: 0; 
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}

/* --- MENU GÓRNE --- */
.main-menu {
  background: var(--texture-bg);
  background-color: var(--c-medium);
  text-align: center;
  padding: 10px 0;
}
.main-menu ul { list-style: none; }
.main-menu li { display: inline-block; margin: 0 15px; }
.main-menu a {
  text-decoration: none; color: var(--c-light); font-weight: bold; font-size: 18px;
  padding: 5px 10px; transition: color 0.3s;
}
.main-menu a:hover { color: var(--c-med-light); }


/* --- UKŁAD GŁÓWNEJ TREŚCI --- */
.content-wrapper {
  display: flex;
  background-color: var(--c-light);
  padding: 20px 0; 
}

/* PANELE BOCZNE */
.sidebar {
  width: 300px;
  padding: 0 15px;
  flex-shrink: 0;
}
.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 12px; }

/* PRZYCISKI MENU BOCZNEGO */
.menu-button a {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  background: var(--texture-bg);
  background-color: var(--c-medium);
  border: 1px solid var(--c-dark);
  border-radius: 5px;
  padding: 10px;
  text-decoration: none;
  color: var(--c-light);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s, background-color 0.2s;
  height: 90px; 
}
.menu-button a:hover { transform: translateY(-2px); background-color: var(--c-dark); }
.menu-button { cursor: pointer; }

/* Ikona i tekst */
.button-icon { 
  width: 65px; height: 65px; flex-shrink: 0; margin-right: 15px; 
}
.button-icon img { width: 100%; height: 100%; object-fit: contain; }

.button-text { 
  font-size: 17px; line-height: 1.2; text-align: left; flex: 1; font-weight: normal; 
}

/* --- ROZWIJANE MENU (AKORDEON) --- */
.submenu-container {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out, padding 0.5s, margin 0.5s;
  list-style: none;
  margin-bottom: 0;
  background-color: rgba(108, 78, 49, 0.1);
  border-radius: 5px;
  padding: 0 5px;
}

.submenu-container.open {
  max-height: 1000px; 
  opacity: 1;
  padding: 5px;
  margin-bottom: 10px;
}

.submenu-container li { margin-bottom: 5px; }
.submenu-container li:last-child { margin-bottom: 0; }

.submenu-link {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: var(--c-dark);
  font-weight: bold;
  font-size: 15px;
  border-bottom: 1px solid rgba(96, 63, 38, 0.2);
  transition: background-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.submenu-link:hover {
  background-color: var(--c-medium);
  color: var(--c-light);
  transform: translateX(5px);
  border-radius: 3px;
}

/* --- MENU PRAWE (ODWRÓCONE) --- */
.reversed-menu .menu-button a { flex-direction: row; }
.reversed-menu .button-text { text-align: left; }
.reversed-menu .button-icon { margin-right: 0; margin-left: 15px; }

/* --- ŚRODEK (PDF / GALERIA) --- */
.main-content {
  width: 600px;
  padding: 0; 
  background-color: var(--c-med-light);
  border-left: 1px solid #e0cda8;
  border-right: 1px solid #e0cda8;
  min-height: 600px;
}
#pdf-viewer canvas { display: block; }

/* --- GALERIA ZDJĘĆ --- */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 20px;
  align-items: start;
}

.gallery-item {
  width: 100%;
  height: auto; /* Pełny obrazek, bez przycinania */
  overflow: hidden;
  border-radius: 5px;
  border: 2px solid var(--c-dark);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.3s;
  background-color: #000;
}

.gallery-item:hover { transform: scale(1.03); }

.gallery-item img {
  width: 100%;
  height: auto; 
  display: block;
}

/* --- LIGHTBOX --- */
.lightbox {
  display: none; 
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.9);
  align-items: center; justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox-content {
  max-width: 90%; max-height: 90%;
  border: 5px solid var(--c-light);
  border-radius: 5px;
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.close-lightbox {
  position: absolute; top: 20px; right: 30px;
  color: #fff; font-size: 50px; font-weight: bold;
  cursor: pointer; transition: color 0.3s;
}
.close-lightbox:hover { color: var(--c-med-light); }


/* --- DOLNE MENU --- */
.bottom-menu {
  padding: 20px 0;
  text-align: center;
}

.logos-row {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 20px;
  padding: 0;
}

.logos-row li {
  width: 140px; height: 140px;
  background: transparent; 
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  transition: transform 0.3s;
}
.logos-row li:hover { transform: scale(1.1); }

.logos-row a { display: block; width: 100%; height: 100%; }
.logos-row img { 
    width: 100%; height: 100%; object-fit: contain; 
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.6)); 
}

.smaller-logos li { width: 100px; height: 100px; }

/* --- STOPKA --- */
footer {
  background: var(--texture-bg);
  background-color: var(--c-medium);
  color: var(--c-light);
  text-align: center;
  padding: 15px 0;
  margin-bottom: 30px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}