/*
 * Leader Artikkelit.
 *
 * Styles for the single article and the article archive. Shared tokens mirror
 * the Leader Products / Hero plugins (black bands, --lp-content measure, brand
 * orange) so articles sit visually alongside the rest of the site.
 *
 * Full-width black sections (.la-hero, .la-archive-hero, .la-archive,
 * .la-readnext) are rendered outside Kadence's content container, so they are
 * already viewport-wide; this stylesheet only paints them and lays out the
 * centred inner band.
 */

.la-hero,
.la-archive-hero,
.la-archive-controls,
.la-archive,
.la-readnext {
    --lp-content: 1290px;
    --la-orange: #f0821a;
    box-sizing: border-box;
}

.la-hero *,
.la-archive-hero *,
.la-archive-controls *,
.la-archive *,
.la-readnext * {
    box-sizing: border-box;
}

/* Break the black bands out to the full viewport width, mirroring the Leader
   Hero block (which gets this from Kadence's alignfull). They are rendered
   outside Kadence's content container, but a capped #inner-wrap can still
   limit them, so we force full-bleed here; the inner rows stay centred at
   --lp-content. */
.la-hero,
.la-archive-hero,
.la-archive-controls,
.la-archive,
.la-readnext {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* ------------------------------------------------------------------ *
 * Single article hero
 * ------------------------------------------------------------------ */

.la-hero {
    background: #000;
    color: #fff;
    margin-bottom: 3rem;
}

/* Full-bleed flex band, mirroring the Leader Hero block: copy on the left,
   image filling the right and bleeding to the page edge. */
.la-hero__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    min-height: clamp(340px, 34vw, 480px);
}

.la-hero__text {
    flex: 1 1 460px;
    align-self: center;
    /* Left edge lines up with the centred content column; the band spans the
       full viewport. */
    padding: 3.5rem 2rem;
    padding-left: max(2rem, calc((100vw - var(--lp-content)) / 2));
}

.la-hero__title {
    margin: 0 0 1.25rem;
    color: #fff;
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
}

.la-hero__excerpt {
    max-width: 46ch;
    margin: 0 0 1.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #e9e9e9;
}

.la-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    font-size: 0.85rem;
}

/* Category tag line: lowercase pills separated by a thin divider. */
.la-hero__cats {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
}

.la-hero__cats__item {
    color: var(--la-orange);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    text-decoration: none;
}

.la-hero__cats__item:hover {
    text-decoration: underline;
}

/* Pipe divider between categories, e.g. "Ravitsemus | Uutuudet". The margin
   matches the flex column gap (0.85rem) so spacing reads evenly on both sides. */
.la-hero__cats__item:not(:first-child)::before {
    content: "|";
    margin-right: 0.85rem;
    color: #777;
}

.la-hero__date {
    color: #bdbdbd;
    letter-spacing: 0.04em;
    flex-basis: 100%;
}

.la-hero__media {
    position: relative;
    flex: 1 1 460px;
    align-self: stretch;
    min-height: inherit;
    overflow: hidden;
}

.la-hero__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ------------------------------------------------------------------ *
 * Single article body (white, centred, readable measure)
 * ------------------------------------------------------------------ */

/* Width, outer spacing and content style (boxed/unboxed) come from the theme's
   Kadence content container, so the article body stays consistent with the
   rest of the site and follows the Customizer content-width setting. Only
   reading typography and the design-specific heading style live here. */
.la-article__body {
    font-size: 1.05rem;
    line-height: 1.75;
}

.la-article__body > :first-child {
    margin-top: 0;
}

.la-article__body h2 {
    margin: 2.5rem 0 1rem;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.15;
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
}

