/* ==========================================================================
   Post Virtuales - Estilo moderno inspirado en el blog real del tema
   ========================================================================== */

:root {
  --pv-primary: #0EA5E9;
  --pv-primary-dark: #0284C7;
  --pv-secondary: #059669;
  --pv-accent: #F59E0B;
  --pv-text: #1E293B;
  --pv-text-light: #64748B;
  --pv-bg: #F8FAFC;
  --pv-card-bg: #FFFFFF;
  --pv-border: #E2E8F0;
  --pv-radius: 16px;
  --pv-radius-sm: 10px;
  --pv-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --pv-shadow-hover: 0 10px 30px rgba(15, 23, 42, 0.12);
  --pv-sidebar-width: 320px;
  --pv-gap: 32px;
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(148, 163, 184, 0.2);
  z-index: 9999;
}
.reading-progress .progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pv-primary), var(--pv-secondary));
  transition: width 0.1s ease-out;
}

/* Hero */
.pv-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  margin-bottom: var(--pv-gap);
}
.pv-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.pv-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pv-hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--pv-primary) 0%, var(--pv-secondary) 100%);
}
.pv-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.85) 100%);
}
.pv-back-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease;
}
.pv-back-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.pv-hero-content {
  position: relative;
  z-index: 2;
  padding: 48px 40px;
  max-width: 900px;
}
.pv-category-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pv-accent);
  color: #1E293B;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.pv-hero-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 12px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.pv-hero-meta {
  font-size: 0.95rem;
  opacity: 0.9;
  margin: 0;
}

/* Layout */
.pv-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.pv-layout {
  display: grid;
  grid-template-columns: 1fr var(--pv-sidebar-width);
  gap: var(--pv-gap);
  align-items: start;
}

/* Main content */
.pv-main {
  background: var(--pv-card-bg);
  border-radius: var(--pv-radius);
  box-shadow: var(--pv-shadow);
  padding: 32px;
  animation: pvFadeInUp 0.5s ease both;
}
.pv-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--pv-border);
}
.pv-views {
  color: var(--pv-text-light);
  font-size: 0.9rem;
  font-weight: 500;
}
.pv-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid var(--pv-border);
  border-radius: 999px;
  background: var(--pv-bg);
  color: var(--pv-text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pv-share-btn:hover {
  background: var(--pv-primary);
  border-color: var(--pv-primary);
  color: #fff;
}
.pv-share-btn.pv-copied {
  background: var(--pv-secondary);
  border-color: var(--pv-secondary);
  color: #fff;
}

.pv-article-content {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--pv-text);
}
.pv-article-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2.2em 0 0.7em;
  color: var(--pv-text);
  scroll-margin-top: 24px;
}
.pv-article-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 1.8em 0 0.6em;
}
.pv-article-content p {
  margin: 0 0 1.2em;
}
.pv-article-content ul,
.pv-article-content ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}
.pv-article-content li {
  margin-bottom: 0.5em;
}
.pv-article-content a {
  color: var(--pv-primary-dark);
  text-decoration: underline;
  text-decoration-color: rgba(2, 132, 199, 0.3);
}
.pv-article-content a:hover {
  text-decoration-color: var(--pv-primary-dark);
}
.pv-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--pv-radius-sm);
  margin: 1.5em 0;
}
.pv-article-content blockquote {
  margin: 1.8em 0;
  padding: 16px 24px;
  border-left: 4px solid var(--pv-primary);
  background: var(--pv-bg);
  border-radius: 0 var(--pv-radius-sm) var(--pv-radius-sm) 0;
  font-style: italic;
  color: var(--pv-text-light);
}
.pv-article-content strong {
  color: var(--pv-text);
}
.pv-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
}
.pv-article-content th,
.pv-article-content td {
  padding: 10px 14px;
  border: 1px solid var(--pv-border);
  text-align: left;
}
.pv-article-content th {
  background: var(--pv-bg);
  font-weight: 700;
}

/* Author card */
.pv-author-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--pv-border);
}
.pv-author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pv-primary), var(--pv-secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.pv-author-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pv-text);
}
.pv-author-role {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--pv-text-light);
}

/* Sidebar */
.pv-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pv-widget {
  background: var(--pv-card-bg);
  border-radius: var(--pv-radius);
  box-shadow: var(--pv-shadow);
  padding: 24px;
  animation: pvFadeInUp 0.5s ease both;
}
.pv-widget:nth-child(2) { animation-delay: 0.08s; }
.pv-widget:nth-child(3) { animation-delay: 0.16s; }
.pv-widget-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pv-text);
}
.pv-topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pv-topic-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pv-bg);
  color: var(--pv-text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--pv-border);
  transition: all 0.2s ease;
}
.pv-topic-tag:hover {
  background: var(--pv-primary);
  border-color: var(--pv-primary);
  color: #fff;
}
.pv-recent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pv-recent-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--pv-border);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.pv-recent-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.pv-recent-item:hover {
  opacity: 0.7;
}
.pv-recent-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--pv-text);
  line-height: 1.4;
}
.pv-recent-date {
  font-size: 0.78rem;
  color: var(--pv-text-light);
}

/* Archive / category grid */
.pv-archive-hero {
  position: relative;
  padding: 64px 24px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--pv-primary) 0%, var(--pv-secondary) 100%);
  margin-bottom: var(--pv-gap);
}
.pv-archive-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 10px;
}
.pv-archive-desc {
  font-size: 1.05rem;
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto;
}
.pv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.pv-card {
  background: var(--pv-card-bg);
  border-radius: var(--pv-radius);
  box-shadow: var(--pv-shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--pv-text);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: pvFadeInUp 0.5s ease both;
}
.pv-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pv-shadow-hover);
  color: var(--pv-text);
}
.pv-card-media {
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--pv-primary) 0%, var(--pv-secondary) 100%);
}
.pv-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pv-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.pv-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.pv-card-excerpt {
  font-size: 0.9rem;
  color: var(--pv-text-light);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}
.pv-card-meta {
  font-size: 0.78rem;
  color: var(--pv-text-light);
  margin-top: 4px;
}

/* Pagination */
.pv-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}
.pv-pagination a,
.pv-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--pv-radius-sm);
  background: var(--pv-card-bg);
  box-shadow: var(--pv-shadow);
  color: var(--pv-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.pv-pagination a:hover {
  background: var(--pv-primary);
  color: #fff;
}
.pv-pagination .pv-current {
  background: var(--pv-primary);
  color: #fff;
}

/* Animations */
@keyframes pvFadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom scrollbar (article content only, webkit) */
.pv-main::-webkit-scrollbar { width: 8px; }

/* Responsive */
@media (max-width: 1024px) {
  .pv-layout {
    grid-template-columns: 1fr;
  }
  .pv-sidebar {
    position: static;
  }
}
@media (max-width: 768px) {
  .pv-hero {
    min-height: 320px;
  }
  .pv-hero-content {
    padding: 32px 20px;
  }
  .pv-main {
    padding: 22px;
  }
  .pv-container {
    padding: 0 16px 40px;
  }
}
@media (max-width: 480px) {
  .pv-action-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .pv-archive-hero {
    padding: 40px 16px;
  }
}
