/* ==========================================================================
   FECATRA — Notícies

   Loaded only on the news pages, on top of app.css. Every colour comes from
   the tokens declared there; nothing is hardcoded.

   The reference design this section was ported from leans on large radii,
   shadows and pills. This stylesheet deliberately does not: app.css states the
   house direction as hairline rules and a strict grid, and that wins. The
   system is kept (bands, eyebrows, grids, the accent rule); the finish is not.
   ========================================================================== */

/* ------------------------------ Utilities --------------------------------- */
.container--narrow { max-width: 800px; }

/* ------------------------------ Breadcrumbs -------------------------------- */
.crumbs { margin-bottom: 20px; }
.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .82rem;
    color: var(--muted);
}
.crumbs li { display: flex; align-items: center; gap: 6px 10px; }
.crumbs li + li::before { content: "/"; color: var(--line-2); }
.crumbs a { color: inherit; }
.crumbs a:hover { color: var(--red-ink); }
.crumbs [aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
    /* Long headlines must not push the trail off the page. */
    max-width: 46ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------- Masthead ---------------------------------- */
.news-masthead {
    position: relative;
    isolation: isolate;
    background: var(--bg-dark);
    border-top: 3px solid var(--red);
    padding: 64px 0 60px;
    overflow: hidden;
}
.news-masthead__bg { position: absolute; inset: 0; z-index: -2; }
.news-masthead__bg img { width: 100%; height: 100%; object-fit: cover; }
/* Two gradients: one across, one up from the floor, so the text keeps its
   contrast whatever the photograph happens to be doing behind it. */
.news-masthead__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(20, 23, 26, .96) 0%, rgba(20, 23, 26, .82) 48%, rgba(20, 23, 26, .55) 100%),
        linear-gradient(0deg, rgba(20, 23, 26, .9) 0%, rgba(20, 23, 26, 0) 60%);
}
.news-masthead__body { position: relative; z-index: 1; }

.news-masthead .crumbs ol { color: rgba(255, 255, 255, .68); }
.news-masthead .crumbs li + li::before { color: rgba(255, 255, 255, .35); }
.news-masthead .crumbs a:hover { color: #fff; }
.news-masthead .crumbs [aria-current="page"] { color: #fff; }

.eyebrow--on-dark { color: rgba(255, 255, 255, .72); }
.eyebrow--on-dark::before { background: var(--red); }

.news-masthead__title {
    font-family: var(--font-head);
    font-weight: 300;
    font-size: clamp(2.1rem, 5.4vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -.02em;
    color: #fff;
    margin: 0 0 .4em;
}
.news-masthead__title strong { font-weight: 700; color: var(--red); }

.news-masthead__lead {
    max-width: 52ch;
    margin: 0;
    color: var(--on-dark);
    font-size: 1.04rem;
}

/* ----------------------------- Category filter ----------------------------- */
.news-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 44px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}
.news-filter__item {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 15px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    font-family: var(--font-head);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--ink-2);
    background: var(--bg);
    transition: border-color .15s ease, color .15s ease;
}
.news-filter__item:hover { border-color: var(--ink); color: var(--ink); }
.news-filter__item.is-current {
    border-color: var(--red);
    color: var(--red-ink);
    box-shadow: inset 0 -2px 0 var(--red);
}

/* --------------------------------- Meta ------------------------------------ */
.news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0 0 10px;
    font-family: var(--font-head);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}
.news-meta__category { color: var(--red-ink); }
a.news-meta__category:hover { color: var(--red); }
.news-meta__category + .news-meta__date::before {
    content: "·";
    margin-right: 12px;
    color: var(--line-2);
}

