﻿/*Seccion de directorio de noticias*/
.main-noticia {
    background: var(--white-gray-color);
    padding: 20px 0 20px 0;
    justify-items: center;
    display: grid;
}

.container-noticia {
    max-width: 1400px;
    /*margin-top: 120px;*/
    width: 100%;
}
.news-row {
    display: block;
}

/* Sidebar filtros */
.card {
    background: white;
    border: 1px solid var(--white-gray-color);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

input, select {
    width: 100%; 
    padding: 10px 12px; 
    border-radius: 8px;
    border: 1px solid var(--white-gray-color); 
    background: white; 
    color: var(--plain-text-color);
    outline: none;
}

input:focus, select:focus { 
    border-color: var(--dark-primary);
}

.btn {
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    gap: 8px; 
    padding: 10px 14px; 
    border-radius: 15px;
    border: none; 
    cursor: pointer; 
    text-decoration: none;
    transition: background .15s ease, transform .05s ease;
    font-weight: 600;
}
.btn-primary-filters { 
    background: var(--primary-color); 
    color: white !important; 
    width: 100%;
}
.btn-primary-filters:hover {
    background: var(--highlight-color);
    color: white !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.btn:active { 
    transform: translateY(3px);
}
.btn-link {
    background: var(--primary-color);
    color: white;
    justify-self: center;
    margin-top: 20px;
}
.btn-link:hover {
    color: white;
    background: var(--highlight-color);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Contenido principal */
/* Destacado */
.hero {
    display: grid; 
    grid-template-columns: 44% 56%; 
    gap: 0;
    border-radius: 12px; 
    overflow: hidden; 
    border: 1px solid var(--white-gray-color);
    background: white; 
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.hero-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    min-height: 220px; 
    padding: 15px;
}
.hero-body { 
    padding: 20px; 
}
.chip { 
    display: inline-block; 
    background: var(--dark-primary); 
    color: white; 
    font-weight: 700;
    padding: 6px 10px; 
    border-radius: 8px 8px 0 0; 
    font-size: .8rem; 
    letter-spacing: .2px; 
}
.date { 
    display: inline-block; 
    background: var(--primary-color); 
    color: white; 
    padding: 8px 12px; 
    border-radius: 10px; 
    /*font-size: .74rem;*/
}
.hero-title { 
    margin: .4rem 0 1rem; 
    font-size: 1.8rem !important; 
    line-height: 1.25; 
    font-weight: bold !important;
    text-transform: uppercase;
}
.hero-meta { 
    color: var(--plain-text-color-gray); 
    font-size: 1.2rem; 
    margin-bottom: .35rem;
    text-transform: uppercase;
    text-align: justify;
}
.hero-desc { 
    color: var(--plain-text-color-gray); 
    margin-bottom: .8rem;
    text-align: justify;
}

/* Grilla de tarjetas */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, calc(100%/3.2));
    gap: 16px;
}
.card-item {
    background: white; 
    border: 1px solid var(--white-gray-color); 
    border-radius: 12px;
    overflow: hidden; 
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    height: 100%;
}
.card-item:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 24px rgba(0,0,0,.12); 
}
.thumb-wrap { 
    position: relative; 
}
.thumb { 
    width: 100%;
    object-fit: cover; 
    display: block;
    height: 250px;
}
.badge-localidad {
    position: absolute; 
    top: 0; 
    left: 0;
    background: var(--dark-primary); 
    color: white; 
    padding: 10px 15px;
    font-weight: 700; 
    font-size: 1.2rem;
    display: inline-flex;
    width: 100%;
}
.card-body { 
    padding: 12px; 
}

.card-title { 
    margin: 5px 0 5px; 
    font-size: 1.8rem; 
    font-weight: bold;
    color: var(--primary-color);
}
.muted { 
    color: var(--plain-text-color-gray); 
    font-size: 1.2rem; 
}
.card-summary {
    margin-top: 10px;
    font-size: small;
    height: 120px;
}
.mb-3 {
    margin: 8px;
}
.d-grid {
    margin-top: 20px;
}

/* Paginación */
.pagination {
    display: flex; 
    flex-flow: wrap;
    gap: 6px; 
    align-items: center;
    margin-top: 15px;
    margin-bottom: 15px;
}

.pagination-span {
    align-self: anchor-center; 
    padding-left: 20px;
}

