/* VideoShufflr Blog — self-contained layout & tokens (no style.css dependency) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-deep: #05060f;
  --bg-surface: #0a0c1a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text: var(--text-primary);
  --border: rgba(255, 255, 255, 0.08);
  --border-default: var(--border);
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --primary: var(--accent-indigo);
  --color-primary: var(--accent-indigo);
  --color-gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --bg-primary: var(--bg-deep);
  --bg-overlay: rgba(5, 6, 15, 0.85);
  --bg-soft: #111327;
  --font-family: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --line-height-relaxed: 1.7;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --shadow-glow-lg: 0 20px 50px rgba(99, 102, 241, 0.35);
  --transition-base: 0.2s ease;
  --z-sticky: 200;

  /* Layout */
  --blog-max: 1200px;
  --article-max: 720px;
  --pad-x: 20px;
  --pad-section-y: 48px;
  --header-h: 64px;
}

@media (min-width: 768px) {
  :root {
    --pad-x: 28px;
    --pad-section-y: 64px;
  }
}

@media (min-width: 1024px) {
  :root {
    --pad-x: 32px;
    --pad-section-y: 72px;
  }
}

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

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

body {
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 10% -10%, #1f2937 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%, #0b1324 0%, transparent 50%),
    var(--bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: var(--line-height-relaxed);
  font-size: 16px;
}

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

a {
  color: var(--accent-indigo);
}

/* ─── Layout shell ─── */
.container {
  width: 100%;
  max-width: var(--blog-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

main {
  display: block;
  padding-bottom: var(--pad-section-y);
}

/* ─── Header ─── */
header.sticky {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: 12px var(--pad-x);
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  min-width: 0;
  flex-shrink: 1;
}

.brand-badge {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  background:
    linear-gradient(135deg, #6366f1, #8b5cf6) padding-box,
    linear-gradient(135deg, #f472b6, #60a5fa, #a78bfa) border-box;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-badge img {
  width: 22px;
  height: 22px;
  display: block;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 15px;
  }
}

nav {
  display: none;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

@media (min-width: 900px) {
  nav {
    display: flex;
  }
}

header nav a {
  position: relative;
  display: inline-block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding-bottom: 6px;
  transition: color var(--transition-base);
  white-space: nowrap;
}

header nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.95), rgba(96, 165, 250, 0.95));
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform 0.26s ease, opacity 0.2s ease;
}

header nav a:hover,
header nav a:focus-visible {
  color: var(--text-primary);
}

header nav a:hover::after,
header nav a:focus-visible::after,
header nav a.active::after {
  transform: scaleX(1);
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .header-actions .btn {
    padding: 0 12px;
    font-size: 13px;
    min-height: 38px;
  }
}

.bg-gradient-primary {
  background: var(--color-gradient-primary);
  color: #fff !important;
  box-shadow: var(--shadow-glow-lg);
}

.bg-gradient-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary) !important;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

/* ─── Blog index hero ─── */
.blog-hero {
  padding: 40px 0 32px;
  text-align: center;
}

@media (min-width: 768px) {
  .blog-hero {
    padding: 56px 0 40px;
  }
}

.blog-hero h1 {
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 0 4px;
}

.gradient-text {
  background: linear-gradient(135deg, #f472b6, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-hero p {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--text-secondary);
  margin: 0 auto;
  max-width: 42rem;
  line-height: 1.65;
  padding: 0 4px;
}

/* Main listing block */
.blog-page-section {
  padding-bottom: 24px;
}

/* ─── Featured post ─── */
.featured-post {
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .featured-post {
    margin-bottom: 48px;
  }
}

.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .featured-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow-lg);
}

.featured-image {
  width: 100%;
  min-height: 200px;
  aspect-ratio: 16 / 10;
  background: var(--color-gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

@media (min-width: 768px) {
  .featured-image {
    min-height: 100%;
    aspect-ratio: auto;
  }
}

.featured-image iconify-icon {
  font-size: clamp(48px, 10vw, 80px);
  color: #fff;
  opacity: 0.95;
}

.featured-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

@media (min-width: 768px) {
  .featured-content {
    padding: 32px 36px;
  }
}

.category-badge {
  display: inline-block;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--color-gradient-primary);
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.featured-content h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.25;
}

.featured-content h2 a {
  color: var(--text-primary);
  text-decoration: none;
}

.featured-content h2 a:hover {
  color: var(--accent-violet);
}

.featured-excerpt {
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.6;
  font-size: 15px;
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ─── Filters ─── */
.blog-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 768px) {
  .filter-btn {
    font-size: 14px;
    padding: 8px 16px;
  }
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-gradient-primary);
  color: #fff;
  border-color: transparent;
}