.la-article__body h3 {
    margin: 2rem 0 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.la-article__body img {
    height: auto;
    border-radius: 8px;
}

.la-article__body figure {
    margin: 2rem 0;
}

/* ------------------------------------------------------------------ *
 * Article cards (used on the archive and in "Lue seuraavaksi")
 * ------------------------------------------------------------------ */

.la-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.la-card {
    position: relative;
    display: flex;
    flex-direction: column;
    list-style: none;
}

.la-card__link {
    color: inherit;
    text-decoration: none;
}

/* Stretch the title link across the whole card so clicking anywhere (image,
   title, category line, date, "Lue lisää") opens the article. On cards the
   categories are plain text (not links), so the whole card stays one target. */
.la-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.la-card__media {
    overflow: hidden;
    background: #1a1a1a;
}

.la-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.la-card:hover .la-card__image {
    transform: scale(1.04);
}

.la-card__body {
    padding: 1.1rem 0 0;
}

.la-card__cats {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    margin-bottom: 0.5rem;
}

.la-card__cats__item {
    color: var(--la-orange);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}

/* Pipe divider between categories, e.g. "Ravitsemus | Uutuudet". The margin
   matches the flex column gap (0.6rem) so spacing reads evenly on both sides. */
.la-card__cats__item:not(:first-child)::before {
    content: "|";
    margin-right: 0.6rem;
    color: #777;
}

.la-card__title {
    margin: 0 0 0.5rem;
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.15;
    font-size: 2.8rem;
}

.la-card__date {
    display: block;
    margin-bottom: 0.75rem;
    color: #bdbdbd;
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.la-card__more {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
}

.la-card__arrow {
    color: var(--la-orange);
}

.la-card:hover .la-card__more {
    color: var(--la-orange);
}

/* ------------------------------------------------------------------ *
 * Archive hero + filters
 * ------------------------------------------------------------------ */

/* Title sits alone on the black band. */
.la-archive-hero {
    background: #000;
    color: #fff;
}

.la-archive-hero__inner {
    max-width: var(--lp-content);
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
    text-align: center;
}

.la-archive-hero__title {
    margin: 0;
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.05;
    font-size: clamp(2.2rem, 5vw, 4rem);
}

/* Intro line + filter buttons sit on their own full-width white band. */
.la-archive-controls {
    background: #fff;
    color: #111;
}

.la-archive-controls__inner {
    max-width: var(--lp-content);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.la-archive-hero__intro {
    margin: 0 0 1.75rem;
    color: #333;
    font-size: 2rem;
}

.la-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.la-filters__btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 3px;
    color: #111;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.la-filters__btn:hover {
    border-color: #000;
    background: rgba(0, 0, 0, 0.06);
}

.la-filters__btn--active {
    background: var(--la-orange);
    border-color: var(--la-orange);
    color: #fff;
}

/* ------------------------------------------------------------------ *
 * Archive grid + pagination (black background, full width)
 * ------------------------------------------------------------------ */

.la-archive {
    background: #000;
    color: #fff;
}

.la-archive__inner {
    max-width: var(--lp-content);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.la-empty {
    text-align: center;
    color: #bdbdbd;
    padding: 2rem 0;
}

.la-archive .pagination,
.la-archive .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 3rem;
}

.la-archive .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.la-archive .page-numbers:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.la-archive .page-numbers.current {
    background: var(--la-orange);
    border-color: var(--la-orange);
}

/* ------------------------------------------------------------------ *
 * "Lue seuraavaksi" band
 * ------------------------------------------------------------------ */

.la-readnext {
    background: #000;
    color: #fff;
}

.la-readnext__inner {
    max-width: var(--lp-content);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 4.5rem;
}

.la-readnext__title {
    margin: 0 0 2rem;
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 900px) {
    .la-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 920px) {
    .la-hero__inner {
        min-height: 0;
    }

    .la-hero__text {
        flex-basis: 100%;
        align-self: auto;
        padding: 2.5rem 1.25rem;
    }

    .la-hero__media {
        flex-basis: 100%;
        min-height: 280px;
    }
}

@media (max-width: 600px) {
    .la-grid {
        grid-template-columns: 1fr;
    }
}
