/* Post Detail Page Styles - AuresTrails */

.post-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.5s ease both;
}

/* Breadcrumb Bar */
.post-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.post-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.post-breadcrumbs .separator {
  opacity: 0.4;
  font-size: 0.75rem;
}

.post-breadcrumbs .current {
  color: var(--primary-light);
  font-weight: 600;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Post Header */
.post-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.post-category-tag {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.12);
  color: var(--primary);
  border: 1px solid rgba(255, 107, 53, 0.28);
  letter-spacing: 0.5px;
}

.post-title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.35;
  color: #FFFFFF;
}

/* Author & Meta Row */
.post-author-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.author-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 107, 53, 0.15);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary-light);
}

.author-meta {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--highlight);
}

.post-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-stats {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-item svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Post Hero Image */
.post-hero-image-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 2rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 107, 53, 0.2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.post-hero-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* Trail / Field Metadata Grid */
.trail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.trail-meta-pill {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

.trail-meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.trail-meta-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--highlight);
}

/* Post Body */
.post-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
  line-height: 1.9;
  font-size: 1.05rem;
  color: var(--text-light);
}

.post-content p {
  margin-bottom: 1.35rem;
  white-space: pre-line;
}

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

/* Gallery of additional photos */
.post-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.post-gallery-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease;
}

.post-gallery-img:hover {
  transform: scale(1.02);
}

/* Tags */
.post-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.post-tag-badge {
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* CTA: Open in AuresTrails App */
.post-app-cta {
  background: linear-gradient(135deg, rgba(232, 93, 4, 0.18) 0%, rgba(255, 107, 53, 0.08) 100%);
  border: 1px solid rgba(255, 107, 53, 0.35);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  margin-bottom: 2rem;
}

.cta-brand-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cta-app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(232, 93, 4, 0.3);
  flex-shrink: 0;
}

.cta-text-wrap h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 0.3rem;
}

.cta-text-wrap p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cta-open-button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  border: none;
  padding: 0.85rem 1.6rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(232, 93, 4, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-open-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(232, 93, 4, 0.45);
}

.cta-open-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Loading State */
.post-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  gap: 1.25rem;
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 107, 53, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Error State ("المنشور غير موجود") */
.post-error-wrap {
  width: 100%;
  max-width: 620px;
  margin: 4rem auto;
  padding: 3rem 2rem;
  background: var(--card-bg);
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: 24px;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  animation: fadeInUp 0.5s ease both;
}

.error-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.error-icon-box svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.error-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 0.75rem;
}

.error-message {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 2rem;
}

.error-back-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  padding: 0.85rem 1.85rem;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 18px rgba(232, 93, 4, 0.3);
}

.error-back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(232, 93, 4, 0.45);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .post-app-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .cta-brand-group {
    flex-direction: column;
  }
  .cta-open-button {
    justify-content: center;
  }
  .post-author-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-stats {
    width: 100%;
    justify-content: flex-end;
  }
}
