/**
 * Single Post Template Styles
 * Matches the design from layoutinstruction/postsingle.md
 * 
 * @package TrekkingInNepal
 */

/* ==========================================================================
   Post Wrapper
   ========================================================================== */

.single-post-wrapper {
  background: #f8f7f5;
  min-height: 60vh;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.post-breadcrumbs {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.post-breadcrumbs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.breadcrumb-link {
  color: #8a7260;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-link:hover {
  color: #f47b25;
}

.breadcrumb-separator {
  color: #8a7260;
}

.breadcrumb-current {
  color: #181411;
  font-weight: 500;
}

/* ==========================================================================
   Hero Image Header
   ========================================================================== */

.post-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.post-hero-container {
  position: relative;
}

.post-hero-image {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  border-radius: 0.75rem;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Dark overlay for better text readability */
.post-hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.2) 100%);
  z-index: 1;
}

.post-hero-content {
  padding: 2rem;
  max-width: 800px;
  position: relative;
  z-index: 2;
}

.post-hero-category {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: #f47b25;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.post-hero-title {
  color: white;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1.5rem 0;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.post-hero-avatar {
  flex-shrink: 0;
}

.post-hero-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.post-hero-author-info {
  color: white;
}

.post-hero-author-name {
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.post-hero-author-meta {
  font-size: 0.875rem;
  opacity: 0.8;
  font-style: italic;
  margin: 0;
}

@media (max-width: 768px) {
  .post-hero-image {
    height: 400px;
  }
  
  .post-hero-content {
    padding: 1.5rem;
  }
  
  .post-hero-title {
    font-size: 2rem;
  }
}

/* ==========================================================================
   Content Grid
   ========================================================================== */

.post-content-grid {
  max-width: 1280px;
  margin: 3rem auto 0 auto;
  padding: 0 1.5rem;
}

.post-content-grid-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .post-content-grid-container {
    flex-direction: row;
    gap: 3rem;
  }
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.post-main-content {
  flex: 1;
  max-width: 100%;
}

@media (min-width: 1024px) {
  .post-main-content {
    max-width: 800px;
  }
}

.post-entry-content {
  font-family: 'Noto Serif', serif;
  font-size: 1.125rem;
  line-height: 1.8;
  color: #4a4a4a;
}

/* Typography */
.post-entry-content p {
  margin: 0 0 1.5rem 0;
}

.post-entry-content h1,
.post-entry-content h2,
.post-entry-content h3,
.post-entry-content h4,
.post-entry-content h5,
.post-entry-content h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: #f47b25;
  margin: 2rem 0 1rem 0;
  line-height: 1.3;
}

.post-entry-content h2 { font-size: 1.5rem; }
.post-entry-content h3 { font-size: 1.25rem; }
.post-entry-content h4 { font-size: 1.125rem; }

.post-entry-content a {
  color: #f47b25;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.post-entry-content a:hover {
  color: #e06a1a;
}

/* Blockquotes */
.post-entry-content blockquote {
  margin: 2.5rem 0;
  padding: 2rem;
  background: #f8f7f5;
  border-left: 4px solid #f47b25;
  border-radius: 0.75rem;
  font-style: italic;
  font-size: 1.25rem;
  text-align: center;
  color: #181411;
  position: relative;
}

.post-entry-content blockquote::before {
  content: '\201C';
  font-size: 3rem;
  color: #f47b25;
  display: block;
  margin-bottom: 1rem;
  line-height: 1;
}

/* Lists */
.post-entry-content ul,
.post-entry-content ol {
  margin: 0 0 1.5rem 0;
  padding-left: 2rem;
}

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

/* Images */
.post-entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
}

/* Image Grid */
.post-entry-content .wp-block-gallery,
.post-entry-content .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

/* Code */
.post-entry-content pre {
  background: #1a1a1a;
  color: #f9fafb;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-entry-content code {
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.post-entry-content pre code {
  background: transparent;
  padding: 0;
}

/* Tables */
.post-entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.post-entry-content th,
.post-entry-content td {
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  text-align: left;
}

.post-entry-content th {
  background: #f9fafb;
  font-weight: 600;
}

/* Page Links */
.page-links {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  font-weight: 600;
}

.page-links a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #f47b25;
  color: white;
  text-decoration: none;
  border-radius: 0.375rem;
  margin: 0 0.25rem;
  transition: all 0.3s ease;
}

.page-links a:hover {
  background: #e06a1a;
  transform: translateY(-2px);
}

/* ==========================================================================
   Post Tags
   ========================================================================== */

.post-tags {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.post-tags-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.post-tags-label .material-symbols-outlined {
  font-size: 1.125rem;
}

.post-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tag {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 2rem;
  transition: all 0.3s ease;
}

.post-tag:hover {
  background: #f47b25;
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .post-tags {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   Author Bio
   ========================================================================== */

.post-author-bio {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 0.75rem;
}

.author-bio-avatar {
  flex-shrink: 0;
}

.author-bio-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.author-bio-content {
  flex: 1;
}

.author-bio-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.author-bio-name a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.author-bio-name a:hover {
  color: #f47b25;
}

.author-bio-description {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #6b7280;
  margin: 0;
}

@media (max-width: 768px) {
  .post-author-bio {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.post-sidebar {
  width: 100%;
}

@media (min-width: 1024px) {
  .post-sidebar {
    width: 320px;
    flex-shrink: 0;
  }
}

/* Sidebar Widget */
.sidebar-widget {
  padding: 1.5rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #f5f2f0;
  margin-bottom: 2rem;
}

.sidebar-widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: #181411;
}

/* Search Widget */
.sidebar-search {
  position: relative;
}

.sidebar-search form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: #9ca3af;
  font-size: 1.25rem;
  pointer-events: none;
}

.sidebar-search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  background: #f8f7f5;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.sidebar-search-input:focus {
  outline: none;
  border: 1px solid #f47b25;
  box-shadow: 0 0 0 1px #f47b25;
}

/* Recent Posts */
.sidebar-recent-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-post-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.recent-post-item:hover {
  transform: translateX(4px);
}

.recent-post-thumbnail {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background-size: cover;
  background-position: center;
}

.recent-post-content {
  flex: 1;
}

.recent-post-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #181411;
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.recent-post-item:hover .recent-post-title {
  color: #f47b25;
}

.recent-post-date {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0;
}

/* Popular Treks */
.sidebar-popular-treks {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.popular-trek-card {
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #f5f2f0;
}

.popular-trek-image {
  height: 128px;
  background-size: cover;
  background-position: center;
}

.popular-trek-content {
  padding: 1rem;
}

.popular-trek-title {
  font-size: 1rem;
  font-weight: 700;
  color: #181411;
  margin: 0 0 0.5rem 0;
}

.popular-trek-meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0 0 0.75rem 0;
}

.popular-trek-button {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background: rgba(244, 123, 37, 0.1);
  color: #f47b25;
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.popular-trek-button:hover {
  background: #f47b25;
  color: white;
}

/* ==========================================================================
   Comments Section
   ========================================================================== */

.post-comments-wrapper {
  max-width: 1280px;
  margin: 3rem auto 0 auto;
  padding: 0 1.5rem 3rem 1.5rem;
}

.post-comments-container {
  max-width: 800px;
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .post-comments-container {
    padding: 1.5rem;
  }
}
