/*
Theme Name: Learn Deep Dive
Theme URI: https://example.com/learn-deep-dive
Author: Learn Deep Dive
Author URI: https://example.com
Description: A clean, responsive blogging theme for Learn Deep Dive.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: learn-deep-dive
Tags: blog, one-column, two-columns, right-sidebar, custom-logo, custom-menu, featured-images
*/

:root {
  --ldd-bg: #f6f8fc;
  --ldd-surface: #ffffff;
  --ldd-surface-elevated: #ffffff;
  --ldd-text: #111827;
  --ldd-muted: #6b7280;
  --ldd-primary: #1e3a5f;
  --ldd-primary-dark: #162e4c;
  --ldd-secondary: #4f46a5;
  --ldd-accent: #22d3ee;
  --ldd-border: #e5e7eb;
  --container-max-width: 1120px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 56px;
  --space-8: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ldd-radius: var(--radius-md);

  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(2, 6, 23, 0.06);
  --shadow-2: 0 8px 24px rgba(2, 6, 23, 0.08);
  --shadow-3: 0 16px 36px rgba(2, 6, 23, 0.12);

  --type-xs: 0.75rem;
  --type-sm: 0.875rem;
  --type-base: 1rem;
  --type-lg: 1.125rem;
  --type-xl: 1.25rem;
  --type-2xl: 1.5rem;
  --type-3xl: 1.875rem;

  --btn-height: 40px;
  --badge-height: 24px;
  --motion-smooth: 0.3s ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--ldd-bg);
  color: var(--ldd-text);
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--type-base);
  line-height: 1.65;
}

h1 {
  font-size: clamp(var(--type-2xl), 4vw, var(--type-3xl));
}

h2 {
  font-size: clamp(var(--type-xl), 3vw, var(--type-2xl));
}

h3 {
  font-size: var(--type-lg);
}

p,
li,
input,
textarea,
select,
button {
  font-size: var(--type-base);
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-title,
.modern-hero-title,
.modern-section-title {
  font-family: "Space Grotesk", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 9999;
  background: var(--ldd-primary);
  color: #fff;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 10px;
}

a {
  color: var(--ldd-primary);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--ldd-primary-dark);
}

.site-header,
.site-footer {
  background: var(--ldd-surface);
  border-bottom: 1px solid var(--ldd-border);
}

.site-footer {
  border-top: 1px solid var(--ldd-border);
  border-bottom: 0;
  margin-top: 3rem;
}

.wrap {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--space-2);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.site-branding .site-title {
  margin: 0;
  font-size: var(--type-2xl);
}

