/* ==========================================================================
   PRECIO-PAGINA-WEB-PROFESIONAL.CSS
   Extensión de blog-post.css para el artículo de precios
   Peak Site Studio · usa las variables definidas en styles.css
   ========================================================================== */

/* ===== AVISO / DESTACADO DENTRO DEL TEXTO ===== */
.post-note {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--card-bg-light);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin: 1.6rem 0 2rem;
}
body.dark .post-note {
  background: var(--card-bg-dark);
  border-color: var(--border-dark);
  border-left-color: var(--accent);
}
.post-note .post-note-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.post-note p {
  margin: 0 !important;
  font-size: 0.96rem !important;
}

/* ===== TABLA DE PRECIOS / COMPARATIVAS ===== */
.post-table-wrap {
  overflow-x: auto;
  margin: 1.6rem 0 2.2rem;
  border: 1px solid var(--border-light);
  border-radius: 16px;
}
body.dark .post-table-wrap {
  border-color: var(--border-dark);
}
.post-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 0.95rem;
}
.post-table th,
.post-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-soft-light);
}
body.dark .post-table th,
body.dark .post-table td {
  border-bottom: 1px solid var(--border-dark);
  color: var(--text-soft-dark);
}
.post-table thead th {
  background: var(--primary);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.post-table tbody tr:last-child td {
  border-bottom: none;
}
.post-table tbody tr:nth-child(even) {
  background: rgba(0, 212, 255, 0.035);
}
.post-table td strong,
.post-table th strong {
  color: var(--text-light);
}
body.dark .post-table td strong {
  color: var(--text-dark);
}
.post-table .price-cell {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  color: var(--accent2);
  white-space: nowrap;
}

/* ===== TARJETAS DE RANGO DE PRECIO ===== */
.price-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin: 1.8rem 0 2.2rem;
}
.price-card {
  background: var(--card-bg-light);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 1.6rem;
}
body.dark .price-card {
  background: var(--card-bg-dark);
  border-color: var(--border-dark);
}
.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 20px 45px rgba(0, 212, 255, 0.12);
  position: relative;
}
.price-card .price-card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent2);
  margin-bottom: 0.6rem;
}
.price-card h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  color: var(--text-light);
  margin: 0 0 0.4rem;
}
body.dark .price-card h4 {
  color: var(--text-dark);
}
.price-card .price-card-amount {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent2);
  margin-bottom: 0.8rem;
  display: block;
}
.price-card p {
  font-size: 0.9rem !important;
  color: var(--text-soft-light) !important;
  margin-bottom: 0.9rem !important;
}
body.dark .price-card p {
  color: var(--text-soft-dark) !important;
}
.price-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft-light);
}
body.dark .price-card ul {
  color: var(--text-soft-dark);
}
.price-card ul li {
  padding-left: 1.3rem;
  position: relative;
  margin-bottom: 0.55rem;
}
.price-card ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent2);
  font-weight: 700;
}

/* ===== BLOQUES DE ERROR / CONSEJO ===== */
.post-tip,
.post-warning {
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0 1.6rem;
  font-size: 0.96rem;
}
.post-tip {
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.25);
}
.post-warning {
  background: rgba(255, 99, 99, 0.06);
  border: 1px solid rgba(255, 99, 99, 0.25);
}
.post-tip strong,
.post-warning strong {
  color: var(--text-light);
  display: block;
  margin-bottom: 0.3rem;
  font-family: "Space Grotesk", sans-serif;
}
body.dark .post-tip strong,
body.dark .post-warning strong {
  color: var(--text-dark);
}
.post-tip p,
.post-warning p {
  margin: 0 !important;
  color: var(--text-soft-light) !important;
}
body.dark .post-tip p,
body.dark .post-warning p {
  color: var(--text-soft-dark) !important;
}

