#login-panel {
    display: none;
}

#emoji-panel {
    position: absolute;
    top: -300px;
    left: 300%;
    transform: translateX(0);
    width: 360px;
    max-height: 450px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 12px;
    display: none;
    z-index: 99999999 !important;
}

#emoji-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.emoji-panel-title {
    font-size: 13px;
    font-weight: 600;
}

.emoji-close-btn {
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
}

#emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.emoji-item {
    font-size: 28px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
}

.emoji-item:hover {
    background: #e5e7eb;
}

#emoji-panel * {
    overflow-anchor: none;
}

#emoji-container {
    position: relative;
    z-index: 9999999;
}

.emoji-container-inline {
    position: relative;
    display: inline-block;
}

.emoji-search-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 6px;
    outline: none;
}

.categoria-chip {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    width: fit-content;
}

.categoria-urgente {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    animation: pulse 1.5s infinite;
}

.categoria-avisos-importantes {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.categoria-información-para-familias,
.categoria-informacion-para-familias {
    background: #ecfeff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.categoria-talleres {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(185, 28, 28, .4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(185, 28, 28, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(185, 28, 28, 0);
    }
}

.noticia-body .categoria-chip + .noticia-title {
    margin-top: 0.3rem;
}

.filtro-categoria {
    position: relative;
    max-width: 260px;
    margin: 0 auto 2rem;
}

.filtro-btn {
    width: 100%;
    background: #fff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 0.6rem 1rem;
    font-weight: 600;
    color: #1e3a8a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.filtro-opciones {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
    list-style: none;
    padding: 0.4rem 0;
    z-index: 50;
}

.filtro-opciones li {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.filtro-opciones li:hover {
    background: #eef2ff;
}

.filtro-opciones li.activo {
    font-weight: 700;
}

.noticias-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.2rem;
    width: min(1500px, 94vw);
}

.acciones-noticia {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.btn-eliminar-noticia {
    background: #e53935;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.btn-editar-noticia {
    background: #1976d2;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.noticia-card {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto 28px auto;
    background: #ffe4e6;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.noticia-img-wrap {
    width: 100%;
    overflow: hidden;
}

.noticia-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    cursor: pointer;
}

.noticia-body {
    padding: 22px 26px;
    position: relative;
}

.noticia-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0.8rem 0;
}

.noticia-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
}

.noticia-tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.noticia-tags span {
    background: #eef2ff;
    color: #1e40af;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-size: .75rem;
}

.noticia-fecha {
    margin-top: 1.2rem;
    font-size: .8rem;
    color: #64748b;
}

.noticia-card.vertical {
    flex-direction: row;
    gap: 1.5rem;
    align-items: stretch;
}

.noticia-card.vertical .noticia-img-wrap {
    width: 35%;
    max-width: 320px;
    flex-shrink: 0;
    display: flex;
}

.noticia-card.vertical .noticia-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.noticia-card.vertical .noticia-body {
    width: 65%;
}

.noticia-card.horizontal .noticia-img-wrap {
    width: 100%;
    height: 640px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffe4e1;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.2rem;
}

.noticia-card.horizontal .noticia-img {
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    display: block;
}

.img-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.img-modal img {
    max-width: 90%;
    max-height: 85%;
    border-radius: 10px;
}

.img-modal .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
}

.img-modal .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: white;
    font-size: 3rem;
    border: none;
    cursor: pointer;
}

.img-modal .prev {
    left: 30px;
}

.img-modal .next {
    right: 30px;
}

.img-modal .dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: auto;
}

.img-modal .dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.img-modal .dot.active {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.15);
}

.img-modal .dot.dot-portada {
    background: #facc15;
}

#imgModalFooter {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 0 50px;
    text-align: center;
    pointer-events: none;
    z-index: 10;
}

#imgModalFooter .btn-primary,
#imgModalFooter .btn-danger {
    pointer-events: auto;
}

#imgModalFooter .btn-danger {
    margin-left: 10px;
}

#imgModalFooter button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}

#imgModalFooter button:hover {
    background: #1d4ed8;
}

.btn-danger {
    background: #dc2626;
    color: white;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger:hover {
    background: #b91c1c;
}

.toast-portada {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: #f3f4f6;
    border: 2px solid #9ca3af;
    color: #111827;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
    z-index: 99999;
}

.toast-portada.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s ease, transform 0.15s ease;
    line-height: 0;
    padding: 0;
}

.icon-btn:hover {
    background: #e5e7eb;
    transform: scale(1.08);
}

.icon-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: bottom center;
}

.icon-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

#preview-imagen-container {
    animation: fadePreview 0.25s ease;
}

@keyframes fadePreview {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .noticia-img.vertical {
        max-height: 420px;
        width: auto;
    }
}

@media (max-width: 768px) {
    .noticia-card {
        width: calc(100% - 22px);
        margin: 0 auto 1.5rem auto !important;
    }

    .noticia-card.vertical {
        flex-direction: column;
    }

    .noticia-card.vertical .noticia-img-wrap,
    .noticia-card.vertical .noticia-body {
        width: 100%;
    }

    .noticia-body {
        padding: 16px 16px;
    }

    .noticia-title {
        font-size: 1.2rem !important;
        line-height: 1.2 !important;
        margin: 0.6rem 0 !important;
    }

    .noticia-text {
        font-size: 0.92rem !important;
        line-height: 1.25 !important;
    }

    .noticia-img-wrap {
        max-height: 260px;
        aspect-ratio: 4 / 3;
    }

    .noticia-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
    }

    .noticia-card.horizontal .noticia-img-wrap {
        height: 420px;
    }

    .noticia-tags span {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }

    .noticia-fecha {
        font-size: 0.7rem;
        margin-top: 0.6rem;
    }
}