.site-description {
  margin: 0.25rem 0 0;
  color: var(--ldd-muted);
  font-size: var(--type-sm);
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.main-navigation a {
  font-weight: 600;
}

.main-layout {
  display: block;
  width: 100%;
  max-width: var(--container-max-width);
  margin: 1.5rem auto 0;
  padding: 0 var(--space-2);
}

.content-area,
.widget-area,
.post-card,
.hero {
  background: var(--ldd-surface);
  border: 1px solid var(--ldd-border);
  border-radius: var(--ldd-radius);
}

.content-area {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: clamp(1.25rem, 2vw, 2rem);
}

/* Minimal design system enforcement */
.post-card,
.tutorial-card,
.path-card,
.topic-section,
.page-hero,
.hero,
.content-area,
.widget-area {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.post-card:hover,
.tutorial-card:hover,
.path-card:hover,
.post-card:focus-within,
.tutorial-card:focus-within,
.path-card:focus-within {
  box-shadow: var(--shadow-2);
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.read-more,
.tutorial-readmore,
.tutorial-readmore-secondary {
  border-radius: var(--radius-sm);
}

.read-more,
.tutorial-readmore,
.tutorial-readmore-secondary {
  min-height: var(--btn-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-2);
  font-size: var(--type-sm);
  font-weight: 600;
  line-height: 1;
}

.tutorial-tag,
.difficulty-badge,
.start-badge,
.tutorial-topic-badge,
.tutorial-meta-pill {
  min-height: var(--badge-height);
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: var(--type-xs);
  font-weight: 700;
  line-height: 1;
}

.hero {
  padding: var(--space-3);
  margin-bottom: var(--space-2);
}

.page-hero {
  background: var(--ldd-surface);
  border: 1px solid var(--ldd-border);
  border-radius: var(--ldd-radius);
  padding: clamp(1rem, 2vw, 1.5rem);
  margin-bottom: 1rem;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.page-hero .post-meta {
  margin-top: 0.45rem;
  margin-bottom: 0;
}

.topic-page,
.learning-path-page {
  display: grid;
  gap: var(--space-2);
}

.topic-section {
  background: var(--ldd-surface);
  border: 1px solid var(--ldd-border);
  border-radius: var(--ldd-radius);
  padding: clamp(var(--space-2), 2vw, var(--space-3));
}

.topic-page .toolbar-tags {
  margin-top: var(--space-2);
}

.hero h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.post-list {
  display: grid;
  gap: var(--space-2);
}

.post-card {
  padding: var(--space-2);
}

.post-thumb img,
.single-thumb img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
}

.post-card h2,
.post-card h1 {
  margin-top: 0;
}

.post-meta {
  color: var(--ldd-muted);
  font-size: var(--type-sm);
  margin-bottom: var(--space-1);
}

.read-more {
  display: inline-block;
  margin-top: var(--space-1);
  font-weight: 600;
  color: var(--ldd-secondary);
}

.widget-area {
  padding: var(--space-2);
  height: fit-content;
}

#secondary,
.widget-area {
  display: none !important;
}

.widget {
  margin-bottom: var(--space-3);
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  margin-top: 0;
  margin-bottom: var(--space-1);
  font-size: var(--type-lg);
}

.search-form {
  display: flex;
  gap: var(--space-1);
}

.search-field,
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  border: 1px solid var(--ldd-border);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
}

button,
input[type="submit"] {
  border: 0;
  background: var(--ldd-primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  min-height: var(--btn-height);
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
  background: var(--ldd-primary-dark);
}

.pagination {
  margin-top: var(--space-2);
}

.pagination .nav-links {
  display: flex;
  justify-content: space-between;
  gap: var(--space-1);
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list li {
  border-bottom: 1px solid var(--ldd-border);
  padding: var(--space-1) 0;
}

.footer-copy {
  color: var(--ldd-muted);
  font-size: var(--type-sm);
}

.footer-widgets {
  min-width: 220px;
}

.footer-widgets .widget {
  margin: 0;
}

.post-card ul,
.post-card ol {
  padding-left: 1.2rem;
}

.post-card blockquote {
  border-left: 4px solid var(--ldd-primary);
  margin: 1rem 0;
  padding: 0.2rem 1rem;
  color: var(--ldd-muted);
}

@media (max-width: 900px) {
  .header-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

body.home {
  background: linear-gradient(135deg, #1e3a5f 0%, #2c4780 45%, #4f46a5 100%);
  color: #eef2ff;
}

.home .site-header,
.home .site-footer {
  background: rgba(8, 12, 30, 0.62);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
}

.home .site-title a,
.home .site-description,
.home .main-navigation a,
.home .footer-copy,
.home .site-footer a {
  color: #dbe6ff;
}

.home .main-layout {
  grid-template-columns: 1fr;
}

.home-modern {
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.modern-hero {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.62);
  padding: 4rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-3);
}

.modern-kicker {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #bfdbfe;
  font-size: 0.82rem;
}

.modern-hero-title {
  margin: 0.9rem auto 0;
  max-width: 900px;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.15;
  font-weight: 800;
  color: #f8faff;
}

.modern-hero-subtitle {
  max-width: 760px;
  margin: 1rem auto 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #dbe6ff;
}

.modern-positioning {
  max-width: 720px;
  margin: 1rem auto 0;
  color: #c7d7ff;
  font-size: 0.98rem;
}

.modern-hero-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.modern-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.8rem 1.3rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.modern-btn:hover,
.modern-btn:focus {
  transform: translateY(-1px);
}

.modern-btn-primary {
  background: var(--ldd-accent);
  color: #083344;
}

.modern-btn-primary:hover,
.modern-btn-primary:focus {
  background: #67e8f9;
  color: #083344;
}

.modern-btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: #f8faff;
}

.modern-btn-secondary:hover,
.modern-btn-secondary:focus {
  border-color: var(--ldd-accent);
  color: var(--ldd-accent);
}

.modern-features {
  margin-top: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.62);
}

.modern-social-proof,
.modern-featured-posts,
.modern-newsletter {
  margin-top: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 2rem;
  background: rgba(15, 23, 42, 0.62);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.proof-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  background: rgba(30, 41, 59, 0.62);
}

.proof-value {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #f8faff;
}

.proof-label {
  margin: 0.35rem 0 0;
  color: #cbd5e1;
  font-size: 0.92rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head .modern-section-title {
  margin: 0;
  text-align: left;
}

.modern-text-link {
  color: #bfdbfe;
  font-weight: 600;
}

.modern-text-link:hover,
.modern-text-link:focus {
  color: var(--ldd-accent);
}

.featured-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.featured-post-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.62);
  padding: 1.1rem;
}

.featured-post-card h3 {
  margin: 0.75rem 0 0.4rem;
  font-size: 1.05rem;
}

.featured-post-card h3 a {
  color: #f8faff;
}

.featured-post-card h3 a:hover,
.featured-post-card h3 a:focus {
  color: #bfdbfe;
}

.featured-post-card p {
  color: #cbd5e1;
  font-size: 0.94rem;
  margin: 0.5rem 0 0;
}

.featured-meta {
  color: #9fb5db;
  font-size: 0.86rem;
}

.featured-thumb img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 10px;
}

.modern-note {
  margin: 0;
  color: #cbd5e1;
}

.modern-newsletter p {
  margin-top: 0;
  color: #dbe6ff;
  text-align: center;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 620px;
  margin: 1rem auto 0;
}

.newsletter-form input[type="email"] {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
}

.newsletter-form button {
  background: var(--ldd-accent);
  color: #083344;
  font-weight: 700;
}

.newsletter-form button:hover,
.newsletter-form button:focus {
  background: #67e8f9;
}

.newsletter-note {
  margin-top: 0.75rem;
  text-align: center;
  color: #a9bbde;
  font-size: 0.86rem;
}

.footer-inner {
  align-items: flex-start;
  flex-wrap: wrap;
}

.footer-brand,
.footer-links,
.footer-meta {
  min-width: 220px;
  flex: 1 1 220px;
}

.footer-title {
  margin: 0;
  font-size: 1.15rem;
}

.footer-title a {
  color: inherit;
}

.footer-tagline {
  margin-top: 0.4rem;
  color: var(--ldd-muted);
  font-size: 0.92rem;
}

.footer-links nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-meta {
  text-align: right;
}

.footer-meta .footer-copy {
  margin: 0 0 0.35rem;
}

.modern-section-title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  color: #f8faff;
}

