/*
Theme Name: NorskKryss
Theme URI: https://www.norskkryss.no
Author: NorskKryss
Description: Clean Scandinavian theme for the NorskKryss Norwegian learning blog.
Version: 1.0.0
Text Domain: norskkryss
*/

:root {
  --nk-primary: #00205B;
  --nk-primary-light: #3D4D7A;
  --nk-accent: #BA0C2F;
  --nk-accent-light: #E84A5F;
  --nk-bg: #FAFAFA;
  --nk-surface: #FFFFFF;
  --nk-text: #1C1B1F;
  --nk-text-secondary: #555;
  --nk-subtle: #E3F2FD;
  --nk-border: #E0E0E0;
  --nk-table-stripe: #F5F7FA;
  --nk-cta-start: #1a3a8f;
  --nk-cta-end: #2d46b9;
  --nk-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --nk-content-width: 720px;
  --nk-wide-width: 960px;
  --nk-radius: 8px;
  --nk-radius-lg: 16px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--nk-font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--nk-text);
  background: var(--nk-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--nk-primary); text-decoration: none; }
a:hover { color: var(--nk-primary-light); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ─── Header ─── */

.nk-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nk-surface);
  border-bottom: 1px solid var(--nk-border);
}

.nk-header__inner {
  max-width: var(--nk-wide-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nk-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--nk-text);
}

.nk-header__brand:hover { text-decoration: none; }

.nk-header__logo { border-radius: 6px; }

.nk-header__title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.nk-header__subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--nk-text-secondary);
}

/* ─── Language switcher ─── */

.nk-lang {
  display: flex;
  background: var(--nk-bg-card);
  border: 1px solid var(--nk-border);
  border-radius: 20px;
  overflow: hidden;
}

