/* Artículo de noticia — detalle.php (rediseño) */

.det-page {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

.det-shell {
    position: relative;
    max-width: var(--td-page-shell-max, 520px);
    margin: 0 auto;
    padding: 0 14px 24px;
    box-sizing: border-box;
}

.det-shell > .td-page-ambient {
    opacity: 0.55;
}

/* Migas */
.det-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 0 0;
    font-size: 11px;
    font-weight: 700;
}

.det-crumb a {
    color: var(--td-muted, #64748b);
    text-decoration: none;
}

.det-crumb a:hover,
.det-crumb a:focus-visible {
    color: #0284c7;
    outline: none;
}

.det-crumb span[aria-current="page"] {
    color: var(--td-text, #0f172a);
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.det-crumb span[aria-hidden="true"] {
    color: var(--td-line, #cbd5e1);
}

/* Artículo — plano sobre el fondo de la página (sin caja blanca) */
.det-article--flat {
    margin: 8px 0 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

/* Cabecera tipográfica */
.det-head {
    padding: 18px 0 16px;
}

.det-head__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.det-head__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px 8px 8px;
    border-radius: 999px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.det-head__back i {
    font-size: 18px;
}

.det-head__tag {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.det-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.det-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
}

.det-pill--muted {
    color: var(--td-muted, #64748b);
    background: var(--td-page-bg, #f8fafc);
    border-color: var(--td-line, #e2e8f0);
    text-transform: none;
    font-size: 11px;
}

.det-head__title {
    margin: 0;
    font-size: clamp(1.35rem, 5.4vw, 1.85rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--td-text, #0f172a);
    text-wrap: balance;
}

.det-head__deck {
    margin: 12px 0 0;
    font-size: clamp(1rem, 3.6vw, 1.125rem);
    font-weight: 600;
    line-height: 1.55;
    color: var(--td-muted, #475569);
}

/* Imagen a ancho de columna, al ras del shell (sin marco del artículo) */
.det-media {
    margin: 0 -14px;
    width: calc(100% + 28px);
    max-width: none;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    border-radius: 0;
    border: none;
}

.det-media__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Cuerpo */
.det-sheet {
    padding: 22px 0 20px;
}

.det-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--td-text, #334155);
}

.det-content p {
    margin: 0 0 1.1em;
}

.det-content p:last-child {
    margin-bottom: 0;
}

/* Video */
.det-video {
    margin: 24px 0 0;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    border: 1px solid var(--td-line, #e2e8f0);
}

.det-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Fuente */
.det-source {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    text-decoration: none;
    color: #92400e;
    transition: transform 0.15s ease;
}

.det-source:active {
    transform: scale(0.99);
}

.det-source__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.65);
}

.det-source__text {
    min-width: 0;
    flex: 1;
}

.det-source__kicker {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.det-source__name {
    display: block;
    font-size: 14px;
    font-weight: 800;
    margin-top: 2px;
}

.det-source__go {
    flex-shrink: 0;
    font-size: 18px;
    opacity: 0.85;
}

/* Compartir */
.det-share {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--td-line, #f1f5f9);
}

.det-share__label {
    margin: 0 0 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--td-muted, #64748b);
}

.det-share__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.det-share__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    border: none;
    font-family: inherit;
    transition: transform 0.15s ease;
}

.det-share__btn:active {
    transform: scale(0.98);
}

.det-share__btn--ws {
    background: linear-gradient(145deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.28);
}

.det-share__btn--ws i {
    font-size: 20px;
}

.det-share__btn--ghost {
    background: var(--td-page-bg, #f1f5f9);
    color: var(--td-text, #0f172a);
    border: 1px solid var(--td-line, #e2e8f0);
}

/* Relacionadas — también plano */
.det-related {
    margin: 28px 0 0;
    padding: 20px 0 8px;
    border-radius: 0;
    background: transparent;
    border: none;
    border-top: 1px solid var(--td-line, #e2e8f0);
}

.det-related__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.det-related__title {
    margin: 0;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--td-muted, #64748b);
}

.det-related__all {
    font-size: 12px;
    font-weight: 800;
    color: #0284c7;
    text-decoration: none;
}

.det-related__grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.det-rel-card {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    background: var(--td-surface, #fff);
    border: 1px solid var(--td-line, #e2e8f0);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.det-rel-card:active {
    border-color: #7dd3fc;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.12);
}

.det-rel-card__thumb {
    flex-shrink: 0;
    width: 96px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
}

.det-rel-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.det-rel-card__body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.det-rel-card__date {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0284c7;
    margin-bottom: 4px;
}

.det-rel-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--td-text, #0f172a);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.det-rel-card__meta {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--td-muted, #64748b);
    text-transform: uppercase;
}

/* Desktop */
@media (min-width: 640px) {
    .det-head {
        padding: 24px 0 20px;
    }

    .det-sheet {
        padding: 28px 0 24px;
    }

    .det-related {
        margin: 32px 0 0;
        padding: 24px 0 16px;
    }

    .det-share__row {
        grid-template-columns: 1fr 1fr;
    }

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

    .det-rel-card {
        flex-direction: column;
        padding: 0;
        overflow: hidden;
    }

    .det-rel-card__thumb {
        width: 100%;
        height: 120px;
        border-radius: 0;
    }

    .det-rel-card__body {
        padding: 12px 12px 14px;
    }
}

@media (min-width: 900px) {
    .det-head__title {
        font-size: 2rem;
    }

    .det-content {
        font-size: 1.125rem;
    }

    .det-related__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .det-share__btn,
    .det-rel-card,
    .det-source {
        transition: none;
    }
}
