/* Computing Tutor Theme - Modern Technology Style */

/* CSS Variables */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-tertiary: #ec4899;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Source Code Pro', monospace;
  --font-size-base: 16px;
  --max-width: 1000px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-sm) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-branding .site-title {
  background: var(--bg-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-branding .site-title:hover {
  opacity: 0.85;
}

.prompt {
  display: none;
}

/* Navigation */
.site-nav .nav-list {
  list-style: none;
  display: flex;
  gap: var(--spacing-xs);
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent-primary);
  background-color: var(--bg-tertiary);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md);
  width: 100%;
}

/* Footer */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-lg) 0;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  text-align: center;
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-xs);
}

.site-footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

/* Sections */
.section {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
}

.section:last-child {
  border-bottom: none;
}

.section h2::before {
  content: none;
}

/* Blog List */
.blog-list {
  list-style: none;
  display: grid;
  gap: var(--spacing-md);
}

.blog-item {
  padding: var(--spacing-lg);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.blog-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.blog-item h3 {
  margin-bottom: var(--spacing-xs);
}

.blog-item h3 a {
  color: var(--text-primary);
}

.blog-item h3 a:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.blog-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-xs);
}

.blog-excerpt {
  color: var(--text-secondary);
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.tag {
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
  color: var(--accent-primary);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--bg-accent);
  color: white;
  text-decoration: none;
}