.modern-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.modern-feature-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.62);
  padding: 1.25rem;
}

.modern-feature-card h3 {
  margin: 0;
  color: #e2e8f0;
  font-size: 1.08rem;
}

.modern-feature-card p {
  margin: 0.6rem 0 0;
  color: #cbd5e1;
  font-size: 0.96rem;
}

@media (max-width: 980px) {
  .proof-grid,
  .featured-post-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-meta {
    text-align: left;
  }

  .modern-feature-grid {
    grid-template-columns: 1fr;
  }

  .modern-hero,
  .modern-features,
  .modern-social-proof,
  .modern-featured-posts,
  .modern-newsletter {
    padding: 1.5rem;
  }
}

/* Single post readability layout */
.single-post .content-area {
  max-width: 860px;
  margin: 0 auto;
}

.single-post .post-card {
  padding: clamp(1.2rem, 2.5vw, 2rem);
}

.single-post .post-card h1 {
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.single-post .post-meta {
  color: #8a93a1;
  font-size: 0.92rem;
  margin-bottom: 1.4rem;
}

.single-post .single-thumb {
  margin: 0 0 1.35rem;
}

.single-post .single-thumb img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--ldd-border);
}

.single-post .post-card p,
.single-post .post-card ul,
.single-post .post-card ol {
  font-size: 1.04rem;
  line-height: 1.85;
  margin: 1rem 0;
}

