/* ============================================
   Modern Blog Theme - tunafi.sh/tiger
   Simple, Beautiful, Accessible, Flexbox-based
   ============================================ */

/* ============================================
   Twemoji Support
   ============================================ */

/* Riffic Bold - Local font face */
@font-face {
  font-family: 'Riffic Bold';
  src: local('Riffic Bold'), local('Riffic-Bold'),
       url("../fonts/riffic-bold.8cecd0ae923b.ttf") format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 0.05em 0 0.1em;
  vertical-align: -0.1em;
  display: inline-block;
}

:root {
  /* Color Palette - Modern & Sophisticated */
  --color-primary: #2563eb;
  --color-primary-dark: #1e40af;
  --color-primary-light: #dbeafe;

  --color-accent: #f59e0b;
  --color-accent-dark: #d97706;
  --color-accent-light: #fef3c7;

  --color-text: #1f2937;
  --color-text-light: #6b7280;
  --color-text-lighter: #9ca3af;

  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-bg-dark: #f3f4f6;

  --color-border: #e5e7eb;
  --color-border-dark: #d1d5db;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-mono: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;

  /* Base font size: 22pt (approximately 1.375rem at 16px base) */
  --font-size-base: 1.375rem;
  --font-size-sm: 1.125rem;
  --font-size-xs: 1rem;
  --font-size-lg: 1.5rem;
  --font-size-xl: 1.75rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout */
  --max-width-sm: 640px;
  --max-width-md: 768px;
  --max-width-lg: 1024px;
  --max-width-xl: 1280px;
  --max-width-content: 720px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base Styles
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-4);
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-bg-dark);
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background-color: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-6);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
  font-style: italic;
  color: var(--color-text-light);
}

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

/* ============================================
   Layout - Flexbox Structure
   ============================================ */

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
}

.container {
  width: 100%;
  max-width: var(--max-width-lg);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: var(--max-width-content);
}

.container-wide {
  max-width: var(--max-width-xl);
}

/* ============================================
   Header & Navigation
   ============================================ */

.site-header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.9);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-xl);
  font-weight: 800;
  font-family: 'Riffic Bold', sans-serif;
  color: var(--color-text);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--color-primary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.nav-link {
  color: var(--color-text-light);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.nav-link[aria-current="page"] {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: currentColor;
  margin: 5px 0;
  transition: var(--transition-fast);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  background: linear-gradient(135deg,
    #ff0033 0%,   /* Electric red */
    #ff6a00 12%,  /* Vivid orange */
    #ffbf00 24%,  /* Warm amber */
    #ffee00 36%,  /* Bright yellow */
    #00e676 48%,  /* Neon green */
    #00d1ff 60%,  /* Sky cyan */
    #0061ff 72%,  /* Pure blue */
    #7a00ff 84%,  /* Vivid violet */
    #ff00ff 92%,  /* Magenta */
    #ff1493 100%  /* Hot pink */
  );
  padding: var(--space-20) 0;
  margin-bottom: var(--space-12);
}

.hero-content {
  max-width: var(--max-width-md);
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-family: 'Riffic Bold', sans-serif;
  font-size: var(--font-size-4xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
  color: #fff;
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
}

/* ============================================
   Cards & Posts
   ============================================ */

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

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

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

.post-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.post-card-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  margin-bottom: var(--space-4);
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-3);
}

.post-card-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  font-family: 'Riffic Bold', sans-serif;
  margin-bottom: var(--space-3);
  line-height: var(--line-height-tight);
}

.post-card-title a {
  color: var(--color-text);
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-card-excerpt {
  color: var(--color-text-light);
  flex-grow: 1;
  margin-bottom: var(--space-4);
}

.post-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* ============================================
   Blog Post Page
   ============================================ */

.post-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.post-title {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  font-family: 'Riffic Bold', sans-serif;
  margin-bottom: var(--space-4);
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  margin-bottom: var(--space-6);
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.post-featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 0;
  margin-bottom: var(--space-8);
}

.post-content {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
}

.post-content > * + * {
  margin-top: var(--space-6);
}

.post-content h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-6);
}