.nk-lang__item {
  display: block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--nk-text-secondary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.nk-lang__item:hover {
  color: var(--nk-primary);
  text-decoration: none;
}

.nk-lang__item--active {
  background: var(--nk-primary);
  color: white;
}

.nk-lang__item--active:hover {
  color: white;
}

/* ─── Footer ─── */

.nk-footer {
  margin-top: 80px;
  border-top: 1px solid var(--nk-border);
  background: var(--nk-surface);
}

.nk-footer__inner {
  max-width: var(--nk-wide-width);
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nk-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nk-footer__title {
  font-size: 14px;
  font-weight: 600;
}

.nk-footer__desc {
  font-size: 13px;
  color: var(--nk-text-secondary);
}

.nk-footer__nav ul {
  display: flex;
  list-style: none;
  gap: 16px;
}

.nk-footer__nav a {
  font-size: 14px;
  color: var(--nk-text-secondary);
}

/* ─── Hero ─── */

.nk-hero {
  position: relative;
  background: linear-gradient(135deg, var(--nk-cta-start) 0%, #0a1a4a 50%, var(--nk-cta-end) 100%);
  padding: 80px 24px;
  overflow: hidden;
  text-align: center;
}

.nk-hero--mini {
  padding: 40px 24px;
}

.nk-hero--mini .nk-hero__title {
  font-size: 28px;
}

.nk-hero--mini .nk-hero__subtitle {
  font-size: 15px;
  margin-bottom: 20px;
}

.nk-hero--mini .nk-hero__btn {
  padding: 10px 24px;
  font-size: 14px;
}

.nk-hero__grid {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(0);
  display: grid;
  grid-template-columns: repeat(5, 48px);
  grid-template-rows: repeat(5, 48px);
  gap: 4px;
  opacity: 0.07;
  will-change: transform;
  transition: transform 0.1s linear;
}

.nk-hero__grid span {
  background: white;
  border-radius: 3px;
  animation: nk-float 6s ease-in-out infinite;
}

.nk-hero__grid span:nth-child(2) { animation-delay: -0.5s; }
.nk-hero__grid span:nth-child(3) { animation-delay: -1s; }
.nk-hero__grid span:nth-child(4) { animation-delay: -1.5s; }
.nk-hero__grid span:nth-child(5) { animation-delay: -2s; }
.nk-hero__grid span:nth-child(6) { animation-delay: -2.5s; }
.nk-hero__grid span:nth-child(8) { animation-delay: -3s; }
.nk-hero__grid span:nth-child(10) { animation-delay: -3.5s; }
.nk-hero__grid span:nth-child(11) { animation-delay: -4s; }
.nk-hero__grid span:nth-child(12) { animation-delay: -4.5s; }
.nk-hero__grid span:nth-child(14) { animation-delay: -5s; }
.nk-hero__grid span:nth-child(15) { animation-delay: -0.8s; }
.nk-hero__grid span:nth-child(16) { animation-delay: -1.3s; }
.nk-hero__grid span:nth-child(18) { animation-delay: -2.8s; }
.nk-hero__grid span:nth-child(20) { animation-delay: -3.3s; }

@keyframes nk-float {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-6px); opacity: 0.6; }
}

.nk-hero__grid span:nth-child(7),
.nk-hero__grid span:nth-child(9),
.nk-hero__grid span:nth-child(13),
.nk-hero__grid span:nth-child(17),
.nk-hero__grid span:nth-child(19) {
  opacity: 0;
}

.nk-hero__content {
  position: relative;
  max-width: var(--nk-wide-width);
  margin: 0 auto;
}

.nk-hero__title {
  font-size: 44px;
  font-weight: 800;
  color: white;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.nk-hero__subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.nk-hero__cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nk-hero__btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.nk-hero__btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.nk-hero__btn--primary {
  background: white;
  color: var(--nk-primary);
}

.nk-hero__btn--primary:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  color: var(--nk-primary);
}

.nk-hero__btn--secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.nk-hero__btn--secondary:hover {
  border-color: white;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  color: white;
}

/* ─── Filter bar ─── */

.nk-filters {
  background: var(--nk-surface);
  border-bottom: 1px solid var(--nk-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 53px;
  z-index: 90;
  margin-bottom: 8px;
  padding-top: 8px;
}

.nk-filters__inner {
  max-width: var(--nk-wide-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nk-filters__inner::-webkit-scrollbar {
  display: none;
}

.nk-filters__group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.nk-filters__group + .nk-filters__group {
  padding-left: 12px;
  border-left: 1px solid var(--nk-border);
}

.nk-filters__pill {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nk-text-secondary);
  background: var(--nk-bg);
  border: 1px solid var(--nk-border);
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.nk-filters__pill:hover {
  color: var(--nk-primary);
  border-color: var(--nk-primary);
  text-decoration: none;
}

.nk-filters__pill--active {
  background: var(--nk-primary);
  color: white;
  border-color: var(--nk-primary);
}

.nk-filters__pill--active:hover {
  color: white;
  background: var(--nk-primary-light);
  border-color: var(--nk-primary-light);
}

.nk-filters__pill--tag {
  background: transparent;
  border-color: var(--nk-accent);
  color: var(--nk-accent);
  font-weight: 500;
}

.nk-filters__pill--tag:hover {
  background: rgba(186, 12, 47, 0.08);
  color: var(--nk-accent);
  border-color: var(--nk-accent);
}

.nk-filters__pill--tag.nk-filters__pill--active {
  background: var(--nk-accent);
  color: white;
  border-color: var(--nk-accent);
}

.nk-filters__more {
  font-size: 13px;
  font-weight: 600;
  color: var(--nk-primary);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 4px;
  transition: color 0.2s;
}

.nk-filters__more:hover {
  color: var(--nk-primary-light);
  text-decoration: none;
}

/* ─── Featured post ─── */

.nk-featured {
  background: var(--nk-surface);
  border: 1px solid var(--nk-border);
  border-left: 4px solid var(--nk-primary);
  border-radius: var(--nk-radius);
  padding: 32px;
  margin-bottom: 48px;
  overflow: hidden;
}

.nk-featured__image {
  display: block;
  margin: -32px -32px 24px;
  overflow: hidden;
}

.nk-featured__image img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.nk-featured__label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--nk-primary);
  background: var(--nk-subtle);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.nk-featured__link { text-decoration: none; }
.nk-featured__link:hover { text-decoration: none; }

.nk-featured__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--nk-text);
  line-height: 1.25;
  margin-bottom: 8px;
}

.nk-featured__date {
  font-size: 14px;
  color: var(--nk-text-secondary);
  display: block;
  margin-bottom: 16px;
}

.nk-featured__excerpt {
  font-size: 16px;
  color: var(--nk-text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.nk-featured__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.nk-featured__read {
  font-size: 15px;
  font-weight: 600;
  color: var(--nk-primary);
  text-decoration: none;
}

.nk-featured__read:hover {
  text-decoration: underline;
}

/* ─── Section title ─── */

.nk-section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--nk-text-secondary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nk-border);
}

/* ─── Main ─── */

.nk-main {
  max-width: var(--nk-wide-width);
  margin: 0 auto;
  padding: 48px 24px;
}

/* ─── Archive / Homepage ─── */

.nk-archive__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--nk-primary);
  margin-bottom: 8px;
}