.single-post .post-card h2,
.single-post .post-card h3,
.single-post .post-card h4 {
  margin-top: 1.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.single-post .post-card li + li {
  margin-top: 0.45rem;
}

.single-post .post-card code {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 0.16rem 0.4rem;
  font-family: "JetBrains Mono", Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  font-size: 0.92em;
}

.single-post .post-card pre {
  background: #0b1220;
  color: #d8e1f0;
  border: 1px solid #1f2a44;
  border-radius: 12px;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 1.2rem 0;
}

.single-post .post-card pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.95rem;
}

.single-post .post-card blockquote {
  margin: 1.4rem 0;
  padding: 0.8rem 1rem 0.8rem 1.1rem;
  border-left: 4px solid var(--ldd-secondary);
  border-radius: 0 10px 10px 0;
  background: #f3f7ff;
  color: #334155;
}

.single-post .post-card blockquote p {
  margin: 0.3rem 0;
}

.single-post .post-card a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.single-post .post-card img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .single-post .content-area {
    max-width: 100%;
  }

  .single-post .post-card p,
  .single-post .post-card ul,
  .single-post .post-card ol {
    font-size: 1rem;
    line-height: 1.75;
  }

  .single-post .single-thumb img {
    max-height: 360px;
  }
}

/* Tutorials listing page */
main.tutorials-page {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 0.25rem;
  border: 0;
  background: transparent;
}

.tutorials-page .tutorials-hero,
.tutorials-page .learning-paths,
.tutorials-page .start-here,
.tutorials-page .topic-group {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.68);
}

main.tutorials-page > .tutorials-hero {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  background: linear-gradient(140deg, rgba(30, 58, 95, 0.95) 0%, rgba(79, 70, 165, 0.9) 100%);
}

.tutorials-page .tutorials-hero h1 {
  margin: 0;
  color: #f8faff;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.tutorials-page .tutorials-hero p {
  margin: 0.75rem 0 0;
  color: #dbe6ff;
  max-width: 760px;
}

.tutorial-toolbar {
  margin-top: var(--space-2);
  position: sticky;
  top: 10px;
  z-index: 20;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(8px);
  padding: var(--space-2);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr minmax(180px, 220px);
  gap: var(--space-2);
}

.toolbar-search input,
.toolbar-sort select {
  width: 100%;
  border: 1px solid rgba(159, 181, 219, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.9);
  color: #eaf1ff;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
}

.toolbar-search input::placeholder {
  color: #9fb5db;
}

.toolbar-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.toolbar-tag {
  appearance: none;
  border: 1px solid rgba(159, 181, 219, 0.3);
  background: rgba(30, 41, 59, 0.9);
  color: #d5e2ff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: border-color var(--motion-smooth), color var(--motion-smooth), background var(--motion-smooth);
}

.toolbar-tag:hover,
.toolbar-tag:focus {
  border-color: var(--ldd-accent);
  color: #f8faff;
}

.toolbar-tag.is-active {
  border-color: transparent;
  background: #0e7490;
  color: #ecfeff;
}

