/* ═══════════════════════════════════════════════════════════════════════════
   Jacek Trznadel — Stylesheet
   Paleta: ziemiste brązy + pergamin, bez tekstur JPG, CSS-only
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Zmienne ──────────────────────────────────────────────────────────────── */
:root {
  --e0: #1e1510;   /* najciemniejszy — stopka, pathway */
  --e1: #3a2718;   /* ciemny brąz — header */
  --e2: #5c3d24;   /* średni brąz — nav, sidebar-head */
  --e3: #8b6340;   /* ciepły brąz — akcenty, boratory */
  --e4: #c4a882;   /* jasno-złoty — obramowania */
  --e5: #dfd0b4;   /* piasek — sidebar bg */
  --e6: #f0e8d4;   /* pergamin — content bg */
  --e7: #f8f4ec;   /* jasny pergamin — hover tła */

  --txt:   #2a1e12;   /* tekst główny */
  --txt2:  #6b5438;   /* tekst drugorzędny */
  --lnk:   #7a3600;   /* linki */
  --lnkh:  #c46030;   /* linki hover */

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:  'Lato', 'Trebuchet MS', Arial, sans-serif;

  --wrap: 820px;
  --sb:   190px;
  --r:    3px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

/* ── Body / tło strony ────────────────────────────────────────────────────── */
body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--txt);
  line-height: 1.65;
  min-height: 100vh;

  /* Tło: ciemnobrązowy gradient + subtelna siatka CSS (bez JPG) */
  background-color: #5a4a34;
  background-image:
    linear-gradient(160deg, #4a3a26 0%, #6a5640 50%, #4e3e2a 100%),
    repeating-linear-gradient(
      0deg, transparent, transparent 3px,
      rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px
    ),
    repeating-linear-gradient(
      90deg, transparent, transparent 3px,
      rgba(0,0,0,0.03) 3px, rgba(0,0,0,0.03) 4px
    );
  background-attachment: fixed;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
#wrap {
  max-width: var(--wrap);
  margin: 20px auto 30px;
  background: var(--e6);
  box-shadow:
    0 2px 8px  rgba(0,0,0,0.35),
    0 8px 32px rgba(0,0,0,0.25);
  border-radius: var(--r);
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════════════ */
#site-header {
  background:
    linear-gradient(160deg, var(--e1) 0%, #4e3222 55%, var(--e2) 100%);
  position: relative;
  overflow: hidden;
}

/* Dekoracyjne "prześwietlenie" — bez obrazka */
#site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 75% 40%,
      rgba(180,130,70,0.18) 0%, transparent 70%);
  pointer-events: none;
}

#header-brand {
  display: flex;
  flex-direction: column;
  padding: 20px 22px 14px;
  position: relative;
}

#site-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: #f2e8d4;
  letter-spacing: 0.3px;
  line-height: 1;
  text-decoration: none;
}
#site-title:hover { color: var(--e4); }

#site-tagline {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #d4b890;
  margin-top: 5px;
}

/* ── Top nav ──────────────────────────────────────────────────────────────── */
#top-nav {
  background: rgba(0,0,0,0.28);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.35);
}
#top-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  padding: 0 10px;
}
#top-nav li + li {
  border-left: 1px solid rgba(255,255,255,0.10);
}
#top-nav a {
  display: block;
  padding: 7px 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #d4bea0;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
#top-nav a:hover {
  color: #f2e8d4;
  background: rgba(255,255,255,0.08);
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
#breadcrumb {
  background: var(--e0);
  padding: 5px 16px;
  font-size: 10.5px;
  color: #806858;
  border-bottom: 1px solid #0e0a06;
}
#breadcrumb a {
  color: #b09070;
  font-weight: 700;
  text-decoration: none;
}
#breadcrumb a:hover { color: #f2e8d4; }
.crumb-sep    { color: #5a4838; margin: 0 5px; }
.crumb-current { color: #c4a882; }

/* ══════════════════════════════════════════════════════════════════════════
   LAYOUT: sidebar + content
   ══════════════════════════════════════════════════════════════════════════ */
#layout {
  display: flex;
  align-items: flex-start;
}

/* ── SIDEBAR ──────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sb);
  flex-shrink: 0;
  background: var(--e5);
  border-right: 1px solid var(--e4);
  /* Minimalna wysokość by pasek był widoczny */
  min-height: 440px;
}

/* Zdjęcie: wkomponowane w tło gradientem na dole */
#photo-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--e1) 0%, var(--e2) 100%);
}
#author-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top center;
  opacity: 0.92;
  transition: opacity 0.3s;
}
#photo-wrap:hover #author-photo { opacity: 1; }

/* Gradient fade: zdjęcie płynnie przechodzi w tło sidebara */
#photo-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: linear-gradient(to bottom, transparent 0%, var(--e5) 100%);
  pointer-events: none;
}

/* Nagłówki sekcji sidebara */
.sb-head {
  background: linear-gradient(to right, var(--e2) 0%, var(--e3) 100%);
  color: #f2e8d4;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-bottom: 1px solid var(--e0);
}