.nk-archive__desc {
  font-size: 16px;
  color: var(--nk-text-secondary);
  margin-bottom: 40px;
}

.nk-post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ─── Card ─── */

.nk-card {
  display: flex;
  flex-direction: column;
  background: var(--nk-surface);
  border: 1px solid var(--nk-border);
  border-radius: var(--nk-radius);
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
}

.nk-card__image {
  display: block;
  margin: -24px -24px 16px;
  overflow: hidden;
}

.nk-card__image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.nk-card:hover .nk-card__image img {
  transform: scale(1.03);
}

.nk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nk-card__link { text-decoration: none; }
.nk-card__link:hover { text-decoration: none; }

.nk-card__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--nk-text);
  line-height: 1.3;
  margin-bottom: 8px;
}

.nk-card__date {
  font-size: 13px;
  color: var(--nk-text-secondary);
  display: block;
  margin-bottom: 12px;
}

.nk-card__excerpt {
  font-size: 15px;
  color: var(--nk-text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.nk-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

/* ─── Tag pills ─── */

.nk-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--nk-accent);
  background: rgba(186, 12, 47, 0.08);
  border-radius: 20px;
  padding: 4px 12px;
  text-decoration: none;
}

.nk-tag:hover {
  background: rgba(186, 12, 47, 0.15);
  text-decoration: none;
  color: var(--nk-accent);
}

/* ─── Pagination ─── */

.nk-pagination {
  margin-top: 48px;
  text-align: center;
}

.nk-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nk-pagination a,
.nk-pagination span {
  padding: 8px 14px;
  border-radius: var(--nk-radius);
  font-size: 14px;
}

.nk-pagination a {
  color: var(--nk-primary);
  border: 1px solid var(--nk-border);
}

.nk-pagination .current {
  background: var(--nk-primary);
  color: white;
}

/* ─── Single post ─── */

.nk-post {
  max-width: var(--nk-content-width);
  margin: 0 auto;
}

.nk-post__header { margin-bottom: 40px; }

.nk-post__title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--nk-text);
  margin-bottom: 16px;
}

.nk-post__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nk-post__meta time {
  font-size: 14px;
  color: var(--nk-text-secondary);
}

.nk-post__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nk-post__featured-image {
  margin-bottom: 32px;
  border-radius: var(--nk-radius);
  overflow: hidden;
}

.nk-post__featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Crossword banner (single post) ─── */

.nk-crossword-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 32px;
  background: linear-gradient(135deg, rgba(26, 58, 143, 0.08), rgba(45, 70, 185, 0.08));
  border: 1px solid rgba(26, 58, 143, 0.2);
  border-radius: var(--nk-radius);
  flex-wrap: wrap;
}

.nk-crossword-banner__icon {
  font-size: 22px;
  color: var(--nk-cta-start);
  flex-shrink: 0;
}

.nk-crossword-banner__text {
  font-size: 15px;
  font-weight: 500;
  color: var(--nk-text);
  flex: 1;
}

.nk-crossword-banner__btn {
  display: inline-block;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--nk-cta-start), var(--nk-cta-end));
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 0.2s, transform 0.2s;
}

.nk-crossword-banner__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 58, 143, 0.35);
  text-decoration: none;
  color: white;
}

/* ─── Post content ─── */

.nk-post__content h2 {
  font-size: 26px;
  font-weight: 600;
  margin: 48px 0 16px;
  color: var(--nk-text);
}