.toolbar-sort {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toolbar-sort label {
  color: #bcd0f5;
  font-size: 0.78rem;
  font-weight: 600;
}

.learning-paths,
.start-here,
.topic-roadmap {
  margin-top: var(--space-3);
}

.learning-paths,
.start-here {
  padding: clamp(var(--space-2), 2.2vw, var(--space-4));
}

.tutorials-section-head h2,
.topic-head h2 {
  margin: 0;
  color: #f8faff;
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
}

.tutorials-section-head p,
.topic-head p {
  margin: 0.55rem 0 0;
  color: #c9d8f6;
  max-width: 760px;
}

.paths-grid {
  margin-top: var(--space-2);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.path-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.75);
  padding: var(--space-2);
  transition: transform var(--motion-smooth), box-shadow var(--motion-smooth), border-color var(--motion-smooth);
}

.path-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(79, 70, 165, 0.16), rgba(34, 211, 238, 0));
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-smooth);
}

.path-card:hover,
.path-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.3);
}

.path-card:hover::before,
.path-card:focus-within::before {
  opacity: 1;
}

.path-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.path-card h3 a {
  color: #f8faff;
}

.path-card h3 a:hover,
.path-card h3 a:focus {
  color: #bfdbfe;
}

.path-stage {
  margin: 0.55rem 0 0;
  color: #9fb5db;
  font-size: 0.84rem;
  line-height: 1.5;
}

.path-progress {
  margin-top: 0.7rem;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.path-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee 0%, #4f46a5 100%);
}

.path-percent {
  margin: 0.5rem 0 0;
  color: #c7d7ff;
  font-size: 0.82rem;
}

.learning-path-tracks {
  margin-top: var(--space-3);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.academy-path {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.75);
  padding: var(--space-2);
  position: relative;
  overflow: hidden;
}

.academy-path::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(79, 70, 165, 0.15), rgba(34, 211, 238, 0));
  pointer-events: none;
}

.academy-path-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
}

.academy-path-head h3 {
  margin: 0;
  color: #f8faff;
  font-size: 1.08rem;
}

.academy-path-head a {
  color: #bfe8ff;
  font-size: 0.84rem;
  font-weight: 600;
}

.academy-path-head a:hover,
.academy-path-head a:focus {
  color: var(--ldd-accent);
}

.path-lessons {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
}

.path-lesson-item {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--space-1);
  align-items: flex-start;
  padding-bottom: var(--space-2);
}

.path-lesson-item:last-child {
  padding-bottom: 0;
}

.path-lesson-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 32px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.5), rgba(79, 70, 165, 0.5));
}

.path-step-number {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.5);
  background: rgba(8, 51, 68, 0.5);
  color: #d9fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.path-lesson-content h4 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.path-lesson-content h4 a {
  color: #f8faff;
}

.path-lesson-content h4 a:hover,
.path-lesson-content h4 a:focus {
  color: #bfdbfe;
}

.path-lesson-meta {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #9fb5db;
  font-size: 0.78rem;
}

.path-lesson-item.is-placeholder .path-step-number {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.7);
  color: #cbd5e1;
}

.path-lesson-item.is-placeholder .path-lesson-content h4 {
  color: #cbd5e1;
}

.start-card {
  margin-top: var(--space-2);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.5);
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(8, 51, 68, 0.5) 0%, rgba(30, 41, 59, 0.8) 100%);
  padding: clamp(1.1rem, 2.1vw, 1.6rem);
  transition: transform var(--motion-smooth), box-shadow var(--motion-smooth), border-color var(--motion-smooth);
}

.start-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.28), rgba(34, 211, 238, 0));
  opacity: 0.65;
  pointer-events: none;
}

.start-card:hover,
.start-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.32);
}

.start-badge {
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #0e7490;
  color: #ecfeff;
}

.start-card h3 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.2rem, 2.8vw, 1.7rem);
}

.start-card h3 a {
  color: #f8faff;
}

.start-card p {
  margin: 0.75rem 0 0;
  color: #d5e2ff;
  font-size: 0.96rem;
}

.start-meta {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #9fb5db;
  font-size: 0.84rem;
}

.topic-roadmap {
  display: grid;
  gap: var(--space-3);
}

.topic-group {
  position: relative;
  overflow: hidden;
  padding: clamp(1.15rem, 2.2vw, 1.8rem);
}

