/* ============================
   ELGATEC Post Layout Booster v0.3.2
   - Solo afecta a ENTRADAS (post)
   - Anti-recursión en PHP
   ============================ */

/* ============================
   HERO PREMIUM (destacada + título)
   ============================ */
.elgatec-hero{
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 22px;
  overflow: hidden;
  margin: 0 0 1.35rem 0;
  min-height: 240px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
@media (min-width: 980px){
  .elgatec-hero{ min-height: 300px; }
}

.elgatec-hero__bg{
  position:absolute;
  inset:0;
  background-image: var(--elg-hero-url);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  filter: saturate(1.05) contrast(1.02);
}

.elgatec-hero__overlay{
  position:absolute;
  inset:0;
  background:
    radial-gradient(1200px 500px at 20% 80%, rgba(0,0,0,.55), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.70));
}

.elgatec-hero__inner{
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 1.25rem 1.25rem 1.35rem 1.25rem;
  display: flex;
  align-items: flex-end;
}
@media (min-width: 980px){
  .elgatec-hero__inner{ padding: 1.6rem 1.8rem 1.8rem 1.8rem; }
}

@keyframes elgatec-chameleon {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.elgatec-hero__title{
  margin: 0;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);

  background: linear-gradient(90deg, #00eaff, #00ff6a, #ffe600, #00eaff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  animation: elgatec-chameleon 6s ease-in-out infinite;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,.65));
}

/* Oculta duplicados típicos */
.elgatec-has-hero .entry-title:not(.elgatec-hero__title),
.elgatec-has-hero h1.wp-block-post-title:not(.elgatec-hero__title),
.elgatec-has-hero .wp-block-post-title:not(.elgatec-hero__title){
  display: none !important;
}
.elgatec-has-hero .post-thumbnail,
.elgatec-has-hero .featured-image,
.elgatec-has-hero img.wp-post-image{
  display: none !important;
}

/* ============================
   PROSE (contenido)
   ============================ */
.elgatec-prose{
  line-height: 1.75;
  font-size: 1.06rem;
}
.elgatec-prose > * + * { margin-top: 1.05rem; }

.elgatec-prose h2{
  margin-top: 2rem;
  margin-bottom: .75rem;
  line-height: 1.2;
  font-weight: 800;

  background: linear-gradient(90deg, #00eaff, #00ff6a, #ffe600);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: elgatec-chameleon 10s ease-in-out infinite;
}

.elgatec-prose h3{
  margin-top: 1.5rem;
  margin-bottom: .6rem;
  line-height: 1.25;
  font-weight: 750;
}

.elgatec-prose ul,
.elgatec-prose ol{ padding-left: 1.2rem; }
.elgatec-prose li + li{ margin-top: .35rem; }

/* Emojis normales */
.elgatec-prose img.emoji,
.elgatec-prose img.wp-smiley,
.elgatec-prose img.twemoji,
.elgatec-prose img[class*="emoji"]{
  display: inline !important;
  width: 1em !important;
  height: 1em !important;
  max-width: 1em !important;
  border-radius: 0 !important;
  vertical-align: -0.1em !important;
}

/* Imágenes 100% (excluye emojis) */
.elgatec-prose figure,
.elgatec-prose .wp-block-image,
.elgatec-prose figure.wp-block-image,
.elgatec-prose .wp-block-media-text__media,
.elgatec-prose .wp-block-cover{
  width: 100% !important;
  max-width: 100% !important;
}
.elgatec-prose figure[style*="width"]{
  width: 100% !important;
  max-width: 100% !important;
}
.elgatec-prose img:not(.emoji):not(.wp-smiley):not(.twemoji):not([class*="emoji"]),
.elgatec-prose a > img:not(.emoji):not(.wp-smiley):not(.twemoji):not([class*="emoji"]),
.elgatec-prose p > img:not(.emoji):not(.wp-smiley):not(.twemoji):not([class*="emoji"]),
.elgatec-prose figure > a > img:not(.emoji):not(.wp-smiley):not(.twemoji):not([class*="emoji"]),
.elgatec-prose figure > img:not(.emoji):not(.wp-smiley):not(.twemoji):not([class*="emoji"]),
.elgatec-prose .wp-block-image img:not(.emoji):not(.wp-smiley):not(.twemoji):not([class*="emoji"]){
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 16px;
}
.elgatec-prose img[style*="width"]:not(.emoji):not(.wp-smiley):not(.twemoji):not([class*="emoji"]){
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}
.elgatec-prose figure,
.elgatec-prose .wp-block-image,
.elgatec-prose figure.wp-block-image{
  margin: 1.25rem 0 !important;
}
.elgatec-prose .wp-block-gallery img{
  width: 100% !important;
  height: auto !important;
}
@media (max-width: 720px){
  .elgatec-prose .alignleft,
  .elgatec-prose .alignright{
    float: none !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* ============================
   TITULOS DE BLOQUES
   ============================ */
.elgatec-block-title{
  margin: 1.8rem 0 0.85rem 0;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* ============================
   COMENTARIOS (estilo premium)
   ============================ */
.elgatec-comments{
  margin-top: 2rem;
  padding: 1.1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
}

.elgatec-commentform-title{
  margin: 0 0 .7rem 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.elgatec-comments .comment-list{
  margin: 0 0 1.1rem 0;
  padding-left: 1.2rem;
}
.elgatec-comments .comment-body{
  margin: 0.85rem 0;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
}
.elgatec-comments .comment-author{ font-weight: 800; }

.elgatec-comments textarea,
.elgatec-comments input[type="text"],
.elgatec-comments input[type="email"],
.elgatec-comments input[type="url"]{
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: inherit;
  padding: 0.75rem 0.85rem;
}

.elgatec-comments input[type="submit"]{
  margin-top: .75rem;
  border-radius: 14px;
  padding: .65rem 1rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}
.elgatec-comments input[type="submit"]:hover{ transform: translateY(-1px); }

/* ============================
   RELACIONADAS (tarjetas)
   ============================ */
.elgatec-related{ margin-top: 1.6rem; }

.elgatec-related__grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 760px){
  .elgatec-related__grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px){
  .elgatec-related__grid{ grid-template-columns: repeat(3, 1fr); }
}

.elgatec-card{
  text-decoration: none;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.elgatec-card:hover{
  transform: translateY(-2px);
  border-color: rgba(0,255,120,0.25);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.elgatec-card__thumb{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(0,234,255,.18), rgba(0,255,106,.12), rgba(255,230,0,.08));
  background-image: var(--elg-card);
  background-size: cover;
  background-position: center;
}
.elgatec-card__body{
  padding: 0.95rem 1rem 1.05rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.elgatec-card__title{ font-weight: 900; line-height: 1.2; }
.elgatec-card__excerpt{ opacity: .9; line-height: 1.45; }

@media (prefers-reduced-motion: reduce){
  .elgatec-hero__title,
  .elgatec-prose h2{ animation: none !important; background-position: 50% 50% !important; }
}
