/* Anuncios (listado y detalle) — usa la paleta del tema (variables.css) */

.d21-news {
    --d21n-card: #ffffff;
    --d21n-soft: #f4f7ff;
    --d21n-shadow: 0 1px 2px rgba(9, 26, 122, .04), 0 8px 24px rgba(9, 26, 122, .06);
    --d21n-shadow-hover: 0 2px 4px rgba(9, 26, 122, .06), 0 16px 36px rgba(9, 26, 122, .12);
    --d21n-accent: var(--primary);
}
[data-bs-theme="dark"] .d21-news {
    --d21n-card: #1e293b;
    --d21n-soft: #0f172a;
    --d21n-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --d21n-shadow-hover: 0 16px 36px rgba(0, 0, 0, .45);
    --d21n-accent: #8ea2ff;
}

/* ---------- Encabezado del listado ---------- */

.d21-news-head {
    margin-bottom: 24px;
}
.d21-news-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-darker);
    font-family: var(--font-family-monospace);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.d21-news-title {
    margin: 14px 0 6px;
    font-family: var(--font-family-monospace);
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--heading-color);
}
.d21-news-sub {
    margin: 0;
    font-size: 15px;
    color: var(--body-color);
}

/* ---------- Tarjetas ---------- */

.d21-news-list {
    display: grid;
    gap: 18px;
}
.d21-news-card {
    display: flex;
    gap: 22px;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--custom-radius);
    background: var(--d21n-card);
    box-shadow: var(--d21n-shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.d21-news-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--d21n-shadow-hover);
}
.d21-news-date {
    flex: 0 0 76px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px 10px;
    border-radius: 12px;
    background: var(--d21n-soft);
    font-family: var(--font-family-monospace);
    text-align: center;
    text-decoration: none !important;
    line-height: 1;
}
.d21-news-date strong {
    font-size: 30px;
    font-weight: 700;
    color: var(--d21n-accent);
}
.d21-news-date span {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--heading-color);
}
.d21-news-date small {
    margin-top: 4px;
    font-size: 11px;
    color: var(--gray);
}
.d21-news-body {
    flex: 1 1 auto;
    min-width: 0;
}
.d21-news-card-title {
    margin: 2px 0 8px;
    font-family: var(--font-family-monospace);
    font-size: 19px;
    line-height: 1.3;
    font-weight: 600;
}
.d21-news-card-title a {
    color: var(--heading-color);
    text-decoration: none;
}
.d21-news-card:hover .d21-news-card-title a {
    color: var(--d21n-accent);
}
.d21-news-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 0 0 16px;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--body-color);
}
.d21-news-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}
.d21-news-more {
    font-family: var(--font-family-monospace);
    font-size: 14px;
    font-weight: 500;
    color: var(--d21n-accent);
    text-decoration: none;
}
.d21-news-more i {
    margin-left: 4px;
    font-size: 12px;
    transition: transform .2s;
}
.d21-news-card:hover .d21-news-more i {
    transform: translateX(4px);
}
.d21-news-edit {
    font-size: 13px;
    color: var(--gray);
}
.d21-news-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.d21-news-share > span {
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--gray);
}
[data-bs-theme="dark"] .d21-news-share > span,
[data-bs-theme="dark"] .d21-news-date small {
    color: var(--body-color);
}
.d21-news-pages {
    margin-top: 24px;
}

/* ---------- Botones de compartir ---------- */