/* Linki nawigacji bocznej */
#side-nav { padding-bottom: 2px; }

.sn-link {
  display: block;
  padding: 5px 8px 5px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--lnk);
  text-decoration: none;
  border-bottom: 1px solid #cfc0a4;
  line-height: 1.4;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.sn-link::before {
  content: '›';
  position: absolute;
  left: 8px;
  color: var(--e3);
  font-weight: 400;
}
.sn-link:hover {
  color: var(--lnkh);
  background: #cfc0a4;
}

/* Ostatnio czytane */
#most-read { margin-top: 6px; }
#most-read ul { list-style: none; padding: 4px 0; }
#most-read li {
  padding: 4px 10px 4px 18px;
  border-bottom: 1px solid #cfc0a4;
  line-height: 1.3;
  position: relative;
}
#most-read li::before {
  content: '·';
  position: absolute;
  left: 8px;
  color: var(--e3);
  font-weight: 700;
}
#most-read li a {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--lnk);
  text-decoration: none;
}
#most-read li a:hover { color: var(--lnkh); }

/* ── CONTENT ──────────────────────────────────────────────────────────────── */
#content {
  flex: 1;
  min-width: 0;
  padding: 14px 18px 24px;
  background: var(--e6);
}

/* ══════════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════════ */
#site-footer {
  background: var(--e0);
  padding: 9px 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #7a6050;
  border-top: 2px solid #100c08;
}
#site-footer a { color: #b09070; text-decoration: none; }
#site-footer a:hover { color: #f2e8d4; }
.ft-sep { color: #4a3828; margin: 0 8px; }

/* ══════════════════════════════════════════════════════════════════════════
   TREŚĆ — klasy Mambo / Joomla
   ══════════════════════════════════════════════════════════════════════════ */

/* Nagłówek artykułu / sekcji */
.contentheading {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--e1);
  border-bottom: 1px solid var(--e4);
  padding-bottom: 6px;
  margin-bottom: 10px;
  line-height: 1.25;
}

/* Nagłówek komponentu (Szukaj, Kontakt, itp.) */
.componentheading {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--e2);
  border-left: 4px solid var(--e3);
  padding: 3px 0 3px 10px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Data publikacji */
.createdate {
  font-size: 11px;
  font-style: italic;
  color: var(--txt2);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* Ciało artykułu */
.contentdescription {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--txt);
}
.contentdescription p  { margin-bottom: 0.9em; }
.contentdescription h2 { font-family: var(--serif); font-size: 16px; color: var(--e2); margin: 1.2em 0 0.5em; }
.contentdescription h3 { font-family: var(--serif); font-size: 14px; color: var(--e2); margin: 1em 0 0.4em; }
.contentdescription blockquote {
  border-left: 3px solid var(--e4);
  padding: 4px 0 4px 14px;
  margin: 10px 0;
  color: var(--txt2);
  font-style: italic;
}

/* Tytuł artykułu jako link (strona główna, sekcje) */
.contentpagetitle,
a.contentpagetitle:link,
a.contentpagetitle:visited {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--lnk);
  text-decoration: none;
  line-height: 1.3;
}
a.contentpagetitle:hover { color: var(--lnkh); }

/* Panelik artykułu (strona główna) */
.contentpaneopen {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--e4);
}
.contentpaneopen:last-child { border-bottom: none; }

/* "czytaj dalej" */
.readon { margin-top: 4px; }
.readon a {
  font-size: 11px;
  font-weight: 700;
  color: var(--lnk);
  text-decoration: none;
}
.readon a:hover { color: var(--lnkh); }

/* Przycisk wstecz */
.back_button {
  text-align: center;
  margin-top: 30px;
  padding-top: 12px;
  border-top: 1px solid var(--e4);
}
.back_button a {
  font-size: 11px;
  font-weight: 700;
  color: var(--lnk);
  text-decoration: none;
}
.back_button a:hover { color: var(--lnkh); }

/* ── Tabele sekcji / kategorii ────────────────────────────────────────────── */
.sectiontable {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--e4);
  margin-top: 6px;
}
.sectiontableheader {
  background: linear-gradient(to right, var(--e2) 0%, var(--e3) 100%);
  color: #f2e8d4;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 10px;
  text-align: left;
}
.sectiontableentry1 { background: var(--e7); }
.sectiontableentry2 { background: var(--e5); }
.sectiontableentry1 td,
.sectiontableentry2 td {
  padding: 5px 10px;
  font-size: 11.5px;
  border-bottom: 1px solid var(--e4);
}
.sectiontableentry1 a,
.sectiontableentry2 a {
  color: var(--lnk);
  font-weight: 700;
  text-decoration: none;
}
.sectiontableentry1 a:hover,
.sectiontableentry2 a:hover { color: var(--lnkh); }