.nk-post__content h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--nk-text);
}

.nk-post__content p { margin-bottom: 20px; }

.nk-post__content ul,
.nk-post__content ol {
  margin: 0 0 20px 24px;
}

.nk-post__content li { margin-bottom: 8px; }

.nk-post__content strong { font-weight: 600; }

.nk-post__content hr {
  border: none;
  border-top: 1px solid var(--nk-border);
  margin: 40px 0;
}

/* ─── Vocabulary tables ─── */

.nk-post__content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  overflow: hidden;
}

.nk-post__content thead th {
  background: var(--nk-primary);
  color: white;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
}

.nk-post__content tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--nk-border);
}

.nk-post__content tbody tr:nth-child(even) {
  background: var(--nk-table-stripe);
}

.nk-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border-radius: var(--nk-radius);
  border: 1px solid var(--nk-border);
}

.nk-table-wrap table { margin: 0; }

/* ─── CTA block ─── */

.nk-cta,
.wp-block-group.nk-cta {
  background: linear-gradient(135deg, var(--nk-cta-start) 0%, var(--nk-cta-end) 100%);
  color: white;
  padding: 48px 32px;
  border-radius: var(--nk-radius-lg);
  text-align: center;
  margin: 32px 0;
}

.nk-cta p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
  font-size: 16px;
}

.nk-cta .nk-cta-title,
.nk-cta p:first-child {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.nk-cta .nk-cta-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  margin-bottom: 16px;
}

.nk-cta a {
  display: block;
  max-width: 280px;
  margin: 12px auto;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 32px;
  border-radius: 30px;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.nk-cta a.nk-btn-primary,
.nk-cta a:first-of-type {
  background: white;
  color: var(--nk-primary);
}

.nk-cta a.nk-btn-secondary {
  background: rgba(0, 0, 0, 0.25);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.nk-cta a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

.nk-cta a.nk-btn-primary:hover,
.nk-cta a:first-of-type:hover {
  color: var(--nk-primary);
}

.nk-cta a.nk-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.35);
  color: white;
  border-color: white;
}

/* ─── Crossword link on cards ─── */

.nk-crossword-link {
  display: block;
  text-align: center;
  margin-top: auto;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--nk-cta-start), var(--nk-cta-end));
  border-radius: 24px;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.nk-crossword-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 58, 143, 0.35);
  text-decoration: none;
  color: white;
}

.nk-featured__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ─── Crossword embed ─── */

.nk-post__content iframe {
  width: 100%;
  min-height: 500px;
  border: none;
  border-radius: var(--nk-radius);
  background: var(--nk-subtle);
  margin: 24px 0;
}

/* ─── Post navigation ─── */

.nk-post-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--nk-border);
}

.nk-post-nav__link {
  text-decoration: none;
  max-width: 48%;
}

.nk-post-nav__link:hover { text-decoration: none; }

.nk-post-nav__next { text-align: right; margin-left: auto; }

.nk-post-nav__label {
  font-size: 13px;
  color: var(--nk-text-secondary);
  display: block;
  margin-bottom: 4px;
}

.nk-post-nav__title {
  font-size: 15px;
  font-weight: 500;
  color: var(--nk-primary);
}

/* ─── More Posts ─── */

.nk-more-posts {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--nk-border);
}

.nk-more-posts__heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nk-text-secondary);
  margin-bottom: 16px;
}

.nk-more-posts__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nk-more-posts__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--nk-border);
}

.nk-more-posts__link {
  font-size: 17px;
  font-weight: 500;
  color: var(--nk-text);
  text-decoration: none;
}

.nk-more-posts__link:hover {
  color: var(--nk-primary);
}

.nk-more-posts__date {
  font-size: 14px;
  color: var(--nk-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Reading time ─── */

.nk-reading-time {
  font-size: 13px;
  color: var(--nk-text-secondary);
}

.nk-reading-time::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--nk-text-secondary);
  vertical-align: middle;
  margin: 0 8px;
}

.nk-post__reading-time {
  font-size: 14px;
  color: var(--nk-text-secondary);
}

.nk-post__reading-time::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--nk-text-secondary);
  vertical-align: middle;
  margin: 0 8px;
}

