/* =========================================================
   06-single.css
   Economía Pixel / Pixel Media Engine
========================================================= */


/* =========================================================
   ESTRUCTURA GENERAL
========================================================= */

.ey-single-main {
    padding-top: 0;
}

/*
 * Ancho general compartido por:
 * - imagen destacada
 * - contenido
 * - sidebar
 */
.ey-single__featured > .ey-container,
.ey-single__layout.ey-container,
.ey-single-main > .ey-container {
    width: calc(100% - 80px);
    max-width: 1320px;
    margin-right: auto;
    margin-left: auto;
}


/* =========================================================
   CABECERA DE LA NOTICIA
========================================================= */

.ey-single__header {
    padding: 38px 0 32px;
    background: #f5f7fa;
    border-bottom: 1px solid var(--ey-border);
}

.ey-single__header-inner {
    width: calc(100% - 80px);
    max-width: 920px;
    margin-right: auto;
    margin-left: auto;
}

.ey-single__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 14px;

    color: var(--ey-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.ey-single__meta a {
    color: var(--ey-blue);
    font-weight: 400;
    text-decoration: none;
    text-transform: uppercase;
}

.ey-single__title {
    margin: 0;

    color: var(--ey-blue-dark);
    font-size: clamp(36px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -1.2px;
}

.ey-single__excerpt {
    max-width: 780px;
    margin: 16px 0 0;

    color: #555;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.55;
}


/* =========================================================
   IMAGEN DESTACADA
========================================================= */

.ey-single__featured {
    padding: 28px 0 10px;
    background: #fff;
}

.ey-single__featured > .ey-container {
    overflow: hidden;
}

.ey-single__featured img {
    display: block;

    width: 100%;
    height: auto;
    max-height: 560px;

    object-fit: cover;
    object-position: center;
}


/* =========================================================
   CONTENIDO + SIDEBAR
========================================================= */

.ey-single__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 32px;

    padding-top: 24px;
}

.ey-single__content {
    min-width: 0;
}

.ey-single__sidebar,
.ey-single__layout .ey-sidebar {
    width: 100%;
    min-width: 0;
}


/* =========================================================
   CUERPO DE LA NOTICIA
========================================================= */

.ey-single__body {
    color: #222;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.75;
}

.ey-single__body p {
    margin: 0 0 22px;
    font-weight: 400;
}

.ey-single__body > p:first-of-type {
    margin-bottom: 28px;

    color: #1f2937;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.65;
}

.ey-single__body h2,
.ey-single__body h3,
.ey-single__body h4 {
    margin: 34px 0 14px;

    color: var(--ey-blue-dark);
    font-weight: 800;
    line-height: 1.2;
}

.ey-single__body h2 {
    font-size: 30px;
}

.ey-single__body h3 {
    font-size: 24px;
}

.ey-single__body h4 {
    font-size: 20px;
}

.ey-single__body ul,
.ey-single__body ol {
    margin: 0 0 24px 22px;
    padding: 0;
}

.ey-single__body li {
    margin-bottom: 8px;
    font-weight: 400;
}

.ey-single__body a {
    color: var(--ey-blue);
    font-weight: 400;

    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.ey-single__body a:hover {
    color: var(--ey-blue-dark);
}


/* =========================================================
   BLOCKQUOTE
========================================================= */

.ey-single__body blockquote {
    margin: 30px 0;
    padding: 22px 26px;

    border-left: 5px solid var(--ey-gold);
    background: #f5f7fa;

    color: #333;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.55;
}


/* =========================================================
   IMÁGENES DENTRO DEL CONTENIDO
========================================================= */

/*
 * IMPORTANTE:
 * Ya NO ocultamos p/figure que contengan imágenes.
 */

.ey-single__body img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;

    margin-right: auto;
    margin-left: auto;
}

/* Gutenberg */
.ey-single__body .wp-block-image {
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
}

.ey-single__body .wp-block-image img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;

    margin-right: auto;
    margin-left: auto;
}