/* ── Formularz kontakt / szukaj ───────────────────────────────────────────── */
.inputbox {
  border: 1px solid var(--e4);
  background: var(--e7);
  color: var(--txt);
  padding: 5px 8px;
  font-size: 12px;
  font-family: var(--sans);
  border-radius: var(--r);
  transition: border-color 0.15s, background 0.15s;
}
.inputbox:focus {
  outline: none;
  border-color: var(--e3);
  background: #fff;
}
.button {
  background: linear-gradient(to bottom, var(--e2), var(--e1));
  color: #f2e8d4;
  border: 1px solid var(--e0);
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  border-radius: var(--r);
  letter-spacing: 0.5px;
  transition: background 0.15s;
}
.button:hover {
  background: linear-gradient(to bottom, var(--e3), var(--e2));
}

/* ── Linki globalne ───────────────────────────────────────────────────────── */
a:link, a:visited { color: var(--lnk); font-weight: bold; text-decoration: none; }
a:hover           { color: var(--lnkh); }

/* ── Cytat ────────────────────────────────────────────────────────────────── */
.cytat {
  font-size: 12px;
  font-style: italic;
  color: var(--txt2);
  padding-left: 18px;
  border-left: 3px solid var(--e4);
  margin: 10px 0;
}

/* ── HR ───────────────────────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--e4);
  margin: 14px 0;
}

/* ── Wzmocnienia ──────────────────────────────────────────────────────────── */
strong { color: var(--e1); }

/* ── Listy w treści artykułu ──────────────────────────────────────────────── */
.contentdescription ul,
.contentdescription ol {
  list-style: disc;
  padding-left: 22px;
  margin-bottom: 0.9em;
}
.contentdescription li { line-height: 1.6; }

/* Ogólne li w sidebarze — reset */
#sidebar li { list-style: none; }

/* ── Drobne klasy pomocnicze ──────────────────────────────────────────────── */

/* Meta artykułu (sekcja › kategoria) */
.art-meta {
  font-size: 10px;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* Pusta lista */
.empty-msg {
  padding: 16px 4px;
  color: var(--txt2);
  font-style: italic;
}

/* Tabela — kolumna daty */
.tbl-date {
  font-size: 10.5px;
  color: var(--txt2);
}

/* Blok kategorii w sekcji */
.cat-block { margin-bottom: 22px; }
.cat-block .contentheading { font-size: 16px; }

/* ── Formularz kontaktu ───────────────────────────────────────────────────── */
.form-wrap { max-width: 480px; }

.contact-info {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--e4);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 3px;
}
.contact-form .inputbox { width: 100%; }
.contact-form textarea.inputbox { resize: vertical; }
.form-btn { padding-top: 4px; }

.req { color: var(--lnkh); font-weight: 700; }

.msg-ok  { color: #3a6b2a; font-weight: 700; padding: 8px 10px; background: #e8f4e0; border: 1px solid #aed498; border-radius: var(--r); margin-bottom: 14px; }
.msg-err { color: #8b2020; font-weight: 700; padding: 8px 10px; background: #f8e8e8; border: 1px solid #d4a0a0; border-radius: var(--r); margin-bottom: 14px; }

/* ── Wyszukiwarka ─────────────────────────────────────────────────────────── */
.search-wrap { max-width: 560px; }

.search-form {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
}
.search-form .inputbox { flex: 1; }

.search-info {
  font-size: 11px;
  color: var(--txt2);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--e4);
}

.search-result {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--e5);
}
.search-snippet {
  font-size: 11.5px;
  color: var(--txt2);
  margin-top: 3px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSYWNOŚĆ
   ══════════════════════════════════════════════════════════════════════════ */

/* Tablet i mniejszy */
@media (max-width: 680px) {
  #wrap { margin: 0; border-radius: 0; }

  /* Sidebar przenosi się NAD treścią */
  #layout { flex-direction: column; }

  #sidebar {
    width: 100%;
    min-height: auto;
    border-right: none;
    border-bottom: 2px solid var(--e3);

    /* Poziomy układ: zdjęcie + menu obok siebie */
    display: flex;
    flex-wrap: wrap;
  }

  #photo-wrap {
    width: 120px;
    height: 130px;
    flex-shrink: 0;
  }
  #author-photo { height: 130px; }
  #photo-fade { height: 30px; }

  #side-nav {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
  }
  .sb-head { width: 100%; }
  .sn-link {
    width: 50%;
    border-right: 1px solid #cfc0a4;
    font-size: 10px;
    padding: 4px 4px 4px 16px;
  }

  #most-read {
    width: 100%;
    margin-top: 0;
  }
  #most-read ul {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 8px;
  }
  #most-read li {
    border: none;
    padding: 2px 6px;
    border-right: 1px solid #cfc0a4;
  }
  #most-read li::before { display: none; }

  #content { padding: 12px; }

  #site-title  { font-size: 22px; }
  #site-tagline { font-size: 9px; letter-spacing: 1.5px; }
  #header-brand { padding: 14px 14px 10px; }
  #top-nav a { padding: 6px 10px; font-size: 9.5px; }
}

/* Telefon pionowy */
@media (max-width: 420px) {
  #site-title { font-size: 19px; }
  .sn-link { width: 100%; }
  #photo-wrap { width: 90px; height: 100px; }
  #author-photo { height: 100px; }
  .contentheading { font-size: 17px; }
}
