/* Rails-themed Web 2.0 Theme for Robby on Rails */
/* Created in 2025 with a nostalgic look back to 2005 and a love for trains */

/* Global Box Model */
*, *:before, *:after {
  box-sizing: border-box;
}

/* Responsive iframe and video embeds */
.post-content iframe, 
.responsive-video-container {
  display: block;
  max-width: 100%;
  margin: 2em auto;
}

.responsive-video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.responsive-video-container iframe,
.responsive-video-container object,
.responsive-video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 2px solid #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background-color: #fff;
}

/* Web 2.0-style video player with border and shadow */
.responsive-video-container:before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
  border-radius: 10px;
  z-index: -1;
  border: 1px solid #ccc;
}

/* Base Elements */
body {
  font-family: 'Source Sans Pro', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f8f8;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Verdana, Arial, sans-serif;
  font-weight: bold;
  color: #333;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

a {
  color: #cc0000; /* Ruby red color */
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #a30000; /* Darker ruby red for hover */
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1140px; /* Increased from 960px for a wider container */
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.main-content {
  float: left;
  width: 72%; /* Slightly increased for better proportions with wider container */
}

.sidebar {
  float: right;
  width: 24%; /* Slightly decreased for better balance */
}

/* Post Container styled like a train car */
.post-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 30px;
  padding: 20px;
  border: 1px solid #ddd;
  position: relative;
}

/* Railroad track styling at the bottom of each post */
.post-container:after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 5%;
  right: 5%;
  height: 6px;
  background-image: repeating-linear-gradient(90deg, #333, #333 10px, transparent 10px, transparent 30px);
  z-index: -1;
}

/* Post Header with Rails-themed Gradient */
.post-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(to bottom, #cc0000, #a30000); /* Ruby/Rails colors */
  padding: 15px;
  border-radius: 8px 8px 0 0;
  margin: -20px -20px 20px;
  position: relative;
  color: white;
}

/* Train tracks decoration for post header */
.post-header:before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-image: repeating-linear-gradient(90deg, #333, #333 10px, transparent 10px, transparent 30px);
  opacity: 0.7;
}

.post-title {
  color: white;
  font-size: 28px;
  margin-bottom: 10px;
  text-shadow: 1px 1px 0 #000;
}

.post-meta {
  color: #ffd;
  font-size: 14px;
  font-family: Verdana, Arial, sans-serif;
}

.post-date {
  background: #333;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: #fff;
  position: relative;
  padding-left: 22px;
}

/* Train ticket style */
.post-date:before {
  content: "🎫";
  position: absolute;
  left: 8px;
  top: 3px;
  font-size: 12px;
}

.post-category {
  display: inline-block;
  margin-left: 5px;
  background-color: #333;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid #fff;
  position: relative;
}

.post-category:before {
  content: "🚂"; /* Train emoji */
  position: absolute;
  left: -15px;
  top: 0px;
  font-size: 14px;
}

.post-category:hover {
  background-color: #cc0000;
  text-decoration: none;
  color: white;
}

/* Post Content */
.post-content {
  font-family: 'Source Sans Pro', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 1.5em;
}

.post-content h2 {
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

/* Web 2.0-style Blockquotes */
.post-content blockquote {
  margin: 1.5em 0;
  padding: 15px 20px 15px 60px;
  background: linear-gradient(to bottom, #f9f9f9, #f1f1f1);
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-style: italic;
  color: #555;
  line-height: 1.7;
}

.post-content blockquote:before {
  content: """;
  font-size: 70px;
  position: absolute;
  left: 15px;
  top: 15px;
  color: #cc0000;
  font-family: Georgia, serif;
  opacity: 0.5;
  line-height: 0.8;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

.post-content blockquote:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), rgba(255,255,255,0));
  border-radius: 10px 10px 0 0;
  pointer-events: none;
}

.post-content blockquote p {
  margin-bottom: 0.7em;
}

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

.post-content blockquote cite {
  display: block;
  text-align: right;
  margin-top: 10px;
  font-style: normal;
  font-weight: bold;
  font-size: 0.9em;
  color: #777;
}

/* Pull Quote Styling (add class="pull-quote" to blockquote) */
.post-content blockquote.pull-quote {
  width: 40%;
  float: right;
  margin: 0.5em 0 1em 1.5em;
  padding: 15px;
  font-size: 1.2em;
  background: linear-gradient(to bottom, #fff, #f4f4f4);
  border-top: 3px solid #cc0000;
  border-bottom: 1px solid #ddd;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.post-content blockquote.pull-quote:before {
  content: none;
}

.post-content blockquote.pull-quote:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(255,255,255,0));
  pointer-events: none;
}

/* Clearfix for pull quotes */
.post-content:after {
  content: "";
  display: table;
  clear: both;
}

/* Make pull quotes responsive */
@media (max-width: 768px) {
  .post-content blockquote.pull-quote {
    width: 100%;
    float: none;
    margin: 1.5em 0;
  }
}

.post-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
  padding: 5px;
  background: #fff;
  border-radius: 3px;
}

/* Post footer meta with publication date */
.post-footer-meta {
  margin: 30px 0 20px;
  padding-top: 15px;
  border-top: 1px dashed #ddd;
  font-style: italic;
  color: #666;
  text-align: right;
}

.post-footer-meta .post-date {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  background: transparent;
  color: inherit;
  border-radius: 0;
}

.post-footer-meta .post-date:before {
  content: "🗓️";
  position: absolute;
  left: 0;
  top: 0px;
  font-size: 14px;
}

/* Web 2.0 Tag Cloud */
.post-tags {
  margin: 30px 0;
}

.tag-cloud {
  margin-top: 10px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.view-all-tags {
  margin-top: 10px;
  text-align: right;
  font-size: 12px;
}

.view-all-tags a {
  color: #0066cc;
  text-decoration: none;
  background: linear-gradient(to bottom, #ffffff, #f0f0f0);
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid #ddd;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  text-shadow: 1px 1px 0 #fff;
}

.view-all-tags a:hover {
  background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
  color: #ff6600;
}

.post-tag {
  display: inline-block;
  background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
  color: #555;
  padding: 2px 8px;
  margin: 0 5px 5px 0;
  border-radius: 15px;
  font-size: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  text-shadow: 1px 1px 0 #fff;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-tag:hover {
  background: linear-gradient(to bottom, #f0f0f0, #d8d8d8);
  color: #333;
  text-decoration: none;
}

/* Author Box */
.author-box {
  background: linear-gradient(to bottom, #f8f8f8, #efefef);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  margin: 30px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.author-content {
  display: flex;
  align-items: center;
}

.author-image {
  flex: 0 0 80px;
  margin-right: 15px;
}

.author-image img {
  width: 80px;
  height: 80px;
  border-radius: 40px;
  border: 3px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.author-bio {
  flex: 1;
}

.author-bio p {
  margin: 0;
  font-style: italic;
}

/* Podcast Widget Styling */
.podcast-widget {
  background: linear-gradient(to bottom, #f8f8f8, #efefef);
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.podcast-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.podcast-image {
  margin-bottom: 15px;
}

.podcast-image img {
  width: 120px;
  height: 120px;
  border-radius: 8px; /* Changed from 60px to 8px for slightly rounded corners */
  border: 3px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.podcast-description h3 {
  margin-top: 0;
  color: #cc0000;
  font-size: 20px;
}

.podcast-description p {
  margin-bottom: 15px;
}

.podcast-button {
  display: inline-block;
  background: linear-gradient(to bottom, #cc0000, #990000);
  color: white;
  padding: 8px 15px;
  border-radius: 15px;
  font-weight: bold;
  text-decoration: none;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
  border: 1px solid #770000;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.podcast-button:hover {
  background: linear-gradient(to bottom, #dd0000, #aa0000);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

/* Web 2.0 Navigation Buttons */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.prev-post, .next-post {
  background: linear-gradient(to bottom, #ffffff, #f0f0f0);
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 15px;
  display: inline-block;
  font-family: Verdana, Arial, sans-serif;
  font-size: 12px;
  color: #555;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  text-shadow: 1px 1px 0 #fff;
  position: relative;
  overflow: hidden;
}

.prev-post:after, .next-post:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(255,255,255,0));
  border-radius: 20px 20px 0 0;
  pointer-events: none;
}

.prev-post:hover, .next-post:hover {
  background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
  color: #333;
  text-decoration: none;
}

.prev-post {
  padding-left: 20px;
}

.next-post {
  padding-right: 20px;
  text-align: right;
}

.post-nav-title {
  display: block;
  font-weight: bold;
  font-size: 13px;
}

/* Related Posts */
.related-posts {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 15px 20px;
  margin-bottom: 30px;
  border: 1px solid #ddd;
}

.related-posts h3 {
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-top: 0;
}

.related-posts ul {
  padding-left: 20px;
}

.related-posts li {
  margin-bottom: 10px;
}

.related-posts small {
  color: #777;
  font-size: 12px;
  display: block;
}

/* Code blocks styling with improved contrast */
.highlight, pre.highlight, code {
  font-family: 'JetBrains Mono', Monaco, Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
}

.highlight {
  margin: 24px 0;
  background-color: #f8f8f8;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #ddd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

pre.highlight, .highlight pre, figure.highlight pre {
  background-color: #1e1e1e !important; /* Darker background for better contrast */
  color: #ffffff !important;  /* Brighter text for better readability */
  border-radius: 6px;
  padding: 18px;
  margin: 0;
  overflow: auto;
  border: 1px solid #000;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  position: relative;
}

.highlight code, figure.highlight code, pre.highlight code {
  background-color: transparent !important;
  color: #ffffff !important;
  border: none;
}

/* Railroad-themed code block styling */
pre.highlight:before, .highlight pre:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(to right, #cc0000, #a30000);
  border-radius: 6px 6px 0 0;
}

/* Inline code styling */
:not(pre) > code {
  background-color: #f0f0f0;
  color: #cc0000; /* Ruby red color for inline code */
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-weight: 500;
}

/* Syntax highlighting colors with improved contrast */
.highlight .c, .highlight .c1 { color: #8a8a8a; } /* Comment - brighter */
.highlight .k, .highlight .kd { color: #42bdff; } /* Keyword - brighter blue */
.highlight .s, .highlight .s1, .highlight .s2 { color: #ffdb7d; } /* String - brighter yellow */
.highlight .na, .highlight .nb { color: #b8e07c; } /* Name - brighter green */
.highlight .o { color: #ff6b9d; } /* Operator - brighter pink */
.highlight .nf { color: #b8e07c; } /* Function - brighter green */
.highlight .mi, .highlight .mf { color: #c39aff; } /* Number - brighter purple */
.highlight .nt { color: #ff6b9d; } /* Tag - brighter pink */


/* Responsive adjustments */
@media (max-width: 980px) {
  .container {
    width: 100%;
    padding: 0 15px;
  }
}

@media (max-width: 768px) {
  .main-content,
  .sidebar {
    float: none;
    width: 100%;
  }
  
  .content-wrapper {
    flex-direction: column;
  }
  
  .post-navigation {
    flex-direction: column;
    gap: 10px;
  }
  
  .next-post {
    text-align: left;
  }
  
  /* Ensure header and footer stretch full width */
  .site-header, .site-footer {
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
  }
  
  /* Full-width footer columns */
  .footer-content {
    display: flex;
    flex-direction: column;
  }
  
  .footer-col {
    width: 100%;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .author-content {
    flex-direction: column;
    text-align: center;
  }
  
  .author-image {
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  /* Improve mobile readability with slightly larger font */
  .post-content {
    font-size: 17px;
    line-height: 1.8;
  }
  
  /* Add small padding for container on tiny screens */
  .container {
    padding: 0 10px;
  }
}

/* Sidebar Navigation Styling */
.sidebar-nav ul, .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li, .footer-links li {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dotted #eee;
}

.sidebar-nav li:last-child, .footer-links li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-nav a {
  display: block;
  padding: 5px 0;
  position: relative;
  padding-left: 25px;
  transition: all 0.2s ease;
}

.sidebar-nav a:before {
  content: "🚆"; /* Train emoji */
  position: absolute;
  left: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-nav a:hover {
  padding-left: 30px;
  color: #cc0000;
}

.sidebar-nav a:hover:before {
  opacity: 1;
}

/* Footer Navigation Styling */
.footer-links a {
  color: #ccc;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
}