/* Custom Font and Color Override - Cloudflare Style */
:root {
  --font-main: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif !important;
  --font-secondary: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif !important;
  --link-color: #056DFF !important; /* Cloudflare blue */
  --visited-color: #0052C6 !important; /* Darker blue for visited */
}

@media (prefers-color-scheme: dark) {
  :root {
    --link-color: #4da3ff !important; /* Lighter blue for dark mode */
    --visited-color: #3d8ae6 !important; /* Darker blue for dark mode */
  }
}

/* Make bold text BLACK and slightly smaller */
strong, b {
  color: #333 !important;
  font-size: 0.95em !important;
}

@media (prefers-color-scheme: dark) {
  strong, b {
    color: #ddd !important;
  }
}

/* Heading Color Hierarchy - Cloudflare Blue */
h1 {
  color: #056DFF !important; /* H1 - Cloudflare Blue */
}

h2 {
  color: #333 !important; /* H2 - Black */
}

h3 {
  color: #3273dc !important; /* H3 - Blue */
}

h4, h5, h6 {
  color: #333 !important; /* H4, H5, H6 - Black */
}

@media (prefers-color-scheme: dark) {
  h1 {
    color: #4da3ff !important; /* H1 - Lighter blue (dark mode) */
  }

  h2 {
    color: #ddd !important; /* H2 - Light gray (dark mode) */
  }

  h3 {
    color: #4da3ff !important; /* H3 - Lighter blue (dark mode) */
  }

  h4, h5, h6 {
    color: #ddd !important; /* H4, H5, H6 - Light gray (dark mode) */
  }
}

/* Force Cloudflare font stack on body and headings */
body {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif !important;
  padding-top: 0px !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", Arial, sans-serif !important;
}

/* Site title (header) - H1 */
header h1 {
  font-size: 1.5rem !important;
  text-align: center !important;
}

/* Rocket emoji color override */
header h1::first-letter {
  color: #FF0000 !important;
}

/* Add horizontal line after header title and after nav */
header a.title {
  display: block;
  /* padding-bottom: 1rem; */
  border-bottom: 1px dashed #999;
  margin-bottom: 1rem;
}

