/* Enable view transitions */
:root {
  view-transition-navigation: auto;
}

/* Customize transition duration */
::view-transition-group(root) {
  animation-duration: 0.8s;
}

/* Shared elements with transition names */
.logo-img {
  view-transition-name: main-logo;
}

.footer-logo {
  view-transition-name: footer-logo;
}

/* Article-specific styles */
.article-section {
  padding: 140px 0 80px;
  background: var(--white);
  min-height: 80vh;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  animation: fadeInUp 1s ease-out;
}

.article-header {
  margin-bottom: 3rem;
  text-align: center;
  border-bottom: 2px solid var(--gray-light);
  padding-bottom: 2rem;
}

.article-header h1 {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.3;
  font-family: var(--font-primary);
  font-weight: 700;
}

.article-meta {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-light);
  font-family: var(--font-secondary);
}

.article-date {
  background: var(--gray-light);
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
}

.article-category {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-light);
  font-family: var(--font-secondary);
}

.article-body h2 {
  color: var(--text-dark);
  margin: 2.5rem 0 1.5rem 0;
  font-size: 1.8rem;
  font-family: var(--font-primary);
  font-weight: 700;
  position: relative;
}

.article-body h2::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gray-light);
  border-radius: 2px;
}

.article-body h3 {
  color: var(--text-dark);
  margin: 2rem 0 1rem 0;
  font-size: 1.4rem;
  font-family: var(--font-primary);
  font-weight: 600;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body ul, .article-body ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-body li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.article-body li strong {
  color: var(--text-dark);
  font-weight: 600;
}

.article-cta {
  background: var(--gradient);
  color: var(--white);
  padding: 3rem;
  border-radius: 12px;
  text-align: center;
  margin-top: 4rem;
  position: relative;
  overflow: hidden;
}

/* article-cta background icon (use articles-local path) */
.article-cta::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  background-image: url('Logo SVG/Icono Blanco.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%);
  opacity: 0.1;
  z-index: 1;
}

.article-cta h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--white);
  font-family: var(--font-primary);
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.article-cta p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  position: relative;
  z-index: 2;
  color: var(--white);
}

/* CTA buttons container */
.article-cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.article-cta .btn-primary {
  background: var(--gray-light);
  color: var(--text-dark);
  border: 2px solid var(--gray-light);
  position: relative;
  z-index: 2;
}

.article-cta .btn-primary:hover {
  background: var(--white);
  color: var(--text-dark);
  border-color: var(--white);
}