.topic-group::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(79, 70, 165, 0.2), rgba(79, 70, 165, 0));
  pointer-events: none;
}

.topic-head {
  margin-bottom: var(--space-2);
}

.tutorials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.tutorial-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(30, 41, 59, 0.72);
  box-shadow: var(--shadow-1);
  padding: var(--space-2);
  transition: transform var(--motion-smooth), border-color var(--motion-smooth), box-shadow var(--motion-smooth);
}

.tutorial-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(79, 70, 165, 0.18), rgba(79, 70, 165, 0));
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-smooth);
}

.tutorial-card:hover,
.tutorial-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: var(--shadow-2);
}

.tutorial-card:hover::before,
.tutorial-card:focus-within::before {
  opacity: 1;
}

.tutorial-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.tutorial-tag-ai {
  background: #083344;
  color: #d9fbff;
}

.tutorial-tag-deep-learning {
  background: #312e81;
  color: #e3e7ff;
}

.tutorial-tag-software-engineering {
  background: #134e4a;
  color: #ccfbf1;
}

.tutorial-tag-system-design {
  background: #713f12;
  color: #fef3c7;
}

.tutorial-card h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.35;
}

.tutorial-card h3 a {
  color: #f8faff;
}

.tutorial-card h3 a:hover,
.tutorial-card h3 a:focus {
  color: #bfdbfe;
}

.tutorial-description {
  margin: 0.65rem 0 0;
  color: #cad6ee;
  font-size: 0.93rem;
  line-height: 1.55;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tutorial-meta {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: #9fb5db;
  font-size: 0.82rem;
}

.card-progress {
  margin-top: 0.7rem;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.card-progress span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee 0%, #4f46a5 100%);
}

.difficulty-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.difficulty-beginner {
  background: #14532d;
  color: #dcfce7;
}

.difficulty-intermediate {
  background: #78350f;
  color: #fef3c7;
}

.difficulty-advanced {
  background: #7f1d1d;
  color: #fee2e2;
}

.tutorial-readmore {
  display: inline-flex;
  margin-top: var(--space-2);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  background: #0e7490;
  color: #ecfeff;
  font-size: 0.84rem;
  font-weight: 700;
  transition: transform var(--motion-smooth), box-shadow var(--motion-smooth), background var(--motion-smooth);
}

.tutorial-readmore:hover,
.tutorial-readmore:focus {
  background: #155e75;
  color: #ecfeff;
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.3), 0 10px 22px rgba(8, 116, 144, 0.35);
}

@media (max-width: 1050px) {
  .tutorial-toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-tags {
    order: 3;
  }

  .paths-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learning-path-tracks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tutorials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tutorial-toolbar {
    top: 6px;
    padding: var(--space-1);
  }

  .paths-grid,
  .tutorials-grid {
    grid-template-columns: 1fr;
  }

  .tutorials-page .tutorials-hero,
  .learning-paths,
  .start-here,
  .topic-group {
    padding: var(--space-2);
  }
}

/* Explore tutorials v2: clean roadmap-style layout */
.tutorials-page {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 0.25rem;
  border: 0;
  background: transparent;
}

.tutorials-page .tutorials-hero,
.tutorials-page .explore-topic-tabs,
.tutorials-page .explore-tutorial-grid-wrap,
.tutorials-page .explore-learning-paths {
  border: 1px solid var(--ldd-border);
  border-radius: var(--radius-lg);
  background: var(--ldd-surface);
  padding: clamp(var(--space-2), 2vw, var(--space-3));
  margin-top: var(--space-2);
}

.tutorials-page .tutorials-hero {
  background: linear-gradient(140deg, rgba(30, 58, 95, 0.9) 0%, rgba(30, 41, 59, 0.95) 100%);
}

.explore-topic-tabs {
  position: sticky;
  top: 10px;
  z-index: 20;
}

.explore-topic-tabs .toolbar-tags {
  gap: 0.6rem;
}

.explore-topic-tabs .toolbar-tag {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
}

