/*
 * Cyfrowy Rynek – styles. Bootstrap 5 is loaded from CDN for the grid/utilities used by
 * secondary pages; everything below defines the site's own look.
 */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1d1a16;
  --ink-2: #3d3832;
  --muted: #6f675d;
  --line: #ebe4da;
  --accent: #e4572e;
  --accent-dark: #c4421d;
  --accent-soft: #fdebe4;
  --free: #2f7d4f;
  --free-soft: #e3f3e8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(29, 26, 22, .04), 0 4px 16px rgba(29, 26, 22, .06);
  --shadow-hover: 0 2px 4px rgba(29, 26, 22, .06), 0 12px 32px rgba(29, 26, 22, .12);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html { background: #faf7f2; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
.container { max-width: 1200px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn-cr {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 15px; line-height: 1.2;
  border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s, transform .15s;
  cursor: pointer; white-space: nowrap;
}
.btn-cr:hover { transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-lg-cr { padding: 16px 28px; font-size: 17px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, .92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .nav-wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.brand b { color: var(--accent); font-weight: 800; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a.nav-a { color: var(--ink-2); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.site-nav a.nav-a:hover { background: var(--line); color: var(--ink); }
.site-nav .btn-cr { margin-left: 8px; padding: 9px 18px; font-size: 14px; }

/* Mobile menu (details/summary, no JS) */
.mnav { display: none; }
.mnav summary {
  list-style: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer;
}
.mnav summary::-webkit-details-marker { display: none; }
.mnav summary span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.mnav[open] summary span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mnav[open] summary span:nth-child(2) { opacity: 0; }
.mnav[open] summary span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mnav-panel {
  position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 32px rgba(29, 26, 22, .12); padding: 8px 18px 20px; display: flex; flex-direction: column;
}
.mnav-panel a:not(.btn-cr) { color: var(--ink); font-weight: 700; font-size: 18px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.mnav-panel .btn-cr { margin-top: 16px; width: 100%; }

/* Hero */
.hero-cr { padding: 72px 0 40px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-dark); background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero-cr h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.08; max-width: 860px; margin: 0 auto 20px; }
.hero-cr h1 em { font-style: normal; color: var(--accent); }
.hero-cr .lead-cr { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }

.search-cr {
  display: flex; max-width: 620px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: var(--shadow);
}
.search-cr input[type=text], .search-cr input[type=search] {
  flex: 1; border: 0; outline: 0; background: transparent; padding: 10px 18px; font-size: 16px; font-family: var(--font); min-width: 0;
}
.search-cr button, .search-cr input[type=submit] { flex: none; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.chips.left { justify-content: flex-start; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip small { color: var(--muted); font-weight: 600; }

/* Sections */
.section-cr { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.section-head .see-all { font-weight: 700; white-space: nowrap; }

.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 0 0 8px; }
.page-head p { color: var(--muted); font-size: 18px; margin: 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }

/* Product grid & cards */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px; }
.pcard {
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
}
.pcard:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.pcard-media { position: relative; aspect-ratio: 4 / 3; background: #f3ede4; overflow: hidden; }
.pcard-media img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; }
.pcard-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.pcard-creator { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.pcard-title {
  font-size: 17px; line-height: 1.3; font-weight: 700; margin: 0 0 14px; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-title a { color: var(--ink); }
.pcard-title a::after { content: ""; position: absolute; inset: 0; }
.pcard-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-cta { font-size: 14px; font-weight: 700; color: var(--accent-dark); }

.price { font-weight: 800; font-size: 17px; color: var(--ink); white-space: nowrap; }
.price-free {
  display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--free); background: var(--free-soft); padding: 4px 10px; border-radius: 999px;
}

/* Placeholder when a cover image is missing or broken */
.pcard-media .ph, .product-media .ph { display: none; }
.pcard-media.noimg, .product-media.noimg { background: linear-gradient(135deg, var(--accent) 0%, #f08a5d 100%); }
.pcard-media.noimg .ph, .product-media.noimg .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; width: 100%; height: 100%;
  color: #fff; font-weight: 800; font-size: 18px; line-height: 1.25; padding: 12px; letter-spacing: -0.01em;
}
.product-media.noimg .ph { font-size: 32px; }

/* Pagination (will_paginate) */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 36px 0 8px; letter-spacing: 0; }
.pagination a, .pagination em, .pagination span {
  min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-style: normal;
}
.pagination em.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .disabled { opacity: .4; }

/* Product page */
.product-cr { padding: 32px 0 24px; }
.product-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.product-media {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px;
  box-shadow: var(--shadow); display: grid; place-items: center; aspect-ratio: 1 / 1;
}
.product-media img { max-height: 100%; width: 100%; object-fit: contain; }
.product-info h1 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; margin: 6px 0 14px; }
.product-creators { font-weight: 600; color: var(--muted); }
.product-creators a { font-weight: 700; }
.product-buy {
  margin: 24px 0; padding: 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.product-buy .price { font-size: 30px; display: block; margin-bottom: 14px; }
.product-buy .btn-cr { width: 100%; }
.product-buy .note { font-size: 13px; color: var(--muted); margin: 12px 0 0; text-align: center; }
.prose { font-size: 18px; line-height: 1.75; color: var(--ink-2); }
.prose p { margin: 0 0 1em; }
.product-about { padding: 8px 0 24px; }
.product-about h2 { font-size: 26px; margin: 24px 0 14px; }
.creator-quote {
  border-left: 4px solid var(--accent); background: var(--surface); padding: 22px 26px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 17px; line-height: 1.7; color: var(--ink-2); box-shadow: var(--shadow);
}
.creator-quote ul { padding-left: 1.2em; margin: .5em 0; }

/* Creators */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.ccard {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
}
.ccard:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.avatar {
  flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center; font-weight: 800; font-size: 20px; text-transform: uppercase;
}
.avatar.lg { width: 84px; height: 84px; font-size: 34px; border-radius: 22px; }
.ccard h3 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.ccard h3 a { color: var(--ink); }
.ccard h3 a::after { content: ""; position: absolute; inset: 0; }
.ccard p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.creator-head { display: flex; gap: 24px; align-items: center; padding: 48px 0 16px; }
.creator-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 0 0 6px; }
.creator-head p { color: var(--ink-2); font-size: 17px; margin: 0 0 14px; max-width: 720px; }

/* Creator CTA band */
.cta-band {
  margin: 48px 0 16px; background: var(--ink); color: #fff; border-radius: 28px; padding: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; font-size: clamp(24px, 3vw, 32px); margin: 0 0 6px; }
.cta-band p { color: #cfc8bf; margin: 0; font-size: 17px; }

/* About / SEO copy */
.about-cr { padding: 32px 0 8px; }
.about-cr h2 { font-size: 26px; margin: 28px 0 12px; }
.about-cr p { font-size: 17px; line-height: 1.75; color: var(--ink-2); }

/* Footer */
.site-footer { margin-top: 64px; background: var(--ink); color: #cfc8bf; padding: 56px 0 32px; font-size: 15px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.footer-bottom { border-top: 1px solid #3a352f; margin-top: 40px; padding-top: 20px; font-size: 13px; color: #8f877c; }

.empty-cr { text-align: center; padding: 48px 0; color: var(--muted); font-size: 18px; }

/* Responsive */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: 1fr; gap: 24px; }
  .product-media { aspect-ratio: auto; max-height: 420px; padding: 20px; }
  .product-media img { max-height: 380px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .container { padding-left: 18px; padding-right: 18px; }
  .site-header .nav-wrap { height: 64px; gap: 12px; }
  .site-nav { display: none; }
  .mnav { display: block; margin-left: auto; }
  .hero-cr .chips {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 20px -18px 0; padding: 0 18px 6px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .hero-cr .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
  .hero-cr h1 { font-size: 34px; }
  .search-cr input[type=search] { padding: 10px 12px; }
  .hero-cr { padding: 40px 0 24px; }
  .hero-cr .lead-cr { font-size: 17px; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pcard-media img { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
  .pcard-body { padding: 12px; }
  .pcard-title { font-size: 15px; margin-bottom: 10px; }
  .pcard-cta { display: none; }
  .price { font-size: 15px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cta-band { padding: 28px; border-radius: 22px; }
  .creator-head { flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 32px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- Legacy styles still used by articles, glossary, newsletter and admin pages ---- */
.main { background-color: var(--surface); border-radius: var(--radius); padding: 30px; border: 1px solid var(--line); }
.main p { font-size: 18px; line-height: 1.7; }
.muted { font-size: 14px; margin: 0 auto 28px auto; color: var(--muted); }
.header-bold { font-weight: 800; }
.mt-50 { margin-top: 50px; }
.mb-20 { margin-bottom: 20px; }
.details-header { padding: 40px 0; }
.tags-heading { font-size: 36px; font-weight: 800; }
.articles-list li { list-style-type: none; }
.articles-list img { width: 100%; object-fit: cover; height: 200px; border-radius: 12px; }
.article-img { width: 40vw; }
.admin-nav { background-color: red; color: #fff; }
.admin-nav a { color: #fff; }
.admin-edit-form input { width: 100%; }
.admin-edit-form textarea { width: 100%; height: 200px; }
span.freebe { display: inline-block; padding: 10px; color: var(--free); font-size: 20px; text-transform: uppercase; font-weight: 900; }
.btn-primary { border-radius: 999px; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Topic landing pages */
.landing-hero { padding-bottom: 8px; }
.landing-hero .crumbs { margin-bottom: 16px; }
.section-cr[id] { scroll-margin-top: 80px; }
.pracawai-box {
  margin: 8px 0 24px; border: 2px solid var(--ink); border-radius: 22px; padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.pracawai-box h3 { font-size: 22px; margin: 4px 0 6px; }
.pracawai-box p { margin: 0; color: var(--ink-2); max-width: 640px; }
.product-cr .pracawai-box { margin-top: 32px; }

/* Articles */
.article-cr { padding: 40px 24px 8px; }
.article-cr h1 { font-size: clamp(30px, 4vw, 44px); margin: 12px 0 8px; line-height: 1.15; }
.article-meta { color: var(--muted); margin: 0 0 28px; }
.article-cr .prose h2 { font-size: 26px; margin: 36px 0 12px; color: var(--ink); }
.article-cr .prose h3 { font-size: 20px; margin: 24px 0 8px; color: var(--ink); }
.article-cr .prose ul { margin: 0 0 1em; padding-left: 1.2em; }
.article-cr .prose li { margin: 0 0 .4em; }
.article-cr .pgrid { margin: 20px 0 28px; }
.article-list { display: grid; gap: 16px; padding: 24px 0 8px; max-width: 820px; }
.article-item { display: block; border: 1px solid var(--line, #e7e1d8); border-radius: 20px; padding: 24px 28px; color: inherit; text-decoration: none; background: #fff; }
.article-item:hover { border-color: var(--ink); }
.article-item h2 { font-size: 22px; margin: 0 0 6px; }
.article-item p { color: var(--ink-2); margin: 0 0 8px; }
