/* Blog-specific styles */
:root {
  --creamsicle: #fff5e6;
  --creamsicle-dim: #ffe5d0;
  --thought-bg: #fffaf0;
  --thought-text: #666;
}

/* Blog post container */
#blog-post {
  max-width: 600px;
  width: 100%;
  color: var(--creamsicle);
  font-family: 'Courier New', monospace;
  font-style: italic;
  line-height: 1.8;
  font-size: 1.1rem;
  position: relative;
  text-align: left;
  box-sizing: border-box;
  
  /* Subtle text shadow for readability */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  
  /* Smooth transitions for post changes */
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Blog content wrapper */
.blog-content {
  font-style: italic;
}

/* Paragraphs */
.blog-content p {
  margin-bottom: 1.5rem;
  text-indent: 2rem;
}

.blog-content p:first-of-type {
  text-indent: 0;
}

.blog-content p:first-of-type::first-letter {
  font-size: 2em;
  float: left;
  line-height: 1;
  margin-right: 0.1em;
  color: var(--creamsicle-dim);
}

/* When text should NOT be italic (emphasized) */
.blog-content .not-italic {
  font-style: normal;
  font-weight: 600;
  color: var(--creamsicle-dim);
}

/* Thought bubble hover targets */
.has-thought {
  cursor: help;
  position: relative;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.5s ease;
}

.has-thought.showing-underline {
  border-bottom-color: var(--creamsicle-dim);
}

/* Thought bubble */
#thought-bubble {
  position: absolute;
  background: var(--thought-bg);
  color: var(--thought-text);
  padding: 1.5rem 2rem;
  border-radius: 15px;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Bradley Hand', cursive;
  font-style: normal;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center; /* Center the text inside */
  box-shadow: 
    0 5px 20px rgba(0, 0, 0, 0.1),
    0 2px 10px rgba(0, 0, 0, 0.05);
  
  /* Sizing */
  width: 600px;
  max-width: calc(100vw - 4rem);
  box-sizing: border-box;
  margin: 0;
  
  /* Start hidden */
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  z-index: 100;
  
  /* Animation */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Visible state with animation */
#thought-bubble.visible {
  animation: slideUpFromBehind 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUpFromBehind {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Date styling */
.post-date {
  display: block;
  margin-top: 2rem;
  text-align: right;  /* This should keep it on the right */
  font-size: 0.875rem;
  color: var(--creamsicle-dim);
  opacity: 0.7;
  position: relative;
}

/* Date hover effects - WITH underline */
.has-date-thought {
  cursor: help;
  display: inline-block;  /* Keep this one */
  border-bottom: 1px dotted transparent;
  transition: border-color 0.5s ease;
  position: relative;
}

.has-date-thought:hover {
  border-bottom-color: var(--creamsicle-dim);
}

/* Human date that appears on hover */
.real-date {
  position: absolute;
  right: calc(100% + 1rem);  /* Position to the left with gap */
  top: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--creamsicle-dim);
  font-style: italic;
  white-space: nowrap;
}

.has-date-thought.showing-real-date .real-date {
  opacity: 1;
}

/* Loading state */
.blog-loading {
  text-align: center;
  color: var(--creamsicle-dim);
  font-style: italic;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #blog-post {
    font-size: 1rem;
    line-height: 1.7;
  }
  
  .blog-content p {
    text-indent: 1.5rem;
  }
  
  #thought-bubble {
    font-size: 0.85rem;
    padding: 0.75rem 1.25rem;
    width: 100%;
  }
}

/* Debug mode */
body.debug .has-thought {
  background: rgba(255, 255, 255, 0.1);
}