.page {
    border: 1px solid var(--white-gray-color); 
    background: white; 
    color: var(--plain-text-color);
    padding: 6px 10px; 
    border-radius: 8px; 
    text-decoration: none; 
    font-weight: 600;
}
.page:hover { 
    background: white; 
}
.page[aria-current="active"] { 
    background: var(--dark-primary); 
    color: white; 
    border-color: var(--dark-primary); 
}
.page.disabled { 
    pointer-events: none; 
    opacity: .45; 
}

.js-ellipsis {
    border: 1px solid var(--white-gray-color);
    background: white;
    color: var(--plain-text-color);
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}
.jump-popover {
    position: sticky;
    z-index: 1000;
    background: white;
    border: 1px solid var(--white-gray-color);
    border-radius: .4rem;
    padding: .35rem;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    display: flex;
    gap: .35rem;
}
.jump-popover[hidden] { 
    display: none; 
}
.jump-popover .jump-input {
    width: 4.5rem;
    padding: .25rem .35rem;
}
.jump-popover .btn-go {
    padding: .25rem .6rem;
    border: 1px solid var(--separator-color);
    background: var(--separator-color);
    color: white;
    border-radius: .35rem;
}
.jump-popover .btn-go:hover { 
    filter: brightness(0.95); 
}

/*Noticia completa*/
.container-breadcrumb {
    padding-top: 220px;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    width: 80%;
}
@media (max-width: 992px) {
    .container-breadcrumb {
        padding-top: 10px;
    }
}

.news-hero {
    display: grid;
    gap: 12px;
    background: white;
    margin: 30px;
    max-width: 80%;
    justify-self: anchor-center;
    border-radius: 15px;
}

/* ===== Card ===== */
.full-new {
    color: var(--plain-text-color);
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    padding: 0 0 20px 0;
}

/* Figure + imagen */
.full-new__figure {
    position: relative;
    margin: 0 40px 0 40px;;
    border-radius: 14px;
    overflow: hidden;
    background: var(--white-gray-color);
}

.full-new__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;     /* mantiene proporción elegante */
    object-fit: cover;
}

/* Overlay del titular (cinta/pill) */
.full-new__overlay {
    position: absolute;
    left: clamp(12px, 3vw, 28px);
    bottom: clamp(12px, 3vw, 28px);
    max-width: min(50%, 800px);
    background: var(--secondary-color);
    color: white;
    border-radius: 18px;
    padding: clamp(10px, 2.4vw, 18px) clamp(12px, 2.8vw, 22px);
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
    align-content: center;
}

.full-new__title {
    margin: 0;
    font-weight: 400;
    letter-spacing: .2px;
    line-height: 1.15;
    font-size: 2vw !important;
    text-transform: uppercase;              
    color: white !important;
}
.full-new__title_mobile {
    margin: 10px 0 10px 0;
    font-weight: 400;
    letter-spacing: .2px;
    line-height: 1.15;
    font-size: 20px !important;
    text-transform: uppercase;
    color: white !important;
    place-self: center;
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 18px;
    padding: 15px;
    max-width: 85%;
    visibility: hidden;
    display: none;
}

/* Meta y acciones */
.full-new__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 40px 0 40px;
    color: var(--plain-text-color-gray);
    margin-top: 10px;
}

.full-new__meta-left,
.full-new__meta-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Chips */
.news-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    background: var(--white-gray-color);
    color: var(--plain-text-color-gray);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--white-gray-color);
}

.category {
    background: var(--secondary-color);
    color: white;
}

.news-chip--location::before {
    content: "📍";
    font-size: 1rem;
    line-height: 1;
}

/* Icon buttons */
.icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--white-gray-color);
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.icon-btn:hover {
    background: var(--white-gray-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.icon-btn:active {
    transform: translateY(0);
}

.icon {
    width: 18px;
    height: 18px;
    fill: var(--plain-text-color-gray);
}

/* ====== Share Modal ====== */
.share-modal[hidden] {
    display: none;
}
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
}

.share-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(2px);
}

.share-dialog {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 8vh auto;
    background: white;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 300px;
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 1rem 1.25rem;
    border-bottom: 1px solid var(--white-gray-color);
}
.share-header h2 {
    font-size: 24px !important;
    font-weight: bold !important;
    margin: 0;
    color: var(--primary-color) !important;
}
.share-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: gray;
    padding: .4rem;
    border-radius: 8px;
}
.share-close:hover {
    background: var(--white-gray-color);
    color: var(--plain-text-color);
}

