/* Blog & Post Styles */

/* Logo link */
.logo-link {
  text-decoration: none;
  color: inherit;
}
.logo-link:hover h1 {
  color: var(--accent);
}

/* Section header links (e.g., "Our Stories" on homepage) */
.section-link {
  color: inherit;
  text-decoration: none;
}
.section-link:hover {
  color: var(--accent);
}

/* Active nav state */
nav a.active {
  border-color: var(--accent);
  background: rgba(125, 211, 252, 0.1);
}

/* Stories listing page */
.stories-page .page-intro {
  color: var(--muted);
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

.stories-grid {
  display: grid;
  gap: 1.5rem;
}

.story-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  background: linear-gradient(135deg, #0f141c, #161b22);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

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

.story-cover {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  background: #0b0f14;
}

/* Story card content - added left padding for cards without cover images */
.story-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* When there's no cover image, the card is just one column */
.story-card:not(:has(.story-cover)) {
  grid-template-columns: 1fr;
}

.story-date {
  color: var(--accent2);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.story-card h3 {
  margin: 0;
  font-size: 1.3rem;
}

.story-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.story-card h3 a:hover {
  color: var(--accent);
}

.story-card p {
  color: var(--muted);
  margin: 0;
  flex: 1;
}

.read-more {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.read-more:hover {
  text-decoration: underline;
}

/* Responsive: stack on mobile */
@media (max-width: 600px) {
  .story-card {
    grid-template-columns: 1fr;
  }
  .story-cover {
    height: 180px;
  }
  .story-card-content {
    padding: 1rem;
  }
}

/* Individual post page */
.post-page {
  max-width: 800px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.back-link:hover {
  color: var(--accent);
}

.post-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.post-header h1 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
}

.post-cover-image {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

/* Post content (rendered Markdown) */
.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.post-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-content p {
  margin: 0 0 1.25rem;
}

.post-content a {
  color: var(--accent);
}

.post-content blockquote {
  border-left: 3px solid var(--accent2);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: rgba(192, 132, 252, 0.08);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--muted);
}

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

.post-content ul,
.post-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Images in posts */
.post-image {
  margin: 1.5rem 0;
}

.post-image img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.post-image figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Photo gallery syntax: multiple images in a row */
.post-content p:has(> img + img) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

/* Video embeds */
.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  margin: 1.5rem 0;
  border-radius: 10px;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Map embeds */
.map-embed {
  margin: 1.5rem 0;
  border-radius: 10px;
  overflow: hidden;
  height: 350px;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.5rem 0;
}

.post-nav a:hover {
  color: var(--accent);
}

.nav-prev {
  text-align: left;
}

.nav-next {
  text-align: right;
  margin-left: auto;
}

.loading-text {
  color: var(--muted);
  font-style: italic;
}

/* Story preview on main page */
.timeline-item.has-post h3 a {
  color: var(--text);
  text-decoration: none;
}

.timeline-item.has-post h3 a:hover {
  color: var(--accent);
}

.timeline-item .read-more {
  margin-top: 0.3rem;
  display: inline-block;
}
