#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 {
    background: #004aad;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: none;
}

.categoria-urgente,
.categoria-avisos-importantes,
.categoria-informacion-para-familias,
.categoria-información-para-familias,
.categoria-talleres {
    background: #004aad;
    color: white;
    border: none;
}

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

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

.filtro-buscador {
    width: 100%;
    background: #fff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-weight: 500;
    color: #1e3a8a;
    transition: border-color 0.2s ease;
}

.filtro-buscador:focus {
    outline: none;
    border-color: #3b82f6;
}

.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: 1400px;
    margin: auto;
    padding: 40px;
}
.noticia-card {
    min-width: 320px;
    max-width: 320px;
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,.08);
    transition: .3s;
    flex-shrink: 0;
    margin: 0;
    position: relative;
}

.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:hover {
    transform: translateY(-5px);
}

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

.noticia-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.noticia-body {
    padding: 18px;
    min-height: 140px;
}

.noticia-title {
    margin: 15px 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
}

.noticia-text {
    color: #555;
    line-height: 1.4;
    font-size: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.noticia-modal-content .noticia-text {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
}

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

.noticia-tags span {
    background: #eef2f7;
    color: #444;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
}

.noticia-fecha {
    margin-top: 12px;
    font-size: 14px;
    color: #888;
}

.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;
}

/* Noticia viewer modal */
.noticia-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.noticia-modal-content {
    background: #fff;
    max-width: 900px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow: auto;
    border-radius: 12px;
    padding: 20px 24px;
    position: relative;
}

.noticia-modal-close {
    position: absolute;
    right: 12px;
    top: 8px;
    background: transparent;
    border: none;
    font-size: 26px;
    cursor: pointer;
}

.noticia-modal-title {
    font-size: 24px;
    margin-bottom: 6px;
}

.noticia-modal-images img {
    max-width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

/* Layout: main image + side content */
.noticia-modal-grid {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.noticia-modal-main {
    flex: 1 1 56%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.noticia-modal-main img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
}

.noticia-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 8px 10px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
}

.noticia-modal-main { position: relative; }

.noticia-modal-nav:hover { background: rgba(0,0,0,0.7); }

#.noticiaModalPrev { left: 8px; }
.noticia-modal-nav#noticiaModalPrev { left: 8px; }
.noticia-modal-nav#noticiaModalNext { right: 8px; }

.noticia-modal-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.noticia-modal-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
}

.noticia-modal-dots .dot.active { background: rgba(255,255,255,1); }

.noticia-modal-side {
    flex: 1 1 44%;
    min-width: 240px;
}

@media (max-width: 800px) {
    .noticia-modal-grid {
        flex-direction: column;
    }

    .noticia-modal-main img {
        max-height: 45vh;
    }
}

#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) {
}

@media (max-width: 768px) {
    .noticia-card {
    display: flex;
    flex-direction: column;
}

    .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: 180px;
    }

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

    .noticia-fecha {
        font-size: 0.7rem;
        margin-top: 0.6rem;
    }
}
.categoria-section {
    margin-bottom: 3rem;
}

.categoria-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.categoria-header h2 {
    color: #222;
    font-size: 30px;
    font-weight: 700;
}

.categoria-nav {
    display: flex;
    gap: 10px;
}

.categoria-nav button {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: #1e40af;
    color: white;
    font-size: 18px;
}

.categoria-nav button:hover {
    background: #1d4ed8;
}

.categoria-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 10px;
}

.categoria-slider::-webkit-scrollbar {
    height: 8px;
}

.categoria-slider::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 20px;
}

.categoria-slider .noticia-card {
    min-width: 320px;
    width: 320px;
    margin: 0;
    flex-shrink: 0;
}