/* =========================
   ENTRADA INDIVIDUAL
========================= */

.tg-single-page {
  background: #f5f6f8;
  padding: 48px 20px;
}

.tg-single-grid {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 760px) 300px;
  gap: 40px;
  align-items: start;
}

.tg-single-article {
  background: #fff;
  padding: 42px;
}

.tg-post-meta {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 12px;
}

.tg-post-title {
  margin: 0 0 28px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #020617;
}

.tg-ad-top,
.tg-ad-middle,
.tg-ad-sidebar {
  border: 1px dashed #94a3b8;
  background: #f1f5f9;
  text-align: center;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 24px;
  margin-bottom: 28px;
}

.tg-featured-image {
  margin-bottom: 34px;
}

.tg-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
}

.tg-single-content {
  font-size: 17px;
  line-height: 1.85;
  color: #1e293b;
}

.tg-single-content p {
  margin: 0 0 1.5rem;
}

.tg-single-content h2,
.tg-single-content h3,
.tg-single-content h4 {
  color: #020617;
  line-height: 1.2;
  margin: 2rem 0 1rem;
}

.tg-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.tg-single-content a {
  color: #2563eb;
  text-decoration: underline;
  font-weight: 700;
}

.tg-ad-middle {
  margin: 40px 0;
  padding: 42px 20px;
  background: #eff6ff;
}

.tg-author-box,
.tg-share-box,
.tg-tags-box,
.tg-related-box,
.tg-comments-box {
  border-top: 1px solid #e2e8f0;
  margin-top: 36px;
  padding-top: 28px;
}

.tg-author-box {
  display: flex;
  gap: 16px;
  align-items: center;
}

.tg-author-box img {
  border-radius: 999px;
}

.tg-author-name {
  margin: 0 0 6px;
  font-weight: 900;
  color: #020617;
}

.tg-author-desc {
  margin: 0;
  font-size: 0.92rem;
  color: #64748b;
}

.tg-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tg-share-buttons a {
  padding: 9px 15px;
  border-radius: 999px;
  background: #020617;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.tg-related-box h2 {
  margin: 0 0 20px;
  font-size: 1.6rem;
  color: #020617;
}

.tg-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.tg-related-card {
  display: block;
  text-decoration: none;
  transition: transform 0.25s ease;
}

/* IMAGEN */
.tg-related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

/* TITULO */
.tg-related-card h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 800;
  color: #020617;
  transition: color 0.2s ease;
}
/* HOVER PRO */
.tg-related-card:hover img {
  transform: scale(1.03);
}

.tg-related-card:hover h3 {
  color: #2563eb;
}
.tg-single-sidebar {
  display: grid;
  gap: 24px;
}

.tg-sidebar-box {
  background: #fff;
  padding: 22px;
  border-radius: 18px;
}

.tg-sidebar-title {
  margin: 0 0 16px;
  font-size: 0.9rem;
  font-weight: 900;
  color: #020617;
}

.tg-sidebar-post {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  text-decoration: none;
}

.tg-sidebar-post img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 82px;
}

.tg-sidebar-post span {
  font-size: 0.86rem;
  line-height: 1.25;
  font-weight: 700;
  color: #1e293b;
}

@media (max-width: 980px) {
  .tg-single-grid {
    grid-template-columns: 1fr;
  }

  .tg-single-article {
    padding: 28px;
  }
}

@media (max-width: 640px) {
  .tg-single-page {
    padding: 28px 14px;
  }

  .tg-single-article {
    padding: 22px;
  }

  .tg-related-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   FIX FUERTE LAYOUT SINGLE
========================= */

body.single main.tg-single-page {
  display: block !important;
}

body.single .tg-single-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 760px) 300px !important;
  max-width: 1120px !important;
  margin: 0 auto !important;
  gap: 40px !important;
}

body.single .tg-single-article {
  width: 100% !important;
  max-width: 760px !important;
}

body.single .tg-single-sidebar {
  width: 300px !important;
  display: block !important;
}

body.single .site-main,
body.single .content-area {
  width: 100% !important;
  max-width: none !important;
}

body.single article {
  float: none !important;
}

body.single aside {
  float: none !important;
}

/* =========================
   BUSCADOR SOLO SIDEBAR
========================= */

.tg-single-sidebar .search-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-single-sidebar .search-field {
  flex: 1;
  height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 0.9rem;
  background: #fff;
  outline: none;
}