/* Figures normales */
.ey-single__body figure {
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
}

.ey-single__body figure img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;

    margin-right: auto;
    margin-left: auto;
}

/* Imágenes antiguas insertadas dentro de párrafos */
.ey-single__body p img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;

    margin: 28px auto;
}

/* Alineaciones Gutenberg */
.ey-single__body .aligncenter {
    margin-right: auto;
    margin-left: auto;
}

.ey-single__body .alignleft {
    float: left;
    margin: 8px 24px 16px 0;
}

.ey-single__body .alignright {
    float: right;
    margin: 8px 0 16px 24px;
}

/* Limpia floats */
.ey-single__body::after {
    display: block;
    clear: both;
    content: "";
}

/* Pie de foto */
.ey-single__body figcaption,
.ey-single__body .wp-element-caption {
    margin-top: 8px;

    color: var(--ey-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}


/* =========================================================
   PIE DE LA NOTICIA
========================================================= */

.ey-single__footer {
    margin-top: 34px;
    padding-top: 24px;

    border-top: 1px solid var(--ey-border);
}


/* =========================================================
   ETIQUETAS
========================================================= */

.ey-single__tags {
    margin-bottom: 24px;

    color: var(--ey-muted);
    font-size: 14px;
    font-weight: 400;
}

.ey-single__tags span {
    color: var(--ey-text);
    font-weight: 400;
}

.ey-single__tags a {
    display: inline-block;

    margin: 3px;
    padding: 6px 10px;

    background: #f0f3f7;
    color: var(--ey-blue);

    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    text-transform: uppercase;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.ey-single__tags a:hover {
    background: var(--ey-blue);
    color: #fff;
}


/* =========================================================
   NAVEGACIÓN ANTERIOR / SIGUIENTE
========================================================= */

.ey-single__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ey-single__nav a {
    display: block;

    height: 100%;
    padding: 15px;

    border: 1px solid var(--ey-border);

    color: var(--ey-text);
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;

    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease;
}

.ey-single__nav a:hover {
    border-color: var(--ey-blue);
    background: #f8fafc;
    color: var(--ey-blue);
}

.ey-single__nav-next {
    text-align: right;
}


/* =========================================================
   NOTICIAS RELACIONADAS
========================================================= */

.ey-related {
    margin-top: 42px;
}

.ey-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.ey-related .ey-card__title,
.ey-related .ey-card__title a {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.3;
}

.ey-related .ey-card__excerpt {
    display: none;
}


/* =========================================================
   CAJA DEL AUTOR
========================================================= */

.ey-author-box {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 22px;

    margin-top: 42px;
    padding: 24px;

    border-top: 4px solid var(--ey-blue);
    background: #f5f7fa;
}

.ey-author-box__avatar img {
    display: block;

    width: 100px;
    height: 100px;

    border-radius: 0;
    object-fit: cover;
}

.ey-author-box__label {
    display: inline-block;

    margin-bottom: 5px;

    color: var(--ey-blue);
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
}

.ey-author-box h3,
.ey-author-box h3 a {
    margin: 0 0 8px;

    color: var(--ey-blue-dark);
    font-size: 23px;
    font-weight: 400;
    line-height: 1.15;
    text-decoration: none;
}

.ey-author-box h3 a:hover {
    color: var(--ey-blue);
}

.ey-author-box p {
    margin: 0;

    color: #555;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
}

.ey-author-box__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 16px;
}

.ey-author-box__button {
    display: inline-flex;
    align-items: center;

    min-height: 38px;
    padding: 0 16px;

    background: var(--ey-blue);
    color: #fff;

    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    text-transform: uppercase;
}

.ey-author-box__button:hover {
    background: var(--ey-blue-dark);
    color: #fff;
}

.ey-author-box__link {
    display: inline-flex;
    align-items: center;

    min-height: 38px;

    color: var(--ey-blue);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
}


/* =========================================================
   SIDEBAR DEL SINGLE
========================================================= */

.single .ey-sidebar a,
.single .ey-sidebar h3,
.single .ey-sidebar h4,
.single .ey-sidebar .ey-widget-post__title,
.single .ey-sidebar .ey-widget-post__title a {
    font-weight: 400;
}

.single .ey-sidebar .ey-widget-featured__title,
.single .ey-sidebar .ey-widget-featured__title a,
.single .ey-sidebar .ey-widget-post-main__title,
.single .ey-sidebar .ey-widget-post-main__title a {
    font-size: 18px;
    line-height: 1.3;
}

.single .ey-sidebar .ey-widget-post__title,
.single .ey-sidebar .ey-widget-post__title a,
.single .ey-sidebar h3,
.single .ey-sidebar h4 {
    font-size: 16px;
    line-height: 1.3;
}

.single .ey-sidebar time,
.single .ey-sidebar .ey-widget-post__date,
.single .ey-sidebar .ey-card__meta {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}


/* =========================================================
   COMPARTIR NOTICIA
========================================================= */

.ey-share {
    margin: 32px 0;
    padding: 20px 22px;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    background: #f8fafc;
}

.ey-share__header {
    margin-bottom: 15px;
}

.ey-share__eyebrow {
    display: block;

    margin-bottom: 3px;

    color: #64748b;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ey-share__title {
    margin: 0;

    color: #111827;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.25;
}

.ey-share__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.ey-share .ey-share__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    width: auto;
    min-width: 0;
    min-height: 34px;
    padding: 7px 11px;

    border: 0;
    border-radius: 7px;

    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;

    cursor: pointer;
    box-shadow: none;

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

.ey-share .ey-share__button:hover {
    color: #fff;
    opacity: 0.88;
    transform: translateY(-1px);
}

.ey-share .ey-share__button svg {
    display: block;

    flex: 0 0 14px;

    width: 14px !important;
    min-width: 14px;
    max-width: 14px;
    height: 14px !important;

    fill: currentColor;
}

.ey-share__button--facebook {
    background: #1877f2;
}

.ey-share__button--x {
    background: #111;
}

.ey-share__button--linkedin {
    background: #0a66c2;
}

.ey-share__button--whatsapp {
    background: #25d366;
}

.ey-share__button--copy {
    background: #475569;
}

.ey-share__button--copy.is-copied {
    background: #15803d;
}


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

.ey-comments {
    margin-top: 52px;
    padding-top: 42px;

    border-top: 1px solid #e5e7eb;
}

.ey-comments__header {
    margin-bottom: 28px;
}

.ey-comments__eyebrow {
    display: block;

    margin-bottom: 5px;

    color: var(--ey-gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ey-comments__title,
.ey-comments__form-title {
    margin: 0;

    color: var(--ey-blue-dark);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.2;
}

.ey-comments__list {
    margin: 0 0 42px;
    padding: 0;

    list-style: none;
}

.ey-comments__list .children {
    margin: 20px 0 0 42px;
    padding: 0;

    list-style: none;
}

.ey-comment {
    margin-bottom: 22px;
}

.ey-comment__body {
    display: flex;
    gap: 16px;

    padding: 22px;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    background: #fff;
}

.ey-comment__avatar {
    flex: 0 0 56px;
}

.ey-comment__avatar img {
    display: block;

    width: 56px;
    height: 56px;

    border-radius: 50%;
    object-fit: cover;
}

.ey-comment__content {
    flex: 1;
    min-width: 0;
}

.ey-comment__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 12px;
}

.ey-comment__author {
    display: block;

    color: var(--ey-blue-dark);
    font-size: 15px;
}

.ey-comment__author a {
    color: inherit;
    text-decoration: none;
}

.ey-comment__date {
    display: inline-block;

    margin-top: 4px;

    color: #64748b;
    font-size: 12px;
    text-decoration: none;
}

.comment-reply-link {
    color: var(--ey-gold);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.ey-comment__text {
    color: #334155;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
}

.ey-comment__text p:last-child {
    margin-bottom: 0;
}

.ey-comment__moderation {
    padding: 9px 12px;

    border-radius: 7px;

    background: #fef3c7;
    color: #854d0e;

    font-size: 13px;
}

.comment-respond {
    margin-top: 38px;
    padding: 28px;

    border-radius: 12px;

    background: #f8fafc;
}

.ey-comments__notes,
.logged-in-as {
    margin: 8px 0 22px;

    color: #64748b;
    font-size: 13px;
}

.comment-form p {
    margin-bottom: 18px;
}

.comment-form label {
    display: block;

    margin-bottom: 7px;

    color: var(--ey-blue-dark);
    font-size: 13px;
    font-weight: 700;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;

    padding: 12px 14px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #fff;
    color: #0f172a;

    font: inherit;
}

.comment-form textarea {
    resize: vertical;
}

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

    box-shadow: 0 0 0 3px rgba(230, 179, 37, 0.18);
}

.ey-comments__submit {
    min-height: 44px;
    padding: 11px 18px;

    border: 0;
    border-radius: 8px;

    background: var(--ey-gold);
    color: var(--ey-blue-dark);

    font-weight: 800;
    cursor: pointer;
}

.ey-comments__submit:hover {
    filter: brightness(0.96);
}

.ey-comments__closed {
    padding: 15px;

    border-radius: 8px;

    background: #f1f5f9;
    color: #64748b;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .ey-single__featured > .ey-container,
    .ey-single__layout.ey-container,
    .ey-single-main > .ey-container {
        width: calc(100% - 40px);
        max-width: 1180px;
    }

    .ey-single__header-inner {
        width: calc(100% - 40px);
    }

    .ey-single__layout {
        grid-template-columns: minmax(0, 1fr) 285px;
        gap: 26px;
    }

    .ey-single__featured img {
        max-height: 520px;
    }
}


/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 768px) {

    .ey-single__header {
        padding: 28px 0 24px;
    }

    .ey-single__header-inner {
        width: calc(100% - 30px);
    }

    .ey-single__title {
        font-size: clamp(30px, 9vw, 40px);
        line-height: 1.08;
        letter-spacing: -0.8px;
    }

    .ey-single__excerpt {
        font-size: 16px;
        line-height: 1.5;
    }

    .ey-single__featured {
        padding-top: 20px;
    }

    .ey-single__featured > .ey-container,
    .ey-single__layout.ey-container,
    .ey-single-main > .ey-container {
        width: calc(100% - 30px);
        max-width: none;
    }

    .ey-single__featured img {
        width: 100%;
        max-height: none;
    }

    .ey-single__layout {
        display: block;
        padding-top: 22px;
    }

    .ey-single__sidebar,
    .ey-single__layout .ey-sidebar {
        width: 100%;
        margin-top: 34px;
    }

    .ey-single__body {
        font-size: 16px;
        line-height: 1.7;
    }

    .ey-single__body > p:first-of-type {
        font-size: 18px;
        line-height: 1.6;
    }

    .ey-single__body h2 {
        font-size: 27px;
    }

    .ey-single__body h3 {
        font-size: 22px;
    }

    .ey-single__body blockquote {
        padding: 19px 20px;
        font-size: 18px;
    }

    /* En móvil evitamos floats de imágenes */
    .ey-single__body .alignleft,
    .ey-single__body .alignright {
        float: none;
        margin: 24px auto;
    }

    .ey-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .ey-author-box {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 17px;
        padding: 20px;
    }

    .ey-author-box__avatar img {
        width: 82px;
        height: 82px;
    }

    .ey-author-box h3 {
        font-size: 21px;
    }

    .ey-share {
        margin: 26px 0;
        padding: 17px;
    }

    .ey-share__buttons {
        gap: 6px;
    }

    .ey-share .ey-share__button {
        min-height: 32px;
        padding: 7px 9px;
        font-size: 11px;
    }

    .ey-share .ey-share__button svg {
        flex: 0 0 13px;

        width: 13px !important;
        min-width: 13px;
        max-width: 13px;
        height: 13px !important;
    }

    .single .ey-sidebar .ey-widget-featured__title,
    .single .ey-sidebar .ey-widget-featured__title a,
    .single .ey-sidebar .ey-widget-post-main__title,
    .single .ey-sidebar .ey-widget-post-main__title a {
        font-size: 18px;
    }

    .single .ey-sidebar .ey-widget-post__title,
    .single .ey-sidebar .ey-widget-post__title a,
    .single .ey-sidebar h3,
    .single .ey-sidebar h4 {
        font-size: 16px;
    }
}


/* =========================================================
   MÓVIL PEQUEÑO
========================================================= */

@media (max-width: 640px) {

    .ey-comment__body {
        padding: 17px;
    }

    .ey-comment__avatar {
        flex-basis: 42px;
    }

    .ey-comment__avatar img {
        width: 42px;
        height: 42px;
    }

    .ey-comment__header {
        flex-direction: column;
        gap: 7px;
    }

    .ey-comments__list .children {
        margin-left: 18px;
    }

    .comment-respond {
        padding: 20px 17px;
    }
}


@media (max-width: 480px) {

    .ey-single__header-inner,
    .ey-single__featured > .ey-container,
    .ey-single__layout.ey-container,
    .ey-single-main > .ey-container {
        width: calc(100% - 24px);
    }

    .ey-single__title {
        font-size: clamp(28px, 9.5vw, 36px);
    }

    .ey-single__nav {
        grid-template-columns: 1fr;
    }

    .ey-single__nav-next {
        text-align: left;
    }

    .ey-related__grid {
        grid-template-columns: 1fr;
    }

    .ey-author-box {
        grid-template-columns: 1fr;
    }

    .ey-author-box__avatar img {
        width: 78px;
        height: 78px;
    }
}

/* =========================================================
   DEBUG / FORZAR IMÁGENES DEL CONTENIDO
========================================================= */

.single .ey-single__body img,
.single .ey-single__body figure,
.single .ey-single__body .wp-block-image,
.single .ey-single__body p img,
.single .ey-single__body figure img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 100% !important;
}