header nav {
  padding-bottom: 1rem;
  border-bottom: 1px dashed #999;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Header nav links - Cloudflare Blue */
header nav a {
  color: #056DFF !important;
  text-decoration: none;
}

header nav a:hover {
  color: #0052C6 !important;
  text-decoration: underline;
}

/* Override visited link color for nav - keep same as normal */
header nav a:visited {
  color: #056DFF !important;
}

header nav a:visited:hover {
  color: #0052C6 !important;
}

/* RSS icon styling */
header nav a.rss-link {
  display: inline-block;
  margin-left: 10px;
  background-color: #FF6600;
  padding: 5px;
  border-radius: 4px;
  line-height: 0;
  vertical-align: middle;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

header nav a.rss-link svg {
  fill: #FFFFFF !important;
  vertical-align: middle;
  display: block;
  width: 14px;
  height: 14px;
}

header nav a.rss-link:hover {
  background-color: #E55A00;
  transform: scale(1.05);
  text-decoration: none !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  header a.title {
    border-bottom-color: #666;
  }

  header nav {
    border-bottom-color: #666;
  }

  header nav a {
    color: #4da3ff !important;
  }

  header nav a:hover {
    color: #3d8ae6 !important;
  }

  header nav a:not(:last-child)::after {
    color: #666;
  }
}

/* Post titles (now h2) - keep them prominent and Cloudflare Blue */
.post-title {
  font-size: 1.5rem !important;
  color: #056DFF !important;
}

@media (prefers-color-scheme: dark) {
  .post-title {
    color: #4da3ff !important;
  }
}

/* Content h2 headings - make them h3 size */
main article h2:not(.post-title) {
  font-size: 1.2rem !important;
}

/* Content h3 headings - make them h4 size and Cloudflare blue */
h3 {
  font-size: 1.2rem !important;
  color: #056DFF !important;
}

/* Links inside h3 should be black (not blue) */
h3 a {
  color: #333 !important;
  text-decoration: none;
}

h3 a:hover {
  color: #3273dc !important;
  text-decoration: underline;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  h3 {
    color: #4da3ff !important;
  }

  h3 a {
    color: #ddd !important;
  }

  h3 a:hover {
    color: #4da3ff !important;
  }
}

/* Content h4 headings */
main article h4 {
  font-size: 1.05rem !important;
}

/* Table Styling */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

table th {
  background-color: #f5f5f5;
  color: #333;
  font-weight: 600;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ddd;
}

table td {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ddd;
}

table tr:nth-child(even) {
  background-color: #fafafa;
}

table tr:hover {
  background-color: #f0f0f0;
}

/* Table links should be Cloudflare blue */
table a {
  color: #056DFF !important;
  text-decoration: none;
}

table a:hover {
  color: #0052C6 !important;
  text-decoration: underline;
}

/* Dark mode support for tables */
@media (prefers-color-scheme: dark) {
  table th {
    background-color: #2a2a2a;
    color: #ddd;
    border-color: #444;
  }

  table td {
    border-color: #444;
  }

  table tr:nth-child(even) {
    background-color: #1a1a1a;
  }

  table tr:hover {
    background-color: #333;
  }

  table a {
    color: #4da3ff !important;
  }

  table a:hover {
    color: #3d8ae6 !important;
  }
}

/* Post Tags Styling */
.post-tags {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.post-tags strong {
  margin-right: 0.5rem;
  color: #333;
}

.post-tags .tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin: 0.25rem;
  background-color: #f5f5f5;
  color: #666;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.post-tags .tag:hover {
  background-color: #333;
  color: #fff;
}

/* Post Meta */
.post-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.post-meta .post-author {
  margin-left: 1rem;
}

/* Post Footer */
.post-footer {
  margin-top: 3rem;
}

/* Articles List Page */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #333;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-description {
  color: #666;
  font-size: 1.1rem;
}

.articles-list {
  margin-top: 2rem;
}

.article-item {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.article-item:last-child {
  border-bottom: none;
}

.article-title {
  margin-bottom: 0.5rem;
}

.article-title a {
  color: #333;
  text-decoration: none;
}

.article-title a:hover {
  color: #0066cc;
}

.article-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.article-meta .article-author {
  margin-left: 1rem;
}

.article-description {
  color: #444;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.article-tags {
  margin-top: 1rem;
}

.article-tags .tag-small {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin-right: 0.5rem;
  background-color: #f0f0f0;
  color: #666;
  border-radius: 3px;
  font-size: 0.85rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .post-tags {
    border-top-color: #444;
  }
  
  .post-tags strong {
    color: #ddd;
  }
  
  .post-tags .tag {
    background-color: #2a2a2a;
    color: #aaa;
  }
  
  .post-tags .tag:hover {
    background-color: #fff;
    color: #333;
  }
  
  .post-meta {
    color: #aaa;
  }
  
  .page-header {
    border-bottom-color: #666;
  }
  
  .page-description {
    color: #aaa;
  }
  
  .article-item {
    border-bottom-color: #444;
  }
  
  .article-title a {
    color: #ddd;
  }
  
  .article-title a:hover {
    color: #66b3ff;
  }
  
  .article-meta {
    color: #aaa;
  }
  
  .article-description {
    color: #ccc;
  }
  
  .article-tags .tag-small {
    background-color: #2a2a2a;
    color: #aaa;
  }
}

/* Post Navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
  gap: 2rem;
}

.post-navigation .prev-post,
.post-navigation .next-post {
  flex: 1;
}

.post-navigation .prev-post {
  text-align: left;
}

.post-navigation .next-post {
  text-align: right;
}

.post-navigation a {
  color: #056DFF !important;
  text-decoration: none;
  font-weight: 500;
}

.post-navigation a:hover {
  color: #0052C6 !important;
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .post-navigation {
    border-top-color: #444;
  }

  .post-navigation a {
    color: #4da3ff !important;
  }

  .post-navigation a:hover {
    color: #3d8ae6 !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .post-tags .tag {
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
  }

  .article-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .article-tags .tag-small {
    font-size: 0.8rem;
  }

  .post-navigation {
    flex-direction: column;
    gap: 1rem;
  }

  .post-navigation .next-post {
    text-align: left;
  }
}

/* Journey List Styling */
.journey-posts {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.journey-post-item {
  margin-bottom: 1rem;
}

.journey-post-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  gap: 1rem;
}

.journey-post-link:hover {
  border-color: #056DFF;
  background-color: #f8f9fa;
  transform: translateX(4px);
}

.journey-post-title {
  color: #333;
  font-weight: 500;
  flex: 1;
}

.journey-post-date {
  background-color: #056DFF;
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .journey-post-link {
    border-color: #444;
  }

  .journey-post-link:hover {
    border-color: #4da3ff;
    background-color: #1a1a1a;
  }

  .journey-post-title {
    color: #ddd;
  }

  .journey-post-date {
    background-color: #4da3ff;
    color: #111;
  }
}

@media (max-width: 768px) {
  .journey-post-link {
    flex-direction: column;
    align-items: flex-start;
  }

  .journey-post-date {
    align-self: flex-end;
  }
}

/* Tags Grid Styling */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.tag-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  background-color: #fff;
}

.tag-card:hover {
  border-color: #056DFF;
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(5, 109, 255, 0.1);
}

.tag-name {
  color: #056DFF;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tag-count {
  color: #666;
  font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
  .tag-card {
    background-color: #0a0a0a;
    border-color: #444;
  }

  .tag-card:hover {
    border-color: #4da3ff;
    background-color: #1a1a1a;
    box-shadow: 0 4px 8px rgba(77, 163, 255, 0.1);
  }

  .tag-name {
    color: #4da3ff;
  }

  .tag-count {
    color: #aaa;
  }
}

@media (max-width: 768px) {
  .tags-grid {
    grid-template-columns: 1fr;
  }
}

/* Journey/Article post tags in list view */
.article-card {
  display: block;
}

.article-card .journey-post-date {
  font-size: 0.85rem;
  color: #fff;
  background-color: #056DFF;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.8rem;
  font-weight: 500;
  display: inline-block;
}

.article-card .journey-post-title {
  font-size: 1.1rem;
  font-weight: 500;
  display: inline;
}

.article-card .journey-post-tags {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.journey-post-tags .tag-small {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  margin-right: 0.4rem;
  margin-top: 0.2rem;
  background-color: #f0f0f0;
  color: #666;
  border-radius: 3px;
  font-size: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  .article-card .journey-post-date {
    background-color: #4da3ff;
    color: #fff;
  }

  .journey-post-tags .tag-small {
    background-color: #333;
    color: #aaa;
  }
}