/* ------------------------------- Featured ---------------------------------- */
.news-featured {
    display: grid;
    gap: 28px;
    padding-bottom: 44px;
    margin-bottom: 44px;
    border-bottom: 2px solid var(--red);
    position: relative;
}
.news-featured__media { overflow: hidden; border: 1px solid var(--line); }
.news-featured__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.news-featured__title {
    font-size: clamp(1.5rem, 3vw, 2.05rem);
    margin: 0 0 .45em;
    line-height: 1.16;
}
.news-featured__title a { color: var(--ink); }
.news-featured .eyebrow { margin-bottom: 12px; }
.news-featured__excerpt { color: var(--ink-2); margin: 0 0 1em; }
.news-featured__more {
    margin: 0;
    font-family: var(--font-head);
    font-size: .84rem;
    font-weight: 700;
    color: var(--red-ink);
}
.news-featured__more span { display: inline-block; transition: transform .15s ease; }

/* Stretched link: the whole block is clickable, one link in the a11y tree. */
.news-featured__title a::after { content: ""; position: absolute; inset: 0; }
.news-featured:hover .news-featured__title a,
.news-featured:focus-within .news-featured__title a { color: var(--red-ink); }
.news-featured:hover .news-featured__more span,
.news-featured:focus-within .news-featured__more span { transform: translateX(3px); }

/* --------------------------------- Grid ------------------------------------ */
.news-archive__title {
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    padding-bottom: 12px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--line);
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 34px 28px;
}

/* ---------------------------------- Card ----------------------------------- */
.news-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
    transition: border-color .15s ease;
}
.news-card__media { overflow: hidden; border-bottom: 1px solid var(--line); }
.news-card__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

.news-card__body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }

.news-card__title { font-size: 1.12rem; line-height: 1.3; margin: 0 0 .55em; }
.news-card__title a { color: var(--ink); }
/* Stretched link over the card. */
.news-card__title a::after { content: ""; position: absolute; inset: 0; }

.news-card__excerpt {
    color: var(--ink-2);
    font-size: .95rem;
    margin: 0 0 1.1em;
    /* Three lines, so a long standfirst cannot break the grid rhythm. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__more {
    margin: auto 0 0;
    font-family: var(--font-head);
    font-size: .8rem;
    font-weight: 700;
    color: var(--red-ink);
}
.news-card__more span { display: inline-block; transition: transform .15s ease; }

/* Hover and keyboard focus must read the same: the accent rule appears on the
   left edge in both, never only on hover. */
.news-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--red);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .18s ease;
}
.news-card:hover, .news-card:focus-within { border-color: var(--line-2); }
.news-card:hover::before, .news-card:focus-within::before { transform: scaleY(1); }
.news-card:hover .news-card__title a,
.news-card:focus-within .news-card__title a { color: var(--red-ink); }
.news-card:hover .news-card__more span,
.news-card:focus-within .news-card__more span { transform: translateX(3px); }

/* --------------------------------- Empty ----------------------------------- */
.news-empty {
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--bg-alt);
    padding: 34px 30px;
}
.news-empty h3 { font-size: 1.15rem; margin-bottom: .4em; }
.news-empty p { margin: 0; color: var(--muted); }

/* -------------------------------- Article ---------------------------------- */
.news-article { padding: 44px 0 72px; }
.news-article__head { margin-bottom: 26px; }
.news-article__title {
    font-size: clamp(1.8rem, 4.2vw, 2.7rem);
    line-height: 1.15;
    letter-spacing: -.015em;
    margin: 0 0 .4em;
}
.news-article__lead {
    font-size: 1.12rem;
    color: var(--ink-2);
    margin: 0;
    padding-left: 18px;
    border-left: 3px solid var(--red);
}

.news-article__figure { margin: 0 0 36px; }
.news-article__figure img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.news-article__body { max-width: none; }

.news-article__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.news-article__stamp { margin: 0; font-size: .86rem; color: var(--muted); }

/* ------------------------------- Responsive -------------------------------- */
@media (min-width: 600px) {
    .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
    .news-featured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 40px; }
}

@media (min-width: 1000px) {
    .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .news-masthead { padding: 44px 0 40px; }
    .crumbs [aria-current="page"] { max-width: 24ch; }
    .news-article { padding: 30px 0 56px; }
    .news-article__foot { flex-direction: column; align-items: flex-start; }
}
