/* News (EXT:news, Resources/Private/News): cards for the start page, the overview and "Weitere Neuigkeiten",
   and the article page. Cards follow DESIGN.md 4.11 (image 16:10, tag + date, title, excerpt, "Weiterlesen").
   Kept apart from the compiled app.css (whose .news / .article rules no longer match this markup);
   replaced by the new design system (workstream 1). app.css sets html { font-size: 120% } (1rem = 19.2px). */

/* ---- cards ---- */
.ifs-news-list { display: grid; gap: 1.2rem; margin-block: .5rem 1rem; }
.ifs-news-list__title { font-size: 1.2rem; margin: 0; }
/* 3 → 2 → 1 columns like .grid-3 of the new design. auto-fill left an empty fourth column on wide screens
   (3 news on the start page, 9 per overview page). */
.ifs-news-cards { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr); }
@media screen and (min-width: 40em) { .ifs-news-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media screen and (min-width: 64em) { .ifs-news-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ifs-news-card {
    position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    background: #fff; border: 1px solid #dcdfe3; border-radius: 8px;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.ifs-news-card:hover, .ifs-news-card:focus-within {
    box-shadow: 0 10px 28px rgba(31, 35, 40, .08); border-color: #297d31; transform: translateY(-2px);
}
.ifs-news-card:has(a:focus-visible) { outline: 2px solid #297d31; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .ifs-news-card, .ifs-news-card:hover, .ifs-news-card:focus-within { transition: none; transform: none; }
}

/* image frame: always 16:10, so all cards in a row line up */
.ifs-news-card__media { aspect-ratio: 16 / 10; max-width: 100%; overflow: hidden; background: #f2eee6; }
.ifs-news-img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* "Ganzes Bild": the whole image fitted in, never enlarged, on a light green ground */
.ifs-news-card__media:has(.ifs-news-img--fit) {
    display: flex; align-items: center; justify-content: center; padding: .5rem;
    background: linear-gradient(135deg, #e4efe3 0%, #d3e6d1 100%);
}
.ifs-news-img--fit { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
/* no image: green like the overview cards (Css/overview.css on next) */
.ifs-news-placeholder {
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 212, 38, .5), rgba(255, 212, 38, 0) 55%),
        linear-gradient(135deg, #0F4C20 0%, #1A6028 45%, #297D31 75%, #3A8F3F 100%);
}
.ifs-news-card:nth-child(3n+2) .ifs-news-placeholder {
    background:
        radial-gradient(circle at 15% 85%, rgba(245, 158, 11, .4), rgba(245, 158, 11, 0) 55%),
        linear-gradient(135deg, #1A6028 0%, #297D31 55%, #3A8F3F 100%);
}
.ifs-news-card:nth-child(3n+3) .ifs-news-placeholder {
    background:
        radial-gradient(circle at 80% 85%, rgba(255, 212, 38, .45), rgba(255, 212, 38, 0) 50%),
        linear-gradient(160deg, #0F4C20 0%, #297D31 70%, #3A8F3F 100%);
}

/* icon of the topic on the placeholder (Resources/Public/Icons/News, white outline) */
.ifs-news-placeholder { display: flex; align-items: center; justify-content: center; }
.ifs-news-placeholder__icon { width: 26%; max-width: 5rem; height: auto; opacity: .9; }

.ifs-news-card__body { display: flex; flex-direction: column; flex: 1; gap: .4rem; padding: .85rem 1rem 1rem; }
.ifs-news-card__title { font-size: .95rem; line-height: 1.3; margin: 0; }
/* the live stylesheet styles every h3 in a content frame (.frame-default h3: margins, underline, bold); not the card title */
.ifs-news-card h3.ifs-news-card__title { margin: 0; padding-bottom: 0; border-bottom: 0; font-weight: 400; }
.ifs-news-card__title a { color: #1f2328; text-decoration: none; }
/* the whole card is clickable through the title link */
.ifs-news-card__title a::after { content: ""; position: absolute; inset: 0; }
.ifs-news-card__title a:hover, .ifs-news-card__title a:focus-visible { color: #297d31; }
.ifs-news-card__title a:focus-visible { outline: none; }
.ifs-news-card__excerpt {
    margin: 0; color: #4b525b; font-size: .78rem; line-height: 1.55;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.ifs-news-more { margin-top: auto; padding-top: .3rem; color: #297d31; font-size: .78rem; font-weight: 600; }
.ifs-news-more::after { content: " →"; }
a.ifs-news-more { text-decoration: none; }
a.ifs-news-more:hover { text-decoration: underline; }
.ifs-news-all { margin: 0; text-align: right; }

/* overview: the newest news as a wide card (image left, text right) */
.ifs-news-card--featured { display: grid; grid-template-columns: minmax(0, 1fr); }
.ifs-news-card--featured .ifs-news-card__title { font-size: 1.15rem; }
.ifs-news-card--featured .ifs-news-card__excerpt { -webkit-line-clamp: 4; line-clamp: 4; font-size: .82rem; }
@media screen and (min-width: 40em) {
    .ifs-news-card--featured { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .ifs-news-card--featured .ifs-news-card__media { aspect-ratio: auto; min-height: 100%; }
    .ifs-news-card--featured .ifs-news-card__body { justify-content: center; padding: 1.2rem 1.4rem; gap: .55rem; }
}

/* tag + date (cards and article) */
.ifs-news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: 0; }
.ifs-news-tag {
    font-size: .55rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
    padding: .25rem .5rem; border-radius: 100px; background: #ffd426; color: #1f2328;
}
a.ifs-news-tag { text-decoration: none; }
a.ifs-news-tag:hover, a.ifs-news-tag:focus-visible { background: #1f2328; color: #ffd426; }
.ifs-news-date { font-size: .65rem; color: #6b7280; font-variant-numeric: tabular-nums; }

/* filter chips above the overview (topics = categories with an icon) */
.ifs-news-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .3rem; }
.ifs-news-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 100px;
    border: 1px solid #c9ced4; background: #fff; color: #1f2328; font-size: .7rem; line-height: 1.2; text-decoration: none;
}
.ifs-news-chip:hover, .ifs-news-chip:focus-visible { border-color: #297d31; color: #297d31; }
.ifs-news-chip.is-active { background: #297d31; border-color: #297d31; color: #fff; }
/* the icon files are white: used as a mask so the chip text colour fills them */
.ifs-news-chip__icon {
    width: 1.1em; height: 1.1em; flex: none; background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}

/* pagination (EXT:news partial List/Pagination) */
.ifs-news-pager ul { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.ifs-news-pager li { margin: 0; }
.ifs-news-pager li > a, .ifs-news-pager li.current, .ifs-news-pager li:not(:has(a)) {
    display: block; min-width: 2.2em; padding: .3rem .6rem; text-align: center; font-size: .75rem;
    border: 1px solid #c9ced4; border-radius: 6px; background: #fff; color: #1f2328; text-decoration: none;
}
.ifs-news-pager li > a:hover { border-color: #297d31; color: #297d31; }
.ifs-news-pager li.current { background: #297d31; border-color: #297d31; color: #fff; }

/* ---- article ---- */
.ifs-news-detail { padding-block: .5rem 1.5rem; }
.ifs-news-article { max-width: 40rem; display: grid; gap: 1rem; }
.ifs-news-article__head { display: grid; gap: .5rem; }
.ifs-news-article__title { margin: 0; line-height: 1.2; text-wrap: balance; }
.ifs-news-article__author { margin: 0; color: #6b7280; font-size: .75rem; }
.ifs-news-article__flow { display: flow-root; }
.ifs-news-lead { font-size: 1.2rem; line-height: 1.45; color: #1f2328; margin: 0 0 1rem; }
.ifs-news-article__text { margin-top: .5rem; }
.ifs-news-article__content { margin-block: .5rem; }

/* article images: shown at most at their own size (no width set on the img) */
.ifs-news-figure { margin: 0 0 1rem; }
.ifs-news-figure__img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.ifs-news-figure__caption { margin-top: .3rem; font-size: .7rem; line-height: 1.4; color: #6b7280; }
.ifs-news-figure--wide { margin-block: .25rem 1.2rem; }
/* small images (under 600 px) beside the text */
.ifs-news-figure--side { max-width: min(315px, 100%); }
@media screen and (min-width: 40em) {
    .ifs-news-figure--side { float: right; max-width: min(315px, 42%); margin: .2rem 0 1rem 1.4rem; }
}
.ifs-news-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 1rem; align-items: start; }
.ifs-news-gallery .ifs-news-figure { margin: 0; }

.ifs-news-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.ifs-news-links .button { margin: 0; }
.ifs-news-files__title { font-size: 1rem; margin: 0 0 .3rem; }
.ifs-news-files ul { margin: 0; list-style: none; }
.ifs-news-files li { padding-block: .2rem; }
.ifs-news-files__size { color: #6b7280; font-size: .7rem; margin-left: .4rem; }

.ifs-news-article__foot {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem;
    border-top: 1px solid #dcdfe3; padding-top: .8rem; margin-top: .5rem;
}
.ifs-news-back { font-weight: 600; text-decoration: none; }
.ifs-news-back::before { content: "← "; }
.ifs-news-share { margin: 0; font-size: .75rem; color: #6b7280; display: flex; gap: .7rem; }

/* "Weitere Neuigkeiten" below the article */
.ifs-news-detail > .ifs-news-list, .ifs-news-detail .ifs-news-list { margin-top: 2rem; }

/* the Foundation grid has no gutter on phones: keep cards and article off the screen edge */
@media screen and (max-width: 39.99em) {
    .ifs-news-detail, .ifs-news-list:not(.ifs-news-detail .ifs-news-list) { padding-inline: .75rem; }
}