.nk-card__meta,
.nk-featured__meta {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.nk-featured__meta { margin-bottom: 16px; }

.nk-card__meta .nk-card__date,
.nk-featured__meta .nk-featured__date {
  margin-bottom: 0;
}

/* ─── Breadcrumb ─── */

.nk-breadcrumb {
  font-size: 13px;
  color: var(--nk-text-secondary);
  margin-bottom: 24px;
}

.nk-breadcrumb a {
  color: var(--nk-text-secondary);
  text-decoration: none;
}

.nk-breadcrumb a:hover {
  color: var(--nk-primary);
  text-decoration: underline;
}

.nk-breadcrumb__sep {
  margin: 0 8px;
  opacity: 0.5;
}

.nk-breadcrumb__current {
  color: var(--nk-text);
  font-weight: 500;
}

/* ─── Reading progress bar ─── */

.nk-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--nk-accent), var(--nk-primary));
  z-index: 200;
  transition: width 0.1s linear;
}

/* ─── Search overlay ─── */

/* ─── App link in header ─── */

.nk-header__app-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nk-header__app-link:hover {
  text-decoration: none;
  opacity: 0.85;
}

.nk-header__badge {
  height: 45px;
  width: auto;
}

@media (max-width: 768px) {
  .nk-header__badge { height: 20px; }
}

.nk-search-toggle {
  background: none;
  border: none;
  color: var(--nk-text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.nk-search-toggle:hover { color: var(--nk-primary); }

.nk-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nk-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  backdrop-filter: blur(4px);
}

.nk-search-overlay--open {
  display: flex;
}

.nk-search-wrap {
  width: 90%;
  max-width: 560px;
  animation: nk-search-in 0.2s ease;
}

.nk-search-form {
  display: flex;
  align-items: center;
  background: var(--nk-surface);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

@keyframes nk-search-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nk-search-form__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px 20px;
  font-size: 17px;
  font-family: var(--nk-font);
  color: var(--nk-text);
  background: transparent;
}

.nk-search-form__input::placeholder {
  color: var(--nk-text-secondary);
}

.nk-search-form__btn {
  background: none;
  border: none;
  padding: 16px;
  cursor: pointer;
  color: var(--nk-primary);
  display: flex;
  align-items: center;
}

.nk-search-form__close {
  background: none;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 24px;
  color: var(--nk-text-secondary);
  line-height: 1;
}

.nk-search-form__close:hover { color: var(--nk-text); }

/* Search suggestions */
.nk-search-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  background: var(--nk-surface);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.nk-search-results:empty { display: none; }
.nk-search-results__item { border-bottom: 1px solid rgba(0,0,0,0.06); }
.nk-search-results__item:last-child { border-bottom: none; }
.nk-search-results__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  text-decoration: none;
  color: var(--nk-text);
  transition: background 0.15s;
}
.nk-search-results__link:hover,
.nk-search-results__item--active .nk-search-results__link {
  background: #e8eef6;
}
.nk-search-results__title {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nk-search-results__date {
  font-size: 13px;
  color: var(--nk-text-secondary);
  white-space: nowrap;
}
.nk-search-results__empty {
  padding: 14px 20px;
  color: var(--nk-text-secondary);
  text-align: center;
  font-size: 14px;
}

/* Crossword grid loader */
.nk-search-loader {
  display: flex;
  justify-content: center;
  padding: 20px;
}
.nk-search-loader__grid {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 28px);
  gap: 3px;
}
.nk-search-loader__cell {
  width: 28px;
  height: 28px;
  border: 2px solid var(--nk-primary);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--nk-font);
  color: white;
  background: transparent;
  animation: nk-cell-fill 1.6s ease-in-out infinite;
}
.nk-search-loader__cell--key {
  border-color: var(--nk-accent);
  animation-name: nk-cell-fill-key;
}
.nk-search-loader__cell--blank {
  border-color: transparent;
  background: transparent;
  animation: none;
}
@keyframes nk-cell-fill-key {
  0%, 100% { background: transparent; color: transparent; }
  30%, 70% { background: var(--nk-accent); color: white; }
}
@keyframes nk-cell-fill {
  0%, 100% { background: transparent; color: transparent; }
  30%, 70% { background: var(--nk-primary); color: white; }
}

