/* ─── PALETA SpiderShop 2.0 ─── */
:root {
  --surface:        #18181b;
  --surface-card:   #27272a;
  --surface-hover:  #3f3f46;
  --surface-border: #52525b;
  --rust:           #ea580c;
  --rust-light:     #f97316;
  --rust-dark:      #c2410c;
  --rust-glow:      rgba(234,88,12,.15);
  --text:           #f4f4f5;
  --text-muted:     #a1a1aa;
  --text-dim:       #71717a;
  --radius:         14px;
  --green:          #4ade80;
  --orange:         #fb923c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--surface); color: var(--text); line-height: 1.6; }
img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 999px; }

/* ─── HEADER ─── */
header {
  background: var(--surface-card);
  border-bottom: 1px solid var(--surface-border);
  padding: 0 2rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.4);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo { display: flex; align-items: center; gap: .6rem; }
.logo-icon { font-size: 1.8rem; line-height: 1; filter: drop-shadow(0 0 6px var(--rust)); }
.logo-img  { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; border: 1px solid var(--rust-dark); box-shadow: 0 0 0 3px var(--rust-glow); }
.logo-text  { font-size: 1.1rem; font-weight: 800; letter-spacing: -.5px; color: var(--text); }
.logo-sub   { font-size: .65rem; color: var(--rust-light); font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
nav { display: flex; gap: .2rem; }
nav a {
  color: var(--text-muted); font-weight: 600; font-size: .875rem;
  padding: .4rem .8rem; border-radius: 8px; transition: background .15s, color .15s;
}
nav a:hover { background: var(--surface-hover); color: var(--text); }
nav a.active { background: var(--rust-glow); color: var(--rust-light); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ─── HERO (fallback — brak postów) ─── */
.hero {
  background: linear-gradient(160deg, #1c1917 0%, var(--surface) 60%);
  border-bottom: 1px solid var(--surface-border);
  padding: 4rem 2rem 3.5rem; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: '🕷️'; position: absolute; font-size: 20rem; opacity: .04;
  top: -3rem; right: -4rem; pointer-events: none; filter: grayscale(1);
}
.hero-badge {
  display: inline-block;
  background: var(--rust-glow); border: 1px solid var(--rust-dark); color: var(--rust-light);
  font-size: .7rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  padding: .3rem 1rem; border-radius: 999px; margin-bottom: 1.2rem;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.5px;
  color: var(--text); line-height: 1.2; margin-bottom: .8rem;
}
.hero p { font-size: 1.05rem; color: var(--text-muted); max-width: 520px; margin: 0 auto 2rem; }
.hero-spider { font-size: 5rem; display: block; margin-bottom: 1rem; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ─── HERO FEATURED ─── */
.hero-featured {
  max-width: 1100px; margin: 0 auto; padding: 4rem 2rem 3rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.hero-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--rust); display: flex; align-items: center; gap: 8px; margin-bottom: 1rem;
}
.hero-line { width: 24px; height: 2px; background: var(--rust); display: block; flex-shrink: 0; }
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.2; letter-spacing: -.02em;
  color: var(--text); margin-bottom: 1rem;
}
.hero-desc { color: var(--text-muted); font-size: 1rem; line-height: 1.7; margin-bottom: 1.5rem; max-width: 480px; }
.hero-meta { font-size: .8rem; color: var(--text-dim); margin-bottom: 2rem; }
.hero-image {
  border-radius: 16px; overflow: hidden; aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--surface-card), var(--surface));
  display: flex; align-items: center; justify-content: center; font-size: 8rem;
  border: 1px solid var(--surface-border); position: relative;
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-image-badge {
  position: absolute; bottom: 16px; left: 16px;
  background: rgba(24,24,27,.85); backdrop-filter: blur(8px);
  border: 1px solid var(--surface-border); border-radius: 8px; padding: 8px 12px;
  font-size: .75rem; color: var(--text);
}
.hero-image-badge span { color: var(--rust-light); font-weight: 700; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.hero-divider { border-top: 1px solid var(--surface-border); }

/* ─── LAYOUT ─── */
.container {
  max-width: 1100px; margin: 0 auto; padding: 3rem 2rem;
  display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: start;
}
.section-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px solid var(--surface-border); padding-bottom: .75rem;
}
.section-title span { color: var(--rust); }

/* ─── POST CARDS ─── */
.posts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.post-card {
  background: var(--surface-card); border: 1px solid var(--surface-border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--rust-dark);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 0 1px var(--rust-dark);
}
.post-card.featured { border-color: var(--rust-dark); }
.post-img {
  height: 190px;
  background: linear-gradient(135deg, #1c1917, #292524);
  display: flex; align-items: center; justify-content: center; font-size: 4.5rem;
  position: relative; overflow: hidden;
}
.post-img.orange-bg { background: linear-gradient(135deg, #1c1410, #27201a); }
.post-img.purple-bg { background: linear-gradient(135deg, #1a1525, #221c33); }
.post-img img { width: 100%; height: 100%; object-fit: cover; }
.post-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(39,39,42,.85) 0%, transparent 55%);
}
.post-featured-badge {
  position: absolute; top: .75rem; left: .75rem; z-index: 1;
  background: var(--rust); color: #fff;
  font-size: .68rem; font-weight: 700; padding: .25rem .75rem; border-radius: 999px; letter-spacing: .5px;
}
.post-body { padding: 1.25rem 1.5rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.post-meta { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; font-size: .78rem; color: var(--text-dim); flex-wrap: wrap; }
.post-tag {
  background: var(--rust-glow); color: var(--rust-light); border: 1px solid var(--rust-dark);
  font-weight: 600; padding: .15rem .6rem; border-radius: 999px; font-size: .72rem;
}
.post-tag.orange { background: rgba(251,146,60,.1); color: #fb923c; border-color: #c2410c; }
.post-tag.purple { background: rgba(139,92,246,.1); color: #a78bfa; border-color: #6d28d9; }
.post-card h2 { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: .45rem; line-height: 1.35; }
.post-card p  { font-size: .875rem; color: var(--text-muted); flex: 1; margin-bottom: 1rem; }
.btn-read {
  align-self: flex-start; background: var(--rust); color: #fff; border: none;
  padding: .45rem 1.1rem; border-radius: 8px;
  font-weight: 600; font-size: .82rem; cursor: pointer; transition: background .15s;
  display: inline-block; font-family: inherit;
}
.btn-read:hover { background: var(--rust-dark); }

/* ─── SIDEBAR ─── */
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.widget {
  background: var(--surface-card); border: 1px solid var(--surface-border);
  border-radius: var(--radius); padding: 1.25rem;
}
.widget-title {
  font-size: .875rem; font-weight: 700; color: var(--text); margin-bottom: 1rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--surface-border);
  display: flex; align-items: center; gap: .4rem;
}
.widget-title a { color: var(--rust-light); }

/* spider profile */
.spider-profile { text-align: center; }
.spider-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, #1c1917, #292524);
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
  margin: 0 auto .75rem;
  border: 2px solid var(--rust-dark);
  box-shadow: 0 0 0 4px var(--rust-glow);
  overflow: hidden;
}
.spider-avatar img { width: 100%; height: 100%; object-fit: cover; }
.spider-name   { font-size: 1rem; font-weight: 700; color: var(--text); }
.spider-species { font-size: .78rem; color: var(--rust-light); font-style: italic; margin-bottom: .75rem; }
.spider-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .75rem; }
.stat { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 8px; padding: .4rem .6rem; text-align: center; }
.stat-val { font-weight: 700; color: var(--rust-light); font-size: .95rem; }
.stat-lbl { font-size: .68rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.gallery-thumb {
  aspect-ratio: 1; border-radius: 8px;
  background: linear-gradient(135deg, #1c1917, #292524);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  cursor: pointer; transition: transform .15s, opacity .15s; overflow: hidden;
  border: 1px solid var(--surface-border);
}
.gallery-thumb:hover { transform: scale(1.04); opacity: .85; }
.gallery-thumb.t2 { background: linear-gradient(135deg, #1c1410, #27201a); }
.gallery-thumb.t3 { background: linear-gradient(135deg, #1a1525, #221c33); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-pill {
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--surface-border);
  padding: .25rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s; display: inline-block;
}
.tag-pill:hover { border-color: var(--rust); color: var(--rust-light); }
.tag-pill.orange:hover { border-color: var(--rust-light); color: var(--rust-light); }

/* ─── SINGLE POST ─── */
.post-full { max-width: 800px; margin: 3rem auto; padding: 0 2rem; }
.post-full h1 { font-size: 2rem; font-weight: 800; color: var(--text); margin-bottom: 1rem; letter-spacing: -.5px; }
.post-content { font-size: 1.05rem; line-height: 1.85; color: var(--text-muted); }
.post-content p  { margin-bottom: 1.2rem; }
.post-content h2 { font-size: 1.4rem; font-weight: 700; color: var(--text); margin: 2rem 0 .75rem; letter-spacing: -.3px; }
.post-content img { border-radius: 12px; margin: 1rem auto; max-height: 500px; width: auto; border: 1px solid var(--surface-border); }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-dim); }
.empty-state span { font-size: 4rem; display: block; margin-bottom: 1rem; opacity: .3; }

/* ─── FOOTER ─── */
footer {
  background: var(--surface-card);
  border-top: 1px solid var(--surface-border);
  text-align: center; padding: 2rem; font-size: .82rem; color: var(--text-dim);
}
footer strong { color: var(--rust-light); }

/* ─── ADMIN (dark) ─── */
.admin-body { background: var(--surface); color: var(--text); font-family: 'Inter', system-ui, sans-serif; }
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--surface-card); color: var(--text); padding: 1.5rem 0; display: flex; flex-direction: column; border-right: 1px solid var(--surface-border); }
.admin-sidebar .brand { padding: 0 1.5rem 1.5rem; font-size: 1rem; font-weight: 800; border-bottom: 1px solid var(--surface-border); color: var(--text); }
.admin-sidebar nav { display: flex; flex-direction: column; padding: .75rem 0; }
.admin-sidebar nav a {
  color: var(--text-muted); text-decoration: none; padding: .6rem 1.5rem;
  font-weight: 600; font-size: .875rem; border-left: 3px solid transparent; transition: all .15s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: var(--rust-glow); color: var(--rust-light); border-left-color: var(--rust);
}
.admin-main { padding: 2rem; }
.admin-main h1 { font-size: 1.4rem; font-weight: 800; color: var(--text); margin-bottom: 1.5rem; }
.card { background: var(--surface-card); border: 1px solid var(--surface-border); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 700; margin-bottom: .4rem; font-size: .875rem; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: .6rem .9rem; border: 1.5px solid var(--surface-border); border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif; font-size: .95rem; color: var(--text);
  background: var(--surface); transition: border .15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--rust);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-dim); }
.form-group textarea { min-height: 180px; resize: vertical; }
.form-group select option { background: var(--surface-card); color: var(--text); }
.btn { padding: .55rem 1.3rem; border-radius: 8px; border: none; font-family: 'Inter', system-ui, sans-serif; font-weight: 700; font-size: .875rem; cursor: pointer; transition: background .15s; display: inline-block; text-decoration: none; }
.btn-primary { background: var(--rust); color: #fff; }
.btn-primary:hover { background: var(--rust-dark); }
.btn-danger  { background: #b91c1c; color: #fff; }
.btn-danger:hover  { background: #991b1b; }
.btn-secondary { background: var(--surface-hover); color: var(--text); border: 1px solid var(--surface-border); }
.btn-secondary:hover { border-color: var(--rust-dark); color: var(--rust-light); }
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; }
.alert-ok  { background: rgba(74,222,128,.1); color: #4ade80; border: 1px solid rgba(74,222,128,.2); }
.alert-err { background: rgba(239,68,68,.1); color: #f87171; border: 1px solid rgba(239,68,68,.2); }
table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--surface-border); font-size: .875rem; color: var(--text); }
table th { font-weight: 700; color: var(--text-muted); background: var(--surface); }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-published  { background: rgba(74,222,128,.1); color: #4ade80; border: 1px solid rgba(74,222,128,.25); }
.badge-draft      { background: rgba(251,191,36,.1); color: #fbbf24; border: 1px solid rgba(251,191,36,.25); }
.badge-scheduled  { background: rgba(96,165,250,.1); color: #60a5fa; border: 1px solid rgba(96,165,250,.25); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .container { grid-template-columns: 1fr; }
  nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface-card); border-bottom: 1px solid var(--surface-border); padding: 1rem; gap: .25rem; }
  nav.open { display: flex; }
  .nav-toggle { display: block; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   STEROWNIA — look Yaqb Hub (BCS DNA): light, granatowy sidebar,
   niebieski akcent, Oxanium. Scope .admin-body → publiczny blog nietknięty.
   Ref: HUB/ui-patterns.md (tokeny --bg-page/--bg-sidebar/--accent, Oxanium).
   ═══════════════════════════════════════════════════════════ */
.admin-body {
  /* przedefiniowane tokeny w scope sterowni = paleta Huba (light) */
  --surface:        #f0f2f5;   /* tło strony */
  --surface-card:   #ffffff;   /* karty */
  --surface-hover:  #f1f5f9;
  --surface-border: #e2e8f0;
  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-dim:       #94a3b8;
  --rust:           #2563eb;   /* akcent → niebieski Huba */
  --rust-light:     #3b82f6;
  --rust-dark:      #1d4ed8;
  background: #f0f2f5 !important;
  color: #1e293b !important;
  font-family: 'Roboto', system-ui, sans-serif !important;
}
.admin-body h1, .admin-body .brand, .admin-body .btn { font-family: 'Oxanium', sans-serif !important; }
.admin-body h1 { letter-spacing: -.01em; }

/* Sidebar granatowy (Hub #1e293b) na jasnym tle */
.admin-body .admin-sidebar {
  background: #1e293b; border-right: none; padding: 0;
}
.admin-body .admin-sidebar .brand {
  color: #fff; font-size: 1.1rem; padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: .5rem;
}
.admin-body .admin-sidebar nav a {
  color: #94a3b8; margin: 1px .6rem; padding: .6rem .9rem; border-radius: 8px;
  font-weight: 500; transition: background .15s, color .15s;
}
.admin-body .admin-sidebar nav a:hover {
  background: rgba(255,255,255,.06); color: #fff;
}
.admin-body .admin-sidebar nav a.active {
  background: #2563eb; color: #fff; font-weight: 700;
}

/* Karty białe z cieniem Huba */
.admin-body .card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.admin-body h1 { color: #1e293b; }

/* Przyciski w stylu Huba */
.admin-body .btn-primary { background: #2563eb; color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.admin-body .btn-primary:hover { background: #1d4ed8; }
.admin-body .btn-secondary { background: #fff; color: #1e293b; border: 1px solid #e2e8f0; }
.admin-body .btn-secondary:hover { border-color: #2563eb; color: #2563eb; }
.admin-body .btn-danger { background: #dc2626; color: #fff; }
.admin-body .btn-danger:hover { background: #b91c1c; }

/* Inputy jasne */
.admin-body .form-group input,
.admin-body .form-group textarea,
.admin-body .form-group select {
  background: #fff; border: 1px solid #e2e8f0; color: #1e293b;
}
.admin-body .form-group input:focus,
.admin-body .form-group textarea:focus,
.admin-body .form-group select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.admin-body .form-group select option { background: #fff; color: #1e293b; }

/* Tabele light: header jasny, wiersze białe */
.admin-body table th { background: #f8fafc; color: #64748b; border-bottom: 1px solid #e2e8f0; font-weight: 700; }
.admin-body table td { border-bottom: 1px solid #eef2f6; color: #1e293b; }
.admin-body table tr:hover td { background: #f8fafc; }

/* Staty dashboardu = liczby akcentem Huba */
.admin-body .card [style*="color:var(--green)"] { color: #2563eb !important; }
.admin-body .card [style*="color:var(--orange)"] { color: #f59e0b !important; }

/* Alerty light */
.admin-body .alert-ok  { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.admin-body .alert-err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* Badge statusów (light, jak pills Huba) */
.admin-body .badge-published { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.admin-body .badge-draft     { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.admin-body .badge-scheduled { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* login box na jasnym */
.admin-body.login-page, body.login-page { background: #f0f2f5 !important; }