/* Tags Overview Page */
.tags-overview .tags-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.tags-overview .tag-item {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.tags-overview .tag-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.tags-overview .tag-link {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
}

.tags-overview .tag-name {
  color: var(--accent-primary);
  font-weight: 600;
}

.tags-overview .tag-count {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-left: var(--spacing-xs);
}

.no-tags {
  color: var(--text-muted);
  font-style: italic;
}

/* Tag Navigation */
.tag-navigation {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.tag-navigation .back-to-blog {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.tag-navigation .back-to-blog:hover {
  text-decoration: underline;
}

/* Blog Index Page */
.blog-index .page-header {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
}

.blog-index .page-header h1 {
  margin-bottom: var(--spacing-xs);
}

.blog-index .page-description {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.no-posts {
  color: var(--text-muted);
  font-style: italic;
}

/* Single Post */
.post-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
}

.post-footer {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.post-navigation .back-to-blog {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.post-navigation .back-to-blog:hover {
  text-decoration: underline;
}

.post-title {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  background: var(--bg-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-content {
  line-height: 1.8;
}

.post-content p {
  margin-bottom: var(--spacing-md);
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

.post-content li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

/* Code Blocks */
code {
  font-family: var(--font-mono);
  background-color: var(--bg-tertiary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  color: var(--accent-secondary);
}

pre {
  background-color: #1e293b;
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  overflow-x: auto;
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-md);
}

pre code {
  background-color: transparent;
  padding: 0;
  color: #e2e8f0;
}

/* Landing Page */
.landing-page {
  width: 100%;
}

.landing-intro {
  text-align: center;
  padding: var(--spacing-xl) 0;
  margin-bottom: var(--spacing-lg);
  background: linear-gradient(135deg, #667eea08 0%, #764ba208 100%);
  border-radius: var(--radius-lg);
}

.landing-intro h1 {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
  background: var(--bg-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-intro .tagline {
  color: var(--text-secondary);
  font-size: 1.25rem;
}

/* Landing Page Sections */
.landing-sections h2 {
  color: var(--text-primary);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  position: relative;
}

.landing-sections h2::before {
  content: none;
}

.landing-sections h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--bg-accent);
  border-radius: 2px;
}

.landing-sections p {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
}

.landing-sections ul,
.landing-sections ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
  color: var(--text-secondary);
}

.landing-sections li {
  margin-bottom: var(--spacing-xs);
  line-height: 1.7;
}

.landing-sections blockquote:not(.alert) {
  background: linear-gradient(135deg, #667eea08 0%, #764ba208 100%);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.landing-sections blockquote:not(.alert) p {
  margin-bottom: var(--spacing-xs);
}

.landing-sections blockquote:not(.alert) p:last-child {
  margin-bottom: 0;
}

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

.landing-sections a {
  color: var(--accent-primary);
  font-weight: 500;
}

.landing-sections a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --font-size-base: 15px;
  }

  .header-container {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .site-nav .nav-list {
    gap: var(--spacing-xs);
  }

  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }

  .landing-intro h1 {
    font-size: 2.25rem;
  }

  .post-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
  }

  .site-branding .site-title {
    font-size: 1.125rem;
  }

  .site-nav a {
    padding: var(--spacing-xs);
    font-size: 0.875rem;
  }

  .landing-intro {
    padding: var(--spacing-lg) var(--spacing-sm);
  }

  .landing-intro h1 {
    font-size: 1.75rem;
  }
}


/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  background-color: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

thead {
  background: var(--bg-accent);
}

th {
  color: white;
  font-weight: 600;
  text-align: left;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: var(--bg-tertiary);
}

tbody tr:nth-child(even) {
  background-color: var(--bg-secondary);
}

tbody tr:nth-child(even):hover {
  background-color: var(--bg-tertiary);
}

@media (max-width: 768px) {
  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: var(--spacing-xs) var(--spacing-sm);
  }
}


/* Heading Anchors */
.heading-anchor {
  position: relative;
}

.heading-anchor .anchor-link {
  position: absolute;
  margin-left: 0.5rem;
  color: var(--accent-primary);
  opacity: 0;
  text-decoration: none;
  font-weight: 400;
  transition: opacity 0.2s ease;
}

.heading-anchor:hover .anchor-link {
  opacity: 1;
}

.heading-anchor .anchor-link:hover {
  text-decoration: none;
  color: var(--accent-secondary);
}


/* Card Container */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

/* Cards */
.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.card-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0;
  color: var(--text-primary);
}

.card-content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.card-content p:last-child {
  margin-bottom: 0;
}


/* Card Style Variants */
.card-primary::before {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  transform: scaleX(1);
}

.card-primary:hover {
  border-color: #6366f1;
}

.card-secondary::before {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  transform: scaleX(1);
}

.card-secondary:hover {
  border-color: #64748b;
}

.card-success::before {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  transform: scaleX(1);
}

.card-success:hover {
  border-color: #22c55e;
}



.card-warning::before {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: scaleX(1);
}

.card-warning:hover {
  border-color: #f59e0b;
}



.card-danger::before {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  transform: scaleX(1);
}

.card-danger:hover {
  border-color: #ef4444;
}



.card-info::before {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: scaleX(1);
}

.card-info:hover {
  border-color: #0ea5e9;
}




/* GitHub-style Alerts/Callouts */
.alert {
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border-radius: var(--radius-md);
  border-left: 4px solid;
}

.alert p {
  margin-bottom: var(--spacing-xs);
}

.alert p:last-child {
  margin-bottom: 0;
}

.alert-heading {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.alert-note {
  background-color: #eff6ff;
  border-color: #3b82f6;
}

.alert-note .alert-heading {
  color: #1d4ed8;
}

.alert-tip {
  background-color: #f0fdf4;
  border-color: #22c55e;
}

.alert-tip .alert-heading {
  color: #16a34a;
}

.alert-important {
  background-color: #faf5ff;
  border-color: #a855f7;
}

.alert-important .alert-heading {
  color: #7c3aed;
}

.alert-warning {
  background-color: #fffbeb;
  border-color: #f59e0b;
}

.alert-warning .alert-heading {
  color: #d97706;
}

.alert-caution {
  background-color: #fef2f2;
  border-color: #ef4444;
}

.alert-caution .alert-heading {
  color: #dc2626;
}


/* Card Container Column Options */
.card-container.card-cols-1 {
  grid-template-columns: 1fr;
}

.card-container.card-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card-container.card-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card-container.card-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .card-container.card-cols-2,
  .card-container.card-cols-3,
  .card-container.card-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .card-container.card-cols-3,
  .card-container.card-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Scrollspy Layout */
.page-with-scrollspy {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: var(--spacing-xl);
  align-items: start;
}

.scrollspy {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.scrollspy-nav {
  padding: var(--spacing-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.scrollspy-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.scrollspy-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scrollspy-item {
  margin-bottom: var(--spacing-xs);
}

.scrollspy-item-sub {
  padding-left: var(--spacing-sm);
}

.scrollspy-link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.25rem 0;
  border-left: 2px solid transparent;
  padding-left: var(--spacing-sm);
  transition: all 0.2s ease;
}

.scrollspy-link:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.scrollspy-link.active {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  font-weight: 500;
}

/* Scroll to Top Button */
.scroll-to-top {
  margin-top: var(--spacing-md);
  width: 100%;
  padding: var(--spacing-sm);
  background: var(--bg-accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Hide scrollspy on smaller screens */
@media (max-width: 1024px) {
  .page-with-scrollspy {
    grid-template-columns: 1fr;
  }

  .scrollspy {
    display: none;
  }
}


/* Anchor offset for fixed navbar */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: 80px;
}


/* Footer Columns */
.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.footer-column {
  text-align: left;
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--spacing-xs);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
}

@media (max-width: 768px) {
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .footer-columns {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-column {
    text-align: center;
  }
}


/* Site Logo */
.site-logo {
  height: 40px;
  width: auto;
  display: block;
}


/* Updated date styling */
.updated-date {
  color: var(--accent-primary);
  font-weight: 500;
}


/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: var(--spacing-md);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin: 0 var(--spacing-xs);
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--text-secondary);
  font-weight: 400;
}

.breadcrumb-item a:hover {
  color: var(--accent-primary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 500;
}
