/* layout.css — container, topbar, hero, sections, footer */

/* === Container === */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--px);
}
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--px); }

/* === Topbar (sticky) === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--c-nav-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--c-border);
  transition: background .4s ease;
}
.topbar-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--f-head);
  letter-spacing: -.01em;
  color: var(--c-fg);
  text-decoration: none;
}
.topbar-brand-dot {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--c-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .8rem;
  flex-shrink: 0;
}
.topbar-brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.topbar-brand-eyebrow {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.topbar-brand-main {
  font-size: 1rem;
  font-weight: 800;
  color: var(--c-fg);
  line-height: 1;
}
.topbar-brand-main span { color: var(--c-accent); }

.topbar-nav {
  display: flex;
  gap: .25rem;
  align-items: center;
}
.topbar-link {
  font-size: .88rem;
  font-weight: 500;
  color: var(--c-fg-muted);
  padding: .55rem .8rem;
  border-radius: var(--r-sm);
  transition: all var(--t-fast);
}
.topbar-link:hover {
  color: var(--c-fg);
  background: var(--a-teal-08);
  text-decoration: none;
}
.topbar-link[aria-current="page"] {
  color: var(--c-accent);
  background: var(--a-teal-12);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  gap: .4rem;
  align-items: center;
}
.topbar-btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-fg-muted);
  transition: all var(--t-fast);
}
.topbar-btn-icon:hover {
  background: var(--a-teal-08);
  color: var(--c-fg);
}

.topbar-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 0;
  align-items: center;
  justify-content: center;
  color: var(--c-fg);
  transition: background var(--t-fast);
  cursor: pointer;
}
.topbar-burger:hover { background: var(--a-teal-08); }
.topbar-burger svg { width: 22px; height: 22px; }

@media (max-width: 760px) {
  .topbar-nav { display: none; }
  .topbar-burger { display: inline-flex; }
}

/* === Mobile drawer === */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  z-index: 90;
  transition: opacity var(--t-base), visibility var(--t-base);
}
.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(85vw, 320px);
  height: 100vh;
  background: var(--c-bg-elev);
  border-left: 1px solid var(--c-border);
  box-shadow: var(--sh-lg);
  transform: translateX(100%);
  transition: transform var(--t-base);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  visibility: hidden;
}
.drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--c-divider);
}
.drawer-title {
  font-family: var(--f-head);
  font-weight: 800;
  font-size: 1rem;
  color: var(--c-fg);
}
.drawer-close {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 0;
  color: var(--c-fg-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drawer-close:hover { background: var(--a-teal-08); color: var(--c-fg); }

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.drawer-link {
  display: block;
  padding: .85rem 1rem;
  font-family: var(--f-head);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--c-fg);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all var(--t-fast);
}
.drawer-link:hover {
  background: var(--a-teal-08);
  color: var(--c-accent);
  text-decoration: none;
}
.drawer-link[aria-current="page"] {
  background: var(--a-teal-12);
  color: var(--c-accent);
  font-weight: 600;
}

.drawer-foot {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-divider);
  font-size: .8rem;
  color: var(--c-fg-muted);
}

/* === Hero (per-page, condensed) === */
/* Hero — subtelne tło, delikatna linia dolna */
.hero {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
}
.hero-eyebrow {
  display: inline-block;
  font-family: var(--f-head);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-accent);
  background: var(--a-teal-12);
  padding: 4px 10px;
  border-radius: var(--r-full);
  margin-bottom: 1rem;
}
[data-theme="dark"] .hero-eyebrow { color: var(--c-accent); }
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: .5rem;
  max-width: 32ch;
}
.hero-lede {
  font-size: clamp(1rem, 1.5vw, 1.05rem);
  color: var(--c-fg-muted);
  max-width: 60ch;
  line-height: 1.6;
}
.hero-meta {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: .85rem;
  color: var(--c-fg-muted);
}
.hero-meta strong { color: var(--c-fg); font-weight: 600; }

/* === Sections === */
.section {
  padding: clamp(2rem, 4vw, 3rem) 0;
}
.section-tight {
  padding: clamp(1.25rem, 2.5vw, 2rem) 0;
}
.section-title {
  font-family: var(--f-head);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.005em;
  color: var(--c-fg);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--a-teal-18);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.section-title small {
  font-weight: 400;
  color: var(--c-fg-muted);
  font-size: .82rem;
}

/* === Breadcrumbs === */
.crumbs {
  font-size: .8rem;
  color: var(--c-fg-muted);
  margin: 1rem 0 .5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
}
.crumbs a {
  color: var(--c-accent);
  font-weight: 500;
  transition: color var(--t-fast);
  text-decoration: none;
}
.crumbs a:hover { text-decoration: underline; }
.crumbs-sep {
  color: var(--c-fg-muted);
  opacity: .4;
  font-size: .7rem;
}
.crumbs-current {
  font-weight: 600;
  color: var(--c-fg);
}

/* === Footer === */
.footer {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding: 2.5rem 0 2rem;
  border-top: none;
  background: var(--c-bg-mid);
  font-size: .85rem;
  color: var(--c-fg-muted);
  position: relative;
}
/* Gradient separator — teal accent line zamiast zwykłego border */
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
  opacity: .4;
}
.footer-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: center;
}
.footer-brand {
  font-family: var(--f-head);
  font-weight: 700;
  color: var(--c-fg);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--c-fg-muted);
  transition: color var(--t-fast);
  font-weight: 500;
}
.footer-links a:hover { color: var(--c-accent); text-decoration: none; }
.footer-fineprint {
  grid-column: 1 / -1;
  padding-top: 1rem;
  margin-top: .5rem;
  border-top: 1px solid var(--c-divider);
  font-size: .75rem;
  color: var(--c-fg-muted);
  opacity: .7;
  letter-spacing: .01em;
}

@media (max-width: 600px) {
  .footer-in { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-links { justify-content: center; }
  /* Sprint 25: topbar-actions przepełniały 375px (poziomy scroll). Na mobile
     chowamy PRO (niszowy power-user toggle) i tekst „Szukaj ⌘K" (⌘K nie istnieje
     na dotyku) — ikona lupy zostaje klikalna. */
  .topbar-pro { display: none; }
  .topbar-cmdk > span { display: none; }
  .topbar-cmdk { padding-left: .5rem; padding-right: .5rem; }
}

/* === Scroll-to-top FAB === */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 80;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(13,148,136,.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-base), background var(--t-fast);
}
.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top:hover {
  background: var(--c-accent-hover, #0f766e);
  box-shadow: 0 4px 16px rgba(13,148,136,.35);
}
.scroll-top svg { width: 20px; height: 20px; }
@media print { .scroll-top { display: none; } }
