
/* =========================================
   LA CONCA FILM COMMISSION
   ACTUALITAT — MODEL D
========================================= */

.news-section {
    padding: 80px 6% 100px;
    background: #F0F0EE;
    color: #191919;
    font-family: "DM Sans", sans-serif;
}

.news-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.news-heading {
    margin-bottom: 65px;
    animation: newsEntrance 1s ease both;
}

.news-heading h1 {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(75px, 11vw, 165px);
    font-weight: 400;
    line-height: .88;
    letter-spacing: -.035em;
    margin: 30px 0;
}

.news-heading h1 em {
    font-weight: 400;
}

.news-heading p {
    max-width: 480px;
    color: #666;
    font-size: 17px;
    line-height: 1.8;
}

/* =========================================
   CERCADOR
========================================= */

.news-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #D8D8D4;
}

.news-toolbar h2 {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 400;
    margin: 0;
}

.news-search input {
    width: 280px;
    max-width: 100%;
    padding: 14px 18px;
    background: transparent;
    border: 1px solid #C9C9C4;
    border-radius: 0;
    font-family: inherit;
    font-size: 13px;
    color: #191919;
}

.news-search input:focus {
    outline: 2px solid #B9A17C;
    outline-offset: 2px;
}

/* =========================================
   FILTRES
========================================= */

.news-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 25px 0;
}

.news-filter {
    border: 1px solid #D0D0CB;
    background: transparent;
    padding: 11px 20px;
    color: #191919;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background .3s, color .3s;
}

.news-filter:hover,
.news-filter.active {
    background: #191919;
    border-color: #191919;
    color: #FFFFFF;
}

/* =========================================
   MOSAIC CINEMATOGRÀFIC
========================================= */

.news-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    grid-auto-rows: 300px;
    grid-auto-flow: row;
    gap: 5px;
}

.news-card {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: #38362F;
    color: white;
    cursor: pointer;
    text-align: left;
    isolation: isolate;
    font-family: "DM Sans", sans-serif;
    animation: newsEntrance .7s ease both;
}

.news-card.featured {
    grid-row: span 2;
}

/* Una sola notícia manté la mida normal */

.news-card:only-child {
    grid-column: 1;
    grid-row: span 1;
}

.news-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition:
        transform .9s cubic-bezier(.16, 1, .3, 1),
        filter .5s ease;
}

.news-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        0deg,
        rgba(0,0,0,.92) 0%,
        rgba(0,0,0,.38) 45%,
        rgba(0,0,0,.08) 100%
    );
    transition: opacity .5s ease;
}

.news-card-content {
    position: absolute;
    z-index: 2;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 28px;
    box-sizing: border-box;
    transition: transform .5s ease;
}

.news-card-category {
    display: block;
    color: #DEC8A5;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.news-card-date {
    display: block;
    font-size: 11px;
    color: #E5E5E5;
    margin-top: 8px;
}

.news-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(30px, 3.2vw, 48px);
    font-weight: 400;
    line-height: 1.05;
    margin: 15px 0;
    overflow-wrap: anywhere;
}

.news-card.featured .news-card-title {
    font-size: clamp(45px, 5vw, 75px);
}

.news-card-link {
    display: block;
    font-size: 12px;
    letter-spacing: .5px;
}

.news-card-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 50%;
    font-size: 20px;
    transition: background .4s, color .4s;
}

/* =========================================
   INTERACCIÓ DE LES NOTÍCIES
========================================= */

@media (hover: hover) {

    .news-card:hover .news-card-image {
        transform: scale(1.09);
    }

    .news-card:hover .news-card-content {
        transform: translateY(-8px);
    }

    .news-card:hover .news-card-arrow {
        background: #FFFFFF;
        color: #191919;
    }

    .news-grid:hover .news-card:not(:hover)
    .news-card-image {
        filter: brightness(.85);
    }
}

.news-card:focus-visible,
.news-filter:focus-visible,
.news-more:focus-visible,
.news-close:focus-visible,
.news-expand-photo:focus-visible,
.news-photo-viewer button:focus-visible,
.news-inline-photo:focus-visible {
    outline: 3px solid #B9A17C;
    outline-offset: 3px;
}

/* =========================================
   RESULTATS
========================================= */

.news-empty {
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.news-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #D8D8D4;
}

#newsCount {
    color: #666;
    font-size: 12px;
}

.news-more {
    padding: 14px 24px;
    background: #191919;
    border: 1px solid #191919;
    color: #FFFFFF;
    font-family: inherit;
    cursor: pointer;
}

.news-more:hover {
    background: #B9A17C;
    border-color: #B9A17C;
    color: #191919;
}

/* =========================================
   CONTACTE
========================================= */

.news-contact {
    background: #191919;
    color: #FFFFFF;
    padding: 100px 6%;
    text-align: center;
}