/* ===== IMAGEN SUGERIDA (placeholder editorial) ===== */
.post-image-placeholder {
  border: 1px dashed var(--border-light);
  border-radius: 16px;
  padding: 2.4rem 1.4rem;
  text-align: center;
  margin: 1.8rem 0 2.2rem;
  color: var(--text-soft-light);
  font-size: 0.85rem;
}
body.dark .post-image-placeholder {
  border-color: var(--border-dark);
  color: var(--text-soft-dark);
}
.post-image-placeholder strong {
  display: block;
  color: var(--text-light);
  font-family: "Space Grotesk", sans-serif;
  margin-bottom: 0.4rem;
}
body.dark .post-image-placeholder strong {
  color: var(--text-dark);
}

/* ===== FAQ (acordeón) ===== */
.faq-list {
  margin-top: 1.2rem;
}
.faq-item {
  border-bottom: 1px solid var(--border-light);
}
body.dark .faq-item {
  border-color: var(--border-dark);
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 18px 4px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
}
body.dark .faq-question {
  color: var(--text-dark);
}
.faq-icon {
  color: var(--accent);
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-answer p {
  padding: 0 4px 18px;
  margin: 0 !important;
}
.faq-item.open .faq-answer {
  max-height: 320px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .price-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .post-table {
    font-size: 0.88rem;
  }
  .post-table th,
  .post-table td {
    padding: 11px 14px;
  }
}

/* =========================================================
   IMAGEN AMPLIABLE / LIGHTBOX
   ========================================================= */

.post-image {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    text-align: center;
}

.post-image img.zoomable-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    cursor: zoom-in;
}

/* Fondo del visor */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 70px 30px 30px;

    background: rgba(0, 0, 0, 0.92);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

/* Lightbox abierto */
.image-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Imagen ampliada */
.image-lightbox-img {
    display: block;

    max-width: min(1400px, 95vw);
    max-height: 88vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 8px;

    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

/* Botón X */
.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.12);
    color: #fff;

    font-size: 34px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}

/* Móvil */
@media (max-width: 768px) {

    .post-image {
        max-width: 100%;
        margin: 1.5rem auto;
    }

    .image-lightbox {
        padding: 65px 12px 20px;
    }

    .image-lightbox-img {
        max-width: 96vw;
        max-height: 82vh;
        border-radius: 6px;
    }

    .image-lightbox-close {
        top: 12px;
        right: 12px;

        width: 44px;
        height: 44px;

        font-size: 30px;
    }
}


/* ==========================================================================
   ADAPTACIÓN RESPONSIVE ESTRICTA (Móviles y Tablets)
   ========================================================================== */

@media (max-width: 991px) {
  /* 1. Contenedor principal: bloquear desbordamiento horizontal */
  .post-hero-grid,
  .post-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.5rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  
  /* 2. Forzar el orden correcto: Artículo ARRIBA, Sidebar ABAJO */
  .post-content {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important; /* Corta de raíz cualquier elemento que intente salirse */
  }

  .post-sidebar {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 1rem !important;
  }

  /* 3. Asegurar que párrafos, cajas de autor y citas respeten los bordes */
  .post-content p,
  .post-lead,
  .post-author,
  .serp-mock {
    max-width: 100% !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important; /* Obliga al texto a saltar de línea si es muy largo */
  }
}

@media (max-width: 768px) {
  /* Ajustes de tamaño para móviles */
  .post-hero-text h1 {
    font-size: 2rem !important;
    line-height: 1.25 !important;
  }

  /* Cajas y formularios 100% adaptados */
  .post-inline-cta,
  .post-author {
    display: flex !important;
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    padding: 1.8rem 1.2rem !important;
    gap: 1.2rem !important;
  }
  
  .post-inline-cta .btn {
    width: 100% !important;
  }

  .comment-fields {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .post-note {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 1.2rem !important;
    gap: 0.8rem !important;
  }
}

/* Corrección específica para el Footer en móviles */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr !important; /* Fuerza 1 sola columna */
    gap: 2rem !important; /* Espaciado uniforme entre los bloques */
    width: 100% !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
  }
}