/* Hallmark · built: the project · redesign: full · genre: editorial · theme: brand (MedGermany teal, blue and orange) · job: read · posture: restrained · surface: absolute · copy: verbatim · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S3 R5 V3 · weakest: S, a post card fits any journal; the real covers and pathway titles carry it, with no tags or decoration added */

/* Shared parts of the blog pages: the post card (/news and related posts under
   an article), the liquid glass utility, and the closing call to action band.
   Tokens only. Owner: Window 4. See docs/blog-revamp/CONTRACT.md. */

/* ------------------------------------------------------------------ */
/* Post card                                                           */
/* ------------------------------------------------------------------ */

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: var(--mg-body);
    font-family: var(--mg-font-body);
}

.post-card__media {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--mg-radius-md);
    background: var(--mg-wash);
}

.post-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 320ms var(--mg-ease);
}

/* Five posts have no cover. A plain branded panel, never the old banner photo. */
.post-card__media--empty {
    background: var(--mg-teal);
}

.post-card__title {
    min-width: 0;
    margin: 16px 0 0;
    color: var(--mg-ink);
    font-family: var(--mg-font-title);
    font-size: var(--mg-size-h3);
    font-weight: var(--mg-weight-title);
    letter-spacing: var(--mg-tracking-title);
    line-height: var(--mg-leading-snug);
    overflow-wrap: break-word;
    text-wrap: balance;
}

.post-card__title a {
    color: var(--mg-ink);
    text-decoration: none;
    scroll-margin-top: calc(var(--mg-header-h) + 16px);
}

/* The title is the card's one real link. Its hit area covers the whole card. */
.post-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--mg-radius-md);
}

.post-card__title a:focus-visible {
    outline: 0;
}

.post-card__title a:focus-visible::after {
    outline: 2px solid var(--mg-focus);
    outline-offset: 4px;
}

.post-card:hover .post-card__title a {
    color: var(--mg-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

.post-card__title a:active {
    color: var(--mg-blue-strong);
}

.post-card__excerpt {
    display: -webkit-box;
    margin: 8px 0 0;
    overflow: hidden;
    color: var(--mg-body);
    font-family: var(--mg-font-body);
    font-size: var(--mg-size-label);
    line-height: 1.5;
    overflow-wrap: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.post-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
    margin: 12px 0 0;
    color: var(--mg-muted);
    font-family: var(--mg-font-body);
    font-size: var(--mg-size-small);
    line-height: 1.5;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .post-card:hover .post-card__media img {
        transform: scale(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    .post-card__media img {
        transition: none;
    }
}

/* ------------------------------------------------------------------ */
/* Liquid glass, CSS only. Solid by default; translucent only where the */
/* browser can blur and the reader has not asked for less transparency. */
/* Text on it stays --mg-ink or --mg-body: at 72% white over pure black */
/* they keep 6.1:1 and 5.2:1. --mg-muted does not, so never use it here. */
/* ------------------------------------------------------------------ */

.mg-glass {
    background: var(--mg-glass-solid);
    border: 1px solid var(--mg-line);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .mg-glass {
        background: var(--mg-glass-bg);
        border-color: var(--mg-glass-rim);
        box-shadow: inset 0 1px 0 var(--mg-glass-rim);
        -webkit-backdrop-filter: blur(var(--mg-glass-blur)) saturate(1.5);
        backdrop-filter: blur(var(--mg-glass-blur)) saturate(1.5);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .mg-glass {
        background: var(--mg-glass-solid);
        border-color: var(--mg-line);
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* ------------------------------------------------------------------ */
/* Closing call to action band                                         */
/* ------------------------------------------------------------------ */

/* Baseline so the band reads as a band on both blog pages. _closing-cta.php
   belongs to Window 2; article.css loads after this file and may refine it. */
.closing-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    padding-block: clamp(32px, 5vw, 56px);
    padding-inline: max(var(--mg-gutter), calc((100% - var(--mg-container)) / 2 + var(--mg-gutter)));
    background: var(--mg-teal);
    color: var(--mg-on-teal);
    font-family: var(--mg-font-body);
}

.closing-cta h2 {
    min-width: 0;
    margin: 0;
    color: var(--mg-on-teal);
    font-family: var(--mg-font-title);
    font-size: var(--mg-size-h2);
    font-weight: var(--mg-weight-title);
    letter-spacing: var(--mg-tracking-title);
    line-height: var(--mg-leading-tight);
    overflow-wrap: break-word;
}

.closing-cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: var(--mg-radius-md);
    background: var(--mg-paper);
    color: var(--mg-ink);
    font-size: var(--mg-size-label);
    font-weight: var(--mg-weight-label);
    text-decoration: none;
}

.closing-cta a:hover {
    background: var(--mg-wash);
    color: var(--mg-ink);
}

.closing-cta a:focus-visible {
    outline: 2px solid var(--mg-focus-on-dark);
    outline-offset: 3px;
}