.d21-share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.d21-share-btn {
    --d21s: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: transparent;
    color: var(--body-color);
    font-size: 14px;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.d21-share-btn:hover,
.d21-share-btn:focus-visible {
    border-color: var(--d21s);
    background: var(--d21s);
    color: #fff;
    transform: translateY(-2px);
    outline: none;
}
.d21-share-wa { --d21s: #1faa59; }
.d21-share-fb { --d21s: #1877f2; }
.d21-share-x { --d21s: #111827; }
.d21-share-in { --d21s: #0a66c2; }
.d21-share-tg { --d21s: #229ed9; }
.d21-share-copy.is-copied {
    border-color: #1faa59;
    background: #1faa59;
    color: #fff;
}
.d21-share-labels .d21-share-btn {
    width: auto;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 15px;
}
.d21-share-labels .d21-share-btn span {
    font-family: var(--font-family-monospace);
    font-size: 13.5px;
    font-weight: 500;
}

/* ---------- Detalle ---------- */

.d21-post {
    padding: 34px 36px;
    border: 1px solid var(--border-color);
    border-radius: calc(var(--custom-radius) * 1.5);
    background: var(--d21n-card);
    box-shadow: var(--d21n-shadow);
}
.d21-post-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family-monospace);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--d21n-accent);
    text-decoration: none;
}
.d21-post-title {
    margin: 14px 0 12px;
    font-family: var(--font-family-monospace);
    font-size: 32px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--heading-color);
}
.d21-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--border-color);
    list-style: none;
}
.d21-post-meta li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--d21n-soft);
    font-size: 13px;
    color: var(--body-color);
}
.d21-post-meta li::first-letter {
    text-transform: uppercase;
}
.d21-post-meta i {
    color: var(--d21n-accent);
}
.d21-post-content {
    padding: 26px 0 8px;
    font-size: 16px;
    line-height: 1.75;
    color: var(--body-color);
    overflow-wrap: break-word;
}
.d21-post-content > :first-child {
    margin-top: 0;
}
.d21-post-content p {
    margin: 0 0 16px;
}
.d21-post-content h1,
.d21-post-content h2,
.d21-post-content h3,
.d21-post-content h4 {
    margin: 26px 0 12px;
    font-family: var(--font-family-monospace);
    font-weight: 600;
    line-height: 1.3;
    color: var(--heading-color);
}
.d21-post-content h1,
.d21-post-content h2 { font-size: 22px; }
.d21-post-content h3 { font-size: 19px; }
.d21-post-content h4 { font-size: 17px; }
.d21-post-content ul,
.d21-post-content ol {
    margin: 0 0 18px;
    padding-left: 22px;
}
.d21-post-content li {
    margin-bottom: 6px;
}
.d21-post-content li > p {
    margin: 0;
}
.d21-post-content li::marker {
    color: var(--d21n-accent);
}
.d21-post-content a {
    color: var(--d21n-accent);
    text-decoration: underline;
}
.d21-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--custom-radius);
}
.d21-post-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: var(--custom-radius);
    background: var(--d21n-soft);
}
.d21-post-share strong {
    font-family: var(--font-family-monospace);
    font-size: 15px;
    font-weight: 600;
    color: var(--heading-color);
}
.d21-post-fb {
    margin-top: 18px;
}
.d21-post-comments {
    margin-top: 20px;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--custom-radius);
    background: var(--d21n-card);
}
.d21-post-comments:empty {
    display: none;
}
.d21-post-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
}
.d21-post-nav .btn i {
    margin-right: 6px;
    font-size: 12px;
}

@media (max-width: 575px) {
    .d21-news-title {
        font-size: 26px;
    }
    .d21-news-card {
        gap: 14px;
        padding: 16px;
    }
    .d21-news-date {
        flex-basis: 58px;
        padding: 10px 4px 8px;
    }
    .d21-news-date strong {
        font-size: 24px;
    }
    .d21-news-share {
        margin-left: 0;
        width: 100%;
    }
    .d21-news-share > span {
        display: none;
    }
    .d21-news-share .d21-share {
        flex-wrap: nowrap;
        gap: 6px;
    }
    .d21-news-share .d21-share-btn {
        width: 32px;
        height: 32px;
    }
    .d21-post {
        padding: 22px 18px;
    }
    .d21-post-title {
        font-size: 25px;
    }
    .d21-post-share {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .d21-news-card,
    .d21-share-btn,
    .d21-news-more i {
        transition: none;
    }
    .d21-news-card:hover,
    .d21-share-btn:hover {
        transform: none;
    }
}
