:root {
  --primary-color: #2563eb;
  --primary-light: #60a5fa;
  --primary-dark: #1d4ed8;
  --text-color: #1f2937;
  --bg-color: #ffffff;
  --accent-bg: #f3f4f6;
  --border-color: #e5e7eb;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --footer-bg: #1f2937;
  --footer-text: #f3f4f6;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
  --bg-secondary: #f9fafb;
  --text-secondary: #6b7280;
}

/* Estilos base con mejoras de accesibilidad */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--accent-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Mejoras de accesibilidad */
:focus {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Contenedor principal */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header con microinteracciones */
.header {
  background-color: var(--bg-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform var(--transition-speed);
}

.header.hidden {
  transform: translateY(-100%);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-speed);
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width var(--transition-speed);
}

.logo:hover::after {
  width: 100%;
}

/* Grid de posts con animaciones suaves */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

/* Tarjetas de posts con microinteracciones */
.post-card {
  background: var(--bg-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: all var(--transition-speed);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--primary-color), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-speed);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.post-card:hover::before {
  transform: scaleX(1);
}

.post-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform var(--transition-speed);
}

.post-card:hover .post-image {
  transform: scale(1.03);
}

/* Títulos y contenido con mejor tipografía */
.main-title {
  font-size: 2.5rem;
  color: var(--text-color);
  margin: 2rem 0;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(120deg, var(--primary-color), var(--primary-light));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.post-title {
  font-size: 1.5rem;
  margin: 1rem 0;
  line-height: 1.3;
}

.post-title a {
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

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

/* Contenedor de comentarios */
.comments-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.comments-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.8rem;
}

.comment-list {
    margin-top: 3rem;
}

.comment {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.comment-content {
    color: var(--text-color);
    line-height: 1.6;
}

.comment-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color var(--transition-speed);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-form button {
    margin-top: 1rem;
    width: 100%;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .comments-container {
        background: var(--bg-secondary);
    }

    .comment {
        background: var(--bg-color);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .comment-form {
        background: var(--bg-color);
    }

    .comment-form input,
    .comment-form textarea {
        background: var(--bg-secondary);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .comments-container {
        padding: 1rem;
        margin: 1rem;
    }

    .comment {
        padding: 1rem;
    }

    .comment-form {
        padding: 1rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Botones con estados y microinteracciones */
.button {
  display: inline-block;
  background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
}

.button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  transition: transform 0.6s;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.button:hover::after {
  transform: translate(-50%, -50%) scale(1);
}

.button:active {
  transform: translateY(0);
}

/* Grid de imágenes destacadas */
.featured-images {
  margin: 3rem 0;
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.section-title {
  font-size: 2rem;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--primary-color), var(--primary-light));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.featured-image {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-speed);
  background: var(--bg-color);
}

.featured-image:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.featured-image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  transition: transform var(--transition-speed);
}

.featured-image:hover img {
  transform: scale(1.05);
}

.featured-image figcaption {
  position: absolute;
  top: 250px;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  font-size: 1rem;
  font-weight: 500;
  transform: translateY(-100%);
}

.image-description {
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 0 0 12px 12px;
}

.image-description h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.image-description p {
  color: var(--text-color);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Footer mejorado */
.footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: white;
  position: relative;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary-light);
}

/* Redes sociales en el footer */
.social-section {
  text-align: center;
}

.social-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-color);
  color: var(--primary-color);
  transition: all var(--transition-speed);
  box-shadow: var(--card-shadow);
}

.social-link:hover {
  transform: translateY(-4px);
  background: var(--primary-color);
  color: white;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.social-icon {
  width: 24px;
  height: 24px;
  transition: transform var(--transition-speed);
}

.social-link:hover .social-icon {
  transform: scale(1.1);
}

/* Ajustes responsive para el footer */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .social-section {
    order: -1;
    margin-bottom: 1rem;
  }

  .social-links {
    gap: 1rem;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }

  .social-icon {
    width: 20px;
    height: 20px;
  }
}

/* Copyright en el footer */
.copyright {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.copyright p {
  margin: 0.5rem 0;
}

.heart {
  color: #e11d48;
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
  .copyright {
    border-color: var(--border-color);
  }
}

/* Preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .heart {
    animation: none;
  }
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #f3f4f6;
    --bg-color: #1f2937;
    --accent-bg: #111827;
    --border-color: #374151;
    --footer-bg: #111827;
    --footer-text: #f3f4f6;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  }

  .post-card {
    background-color: var(--bg-color);
  }

  .comment-form {
    background-color: var(--accent-bg);
  }

  .comment-form input,
  .comment-form textarea {
    background-color: var(--bg-color);
    color: var(--text-color);
  }

  .main-title {
    background: linear-gradient(120deg, var(--primary-light), #60a5fa);
    background-clip: text;
    -webkit-background-clip: text;
  }

  .featured-image {
    background: var(--bg-color);
  }

  .image-description {
    background: var(--bg-color);
  }

  .comment-form input,
  .comment-form textarea {
    background: var(--bg-color);
    border-color: var(--border-color);
  }

  .comment {
    background: var(--bg-color);
  }
}

/* Mejoras de accesibilidad y responsividad */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .main-title {
    font-size: 2rem;
  }

  .posts-grid {
    padding: 1rem;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }
  
  .featured-image {
    margin: 0 auto;
    max-width: 500px;
  }

  .image-description {
    padding: 1.25rem;
  }

  .image-description h3 {
    font-size: 1.1rem;
  }

  .image-description p {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-image:hover {
    transform: none;
  }

  .featured-image:hover img {
    transform: none;
  }
}

/* Mensaje cuando no hay posts */
.no-posts {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin: 2rem auto;
  max-width: 600px;
}

.no-posts h2 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.no-posts p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
  .no-posts {
    background: var(--bg-secondary);
  }
}