.post-content h3 {
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.post-content ul,
.post-content ol {
  padding-left: var(--space-8);
  margin: var(--space-6) 0;
}

.post-content li + li {
  margin-top: var(--space-3);
}

.post-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================
   Tags
   ============================================ */

.tags-section {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 2px solid var(--color-border);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  font-family: 'Riffic Bold', sans-serif;
  transition: all var(--transition-fast);
}

.tag:hover {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-12) 0;
}

.pagination-link {
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.pagination-link:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.pagination-current {
  padding: var(--space-3) var(--space-5);
  background-color: var(--color-primary);
  color: var(--color-bg);
  border-radius: var(--radius);
  font-weight: 600;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  padding: var(--space-12) 0;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  flex-wrap: wrap;
  gap: var(--space-4);
  text-align: center;
}

.footer-text {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.footer-link {
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-primary);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  border: none;
  font-size: var(--font-size-base);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
  background-color: var(--color-bg-alt);
  border-color: var(--color-border-dark);
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-light); }
.text-small { font-size: var(--font-size-sm); }

.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .site-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100vh;
    background-color: var(--color-bg);
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
    transition: left var(--transition-base);
    z-index: 999;
  }

  .site-nav.is-active {
    left: 0;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: var(--space-2);
  }

  .nav-link {
    width: 100%;
    padding: var(--space-4);
  }

  .nav-toggle {
    display: block;
    z-index: 1000;
  }

  .hero {
    padding: var(--space-12) 0;
  }

  .hero-title {
    font-size: var(--font-size-3xl);
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-title {
    font-size: var(--font-size-3xl);
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================
   Accessibility
   ============================================ */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background-color: var(--color-primary);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 10000;
}

.skip-link:focus {
  top: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .site-header,
  .site-nav,
  .site-footer,
  .tags-section,
  .pagination {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }
}

/* ============================================
   Links Page Styles
   ============================================ */

.links-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  max-width: var(--max-width-lg);
  margin: 0 auto;
}

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

.link-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.link-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.link-card-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin: 0 0 var(--space-3) 0;
  line-height: var(--line-height-tight);
}

.link-card-title a {
  color: var(--color-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.link-card-title a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.link-card-title a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

.external-link-icon {
  font-size: var(--font-size-base);
  opacity: 0.6;
  transition: opacity var(--transition-base);
}

.link-card:hover .external-link-icon {
  opacity: 1;
}

.link-card-description {
  color: var(--color-text-light);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  margin: 0;
}

/* ============================================
   Page Header Styles (for About/Links)
   ============================================ */

.page-header {
  margin-bottom: var(--space-10);
}

.page-title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  line-height: var(--line-height-tight);
  margin: 0;
  color: var(--color-text);
}

.page-content {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
}

.page-content > * + * {
  margin-top: var(--space-6);
}


/* ============================================
   Image Block (Post content images)
   ============================================ */

.post-content .image-block {
  margin: var(--space-8) 0;
}

/* Alignment modifiers */
.post-content .image-block.image-block--full {
  max-width: 100%;
}
.post-content .image-block.image-block--center {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.post-content .image-block.image-block--left {
  max-width: 75%;
  margin-right: auto;
}
.post-content .image-block.image-block--right {
  max-width: 75%;
  margin-left: auto;
}

/* Framed box that the image fills */
.post-content .image-block__frame {
  display: block;
  width: 100%;
  /* Square corners and natural aspect ratio: no cropping */
  border-radius: 0;
  box-shadow: var(--shadow-md);
}

.post-content .image-block__img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.post-content .image-block__caption {
  text-align: center;
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
  margin-top: var(--space-3);
}

/* Generic fallback for images inserted via rich text */
.post-content img {
  border-radius: 0;
}


/* ============================================
   Links Page Enhancements - Icons + Rainbow Gradients
   ============================================ */

/* Header layout inside each link card */
.link-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  text-align: center;
}

/* Medium-large icon beside the link title */
.link-card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  flex: 0 0 auto;
}

/* Card visual refresh: vibrant gradient backgrounds */
.link-card {
  position: relative;
  display: block; /* anchor as block-level card */
  border: none;
  border-radius: var(--radius-lg);
  color: #fff;
  overflow: hidden;
  text-align: center;
  text-decoration: none; /* remove default underline on anchor */
}