/* ─── Back to top ─── */

.nk-back-to-top {
  position: fixed;
  bottom: 90px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--nk-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 14px rgba(0, 32, 91, 0.3);
}

.nk-back-to-top--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nk-back-to-top:hover {
  background: var(--nk-primary-light);
}

/* ─── Footer links ─── */

.nk-footer__links {
  display: flex;
  gap: 24px;
}

.nk-footer__links a {
  font-size: 14px;
  color: var(--nk-text-secondary);
  text-decoration: none;
}

.nk-footer__links a:hover {
  color: var(--nk-primary);
}

/* ─── 404 ─── */

.nk-404 {
  max-width: var(--nk-content-width);
  margin: 40px auto;
  text-align: center;
}

.nk-404__grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.nk-404__grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  font-size: 40px;
  font-weight: 800;
  color: var(--nk-primary);
  background: var(--nk-subtle);
  border-radius: var(--nk-radius);
}

.nk-404 h1 {
  font-size: 32px;
  color: var(--nk-text);
  margin-bottom: 12px;
}

.nk-404 p {
  color: var(--nk-text-secondary);
  margin-bottom: 32px;
  font-size: 17px;
}

.nk-404__search {
  display: flex;
  max-width: 400px;
  margin: 0 auto 40px;
  border: 1px solid var(--nk-border);
  border-radius: 30px;
  overflow: hidden;
  background: var(--nk-surface);
}

.nk-404__search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 20px;
  font-size: 15px;
  font-family: var(--nk-font);
}

.nk-404__search-btn {
  border: none;
  background: var(--nk-primary);
  color: white;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.nk-404__search-btn:hover { background: var(--nk-primary-light); }

.nk-404__suggestions {
  margin-bottom: 32px;
}

.nk-404__suggestions h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--nk-text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nk-404__suggestions ul {
  list-style: none;
  padding: 0;
}

.nk-404__suggestions li {
  padding: 12px 0;
  border-top: 1px solid var(--nk-border);
}

.nk-404__suggestions a {
  font-size: 17px;
  font-weight: 500;
  color: var(--nk-text);
  text-decoration: none;
}

.nk-404__suggestions a:hover { color: var(--nk-primary); }

.nk-404__home {
  display: inline-block;
  padding: 12px 28px;
  background: var(--nk-primary);
  color: white;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.nk-404__home:hover {
  background: var(--nk-primary-light);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ─── Blockquote ─── */

.nk-post__content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--nk-primary);
  background: var(--nk-subtle);
  border-radius: 0 var(--nk-radius) var(--nk-radius) 0;
  font-style: italic;
  color: var(--nk-text);
}

.nk-post__content blockquote p:last-child {
  margin-bottom: 0;
}

/* ─── Code blocks ─── */

.nk-post__content code {
  font-size: 0.9em;
  background: var(--nk-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.nk-post__content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px 24px;
  border-radius: var(--nk-radius);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}

.nk-post__content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ─── Image captions ─── */

.nk-post__content figure {
  margin: 32px 0;
}

.nk-post__content figcaption {
  font-size: 13px;
  color: var(--nk-text-secondary);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* ─── Print styles ─── */

@media print {
  .nk-header, .nk-footer, .nk-filters, .nk-hero,
  .nk-crossword-banner, .nk-crossword-link, .nk-post-nav,
  .nk-more-posts, .nk-back-to-top, .nk-progress-bar,
  .nk-search-overlay, .nk-cta, iframe {
    display: none !important;
  }
  .nk-main { padding: 0; }
  .nk-post { max-width: 100%; }
  body { font-size: 12pt; }
  a { color: inherit; text-decoration: underline; }
}

/* ─── Taxonomy pages (all categories / all tags) ─── */

.nk-taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.nk-taxonomy-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--nk-surface);
  border: 1px solid var(--nk-border);
  border-radius: var(--nk-radius);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.nk-taxonomy-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--nk-primary);
  text-decoration: none;
}

.nk-taxonomy-card--tag:hover {
  border-color: var(--nk-accent);
}