.explore-tutorial-grid-wrap .section-head,
.explore-learning-paths .section-head {
  margin-bottom: var(--space-2);
}

.explore-tutorial-grid-wrap .tutorials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.explore-tutorial-grid-wrap .tutorial-card {
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid var(--ldd-border);
  box-shadow: none;
  transform: none;
}

.explore-tutorial-grid-wrap .tutorial-card::before,
.explore-learning-paths .path-card::before {
  display: none;
}

.explore-tutorial-grid-wrap .tutorial-card:hover,
.explore-tutorial-grid-wrap .tutorial-card:focus-within,
.explore-learning-paths .path-card:hover,
.explore-learning-paths .path-card:focus-within {
  transform: none;
  box-shadow: none;
  border-color: rgba(34, 211, 238, 0.45);
}

.tutorial-tag-java {
  background: #3f2a11;
  color: #fde68a;
}

.tutorial-tag-javascript {
  background: #713f12;
  color: #fef3c7;
}

.explore-learning-paths .paths-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.explore-learning-paths .path-card {
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid var(--ldd-border);
}

@media (max-width: 900px) {
  .explore-tutorial-grid-wrap .tutorials-grid,
  .explore-learning-paths .paths-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .explore-topic-tabs {
    top: 6px;
  }

  .explore-tutorial-grid-wrap .tutorials-grid,
  .explore-learning-paths .paths-grid {
    grid-template-columns: 1fr;
  }
}

/* Strict tutorial detail template */
.tutorial-layout {
  display: grid;
  gap: var(--space-2);
}

.tutorial-hero {
  background: var(--ldd-surface);
  border: 1px solid var(--ldd-border);
  border-radius: var(--ldd-radius);
  padding: clamp(var(--space-2), 2vw, var(--space-3));
}

.tutorial-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  line-height: 1.2;
}

.tutorial-hero-meta {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tutorial-topic-badge,
.tutorial-meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--ldd-border);
  background: #f8fafc;
  color: #334155;
}

.tutorial-topic-badge {
  border-color: rgba(30, 58, 95, 0.28);
  background: rgba(30, 58, 95, 0.08);
  color: var(--ldd-primary);
}

.tutorial-content {
  padding: clamp(var(--space-2), 2.4vw, var(--space-4));
}

.tutorial-content > * + * {
  margin-top: var(--space-2);
}

.tutorial-content h2,
.tutorial-content h3,
.tutorial-content h4 {
  padding-top: 0.5rem;
  border-top: 1px solid var(--ldd-border);
}

.tutorial-content .wp-block-code,
.tutorial-content pre {
  background: #0b1220;
  color: #d8e1f0;
  border: 1px solid #1f2a44;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  overflow-x: auto;
}

.tutorial-content .tutorial-example,
.tutorial-content .wp-block-group.is-style-example,
.tutorial-content .wp-block-quote {
  border: 1px solid rgba(79, 70, 165, 0.22);
  border-left: 4px solid var(--ldd-secondary);
  border-radius: var(--radius-md);
  background: #f6f7ff;
  padding: var(--space-2);
}

.tutorial-bottom {
  display: grid;
  gap: var(--space-2);
}

.tutorial-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.tutorial-related-card {
  border: 1px solid var(--ldd-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: #fff;
}

.tutorial-related-card h3 {
  margin: 0;
  font-size: var(--type-base);
}

.tutorial-next-card h2 {
  margin-top: 0.25rem;
  margin-bottom: 0.8rem;
}

.tutorial-cta {
  background: linear-gradient(150deg, rgba(30, 58, 95, 0.08), rgba(79, 70, 165, 0.08));
}

.tutorial-cta-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tutorial-readmore-secondary {
  background: #312e81;
  color: #eef2ff;
}

.tutorial-readmore-secondary:hover,
.tutorial-readmore-secondary:focus {
  background: #1e1b4b;
  color: #eef2ff;
}

@media (max-width: 900px) {
  .tutorial-related-grid {
    grid-template-columns: 1fr;
  }
}