/* ─── Blog grid ─── */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

@media (min-width: 640px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.28);
}

.blog-card-image {
  width: 100%;
  height: 180px;
  flex-shrink: 0;
  background: var(--color-gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

@media (min-width: 768px) {
  .blog-card-image {
    height: 200px;
  }
}

.blog-card-image iconify-icon {
  font-size: 56px;
  color: #fff;
  opacity: 0.95;
}

.blog-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.35;
}

.blog-card-content h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.blog-card-content h3 a:hover {
  color: var(--accent-violet);
}

.blog-card-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 14px;
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 40px 0 16px;
  padding: 0 4px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pagination a:hover {
  background: var(--color-gradient-primary);
  border-color: transparent;
  color: #fff;
}

.pagination .active {
  background: var(--color-gradient-primary);
  border-color: transparent;
  color: #fff;
}

/* ─── Newsletter ─── */
.newsletter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  margin: 40px 0 8px;
}

@media (min-width: 768px) {
  .newsletter {
    padding: 40px 36px;
    margin: 48px 0 8px;
  }
}

.newsletter h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text-primary);
}

.newsletter p {
  color: var(--text-secondary);
  margin: 0 0 24px;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 520px) {
  .newsletter-form {
    flex-direction: row;
    align-items: stretch;
  }
}

.newsletter-form input {
  flex: 1;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
}

.newsletter-form input::placeholder {
  color: var(--text-muted);
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.newsletter-form button {
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  background: var(--color-gradient-primary);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.2s ease;
  white-space: nowrap;
}

.newsletter-form button:hover {
  filter: brightness(1.06);
}

.newsletter-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Category page CTA ─── */
.blog-category-cta {
  text-align: center;
  margin-top: 48px;
  padding-bottom: 16px;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 32px 0 40px;
  margin-top: 0;
}

footer .container p {
  margin: 0;
  line-height: 1.8;
  font-size: 14px;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover {
  color: var(--text-primary);
}

/* ─── Article pages ─── */
main article {
  padding-top: 8px;
}

main article > .container {
  padding-top: 24px;
  padding-bottom: 16px;
}

@media (min-width: 768px) {
  main article > .container {
    padding-top: 32px;
  }
}

.article-header {
  max-width: var(--article-max);
  margin: 0 auto 32px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 12px 0 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 14px;
  color: var(--text-muted);
  padding-bottom: 8px;
}

.article-content {
  max-width: var(--article-max);
  margin: 0 auto;
  padding: 8px 0 40px;
}

.article-content > *:first-child {
  margin-top: 0;
}

.article-content p.lead {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-content h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  margin: 2.5rem 0 1rem;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.article-content p {
  margin: 0 0 1.125rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
  color: var(--text-secondary);
}

.article-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  padding-left: 0.25rem;
}

.article-content li::marker {
  color: var(--accent-violet);
}

.article-content a {
  color: #a5b4fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: #c4b5fd;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-indigo);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-muted);
  background: rgba(99, 102, 241, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content em {
  color: var(--text-secondary);
}

.cta-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  margin: 2.5rem 0 1rem;
}

@media (min-width: 768px) {
  .cta-box {
    padding: 28px 28px;
  }
}

.cta-box h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.cta-box p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.cta-actions .btn {
  flex: 1 1 auto;
  min-width: min(100%, 200px);
}

@media (max-width: 479px) {
  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .btn {
    width: 100%;
  }
}

/* Related posts — full container width */
.related-posts {
  max-width: var(--blog-max);
  margin: 48px auto 0;
  padding: 40px 0 0;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  margin: 0 0 24px;
  color: var(--text-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ─── Modal (newsletter etc.) ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-glow-lg);
  position: relative;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-gradient-primary);
  color: #fff;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
}

.modal-icon.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.35);
}

.modal-icon svg {
  width: 32px;
  height: 32px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-content h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 12px;
  text-align: center;
  color: var(--text-primary);
}

.modal-content p {
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 20px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Utilities ─── */
.mobile-hide {
  display: none;
}

@media (min-width: 900px) {
  .mobile-hide {
    display: initial;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