.news-contact .news-label {
    color: #B9A17C;
}

.news-contact h2 {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(55px, 8vw, 115px);
    font-weight: 400;
    line-height: .95;
    margin: 30px 0;
}

.news-contact p {
    color: #C4C4C4;
    margin-bottom: 30px;
}

.news-contact a {
    display: inline-block;
    padding: 16px 25px;
    border: 1px solid #B9A17C;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 13px;
    transition: background .3s, color .3s;
}

.news-contact a:hover {
    background: #B9A17C;
    color: #191919;
}

/* =========================================
   FINESTRA DE NOTÍCIA
========================================= */

.news-dialog {
    position: fixed;
    inset: 0;
    width: min(900px, 92vw);
    max-width: 92vw;
    max-height: 88vh;
    max-height: 88dvh;
    padding: 0;
    border: 0;
    margin: auto;
    background: #F0F0EE;
    color: #191919;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 3px;
}

.news-dialog::backdrop {
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(5px);
}

.news-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #FFFFFF;
    color: #191919;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    transition: background .3s, color .3s;
}

.news-close:hover {
    background: #191919;
    color: #FFFFFF;
}

/* =========================================
   FOTOGRAFIA PRINCIPAL
========================================= */

.news-article-cover {
    position: relative;
    height: clamp(210px, 30vw, 340px);
    overflow: hidden;
    background: #38362F;
}

.news-article-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

#articleImage {
    cursor: zoom-in;
}

#articleImage[hidden],
#articleIntro[hidden],
#expandNewsPhoto[hidden],
#previousNewsPhoto[hidden],
#nextNewsPhoto[hidden],
#newsEmpty[hidden],
#newsMore[hidden] {
    display: none !important;
}

/* BOTÓ PER AMPLIAR LA FOTOGRAFIA */

.news-expand-photo {
    position: absolute;
    bottom: 18px;
    right: 18px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 17px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 2px;
    background: rgba(25,25,25,.75);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .3s, color .3s;
}

.news-expand-photo:hover {
    background: #FFFFFF;
    color: #191919;
}

/* =========================================
   CONTINGUT DE LA NOTÍCIA
========================================= */

.news-article {
    position: relative;
    padding: 36px 5% 45px;
    font-family: "DM Sans", sans-serif;
}

.news-article .news-label {
    color: #806A49;
    font-size: 10px;
    letter-spacing: 2px;
}

.news-article-date {
    font-size: 12px;
    color: #666;
    margin: 12px 0;
}

.news-article h2 {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(36px, 4.5vw, 60px);
    font-weight: 400;
    line-height: 1.05;
    margin: 16px 0 24px;
    overflow-wrap: anywhere;
}

.news-article-intro {
    font-size: 17px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #D8D8D4;
}

#articleContent {
    font-size: 15px;
    line-height: 1.85;
    color: #555;
    overflow-wrap: anywhere;
}

#articleContent p {
    font-size: 15px;
    line-height: 1.85;
    color: #555;
    margin: 0 0 18px;
}

#articleContent p:last-child {
    margin-bottom: 0;
}

#articleContent h2,
#articleContent h3,
#articleContent h4 {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.15;
    color: #191919;
    margin: 30px 0 15px;
}

#articleContent ul,
#articleContent ol {
    padding-left: 25px;
    margin: 18px 0;
}

#articleContent ul {
    list-style: disc;
}

#articleContent ol {
    list-style: decimal;
}

#articleContent a {
    color: #806A49;
    text-decoration: underline;
    text-underline-offset: 4px;
}

#articleContent blockquote {
    border-left: 2px solid #B9A17C;
    padding: 15px 25px;
    margin: 25px 0;
}

#articleContent figure {
    max-width: 100%;
    margin: 24px 0;
}

#articleContent img {
    display: block;
    max-width: 100%;
    height: auto;
}

#articleContent figcaption {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #666;
}

#articleContent table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

#articleContent video {
    max-width: 100%;
}

/* =========================================
   GALERIA DE WORDPRESS
========================================= */

#articleContent .wp-block-gallery,
#articleContent .gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 25px 0;
}

#articleContent .wp-block-gallery figure,
#articleContent .gallery-item {
    width: 100%;
    min-width: 0;
    margin: 0;
}

#articleContent .wp-block-gallery img,
#articleContent .gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.news-inline-photo {
    position: relative;
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    overflow: hidden;
    cursor: zoom-in;
}

.news-inline-photo img {
    transition: transform .6s ease;
}

.news-inline-photo:hover img {
    transform: scale(1.04);
}

.news-inline-photo-icon {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #FFFFFF;
    font-size: 20px;
    pointer-events: none;
}

/* =========================================
   VISOR DE FOTOGRAFIES A PANTALLA COMPLETA
========================================= */

#newsPhotoViewer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #111111;
    color: #FFFFFF;
    overflow: hidden;
    box-sizing: border-box;
}

