/* =========================================================
   Traditio Sancta — arkusz stylów strony publicznej
   Paleta: głęboki granat/czerń + złoto + kość słoniowa (wg logo)
   Kroje: system fonts (bez CDN) — szeryfowe dla nagłówków, bezszeryfowe dla treści
   ========================================================= */

:root {
  /* Zmienne "maroon-*" zachowują nazwy dla kompatybilności, ale przenoszą
     teraz odcienie GRANATU (navy), zgodnie z nową identyfikacją wizualną. */
  --color-maroon-900: #0a0e1c;   /* najgłębszy granat, prawie czerń */
  --color-maroon-800: #121834;
  --color-maroon-700: #1c2547;   /* podstawowy granat (przyciski, akcenty) */
  --color-maroon-600: #2b376a;

  --color-navy-900: #0a0e1c;
  --color-navy-800: #121834;
  --color-navy-700: #1c2547;
  --color-navy-600: #2b376a;

  --color-gold-600: #b3922f;
  --color-gold-500: #d4af37;      /* złoto z logo */
  --color-gold-400: #e0c25f;
  --color-gold-300: #ecd899;
  --color-cream-100: #fbf7ee;
  --color-cream-200: #f3ecda;
  --color-ink-900: #1c1b18;
  --color-ink-700: #3a352d;
  --color-ink-500: #6b5d4f;
  --color-line: #e5dcc4;
  --shadow-card: 0 6px 24px rgba(10, 14, 28, 0.10);
  --radius: 10px;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-ink-900);
  background: var(--color-cream-100);
  line-height: 1.65;
}

h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--color-maroon-900); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--color-maroon-700); text-decoration: none; }
a:hover { color: var(--color-gold-600); }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-tight { padding: 36px 0; }
.section-alt { background: var(--color-cream-200); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-gold-600);
  font-weight: 700;
  margin-bottom: .6em;
}

