/* KSeF Alert – poradniki (blog). Tokens shared with the homepage. */
:root {
  --paper: #f5f6f3;
  --white: #ffffff;
  --ink: #14162b;
  --ink-2: #2a2d47;
  --muted: #5a5f73;
  --line: #dcdee6;
  --stamp: #3d2fd1;
  --stamp-dark: #2c20a8;
  --stamp-tint: #ecebfd;
  --signal: #f5a400;
  --radius-s: 6px;
  --radius-m: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 50;
  background: var(--white);
  padding: 8px 12px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-s);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--stamp);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--stamp-dark);
}
.btn-light {
  background: var(--white);
  color: var(--ink);
}
.btn-light:hover {
  background: var(--stamp-tint);
}
.btn-small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.95rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 246, 243, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--stamp);
  display: grid;
  place-items: center;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--signal);
  border: 2px solid var(--paper);
}
.main-nav {
  display: flex;
  gap: 28px;
}
.main-nav a {
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.97rem;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--stamp);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.login-link {
  font-weight: 600;
  text-decoration: none;
  font-size: 0.97rem;
}

/* ---------- Breadcrumbs ---------- */
.crumbs {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--line);
}
.crumbs a {
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--stamp);
  text-decoration: underline;
}

/* ---------- Article ---------- */
.post-head {
  padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}
.post-head h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  letter-spacing: -0.035em;
  max-width: 22ch;
}
.post-facts {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 0.95rem;
}
.post-facts .cat {
  color: var(--stamp);
  font-weight: 700;
  text-decoration: none;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 68ch) minmax(0, 300px);
  justify-content: space-between;
  gap: clamp(32px, 6vw, 80px);
  padding: clamp(36px, 5vw, 56px) 0 clamp(56px, 8vw, 96px);
}

.prose {
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--ink-2);
}
.prose > * + * {
  margin-top: 1.1em;
}
.prose p,
.prose ul,
.prose ol {
  margin-bottom: 0;
}
.prose h2 {
  margin-top: 2em;
  font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  color: var(--ink);
}
.prose h3 {
  margin-top: 1.6em;
  font-size: 1.22rem;
  color: var(--ink);
}
.prose h2 + *,
.prose h3 + * {
  margin-top: 0.6em;
}
.prose a {
  color: var(--stamp);
  font-weight: 600;
  text-underline-offset: 3px;
}
.prose strong {
  color: var(--ink);
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose li + li {
  margin-top: 0.45em;
}
.prose li::marker {
  color: var(--stamp);
}
.prose .notice {
  background: var(--white);
  border-left: 4px solid var(--signal);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  padding: 16px 20px;
  font-size: 1rem;
}

/* FAQ inside content */
.prose details {
  border-bottom: 1px solid var(--line);
  margin-top: 0;
}
.prose h2 + details {
  border-top: 2px solid var(--ink);
  margin-top: 0.8em;
}
.prose summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  font-weight: 700;
  color: var(--ink);
}
.prose summary::-webkit-details-marker {
  display: none;
}
.prose summary::after {
  content: "+";
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--stamp);
}
.prose details[open] summary::after {
  content: "−";
}
.prose details p {
  margin: 0;
  padding: 0 46px 18px 0;
}

/* Inline product CTA at the end of the article */
.post-cta {
  margin-top: 3em;
  background: var(--ink);
  color: #e9eaf3;
  border-radius: var(--radius-m);
  padding: clamp(24px, 4vw, 36px);
}
.post-cta h2 {
  margin: 0 0 10px;
  color: var(--white);
  font-size: 1.5rem;
}
.prose .post-cta .btn-primary {
  color: var(--white);
  text-decoration: none;
}
.post-cta p {
  color: #b7b9d0;
  margin: 0 0 20px;
  max-width: 52ch;
}

/* Sidebar */
.post-aside {
  position: relative;
}
.aside-card {
  position: sticky;
  top: 96px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
}
.aside-card h2 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.aside-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 18px;
}
.aside-card .btn {
  width: 100%;
}
.aside-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Related */
.related {
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 80px) 0;
  background: var(--white);
}
.related h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-bottom: 28px;
}

/* ---------- Post list (used by blog index and related) ---------- */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}
.post-list li {
  border-bottom: 1px solid var(--line);
}
.post-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 32px;
  padding: 20px 0;
  text-decoration: none;
}
.post-list strong {
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.post-list span {
  color: var(--muted);
  grid-column: 1;
  max-width: 64ch;
}
.post-list em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.9rem;
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
}
.post-list a:hover strong {
  color: var(--stamp);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Blog index ---------- */
.blog-head {
  padding: clamp(48px, 7vw, 96px) 0 clamp(32px, 5vw, 56px);
}
.blog-head h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  letter-spacing: -0.04em;
  margin-bottom: 18px;
}
.blog-head p {
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  color: var(--ink-2);
  max-width: 56ch;
}
.topic-nav {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.topic-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--white);
}
.topic-nav a:hover {
  border-color: var(--stamp);
  color: var(--stamp);
}

.featured {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
  margin-bottom: clamp(56px, 8vw, 96px);
}
.feature {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius-m);
  background: var(--white);
  border: 1px solid var(--line);
  text-decoration: none;
  min-height: 220px;
}
.feature:hover {
  border-color: var(--stamp);
}
.feature .cat {
  color: var(--stamp);
  font-weight: 700;
  font-size: 0.9rem;
}
.feature strong {
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.feature span {
  color: var(--muted);
}
.feature em {
  margin-top: auto;
  font-style: normal;
  color: var(--muted);
  font-size: 0.9rem;
}
.feature.lead {
  background: var(--stamp);
  border-color: var(--stamp);
  color: var(--white);
}
.feature.lead .cat,
.feature.lead span,
.feature.lead em {
  color: #dcdafd;
}
.feature.lead strong {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}

.topic {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(24px, 5vw, 72px);
  margin-bottom: clamp(56px, 8vw, 88px);
  scroll-margin-top: 96px;
}
.topic h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}
.topic-intro p {
  margin-top: 12px;
  color: var(--muted);
}

/* ---------- Final CTA band + footer ---------- */
.cta-band {
  background: var(--ink);
  color: #e9eaf3;
  padding: clamp(48px, 7vw, 80px) 0;
}
.cta-band .wrap {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h2 {
  color: var(--white);
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  max-width: 20ch;
}
.cta-band p {
  color: #a9acc4;
  margin-top: 10px;
}

.site-footer {
  background: var(--ink);
  color: #a9acc4;
  padding: 0 0 40px;
  font-size: 0.93rem;
}
.footer-inner {
  border-top: 1px solid #2a2d47;
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-inner ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer a {
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--white);
  text-decoration: underline;
}
.footer-note {
  margin-top: 16px;
  font-size: 0.85rem;
  max-width: 70ch;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .main-nav {
    display: none;
  }
  .post-layout {
    grid-template-columns: 1fr;
  }
  /* the inline CTA at the end of the content covers mobile */
  .post-aside {
    display: none;
  }
  .featured {
    grid-template-columns: 1fr;
  }
  .feature {
    min-height: 0;
  }
  .topic {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .header-actions .btn {
    display: none;
  }
  .prose {
    font-size: 1.04rem;
  }
  .post-list a {
    grid-template-columns: 1fr;
  }
  .post-list em {
    grid-column: 1;
    grid-row: auto;
  }
}