#newsPhotoViewer:not([open]) {
    display: none;
}

#newsPhotoViewer[open] {
    display: flex;
    flex-direction: column;
}

#newsPhotoViewer::backdrop {
    background: #111111;
}

.news-viewer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 4%;
    flex-shrink: 0;
}

.news-viewer-heading {
    min-width: 0;
}

.news-viewer-heading span {
    display: block;
    color: #B9A17C;
    font-size: 10px;
    letter-spacing: 2px;
}

#newsViewerTitle {
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(22px, 3vw, 35px);
    line-height: 1.15;
    margin: 6px 0 0;
    color: #FFFFFF;
    overflow-wrap: anywhere;
}

#closeNewsViewer {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 50%;
    background: transparent;
    color: #FFFFFF;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: background .3s, color .3s;
}

#closeNewsViewer:hover {
    background: #FFFFFF;
    color: #191919;
}

/* FOTOGRAFIA SENSE RETALLS */

.news-viewer-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 6%;
    box-sizing: border-box;
}

#fullNewsPhoto {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    object-fit: contain;
    object-position: center;
}

/* FLETXES DE NAVEGACIÓ */

.news-viewer-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 50%;
    background: rgba(25,25,25,.75);
    color: #FFFFFF;
    font-size: 22px;
    cursor: pointer;
    transition: background .3s, color .3s;
}

.news-viewer-arrow:hover {
    background: #FFFFFF;
    color: #191919;
}

#previousNewsPhoto {
    left: 2%;
}

#nextNewsPhoto {
    right: 2%;
}

.news-viewer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 4%;
    flex-shrink: 0;
    color: rgba(255,255,255,.65);
    font-size: 11px;
    letter-spacing: 1.5px;
}

#newsPhotoCounter {
    color: #FFFFFF;
}

/* =========================================
   ANIMACIONS
========================================= */

@keyframes newsEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   ADAPTACIÓ TABLET
========================================= */

@media (max-width: 900px) {

    .news-grid {
        grid-auto-rows: 260px;
    }

    .news-card-content {
        padding: 20px;
    }

    .news-card-title {
        font-size: 35px;
    }

    .news-card.featured .news-card-title {
        font-size: 48px;
    }

    .news-article {
        padding: 30px 5% 40px;
    }
}

/* =========================================
   ADAPTACIÓ MÒBIL
========================================= */

@media (max-width: 650px) {

    .news-section {
        padding: 45px 5% 65px;
    }

    .news-heading {
        margin-bottom: 40px;
    }

    .news-heading h1 {
        font-size: clamp(65px, 13vw, 90px);
    }

    .news-heading p {
        font-size: 15px;
    }

    .news-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .news-search input {
        width: 100%;
    }

    .news-filters {
        gap: 6px;
    }

    .news-filter {
        padding: 9px 13px;
        font-size: 11px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
    }

    .news-card.featured {
        grid-row: span 1;
        min-height: 300px;
    }

    .news-card.featured .news-card-title {
        font-size: 38px;
    }

    .news-card-title {
        font-size: 35px;
    }

    .news-card-arrow {
        width: 36px;
        height: 36px;
        top: 15px;
        right: 15px;
    }

    .news-contact {
        padding: 70px 5%;
    }

    .news-dialog {
        width: 94vw;
        max-width: 94vw;
        max-height: 92vh;
        max-height: 92dvh;
    }

    .news-article-cover {
        height: 240px;
    }

    .news-article {
        padding: 25px 6% 35px;
    }

    .news-article h2 {
        font-size: 39px;
        margin: 15px 0 20px;
    }

    .news-article-intro {
        font-size: 16px;
    }

    #articleContent p {
        font-size: 14px;
    }

    .news-close {
        width: 38px;
        height: 38px;
        top: 12px;
        right: 12px;
    }

    .news-expand-photo {
        right: 12px;
        bottom: 12px;
        padding: 10px 12px;
        font-size: 11px;
    }

    #articleContent .wp-block-gallery,
    #articleContent .gallery {
        grid-template-columns: 1fr;
    }

    .news-viewer-top {
        padding: 20px 5%;
    }

    .news-viewer-heading span {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .news-viewer-stage {
        padding: 5px 0;
    }

    .news-viewer-arrow {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .news-viewer-bottom {
        padding: 18px 5%;
        font-size: 9px;
    }
}

/* =========================================
   ACCESSIBILITAT
========================================= */

@media (prefers-reduced-motion: reduce) {

    .news-heading,
    .news-card {
        animation: none;
    }

    .news-card-image,
    .news-card-content,
    .news-card-arrow,
    .news-inline-photo img {
        transition: none;
    }

    .news-card:hover .news-card-image,
    .news-card:hover .news-card-content,
    .news-inline-photo:hover img {
        transform: none;
    }
}