.nk-taxonomy-card__name {
  font-size: 18px;
  font-weight: 600;
  color: var(--nk-text);
  margin-bottom: 8px;
}

.nk-taxonomy-card--tag .nk-taxonomy-card__name {
  color: var(--nk-accent);
}

.nk-taxonomy-card__desc {
  font-size: 14px;
  color: var(--nk-text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.nk-taxonomy-card__count {
  margin-top: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--nk-text-secondary);
}

/* ─── Scroll reveal ─── */

.nk-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.nk-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger delays set via JS */

/* ─── Mobile ─── */

@media (max-width: 768px) {
  /* Header */
  .nk-header__inner { padding: 10px 16px; }
  .nk-header__title { font-size: 14px; max-width: 180px; }
  .nk-header__subtitle { font-size: 10px; }
  .nk-header__brand { gap: 8px; min-width: 0; }
  .nk-header__logo { width: 32px; height: 32px; flex-shrink: 0; }

  /* Hero */
  .nk-hero { padding: 48px 16px; }
  .nk-hero__title { font-size: 32px; }
  .nk-hero__subtitle { font-size: 15px; margin-bottom: 24px; }
  .nk-hero__btn { padding: 12px 24px; font-size: 15px; }
  .nk-hero__cta { flex-direction: column; align-items: center; gap: 12px; }
  .nk-hero--mini { padding: 28px 16px; }
  .nk-hero--mini .nk-hero__title { font-size: 22px; }

  /* Filter bar */
  .nk-filters { top: 45px; }
  .nk-filters__inner {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nk-filters__group { flex-wrap: wrap; gap: 6px; }
  .nk-filters__group + .nk-filters__group {
    padding-left: 0;
    border-left: none;
    padding-top: 6px;
    border-top: 1px solid var(--nk-border);
    width: 100%;
  }
  .nk-filters__pill { padding: 5px 12px; font-size: 12px; }

  /* Featured post */
  .nk-featured { padding: 20px; }
  .nk-featured__image { margin: -20px -20px 16px; }
  .nk-featured__image img { height: 180px; }
  .nk-featured__title { font-size: 22px; }
  .nk-featured__excerpt { font-size: 15px; }
  .nk-featured__actions { flex-direction: column; gap: 8px; }

  /* Post grid */
  .nk-post-grid { grid-template-columns: 1fr; }
  .nk-card__title { font-size: 18px; }
  .nk-card__excerpt { font-size: 14px; }

  /* Taxonomy pages */
  .nk-taxonomy-grid { grid-template-columns: 1fr; }

  /* Single post */
  .nk-post { padding: 24px 16px; }
  .nk-post__title { font-size: 26px; }
  .nk-post__content { font-size: 16px; }
  .nk-post-nav { flex-direction: column; gap: 16px; }
  .nk-post-nav__link { max-width: 100%; }
  .nk-post-nav__next { text-align: left; }

  /* Crossword banner */
  .nk-crossword-banner { padding: 12px 16px; }
  .nk-crossword-banner__text { font-size: 14px; }

  /* More posts */
  .nk-more-posts__item { flex-direction: column; gap: 4px; }
  .nk-more-posts__link { font-size: 15px; }
  .nk-more-posts__date { font-size: 13px; }

  /* CTA block */
  .nk-cta { padding: 28px 20px; }
  .nk-cta a { display: block; margin: 8px 0; }

  /* Search */
  .nk-search-overlay { padding-top: 80px; }
  .nk-search-form__input { font-size: 16px; padding: 14px 16px; }

  /* Back to top */
  .nk-back-to-top { bottom: 80px; right: 20px; width: 40px; height: 40px; }

  /* 404 */
  .nk-404__grid span { width: 64px; height: 64px; font-size: 32px; }
  .nk-404 h1 { font-size: 24px; }

  /* Breadcrumb */
  .nk-breadcrumb { font-size: 12px; }
  .nk-breadcrumb__current { display: none; }

  /* Footer */
  .nk-footer { padding: 24px 16px; }
  .nk-footer__inner {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  .nk-footer__links { justify-content: center; }

  /* Main content spacing */
  .nk-main { padding: 24px 16px; }
  .nk-archive { padding: 0; }
  .nk-section-title { font-size: 18px; }
}