.section-head { max-width: 680px; margin: 0 0 2.4rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.lede { font-size: 1.1rem; color: var(--color-ink-700); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .8em 1.6em;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  text-align: center;
}
.btn-primary { background: var(--color-maroon-700); color: #fff; }
.btn-primary:hover { background: var(--color-maroon-800); color: #fff; }
.btn-gold { background: var(--color-gold-500); color: var(--color-maroon-900); }
.btn-gold:hover { background: var(--color-gold-600); color: #fff; }
.btn-outline { background: transparent; border-color: var(--color-maroon-700); color: var(--color-maroon-700); }
.btn-outline:hover { background: var(--color-maroon-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-ink-700); border-color: var(--color-line); }
.btn-block { width: 100%; }
.btn-sm { padding: .5em 1.1em; font-size: .85rem; }
.btn-danger { background: #a3272c; color: #fff; }

/* ---------- Nagłówek / nawigacja ---------- */
.site-header {
  background: linear-gradient(180deg, var(--color-navy-800), var(--color-navy-900));
  border-bottom: 2px solid var(--color-gold-600);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 20px; }
.brand { display: flex; align-items: center; gap: .7em; font-family: var(--font-serif); }
.brand-mark {
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(212,175,55,.18), transparent 60%);
  color: var(--color-gold-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--color-gold-500);
}
.brand-logo-img { height: 52px; width: auto; display: block; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.2rem; color: var(--color-gold-300); letter-spacing: .02em; }
.brand-text span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-gold-500); }

.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
  color: #e8e2d2;
  font-weight: 600;
  font-size: .95rem;
  padding: .6em .85em;
  border-radius: 6px;
}
.main-nav a:hover, .main-nav a.active { background: rgba(212,175,55,.14); color: var(--color-gold-300); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: .4em; font-weight: 700; color: var(--color-gold-300); }
.cart-link:hover { color: var(--color-gold-500); }
.account-link { display: inline-flex; align-items: center; gap: .3em; font-weight: 600; font-size: .92rem; color: #e8e2d2; }
.account-link:hover { color: var(--color-gold-300); }
.cart-badge {
  background: var(--color-gold-500); color: var(--color-navy-900);
  border-radius: 999px; font-size: .72rem; min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.nav-toggle { display: none; background: none; border: 1px solid var(--color-gold-600); border-radius: 6px; padding: .5em .7em; cursor: pointer; color: var(--color-gold-300); }

@media (max-width: 860px) {
  .main-nav { position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-navy-800);
    flex-direction: column; align-items: stretch; border-bottom: 2px solid var(--color-gold-600); padding: 8px 20px 16px;
    display: none; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(circle at 50% 30%, rgba(212,175,55,0.20), transparent 55%),
              linear-gradient(160deg, #060812 0%, var(--color-navy-900) 45%, var(--color-navy-700) 100%);
  color: #f4ecd8;
  padding: 84px 0 92px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(212,175,55,0.035) 0 2px, transparent 2px 36px);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 740px; }
.hero h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.hero .lede { color: #ecdcb6; font-size: 1.15rem; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.8em; }
.hero-ornament { color: var(--color-gold-500); margin-bottom: .5em; }
.hero-ornament img, .hero-ornament svg { height: 96px; width: auto; filter: drop-shadow(0 4px 16px rgba(0,0,0,.4)); }
.hero-logo-img { height: 130px; width: auto; margin-bottom: .6em; filter: drop-shadow(0 6px 22px rgba(0,0,0,.45)); }

/* ---------- Karty ---------- */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(10,14,28,.16); }
.card-media { aspect-ratio: 4/3; background: var(--color-cream-200); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media.placeholder { color: var(--color-gold-600); font-family: var(--font-serif); font-size: 2rem; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: .5em; flex: 1; }
.card-body h3 { margin-bottom: .15em; }
.card-body h3 a { color: inherit; }
.card-meta { font-size: .82rem; color: var(--color-ink-500); text-transform: uppercase; letter-spacing: .05em; }
.card-excerpt { color: var(--color-ink-700); font-size: .95rem; flex: 1; }
.card-footer { margin-top: auto; padding-top: .6em; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Okładka książki */
.book-cover { aspect-ratio: 3/4.2; background: linear-gradient(160deg, var(--color-maroon-700), var(--color-maroon-900)); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover-fallback { color: var(--color-gold-300); font-family: var(--font-serif); text-align: center; padding: 1.4em; font-size: 1.05rem; }

.price { font-family: var(--font-serif); font-weight: 700; color: var(--color-maroon-800); font-size: 1.2rem; }

.badge {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: .32em .7em; border-radius: 999px;
}
.badge-preorder { background: #fbe6c8; color: #7c4a10; }
.badge-available { background: #dcefdd; color: #1f6b32; }
.badge-soldout { background: #f1dede; color: #8a2b2b; }
.badge-draft { background: #e6e0d8; color: var(--color-ink-500); }
.badge-published { background: #dcefdd; color: #1f6b32; }

/* ---------- Formularze ---------- */
label { display: block; font-weight: 600; margin-bottom: .35em; font-size: .92rem; color: var(--color-ink-700); }
.field { margin-bottom: 1.1em; }
.field-hint { font-size: .8rem; color: var(--color-ink-500); margin-top: .3em; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=search], input[type=date], input[type=url], select, textarea {
  width: 100%;
  padding: .75em .9em;
  border: 1px solid var(--color-line);
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-ink-900);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--color-maroon-600); box-shadow: 0 0 0 3px rgba(28,37,71,.14);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.checkbox-row { display: flex; align-items: flex-start; gap: .6em; font-size: .9rem; }
.checkbox-row input { width: auto; margin-top: .25em; }

/* ---------- Panele / boxy ---------- */
.panel { background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-card); }
.panel + .panel { margin-top: 20px; }
.divider { border: none; border-top: 1px solid var(--color-line); margin: 1.6em 0; }

/* ---------- Alerty / flash ---------- */
.alert { padding: .9em 1.1em; border-radius: 8px; margin-bottom: 14px; font-size: .92rem; border: 1px solid transparent; }
.alert-success { background: #e3f3e4; color: #1f6b32; border-color: #bfe2c4; }
.alert-error { background: #fbe4e4; color: #8a2b2b; border-color: #f1c3c3; }

/* ---------- Blog ---------- */
.post-hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 1.6em; box-shadow: var(--shadow-card); }
.post-content { font-size: 1.05rem; color: var(--color-ink-900); }
.post-content h2, .post-content h3 { margin-top: 1.4em; }
.post-content blockquote {
  border-left: 4px solid var(--color-gold-500);
  margin: 1.4em 0; padding: .3em 1.2em; color: var(--color-ink-700); font-style: italic;
  background: var(--color-cream-200); border-radius: 0 8px 8px 0;
}
.post-content img { border-radius: 8px; margin: 1.2em 0; }
.post-content ul, .post-content ol { margin-bottom: 1.2em; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1.6em; }
.tag-pill { background: var(--color-cream-200); color: var(--color-maroon-800); border-radius: 999px; padding: .3em .9em; font-size: .82rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 2.2em; }
.filter-pill {
  padding: .45em 1em; border-radius: 999px; border: 1px solid var(--color-line);
  color: var(--color-ink-700); font-size: .87rem; font-weight: 600;
}
.filter-pill.active, .filter-pill:hover { background: var(--color-maroon-700); border-color: var(--color-maroon-700); color: #fff; }
.search-box { display: flex; gap: 8px; margin-left: auto; }
.search-box input { width: 220px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 2.4em; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid var(--color-line); font-weight: 600; color: var(--color-ink-700);
}
.pagination a:hover { background: var(--color-cream-200); }
.pagination .current { background: var(--color-maroon-700); border-color: var(--color-maroon-700); color: #fff; }

/* ---------- Wideo ---------- */
.video-embed { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.video-embed iframe, .video-embed video { width: 100%; height: 100%; border: 0; display: block; }
.video-thumb { position: relative; aspect-ratio: 16/9; background: var(--color-ink-900); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.video-thumb .play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2.4rem;
}
.video-thumb .play-icon span {
  width: 62px; height: 62px; border-radius: 50%; background: rgba(28,37,71,.88);
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--color-gold-500);
}

/* ---------- Koszyk / checkout ---------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--color-line); font-size: .93rem; }
.cart-table th { text-transform: uppercase; letter-spacing: .04em; font-size: .74rem; color: var(--color-ink-500); }
.cart-product { display: flex; align-items: center; gap: 12px; }
.cart-product-thumb { width: 56px; height: 74px; border-radius: 4px; overflow: hidden; background: var(--color-maroon-800); flex-shrink: 0; }
.cart-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qty-input { width: 70px; }
.order-summary-row { display: flex; justify-content: space-between; padding: .5em 0; font-size: .95rem; }
.order-summary-row.total { font-weight: 700; font-size: 1.15rem; color: var(--color-maroon-800); border-top: 1px solid var(--color-line); margin-top: .4em; padding-top: .8em; }

/* ---------- Stopka ---------- */
.site-footer { background: var(--color-maroon-900); color: #ecdfc4; padding: 56px 0 26px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--color-gold-300); font-size: 1rem; margin-bottom: .9em; }
.site-footer a { color: #ecdfc4; }
.site-footer a:hover { color: var(--color-gold-500); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55em; font-size: .92rem; }
.footer-bottom {
  border-top: 1px solid rgba(236,223,196,.18); margin-top: 40px; padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: #cdb98f;
}
.newsletter-form { display: flex; gap: 8px; margin-top: .6em; }
.newsletter-form input { background: rgba(255,255,255,.08); border-color: rgba(236,223,196,.25); color: #fff; }
.newsletter-form input::placeholder { color: #cdb98f; }
.social-row { display: flex; gap: 10px; margin-top: .8em; }
.social-row a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(236,223,196,.35);
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .84rem; color: var(--color-ink-500); margin-bottom: 1.4em; }
.breadcrumb a { color: var(--color-ink-500); }
.breadcrumb a:hover { color: var(--color-maroon-700); }

/* ---------- Strona błędu ---------- */
.error-page { text-align: center; padding: 100px 20px; }
.error-page .code { font-family: var(--font-serif); font-size: 5rem; color: var(--color-gold-500); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--color-ink-500); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Odtwarzacz „Posłuchaj artykułu" (TTS) ---------- */
.tts-player {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(180deg, var(--color-cream-100), var(--color-cream-200));
  border: 1px solid var(--color-line);
  border-left: 4px solid var(--color-gold-500);
  border-radius: 10px;
  padding: 12px 16px; margin: 0 0 24px;
}
.tts-player .btn { cursor: pointer; }
.tts-rate { font-size: .85rem; color: var(--color-ink-700); display: inline-flex; align-items: center; gap: 6px; }
.tts-rate select {
  font-size: .85rem; padding: 4px 6px; border: 1px solid var(--color-line);
  border-radius: 6px; background: #fff; color: var(--color-ink-900);
}
.tts-status { font-size: .85rem; color: var(--color-gold-600); font-weight: 600; margin-left: auto; }
