/**
 * Single Post Template Styles
 */

/* ===================================
   SINGLE POST LAYOUT
   =================================== */

/* ===================================
   BREADCRUMBS
   =================================== */

.post-breadcrumbs {
  padding: var(--tcp-space-8) 0 var(--tcp-space-3) 0;
}

.breadcrumb-nav {
  font-size: 0.875rem;
  color: var(--tcp-gray-400);
}

.breadcrumb-nav a {
  color: var(--tcp-gray-400);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
  color: var(--tcp-primary, #0066cc);
}

.breadcrumb-separator {
  margin: 0 8px;
  color: var(--tcp-gray-400, #9ca3af);
}

.breadcrumb-current {
  color: var(--tcp-gray-900, #1a1a1a);
  font-weight: 500;
}

/* ===================================
   POST HEADER
   =================================== */

.single-post-header {
  padding: var(--tcp-space-8) 0;
  scroll-margin-top: 100px; /* Compensate for sticky header */
}

.single-post-header .container {
  max-width: 800px;
}

.post-category {
  margin-bottom: var(--tcp-space-3);
}

.post-category a {
  font-family: var(--tcp-font-secondary);
  font-size: var(--tcp-text-sm);
  font-weight: 700;
  color: var(--tcp-primary);
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.post-category a:hover {
  color: var(--tcp-primary-dark, #0056b3);
}

.post-title {
  font-family: var(--tcp-font-display);
  font-size: var(--tcp-text-4xl);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--tcp-space-4) 0;
  color: var(--tcp-dark);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--tcp-space-1);
  flex-wrap: wrap;
}

.post-author {
  align-items: center;
  display: flex;
  font-family: var(--tcp-font-primary);
  gap: var(--tcp-space-1);
}

.post-author img {
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

.post-author a {
  font-size: var(--tcp-text-base);
  font-weight: 600;
  color: var(--tcp-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-author a:hover {
  color: var(--tcp-primary);
}

.post-date {
  font-family: var(--tcp-font-primary);
  font-size: var(--tcp-text-base);
  color: var(--tcp-gray-600);
}

/* ===================================
   FEATURED IMAGE - WIDER THAN TEXT
   =================================== */

.single-post-featured-image {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto var(--tcp-space-8) auto;
  position: relative;
}

.single-post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.single-post-featured-image .wp-caption-text {
  font-family: var(--tcp-font-primary);
  font-size: var(--tcp-text-sm);
  font-style: italic;
  color: var(--tcp-gray-600);
  margin-top: var(--tcp-space-2);
  padding: 0 var(--tcp-space-4);
  text-align: center;
}

/* ===================================
   POST CONTENT - NARROWER CONTAINER
   =================================== */

.single-post-content {
  padding: var(--tcp-space-8) 0;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--tcp-space-4);
}

/* Larger font size for readability */
.post-content {
  font-family: var(--tcp-font-primary);
  font-size: 1.2rem;
  letter-spacing: -0.01;
  line-height: 1.8;
  color: var(--tcp-gray-800);
}

.post-content > p:first-of-type::first-letter {
  font-family: var(--tcp-font-display);
  font-size: 6.5em;
  font-weight: 500;
  line-height: 0.7;
  float: left;
  margin: 0.1em 0.1em 0 0;
  color: var(--tcp-dark);
  text-transform: uppercase;
}

.post-content p {
  margin-bottom: var(--tcp-space-6);
}

.post-content h2 {
  font-family: var(--tcp-font-display);
  font-size: var(--tcp-text-2xl);
  font-weight: 700;
  margin: var(--tcp-space-8) 0 var(--tcp-space-4) 0;
  color: var(--tcp-dark);
}

.post-content h3 {
  font-family: var(--tcp-font-display);
  font-size: var(--tcp-text-xl);
  font-weight: 700;
  margin: var(--tcp-space-6) 0 var(--tcp-space-3) 0;
  color: var(--tcp-dark);
}

.post-content ul,
.post-content ol {
  margin: var(--tcp-space-4) 0;
  padding-left: var(--tcp-space-6);
}

.post-content li {
  margin-bottom: var(--tcp-space-2);
}

.post-content a {
  color: var(--tcp-primary);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.post-content a:hover {
  color: var(--tcp-primary-dark, #0056b3);
}

.post-content blockquote {
  border-left: 4px solid var(--tcp-primary);
  padding-left: var(--tcp-space-4);
  margin: var(--tcp-space-6) 0;
  font-style: italic;
  color: var(--tcp-gray-700);
}

/* Image captions in content */
.post-content .wp-caption,
.post-content figure {
  max-width: 100%;
  margin: var(--tcp-space-6) auto;
}

.post-content .wp-caption-text,
.post-content figcaption {
  font-family: var(--tcp-font-primary);
  font-size: var(--tcp-text-sm);
  font-style: italic;
  color: var(--tcp-gray-600);
  margin-top: var(--tcp-space-2);
  text-align: center;
  padding: 0 var(--tcp-space-2);
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===================================
   IN-CONTENT ADVERTISEMENTS
   =================================== */

.content-advertisement {
  margin: var(--tcp-space-8) auto;
  text-align: center;
  max-width: 1280px;
}

.content-advertisement[data-ad-id="single-top-ad"] {
  margin: var(--tcp-space-8) auto 0 auto;
}

.content-advertisement .ad-image {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Desktop ad (1280x150) */
.content-advertisement .ad-image-desktop {
  display: block;
  max-width: 1280px;
  width: 100%;
}

/* Mobile ad (768x400) */
.content-advertisement .ad-image-mobile {
  display: none;
}

/* Google Ads container */
.content-google-ad {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .content-advertisement .ad-image-desktop {
    display: none;
  }

  .content-advertisement .ad-image-mobile {
    display: block;
    max-width: 768px;
    width: 100%;
  }

  .content-advertisement {
    max-width: 100%;
  }

  .content-google-ad {
    min-height: 400px;
  }
}

/* ===================================
   POST TAGS
   =================================== */

.post-tags {
  margin: var(--tcp-space-8) 0;
  padding-top: var(--tcp-space-6);
  border-top: 1px solid var(--tcp-gray-300);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--tcp-space-2);
}

.tags-label {
  font-family: var(--tcp-font-secondary);
  font-size: var(--tcp-text-base);
  font-weight: 700;
  color: var(--tcp-gray-600);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.post-tag {
  font-family: var(--tcp-font-primary);
  font-size: var(--tcp-text-base);
  color: var(--tcp-gray-700);
  background: var(--tcp-gray-100);
  padding: var(--tcp-space-1) var(--tcp-space-3);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.post-tag:hover {
  background: var(--tcp-primary);
  color: var(--tcp-white);
}

/* ===================================
   AUTHOR BIO
   =================================== */

.author-bio {
  display: flex;
  gap: var(--tcp-space-4);
  padding: var(--tcp-space-6);
  background: var(--tcp-gray-100);
  border-radius: 8px;
  margin: var(--tcp-space-8) 0;
}

.author-avatar img {
  border-radius: 50%;
  width: 80px;
  height: 80px;
}

.author-info {
  flex: 1;
}

.author-name {
  font-family: var(--tcp-font-display);
  font-size: var(--tcp-text-xl);
  font-weight: 700;
  margin: 0 0 var(--tcp-space-2) 0;
}

.author-name a,
.author-description a {
  color: var(--tcp-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.author-name a:hover,
.author-description a:hover {
  color: var(--tcp-primary);
}

.author-description {
  font-family: var(--tcp-font-primary);
  font-size: var(--tcp-text-base);
  line-height: 1.6;
  color: var(--tcp-gray-700);
  margin: 0;
}

/* ===================================
   RELATED POSTS SECTIONS
   =================================== */

.related-posts-section,
.latest-posts-section {
  padding: var(--tcp-space-6) 0;
  background: var(--tcp-gray-50);
}

.latest-posts-section {
  background: var(--tcp-white);
}

.category-title span:hover {
  color: var(--tcp-dark);
}

/* Use existing mod_category-grid styles */
/* The .category-grid, .category-posts, and .post-card styles 
   are already defined in mod_category-grid.css */

/* Override grid columns for related/latest sections */
.related-posts-section .category-grid.posts-4 .category-posts,
.latest-posts-section .category-grid.posts-3 .category-posts {
  display: grid;
  gap: var(--tcp-space-6);
}

.related-posts-section .category-grid.posts-4 .category-posts {
  grid-template-columns: repeat(4, 1fr);
}

.latest-posts-section .category-grid.posts-3 .category-posts {
  grid-template-columns: repeat(3, 1fr);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
  .post-title {
    font-size: var(--tcp-text-3xl);
  }

  .single-post-featured-image {
    max-width: 100%;
  }

  .related-posts-section .category-grid.posts-4 .category-posts {
    grid-template-columns: repeat(2, 1fr);
  }

  .latest-posts-section .category-grid.posts-3 .category-posts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .single-post {
    margin: var(--tcp-space-8) 0;
  }

  .single-post-header {
    padding: var(--tcp-space-6) 0;
  }

  .post-title {
    font-size: var(--tcp-text-2xl);
  }

  .post-content {
    font-size: 1rem; /* 16px on mobile */
  }

  .author-bio {
    flex-direction: column;
    text-align: center;
  }

  .author-avatar {
    margin: 0 auto;
  }

  .related-posts-section .category-grid.posts-4 .category-posts,
  .latest-posts-section .category-grid.posts-3 .category-posts {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: var(--tcp-text-2xl);
  }

  .related-posts-section,
  .latest-posts-section {
    padding: var(--tcp-space-8) 0;
  }
}