.share-body {
    padding: 1rem 1.25rem 1.25rem;
}
.share-caption {
    margin: 0 0 .75rem;
    color: gray;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
}
.share-item {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .7rem .8rem;
    border-radius: 12px;
    border: 1px solid var(--white-gray-color);
    background: var(--white-gray-color);
    color: var(--plain-text-color) !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease, border-color .15s ease, box-shadow .15s ease;
    font-weight: 400 !important;
}
.share-item:hover {
    background: white;
    border-color: var(--white-gray-color);
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    color: var(--separator-color) !important;
}
.share-item:active {
    transform: scale(.99);
}
.share-item .share-icon {
    font-size: 1.8rem;
}
.svg-inline--fa {
    color: var(--plain-text-color) !important;
}

.share-item.copied {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary-color) 20%, white);
}

.share-footer {
    padding: .9rem 1.25rem; border-top: 1px solid var(--white-gray-color);
    display: flex; justify-content: flex-end; gap: .5rem;
    background-color: transparent !important;
}
.btn-secondary {
    padding: .55rem .9rem;
    border-radius: 10px;
    border: 1px solid var(--white-gray-color);
    background: white;
    color: var(--plain-text-color);
    cursor: pointer;
}
.btn-secondary:hover {
    background: var(--white-gray-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* Accesibilidad visual */
.share-dialog:focus {
    outline: 3px solid color-mix(in srgb, var(--secondary-color) 70%, #6aa9ff);
    outline-offset: 2px;
}

/* Lead / avance */
.full-new__lead {
    margin: 40px;
    color: var(--plain-text-color);
    line-height: 1.5;
    font-size: 1rem;
    p, span {
        font-family: 'Montserrat', sans-serif !important;
    }
}

/* Carrusel de imágenes de noticia completa */
#carousel .carousel-item {
    height: clamp(240px, 50vw, 560px);
}
#carousel .carousel-item img {
    object-fit: cover;
    height: 100%;
}

/* Alto consistente para todas las slides */
#carousel .carousel-item {
    height: clamp(240px, 50vw, 560px);
    position: relative;
}

#carousel .carousel-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media(max-width: 440px){
    .jump-popover{
        position: inherit;
    }
}

@media (min-width: 768px) {
    #carousel .carousel-item { height: 600px; }
}
@media (min-width: 1200px) {
    #carousel .carousel-item { height: 800px; }
}

.carousel-control {
    align-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .01);
    border: 0 solid transparent;
    border-radius: 15px;
}
.svg-inline--fa {
    color: white;
}
.carousel-inner{
    border: 1px solid transparent;
    border-radius: 15px;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .full-new__overlay {
        visibility: hidden;
    }
    .full-new__title_mobile {
        visibility: visible;
        display: flex;
    }
}
@media (max-width: 768px) {
    .full-new__meta {
        flex-direction: column;
        align-items: stretch;
    }
    .full-new__meta-right {
        justify-content: flex-end;
    }
}

/*Esto es para que cuando se vean las noticias en móviles el apartado de filtros quede arriba del listado de noticias.*/
@media (max-width: 1200px) {
    #listado-container {
        order: 2 !important;
    }
    #filtros-listado {
        order: 1 !important;
    }
    #paginacion-listado {
        order: 3 !important;
    }
    #tarjetas-noticias{
        grid-template-columns: 80%;
        justify-content: center;
    }

    .news-row {
        display: grid;
    }

    .hero-body {
        padding: 10px;
    }
    
    .hero-img {
        padding: 0;
    }
    
    #primeraNoticia {
        margin: 15px;
    }
}

/*Loader*/
.loader-overlay {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white; /* White background, can be opaque */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 30px 0 30px 0;
}
.spinner {
    border: 16px solid #f3f3f3; /* Light grey "track" */
    border-top: 16px solid var(--primary-color); /* Blue "spinner" part */
    border-radius: 50%; /* Makes the element a perfect circle */
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite; /* Apply the spin animation */
}
@keyframes spin {
    0% { transform: rotate(0deg); } /* Start the rotation at 0 degrees */
    100% { transform: rotate(360deg); } /* End the rotation at 360 degrees */
}

a:hover {
    text-decoration: none !important;
}