.single .ey-single__body img,
.single .ey-single__body figure img,
.single .ey-single__body .wp-block-image img {
    width: auto !important;
    height: auto !important;
    margin: 28px auto !important;
}

/* =========================================================
   FORZAR VISIBILIDAD DE IMÁGENES INTERNAS
========================================================= */

.single .ey-single__body img,
.single .ey-single__body figure,
.single .ey-single__body p:has(img),
.single .ey-single__body .wp-block-image {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.single .ey-single__body p:has(img),
.single .ey-single__body figure,
.single .ey-single__body .wp-block-image {
    width: 100% !important;
    margin: 30px 0 !important;
    padding: 0 !important;
}

.single .ey-single__body img {
    margin: 0 auto !important;
}

/* =========================================================
   FIX DEFINITIVO IMÁGENES INSERTADAS EN POSTS
========================================================= */

.single .ey-single__body p,
.single .ey-single__body figure,
.single .ey-single__body .wp-block-image,
.single .ey-single__body .wp-block-gallery,
.single .ey-single__body .wp-block-media-text,
.single .ey-single__body div {
    visibility: visible !important;
    opacity: 1 !important;
}

.single .ey-single__body p:has(img),
.single .ey-single__body figure:has(img),
.single .ey-single__body .wp-block-image {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 30px 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.single .ey-single__body img {
    display: block !important;
    position: static !important;
    float: none !important;

    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;

    margin: 0 auto !important;

    visibility: visible !important;
    opacity: 1 !important;

    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
}