.tg-single-sidebar .search-form button,
.tg-single-sidebar .search-submit,
.tg-single-sidebar button[type="submit"] {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.tg-single-sidebar .search-form button svg,
.tg-single-sidebar button[type="submit"] svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.tg-single-sidebar .search-form button::before,
.tg-single-sidebar button[type="submit"]::before {
  display: none !important;
  content: none !important;
}

/* OCULTAR AUTOR DUPLICADO */
.author,
.byline,
.post-author,
.entry-author,
.wp-block-post-author {
  display: none !important;
}

/* =========================
   AUTOR PERSONALIZADO
========================= */

.tg-author-box {
  margin-top: 42px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #f8fafc;
  display: flex;
  gap: 20px;
 align-items: flex-start;
}

.tg-author-avatar {
  flex: 0 0 76px;
  width: 150px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.tg-author-avatar img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.tg-author-name {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 900;
  color: #020617;
}

.tg-author-bio {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #475569;
}

.tg-author-bio p {
  margin: 0 0 8px;
}

.tg-author-bio p:last-child {
  margin-bottom: 0;
}

.tg-share-title {
  font-size: 0.9rem;
  font-weight: 900;
  margin-bottom: 12px;
  color: #020617;
}

.tg-share-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tg-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.25s ease;
  background: #f1f5f9;
  color: #020617;
}

/* ICONOS */
.tg-share-icons {
  display: flex;
  gap: 10px;
}

.tg-share-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s ease;
}

.tg-share-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* COLORES */
.tg-share-icon.x { background: #000; }
.tg-share-icon.fb { background: #1877f2; }
.tg-share-icon.in { background: #0a66c2; }
.tg-share-icon.tg { background: #229ed9; }
.tg-share-icon.wa { background: #25d366; }
.tg-share-icon.mail { background: #64748b; }
.tg-share-icon.pin { background: #e60023; }

.tg-share-icon:hover {
  transform: translateY(-2px) scale(1.05);
  opacity: 0.9;
}

/* =========================
   COMENTARIOS
========================= */

.tg-comments-box {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid #e2e8f0;
}

.tg-comments-box h2,
.tg-comments-box h3,
.comment-reply-title {
  margin: 0 0 18px;
  font-size: 1.45rem;
  font-weight: 900;
  color: #020617;
}

.comment-form {
  margin-top: 20px;
}

.comment-notes,
.logged-in-as {
  margin-bottom: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #475569;
}

.comment-form-comment {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form label {
  font-size: 0.88rem;
  font-weight: 800;
  color: #020617;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 0.95rem;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

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

.comment-form textarea:focus,
.comment-form input:focus {
  border-color: #0f172a;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, .08);
}

.form-submit {
  margin-top: 18px;
}

.form-submit input[type="submit"],
.comment-form .submit {
  border: 0;
  border-radius: 999px;
  background: #020617;
  color: #fff;
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}

.form-submit input[type="submit"]:hover,
.comment-form .submit:hover {
  transform: translateY(-2px);
  opacity: .9;
}
/* =========================
   FIX LISTAS EN ENTRADAS
========================= */

body.single .tg-single-content ul,
body.single .entry-content ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
  padding-left: 1.6rem !important;
  margin: 1rem 0 1.4rem 0 !important;
}

body.single .tg-single-content ol,
body.single .entry-content ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
  padding-left: 1.6rem !important;
  margin: 1rem 0 1.4rem 0 !important;
}

body.single .tg-single-content li,
body.single .entry-content li {
  display: list-item !important;
  margin-bottom: 0.45rem !important;
  line-height: 1.5 !important;
}
/* =========================
   FIX SINGLE MÓVIL
========================= */

@media (max-width: 768px) {
  body.single .tg-single-page {
    padding: 24px 12px;
  }

  body.single .tg-single-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.single .tg-single-article {
    width: 100% !important;
    max-width: 100% !important;
    padding: 22px 18px !important;
    margin: 0 0 28px !important;
  }

  body.single .tg-single-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
  }

  body.single .tg-sidebar-box {
    width: 100% !important;
    margin-bottom: 20px;
  }

  body.single .tg-post-title {
    font-size: 2rem !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  body.single .tg-featured-image img {
    border-radius: 14px;
  }

  body.single .tg-related-grid {
    grid-template-columns: 1fr !important;
  }

  body.single .tg-author-box {
    align-items: flex-start;
  }
}