/* Blog-specific styles - Modern, minimalistic, Tic Tac Toe inspired design */

:root {
  --bg-color: #ffffff;
  --text-color: #2c3e50;
  --accent-blue: #3498db;
  --accent-blue-light: #ebf5fb;
  --accent-green: #2ecc71;
  --accent-gray: #ecf0f1;
  --border-color: #bdc3c7;
  --card-bg: #ffffff;
  --panel-ghost: rgba(0, 0, 0, 0.04);
  --stroke: rgba(0, 0, 0, 0.08);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
  --radius: 18px;
  --content-width: min(1180px, 94vw);
  --font-main: 'Outfit', sans-serif;
}

body.dark-mode {
  --bg-color: #1e1e1e;
  --text-color: #cccccc;
  --accent-blue: #569cd6;
  --accent-blue-light: #252526;
  --accent-green: #4ec9b0;
  --accent-gray: #252526;
  --border-color: #3e3e42;
  --card-bg: #252526;
  --panel-ghost: rgba(255, 255, 255, 0.04);
  --stroke: rgba(255, 255, 255, 0.08);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  line-height: 1.6;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-ghost);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
}

.theme-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .slider {
  background-color: var(--accent-blue);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.branding {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  display: inline-block;
  color: inherit;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-ghost);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
  transition: all 200ms ease;
}

.branding:hover {
  background: var(--accent-gray);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.brand-tag {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-color);
  opacity: 0.9;
  letter-spacing: 0.5px;
}

a {
  color: inherit;
  text-decoration: none;
}

.blog-main {
  width: var(--content-width);
  margin: 0 auto;
  padding: 140px 0 52px;
}

.blog-article {
  background: var(--card-bg);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 64px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.blog-article:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.blog-article::before {
  content: "";
  position: absolute;
  inset: -14% -24% 48% 16%;
  background: linear-gradient(125deg, rgba(52, 152, 219, 0.08), rgba(46, 204, 113, 0.06));
  transform: rotate(4deg);
  opacity: 0.4;
  z-index: -1;
  transition: opacity 200ms ease, transform 300ms ease;
}

body.dark-mode .blog-article::before {
  background: linear-gradient(125deg, rgba(86, 156, 214, 0.08), rgba(78, 201, 176, 0.06));
}

.blog-article:hover::before {
  opacity: 0.6;
  transform: rotate(2deg);
}

.blog-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--stroke);
  position: relative;
}

.blog-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  border-radius: 2px;
}

.blog-title {
  margin: 0 0 20px 0;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.2;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 20px;
}

.blog-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-green));
  border-radius: 3px;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-color);
  opacity: 0.7;
  font-size: 15px;
  font-weight: 500;
}

.blog-meta time {
  font-weight: 600;
  color: var(--accent-blue);
  opacity: 0.9;
}

.blog-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-color);
}

.blog-content h2 {
  margin: 40px 0 20px 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.3;
  position: relative;
  padding-left: 16px;
}

.blog-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 70%;
  background: var(--accent-blue);
  border-radius: 3px;
}

.blog-content h3 {
  margin: 28px 0 14px 0;
  font-size: 21px;
  font-weight: 600;
  color: var(--accent-green);
  line-height: 1.3;
  padding-left: 10px;
  border-left: 4px solid var(--accent-green);
}

.blog-content p {
  margin: 0 0 24px 0;
  color: var(--text-color);
  opacity: 0.9;
}

.blog-content strong {
  color: var(--text-color);
  opacity: 1;
  font-weight: 600;
  background: linear-gradient(120deg, var(--accent-blue), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-intro {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-color);
  opacity: 0.95;
  margin-bottom: 32px;
  padding: 28px;
  background: var(--panel-ghost);
  border-radius: 16px;
  border-left: 5px solid var(--accent-blue);
  line-height: 1.7;
  position: relative;
}

.blog-intro::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
  border-radius: 0 0 0 16px;
  opacity: 0.1;
}

.blog-section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--stroke);
  position: relative;
}

.blog-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.blog-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: -20px;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-blue), transparent);
  border-radius: 2px;
  opacity: 0.3;
}


.blog-section h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.blog-section h3 {
  margin-top: 24px;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 4px solid var(--accent-green);
}

.blog-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
  transition: gap 150ms ease, transform 150ms ease;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--panel-ghost);
  border: 1px solid var(--stroke);
  font-size: 15px;
}

.blog-back:hover {
  gap: 14px;
  transform: translateX(-6px);
  background: var(--accent-gray);
  border-color: var(--accent-blue);
}

@media (max-width: 640px) {
  .blog-main {
    padding: 100px 0 40px;
  }
  
  .blog-article {
    padding: 32px 20px;
  }
  
  .blog-content {
    font-size: 16px;
  }
  
  .blog-title {
    padding-left: 12px;
    font-size: clamp(24px, 4vw, 32px);
  }
  
  .blog-title::before {
    width: 3px;
  }
  
  .blog-intro {
    padding: 20px;
    font-size: 17px;
  }
  
  .blog-section::before {
    left: -10px;
  }
}

/* Print styles */
@media print {
  .theme-toggle,
  .branding,
  .blog-back,
  .reading-progress,
  .back-to-top,
  .print-btn {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .blog-article {
    box-shadow: none !important;
    border: none !important;
    background: white !important;
  }
  
  .blog-article::before {
    display: none !important;
  }
}
