/* News and other picture listings on /menu/{id} (site/menu.blade.php).
   Replaces the legacy .blog-article cards, which sat in the 1660px
   .incontainer with no gutter: the cards touched, the photos were cut to a
   strip, and the fixed text heights left holes. Here the grid owns the gaps,
   every photo keeps a 16:10 frame, and every card is the same speech bubble
   as the announcements (announcements.css): equal size, tail at lower left. */

.nws-grid {
    --nws-ink: #22222e;
    --nws-muted: #5a5a67;
    --nws-faint: #8a8a96;
    --nws-red: #E32D44;
    --nws-paper: #fff;
    --nws-well: #ececf0;

    list-style: none;
    margin: 30px 0 10px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px 32px;           /* row gap leaves room for the tail */
}

/* the card is a bubble: no overflow:hidden on it (that would clip the
   tail), so the photo rounds its own top corners, and one drop-shadow
   filter covers bubble and tail together */
.nws {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--nws-paper);
    color: var(--nws-ink);
    border-radius: 26px;
    filter: drop-shadow(0 8px 18px rgba(34, 34, 46, .07)) drop-shadow(0 1px 2px rgba(34, 34, 46, .06));
    transition: transform .2s ease, filter .2s ease;
}
.nws::before {
    content: '';
    position: absolute;
    left: 34px;
    bottom: -17px;
    width: 34px;
    height: 18px;
    background: inherit;
    clip-path: path('M0 0 H34 C24 4 14 10 4 18 C8 10 8 4 0 0 Z');
}
.nws:hover,
.nws:focus-within {
    transform: translateY(-3px);
    filter: drop-shadow(0 14px 26px rgba(34, 34, 46, .12)) drop-shadow(0 1px 2px rgba(34, 34, 46, .06));
}

.nws__cover {
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 26px 26px 0 0;
    background: var(--nws-well);
}
.nws__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.nws:hover .nws__cover img { transform: scale(1.03); }

/* no photo: the crest, small, on a quiet well — not stretched across the frame */
.nws__cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}
.nws__cover--empty img {
    width: 84px;
    height: auto;
    object-fit: contain;
    opacity: .35;
    filter: grayscale(1);
}
.nws:hover .nws__cover--empty img { transform: none; }

.nws__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 26px 24px;
}

.nws__date {
    font-size: 13px;
    color: var(--nws-faint);
    margin-bottom: 10px;
}

.nws__title {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.45;
}
.nws__title a {
    color: inherit;
    text-decoration: none;
}
.nws:hover .nws__title { color: var(--nws-red); }

/* the whole card is the link; the edit pencil (z-index 3) stays on top */
.nws__title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}
.nws__title a:focus-visible { outline: none; }
.nws:has(.nws__title a:focus-visible) {
    outline: 3px solid var(--nws-ink);
    outline-offset: 4px;
}

.nws__text {
    margin: 0 0 18px !important;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--nws-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nws__more {
    margin-top: auto;
    font-size: 14px;
    color: var(--nws-red);
}

@media (max-width: 1100px) {
    .nws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .nws-grid { grid-template-columns: 1fr; gap: 40px; margin-top: 10px; }
    .nws { border-radius: 22px; }
    .nws::before { left: 26px; }
    .nws__cover { border-radius: 22px 22px 0 0; }
    .nws__body { padding: 20px 22px 22px; }
    .nws__title { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    .nws, .nws__cover img { transition: none; }
    .nws:hover, .nws:focus-within, .nws:hover .nws__cover img { transform: none; }
}