.link-card-title {
  margin: 0;
}

.link-card-title {
  color: #fff;
  text-decoration: none;
  display: inline-block;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  transition: text-decoration-color var(--transition-base);
}

.link-card:hover .link-card-title {
  color: #fff;
  text-decoration: underline;
}

.link-card-description {
  color: rgba(255, 255, 255, 0.92);
}

/* Add a soft light overlay for elegance */
.link-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1200px 400px at -10% -20%, rgba(255,255,255,0.25), transparent 60%),
              radial-gradient(800px 300px at 120% 120%, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}

/* Ensure inner content sits above gradient/overlay */
.link-card > * {
  position: relative;
  z-index: 1;
}

/* Vibrant, elegant rainbow gradients per card (cycle through) */
.links-grid .link-card:nth-child(8n + 1) {
  background-image: linear-gradient(135deg, #ff3b30, #ff9500);
}
.links-grid .link-card:nth-child(8n + 2) {
  background-image: linear-gradient(135deg, #ffcc00, #34c759);
}
.links-grid .link-card:nth-child(8n + 3) {
  background-image: linear-gradient(135deg, #30d158, #64d2ff);
}
.links-grid .link-card:nth-child(8n + 4) {
  background-image: linear-gradient(135deg, #0a84ff, #5e5ce6);
}
.links-grid .link-card:nth-child(8n + 5) {
  background-image: linear-gradient(135deg, #7d7aff, #bf5af2);
}
.links-grid .link-card:nth-child(8n + 6) {
  background-image: linear-gradient(135deg, #ff375f, #ff9f0a);
}
.links-grid .link-card:nth-child(8n + 7) {
  background-image: linear-gradient(135deg, #ffd60a, #00c7be);
}
.links-grid .link-card:nth-child(8n + 8) {
  background-image: linear-gradient(135deg, #64d2ff, #ff2d55);
}

/* Hover lift and glow */
.link-card:hover {
  transform: translateY(-3px);
}


/* ============================================
   Simple Feed List (Home page)
   ============================================ */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
  max-width: var(--max-width-content);
  margin-left: auto;
  margin-right: auto;
}

.feed-item {
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.feed-item-title {
  font-family: 'Riffic Bold', sans-serif;
  font-weight: 800;
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-2) 0;
}

.feed-item-title a {
  color: var(--color-primary);
  text-decoration: none;
}

.feed-item-title a:hover {
  text-decoration: underline;
}

.feed-item-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-text-light);
  font-size: var(--font-size-sm);
}


/* Make entire link card (anchor) keyboard-focusable with visible outline */
.link-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--border-radius-sm);
}

/* ============================================
   Code Block Styles - Pygments Syntax Highlighting
   ============================================ */

.code-block {
  margin: var(--space-8) 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: #282c34;
  box-shadow: var(--shadow-md);
}

.code-block-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: #21252b;
  border-bottom: 1px solid #181a1f;
}

.code-block-filename {
  color: #abb2bf;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.code-block-language {
  color: #5c6370;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block-content {
  overflow-x: auto;
  background: #282c34;
}

/* Pygments Highlight Container */
.highlight {
  margin: 0;
  background: #282c34;
  color: #abb2bf;
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.highlight pre {
  margin: 0;
  padding: var(--space-4);
  background: transparent;
  overflow-x: auto;
  font-family: var(--font-mono);
}

/* Line Number Table Layout */
.highlight .linenodiv {
  background: #21252b;
  padding: var(--space-4) var(--space-3);
  border-right: 1px solid #181a1f;
}

.highlight .linenodiv pre {
  padding: 0;
  margin: 0;
  color: #5c6370;
  background: transparent;
  text-align: right;
  user-select: none;
}

.highlight .linenodiv a {
  color: #5c6370;
  text-decoration: none;
}

.highlight .linenodiv a:hover {
  color: #abb2bf;
}

/* Code Content */
.highlight .code {
  display: block;
}

/* Highlighted Lines */
.highlight .hll {
  background-color: #3e4451;
  display: block;
  margin: 0 calc(var(--space-4) * -1);
  padding: 0 var(--space-4);
}

/* One Dark Theme - Pygments Token Colors */
.highlight .c { color: #5c6370; font-style: italic; } /* Comment */
.highlight .err { color: #e06c75; } /* Error */
.highlight .k { color: #c678dd; } /* Keyword */
.highlight .o { color: #abb2bf; } /* Operator */
.highlight .ch { color: #5c6370; font-style: italic; } /* Comment.Hashbang */
.highlight .cm { color: #5c6370; font-style: italic; } /* Comment.Multiline */
.highlight .cp { color: #5c6370; font-style: italic; } /* Comment.Preproc */
.highlight .cpf { color: #5c6370; font-style: italic; } /* Comment.PreprocFile */
.highlight .c1 { color: #5c6370; font-style: italic; } /* Comment.Single */
.highlight .cs { color: #5c6370; font-style: italic; } /* Comment.Special */
.highlight .gd { color: #e06c75; } /* Generic.Deleted */
.highlight .ge { font-style: italic; } /* Generic.Emph */
.highlight .gh { color: #61afef; font-weight: bold; } /* Generic.Heading */
.highlight .gi { color: #98c379; } /* Generic.Inserted */
.highlight .gp { color: #5c6370; font-weight: bold; } /* Generic.Prompt */
.highlight .gs { font-weight: bold; } /* Generic.Strong */
.highlight .gu { color: #c678dd; font-weight: bold; } /* Generic.Subheading */
.highlight .kc { color: #d19a66; } /* Keyword.Constant */
.highlight .kd { color: #c678dd; } /* Keyword.Declaration */
.highlight .kn { color: #c678dd; } /* Keyword.Namespace */
.highlight .kp { color: #c678dd; } /* Keyword.Pseudo */
.highlight .kr { color: #c678dd; } /* Keyword.Reserved */
.highlight .kt { color: #e5c07b; } /* Keyword.Type */
.highlight .m { color: #d19a66; } /* Literal.Number */
.highlight .s { color: #98c379; } /* Literal.String */
.highlight .na { color: #e5c07b; } /* Name.Attribute */
.highlight .nb { color: #e5c07b; } /* Name.Builtin */
.highlight .nc { color: #e5c07b; } /* Name.Class */
.highlight .no { color: #d19a66; } /* Name.Constant */
.highlight .nd { color: #61afef; } /* Name.Decorator */
.highlight .ni { color: #abb2bf; } /* Name.Entity */
.highlight .ne { color: #e06c75; } /* Name.Exception */
.highlight .nf { color: #61afef; } /* Name.Function */
.highlight .nl { color: #e5c07b; } /* Name.Label */
.highlight .nn { color: #abb2bf; } /* Name.Namespace */
.highlight .nx { color: #abb2bf; } /* Name.Other */
.highlight .py { color: #abb2bf; } /* Name.Property */
.highlight .nt { color: #e06c75; } /* Name.Tag */
.highlight .nv { color: #e06c75; } /* Name.Variable */
.highlight .ow { color: #c678dd; } /* Operator.Word */
.highlight .w { color: #abb2bf; } /* Text.Whitespace */
.highlight .mb { color: #d19a66; } /* Literal.Number.Bin */
.highlight .mf { color: #d19a66; } /* Literal.Number.Float */
.highlight .mh { color: #d19a66; } /* Literal.Number.Hex */
.highlight .mi { color: #d19a66; } /* Literal.Number.Integer */
.highlight .mo { color: #d19a66; } /* Literal.Number.Oct */
.highlight .sa { color: #98c379; } /* Literal.String.Affix */
.highlight .sb { color: #98c379; } /* Literal.String.Backtick */
.highlight .sc { color: #98c379; } /* Literal.String.Char */
.highlight .dl { color: #98c379; } /* Literal.String.Delimiter */
.highlight .sd { color: #5c6370; font-style: italic; } /* Literal.String.Doc */
.highlight .s2 { color: #98c379; } /* Literal.String.Double */
.highlight .se { color: #d19a66; } /* Literal.String.Escape */
.highlight .sh { color: #98c379; } /* Literal.String.Heredoc */
.highlight .si { color: #d19a66; } /* Literal.String.Interpol */
.highlight .sx { color: #98c379; } /* Literal.String.Other */
.highlight .sr { color: #98c379; } /* Literal.String.Regex */
.highlight .s1 { color: #98c379; } /* Literal.String.Single */
.highlight .ss { color: #98c379; } /* Literal.String.Symbol */
.highlight .bp { color: #e5c07b; } /* Name.Builtin.Pseudo */
.highlight .fm { color: #61afef; } /* Name.Function.Magic */
.highlight .vc { color: #e06c75; } /* Name.Variable.Class */
.highlight .vg { color: #e06c75; } /* Name.Variable.Global */
.highlight .vi { color: #e06c75; } /* Name.Variable.Instance */
.highlight .vm { color: #e06c75; } /* Name.Variable.Magic */
.highlight .il { color: #d19a66; } /* Literal.Number.Integer.Long */

/* Inline code (not in code blocks) */
code:not(.highlight code) {
  background: #f3f4f6;
  color: #e06c75;
  padding: 0.125rem 0.375rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Accessibility improvements */
.code-block:focus-within {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Scrollbar styling for code blocks */
.code-block-content::-webkit-scrollbar {
  height: 8px;
}

.code-block-content::-webkit-scrollbar-track {
  background: #21252b;
}

.code-block-content::-webkit-scrollbar-thumb {
  background: #5c6370;
  border-radius: 4px;
}

.code-block-content::-webkit-scrollbar-thumb:hover {
  background: #abb2bf;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .code-block {
    margin: var(--space-6) calc(var(--space-4) * -1);
    border-radius: 0;
  }

  .highlight pre {
    padding: var(--space-3);
  }

  .highlight .linenodiv {
    padding: var(--space-3) var(--space-2);
  }
}

/* ============================================
   Table Block Styles - Elegant and Accessible
   ============================================ */

.table-container {
  margin: var(--space-8) 0;
  overflow: hidden;
}

.table-caption {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--color-text);
  margin-bottom: var(--space-3);
  text-align: center;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

/* Wagtail TableBlock renders as <table> element */
.table-responsive table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  background: var(--color-bg);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

.table-responsive thead {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  text-align: left;
}

.table-responsive thead tr {
  border-bottom: 2px solid var(--color-primary-dark);
}

.table-responsive th {
  padding: var(--space-4) var(--space-4);
  font-weight: 600;
  vertical-align: middle;
  border-bottom: 2px solid var(--color-primary-dark);
}

/* First column headers (when first_col_is_header is true) */
.table-responsive tbody th {
  background: var(--color-bg-dark);
  font-weight: 600;
  text-align: left;
  border-right: 2px solid var(--color-border-dark);
}

.table-responsive td {
  padding: var(--space-4) var(--space-4);
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

.table-responsive tbody tr {
  transition: background-color 0.2s ease;
}

.table-responsive tbody tr:hover {
  background: var(--color-bg-alt);
}

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

/* Striped rows for better readability */
.table-responsive tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

.table-responsive tbody tr:nth-child(even):hover {
  background: var(--color-bg-dark);
}

/* Ensure proper spacing for content inside cells */
.table-responsive td p,
.table-responsive th p {
  margin: 0;
}

.table-responsive td ul,
.table-responsive td ol {
  margin: 0;
  padding-left: var(--space-5);
}

/* Responsive table enhancements */
@media (max-width: 768px) {
  .table-container {
    margin: var(--space-6) calc(var(--space-4) * -1);
  }

  .table-responsive {
    border-radius: 0;
  }

  .table-responsive table {
    font-size: var(--font-size-sm);
  }

  .table-responsive th,
  .table-responsive td {
    padding: var(--space-3) var(--space-2);
  }

  .table-caption {
    padding: 0 var(--space-4);
  }
}

/* Scrollbar styling for tables */
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--color-bg-dark);
  border-radius: var(--border-radius-sm);
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--color-border-dark);
  border-radius: var(--border-radius-sm);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-lighter);
}

/* Accessibility: Focus styles for keyboard navigation */
.table-responsive:focus-within {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
