/* =============================================================================
   Notícias — Estilos Específicos (apenas para notícias)
   Rede de Bibliotecas de Barcelos
   ============================================================================= */

/* Este arquivo contém apenas estilos específicos de notícias.
   Os estilos compartilhados estão em comum.css */

/* ─── Galeria ────────────────────────────────────────────────────────────── */

.ns-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 100px));
    gap: 8px;
    justify-content: start;
}

.ns-gallery a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f5f5f5;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
    width: 100px;
    height: 100px;
}

@media (max-width: 600px) {
    .ns-gallery {
        gap: 6px;
    }
}

.ns-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.ns-gallery a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ns-gallery a:hover img {
    transform: scale(1.05);
}

/* ─── Ficheiros ──────────────────────────────────────────────────────────── */

.ns-files {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ns-files li {
    margin: 0;
}

.ns-files li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: color .2s;
    font-family: "Bricolage Grotesque", sans-serif;
}

.ns-files li a svg {
    flex-shrink: 0;
    color: #999;
    transition: color .2s;
}

.ns-files li a:hover {
    color: #ED1C24;
}

.ns-files li a:hover svg {
    color: #ED1C24;
}

/* ─── URLs / Links ───────────────────────────────────────────────────────── */

.ns-urls {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ns-urls li {
    margin: 0;
}

.ns-urls li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-family: "Bricolage Grotesque", sans-serif;
    transition: color .2s;
}

.ns-urls li a svg {
    flex-shrink: 0;
    color: #999;
    transition: color .2s;
}

.ns-urls li a:hover {
    color: #ED1C24;
}

.ns-urls li a:hover svg {
    color: #ED1C24;
}

/* ─── Navegação entre notícias ────────────────────────────────────────────── */

.ns-navigation {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e8e3db;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ─── Dots (à esquerda) ──────────────────────────────────────────────────── */

.ns-nav-dots {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ns-nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: none;
    border: 1px solid #ED1C24;
    cursor: pointer;
    transition: background .2s, transform .2s;
    text-decoration: none;
    display: block;
    flex-shrink: 0;
}

.ns-nav-dot:hover {
    background: #ED1C24;
    border-color: #ED1C24;
    transform: scale(1.2);
}

.ns-nav-dot.is-current {
    background: #ED1C24;
    width: 11px;
    height: 11px;
    cursor: default;
}

.ns-nav-dot.is-current:hover {
    transform: none;
}

/* ─── Setas (à direita) ──────────────────────────────────────────────────── */

.ns-nav-arrows {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ns-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    text-decoration: none;
    transition: color .2s;
    flex-shrink: 0;
    padding: 8px;
}

.ns-nav-arrow svg {
    width: 20px;
    height: 20px;
    display: block;
    overflow: visible;
}

/* Seta anterior: tronco cresce para a direita (origin no lado esquerdo) */
.ns-nav-prev .ns-arrow-trunk {
    transition: transform .3s ease;
    transform-origin: 5px 12px;
}

/* Seta próxima: tronco cresce para a esquerda (origin no lado direito) */
.ns-nav-next .ns-arrow-trunk {
    transition: transform .3s ease;
    transform-origin: 19px 12px;
}

.ns-arrow-head {
    transition: none;
}

.ns-nav-arrow:hover {
    color: #ED1C24;
}

.ns-nav-prev:hover .ns-arrow-trunk {
    transform: scaleX(1.8);
}

.ns-nav-next:hover .ns-arrow-trunk {
    transform: scaleX(1.8);
}

.ns-nav-arrow.ns-nav-disabled {
    opacity: .3;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 600px) {
    .ns-navigation {
        margin-top: 32px;
        padding-top: 24px;
        gap: 16px;
    }

    .ns-nav-dots {
        gap: 8px;
    }

    .ns-nav-arrow {
        width: 40px;
        height: 40px;
    }
}

/* ─── Lightbox ──────────────────────────────────────────────────────────── */

.ns-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ns-lightbox[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.ns-lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
}

.ns-lightbox__container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    box-sizing: border-box;
}

.ns-lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.ns-lightbox__image {
    max-width: 100%;
    max-height: calc(90vh - 60px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: ns-lightbox-fade-in 0.3s ease;
}

@keyframes ns-lightbox-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ns-lightbox__counter {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: "Bricolage Grotesque", sans-serif;
    text-align: center;
    opacity: 0.8;
}

.ns-lightbox__close,
.ns-lightbox__prev,
.ns-lightbox__next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    z-index: 2;
    padding: 0;
    margin: 0;
}

.ns-lightbox__close:hover,
.ns-lightbox__prev:hover,
.ns-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.ns-lightbox__close {
    top: 20px;
    right: 20px;
}

.ns-lightbox__prev,
.ns-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
}

.ns-lightbox__prev {
    left: 20px;
}

.ns-lightbox__next {
    right: 20px;
}

.ns-lightbox__prev svg,
.ns-lightbox__next svg,
.ns-lightbox__close svg {
    width: 24px;
    height: 24px;
    display: block;
}

@media (max-width: 768px) {
    .ns-lightbox__container {
        padding: 40px 16px;
    }
    
    .ns-lightbox__content {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .ns-lightbox__image {
        max-height: calc(85vh - 50px);
    }
    
    .ns-lightbox__close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
    
    .ns-lightbox__prev,
    .ns-lightbox__next {
        width: 48px;
        height: 48px;
    }
    
    .ns-lightbox__prev {
        left: 16px;
    }
    
    .ns-lightbox__next {
        right: 16px;
    }
    
    .ns-lightbox__counter {
        font-size: 13px;
    }
}