/* WhatsApp button in CTA */
.article-cta .btn-whatsapp {
  background: var(--accent-color);
  color: var(--white);
  border: 2px solid var(--accent-color);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.article-cta .btn-whatsapp:hover {
  background: #128c7e;
  border-color: #128c7e;
  color: var(--white);
}

.article-cta .btn-whatsapp i {
  font-size: 1.2rem;
}

/* Back button */
.back-button {
  position: fixed;
  top: 50%;
  left: 30px;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: var(--white);
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  z-index: 1001;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  view-transition-name: back-button;
}

.back-button:hover {
  background: var(--gray-light);
  color: var(--text-dark);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 25px rgba(190, 234, 220, 0.4);
  border-color: var(--gray-light);
}

.back-button:active {
  transform: translateY(-50%) scale(1.05);
}

/* Dark theme for articles */
[data-theme="dark"] .article-section {
  background: var(--white);
}

[data-theme="dark"] .article-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .article-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .article-date {
  background: var(--gray-light);
  color: var(--text-dark) !important;
}

[data-theme="dark"] .article-category {
  background: var(--primary-color);
  color: var(--white) !important;
}

/* Dark theme for article body text */
[data-theme="dark"] .article-body {
  color: var(--text-light);
}

[data-theme="dark"] .article-body h2,
[data-theme="dark"] .article-body h3 {
  color: var(--text-dark);
}

/* Dark theme for article CTA */
[data-theme="dark"] .article-cta {
  background: var(--gradient) !important;
  color: var(--white) !important;
}

[data-theme="dark"] .article-cta h3 {
  color: #FFFFFF !important;
}

[data-theme="dark"] .article-cta p {
  color: #FFFFFF !important;
  opacity: 0.95;
}

[data-theme="dark"] .article-cta .btn-primary {
  background: var(--gray-light);
  color: var(--text-dark) !important;
  border-color: var(--gray-light);
}

[data-theme="dark"] .article-cta .btn-primary:hover {
  background: var(--white);
  color: var(--text-dark) !important;
  border-color: var(--white);
}

[data-theme="dark"] .article-cta .btn-whatsapp {
  background: var(--accent-color);
  color: var(--white) !important;
  border-color: var(--accent-color);
}

[data-theme="dark"] .article-cta .btn-whatsapp:hover {
  background: #128c7e;
  border-color: #128c7e;
  color: var(--white) !important;
}

[data-theme="dark"] .back-button {
  background: var(--card-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

[data-theme="dark"] .back-button:hover {
  background: var(--gray-light);
  color: var(--text-dark);
  border-color: var(--gray-light);
}

/* Table Styles for Articles */
.comparison-table,
.ha-table,
.process-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.comparison-table thead,
.ha-table thead,
.process-table thead {
    background: var(--primary-color);
    color: var(--white);
}

.comparison-table th,
.ha-table th,
.process-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-family: var(--font-primary);
    border-bottom: 2px solid var(--gray-light);
}

.comparison-table td,
.ha-table td,
.process-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    font-family: var(--font-secondary);
}

.comparison-table tbody tr:hover,
.ha-table tbody tr:hover,
.process-table tbody tr:hover {
    background: rgba(190, 234, 220, 0.1);
    transition: background 0.3s ease;
}

.comparison-table tbody tr:last-child td,
.ha-table tbody tr:last-child td,
.process-table tbody tr:last-child td {
    border-bottom: none;
}

/* Extra table polish for article tables: zebra rows, tighter spacing, responsive overflow */
.article-content .comparison-table,
.article-content .ha-table,
.article-content .process-table {
	/* ensure tables inherit article card background and rounded corners */
	background: transparent;
	border-radius: 8px;
	overflow: hidden;
	width: 100%;
	border-collapse: collapse;
}

.article-content thead th {
	background: var(--primary-color);
	color: #FFFFFF !important;
	padding: 12px 14px;
	text-align: left;
	font-weight: 700;
}

.article-content tbody td {
	padding: 12px 14px;
	border-bottom: 1px solid rgba(0,0,0,0.06);
	color: var(--text-light);
}

.article-content tbody tr:nth-child(odd) {
	background: rgba(190,234,220,0.04);
}

.article-content tbody tr:hover {
	background: rgba(190,234,220,0.10);
	transition: background 0.18s ease;
}

/* compact layout on small screens, allow horizontal scroll */
.article-content .comparison-table,
.article-content .ha-table,
.article-content .process-table {
	max-width: 100%;
	display: block;
	overflow-x: auto;
}

/* Dark theme tweaks */
[data-theme="dark"] .article-content thead th {
	background: var(--primary-color);
	color: #FFFFFF !important;
}

[data-theme="dark"] .article-content tbody td {
	color: var(--text-light);
	border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .article-content tbody tr:nth-child(odd) {
	background: rgba(255,255,255,0.02);
}

/* Fallback table styling for any missed cases */
.comparison-table thead,
.ha-table thead,
.process-table thead {
    background: var(--primary-color) !important;
    color: #FFFFFF !important;
}

.comparison-table th,
.ha-table th,
.process-table th {
    color: #FFFFFF !important;
    background: var(--primary-color);
    font-weight: 700;
}

/* Dark theme for fallback tables */
[data-theme="dark"] .comparison-table thead,
[data-theme="dark"] .ha-table thead,
[data-theme="dark"] .process-table thead {
    background: var(--primary-color) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .comparison-table th,
[data-theme="dark"] .ha-table th,
[data-theme="dark"] .process-table th {
    color: #FFFFFF !important;
    background: var(--primary-color);
}

/* Article Images */
.article-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin: 2rem auto;
    display: block;
    transition: all 0.3s ease;
}

.article-image:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.article-image-container {
    text-align: center;
    margin: 2rem 0;
}

.article-image-caption {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.5rem;
    text-align: center;
}

/* Dark theme for article images */
[data-theme="dark"] .article-image {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

[data-theme="dark"] .article-image:hover {
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

[data-theme="dark"] .article-image-caption {
    color: var(--text-light);
}

/* Responsive images */
@media (max-width: 768px) {
    .article-image {
        max-width: 100%;
        margin: 1.5rem auto;
    }
}

@media (max-width: 480px) {
    .article-image {
        margin: 1rem auto;
        border-radius: 8px;
    }
}

/* Custom view transition animations */
::view-transition-old(main-logo),
::view-transition-new(main-logo) {
  animation-duration: 0.6s;
}

::view-transition-old(footer-logo),
::view-transition-new(footer-logo) {
  animation-duration: 0.6s;
}

::view-transition-old(back-button),
::view-transition-new(back-button) {
  animation-duration: 0.4s;
}

/* Enhanced fade animation for content */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth transitions for interactive elements */
.article-content {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}
.article-content {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}
.article-content {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}
