@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Space+Mono:wght@400;700&display=swap");

:root {
  --background: #f7f7f4;
  --surface: #ecece7;
  --surface-hover: #deded7;
  --text: #171717;
  --muted: #666660;
  --border: #cfcfc7;
  --accent: #1d4ed8;

  /* Maksymalna szerokość całej treści po prawej stronie. */
  --content-width: 1180px;
  --text-width: 120ch;
}

html[data-theme="dark"] {
  --background: #141414;
  --surface: #202020;
  --surface-hover: #2c2c2c;
  --text: #f2f2ed;
  --muted: #aaa9a2;
  --border: #3b3b3b;
  --accent: #8ab4ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  transition: background-color 0.2s ease, color 0.2s ease;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

pre {
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 16px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 15%) minmax(0, 85%);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 28px 18px 24px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-top: 8px;
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.logo img {
  display: block;
  width: min(100%, 110px);
  height: auto;
}

.menu {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.menu a {
  display: block;
  padding: 13px 14px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 18px;
  line-height: 1.55;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.menu a:hover,
.menu a:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.menu a.active {
  border-left-color: var(--accent);
  background: var(--surface-hover);
  font-weight: 700;
}


/* =========================================================
   MENU ROZWIJANE — O NAS
   ========================================================= */

.menu-group {
  display: flex;
  flex-direction: column;
}

.menu-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 18px;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.menu-parent:hover,
.menu-parent:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.menu-parent.active {
  border-left-color: var(--accent);
  background: var(--surface-hover);
  font-weight: 700;
}

.submenu-arrow {
  margin-left: 10px;
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.menu-parent[aria-expanded="true"] .submenu-arrow {
  transform: rotate(90deg);
}

.submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 8px 16px;
}

.submenu.open {
  display: flex;
}

.menu .submenu a {
  padding: 8px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 5px 5px 0;
  font-size: 15px;
  line-height: 1.4;
}

.menu .submenu a.active {
  border-left-color: var(--accent);
  background: var(--surface-hover);
  font-weight: 700;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  font-family: "Space Mono", monospace;
  font-size: 16px;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--surface-hover);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.main-column {
  min-width: 0;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;

  display: flex;
  flex-direction: column;

  width: 100%;
  min-width: 0;

  padding: clamp(36px, 4vw, 72px);
}

.content:focus {
  outline: none;
}

.page {
    width: min(100%, var(--content-width));
    margin: 0 auto;
    flex: 1;
}

.page a.mail-link {
  color: var(--text);
  text-decoration: none;
}

.page a.mail-link:hover,
.page a.mail-link:focus-visible {
  color: var(--text);
  text-decoration: none;
    font-weight: 500;
}
.page a[href^="mailto:"] {
  color: var(--text);
  text-decoration: none;
}

.footer {
  width: 100%;
  margin-top: auto;
  padding: 24px clamp(36px, 4vw, 72px) 30px;

  border-top: 1px solid var(--border);

  color: var(--muted);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.page,
.loader,
.error {
  width: min(100%, var(--content-width));
  margin: 0 auto;
}

.page h1,
.page h2,
.page h3 {
  font-family: "Space Mono", monospace;
  overflow-wrap: anywhere;
}

.page h1 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 3vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.page h2 {
  margin: 1.7em 0 0.8em;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.3;
}

.page h3 {
  margin: 1.2em 0 0.7em;
  font-size: 1.2rem;
  line-height: 1.4;
}

.page p,
.page li {
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

.page p {
  max-width: var(--text-width);
  margin: 0 0 1.4em;
  overflow-wrap: anywhere;
  text-align: justify;
  text-justify: inter-word;
  text-indent: 1em;
}

.page ul,
.page ol {
  max-width: 92ch;
  padding-left: 1.4em;
}

.page a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.loader,
.error {
  color: var(--muted);
}

.error {
  color: #b42318;
}


@media (max-width: 1000px) {
  .layout {
    grid-template-columns: minmax(210px, 24%) minmax(0, 76%);
  }

  .content {
    padding: 42px 34px 64px;
  }

  .page p,
  .page li {
    font-size: 16px;
  }
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 100;
    top: 0;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "logo actions"
        "menu menu";

    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }


.logo {
    grid-area: logo;

    justify-self: start;

    margin: 0;
}

.logo img {
    width: 70px;
}
  .menu {
    grid-area: menu;

    display: grid;
    grid-template-columns:
      max-content
      max-content
      max-content
      max-content;

    align-items: center;
    justify-content: start;

    column-gap: 4px;
    row-gap: 6px;

    width: 100%;

    overflow-x: auto;
    overflow-y: visible;

    scrollbar-width: none;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .header-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .socials {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    gap: 8px;
  }

  .menu a {
    padding: 8px 10px;
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    font-size: 15px;
    white-space: nowrap;
  }

  .menu a.active {
    border-bottom-color: var(--accent);
  }

  /*
   * Na mobile kontener "O nas" nie tworzy osobnego pudełka.
   * Dzięki display: contents przycisk "O nas" oraz submenu
   * zachowują się jak bezpośrednie elementy .menu.
   */
  .menu-group {
    display: contents;
  }

  .menu-parent {
    flex: 0 0 auto;

    width: auto;
    height: auto;

    padding: 8px 10px;

    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;

    font-size: 15px;
    white-space: nowrap;
  }

  .menu-parent.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .submenu-arrow {
    margin-left: 5px;
    font-size: 15px;
  }

  /*
   * Podmenu jest częścią normalnego układu dokumentu.
   * Nie używamy position: absolute, więc po rozwinięciu
   * zwiększa wysokość nagłówka i nie zasłania treści strony.
   */
  .submenu {
    display: none;

    position: static;

    grid-column: 1 / -1;
    width: 100%;

    margin: 6px 0 0;
    padding: 8px 0 0;

    flex-direction: row;
    justify-content: flex-start;
    align-items: center;

    gap: 6px;

    background: transparent;

    border-top: 1px solid var(--border);
    border-bottom: 0;

    box-shadow: none;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: thin;
  }

  .submenu.open {
    display: flex;
  }

  .menu .submenu a {
    flex: 0 0 auto;

    padding: 8px 12px;

    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;

    font-size: 14px;
    white-space: nowrap;
  }

  .menu .submenu a.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
    background: var(--surface-hover);
  }

  .theme-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
  }

  .theme-label {
    display: none;
  }

  .content {
    padding: 38px 22px 60px;
  }

  .page h1 {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
  }

  .page p,
  .page li {
    max-width: none;
    font-size: 16px;
    line-height: 1.7;
  }
}

@media (max-width: 560px) {
  .sidebar {
    grid-template-columns: 1fr auto;
  }

  .menu {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 2px;
  }

  .theme-toggle {
    justify-self: end;
  }

  .content {
    padding-inline: 18px;
  }

  .submenu {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .photo-gallery {
    grid-template-columns: 1fr;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* =========================================================
   TREŚĆ PODSTRON — SEKCJE, ZDJĘCIA I OBLEWANIE TEKSTEM
   ========================================================= */

/* Każdy opis działania warto umieścić w osobnym <section>. */
.page section,
.page .article-section {
  display: flow-root;
  margin: 0 0 70px;
}

.page section:last-child,
.page .article-section:last-child {
  margin-bottom: 0;
}

/* Wariant bez podpisu: <img class="article-image left"> */
.article-image {
  display: block;
  width: auto;
  max-width: 38%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgb(0 0 0 / 14%);
}

.article-image.left {
  float: left;
  margin: 0 30px 20px 0;
}

.article-image.right {
  float: right;
  margin: 0 0 20px 30px;
}

/* Wariant z podpisem:
   <figure class="article-figure left">
     <img ...>
     <figcaption>...</figcaption>
   </figure>
*/
.article-figure,
.figure {
  width: min(38%, 460px);
  margin-top: 0;
  margin-bottom: 22px;
}

.article-figure.left,
.figure.left {
  float: left;
  margin-right: 30px;
  margin-left: 0;
}

.article-figure.right,
.figure.right {
  float: right;
  margin-right: 0;
  margin-left: 30px;
}

.article-figure img,
.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgb(0 0 0 / 14%);
}

.article-figure figcaption,
.figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

/* Pomocnicze ręczne zakończenie oblewania, gdy nie używasz <section>. */
.clear,
.clearfix {
  clear: both;
}

/* Na mniejszych ekranach zdjęcia przechodzą nad tekst. */
@media (max-width: 900px) {
  .article-image,
  .article-image.left,
  .article-image.right,
  .article-figure,
  .article-figure.left,
  .article-figure.right,
  .figure,
  .figure.left,
  .figure.right {
    float: none;
    width: min(100%, 460px);
    max-width: 100%;
    margin: 0 auto 24px;
  }

  .page section,
  .page .article-section {
    margin-bottom: 52px;
  }
  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

}

/* =========================================================
   DUŻE ZDJĘCIA — NA SZEROKOŚĆ TEKSTU
   ========================================================= */

.wide-figure {
  width: min(100%, var(--text-width));
  margin: 2.2em auto;
}

.wide-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;

  border-radius: 10px;
  box-shadow: 0 8px 22px rgb(0 0 0 / 14%);
}

.wide-figure figcaption {
  margin-top: 8px;

  color: var(--muted);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.socials {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin: 24px 0;
}

.socials a {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    color: var(--text);
    text-decoration: none;

    border-radius: 50%;

    transition: all .2s ease;
}

.social-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.socials a.facebook:hover {
    color: #1877F2;
}

.socials a.instagram:hover {
    color: #E1306C;
}
/* =========================================================
   GALERIA ZDJĘĆ
   ========================================================= */

.photo-gallery {

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    width: min(100%, var(--text-width));
    margin: 2.5em auto;
}

.photo-gallery figure {
    margin: 0;
}

.photo-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgb(0 0 0 / 14%);
    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.photo-gallery img:hover {
    transform: scale(1.00);
    box-shadow: 0 12px 28px rgb(0 0 0 / 20%);
}

.photo-gallery figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

/* Stan nieaktywnego social media. */
.socials a.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

/* =========================================================
   LOGOTYPY PARTNERÓW / MECENASÓW
   ========================================================= */

.logo-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;

  width: min(100%, var(--text-width));
  margin: 2.5em auto;
}

.logo-gallery .logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;

  min-height: 180px;
  margin: 0;
  padding: 20px;

  background: #fff;
  border-radius: 8px;
}

.logo-gallery .logo-item img {
  display: block;

  max-width: 100%;
  max-height: 110px;

  width: auto;
  height: auto;

  object-fit: contain;
}

.logo-gallery .logo-item figcaption {
  margin-top: 14px;

  color: #171717;
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}
/* =========================================================
   STRONA GŁÓWNA — LOGO
   ========================================================= */

.home-page {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 100%;
}

.home-logo {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
}

.home-logo img {
  display: block;

  width: min(100%, 900px);
  height: auto;

  object-fit: contain;
}

/* =========================================================
   RESPONSYWNOŚĆ GALERII ZDJĘĆ I LOGOTYPÓW

   Te reguły są celowo na końcu pliku, żeby miały pierwszeństwo
   przed bazowymi definicjami galerii.
   ========================================================= */

@media (max-width: 900px) {
  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .logo-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .logo-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .photo-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .logo-gallery {
    grid-template-columns: 1fr;
  }
}

