/* Shared styles for the announcement card (delivery/announcement_card.html).
   Loaded into the Wagtail admin via the delivery insert_global_admin_css hook. */

.announcement-card {
    --accent: #1D9E75;
    /* Lift the card off the page: mixing the page surface toward the
       text color lightens it on dark themes and darkens it on light,
       giving consistent contrast either way. */
    background: rgba(127, 127, 127, 0.07);
    background: color-mix(
        in srgb,
        var(--w-color-surface-page) 92%,
        var(--w-color-text-context) 8%
    );
    border: 1px solid var(--w-color-border-furniture-more-contrast);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.announcement-card[data-type="FEATURE"]     { --accent: #1D9E75; }
.announcement-card[data-type="IMPROVEMENT"] { --accent: #3B82F6; }
.announcement-card[data-type="FIX"]         { --accent: #F59E0B; }

.announcement-card__row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    list-style: none;
}
.announcement-card__row::-webkit-details-marker { display: none; }
.announcement-card__title {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.announcement-card__chip {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--accent);
    background: rgba(127, 127, 127, 0.1);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    white-space: nowrap;
    flex-shrink: 0;
}
.announcement-card__date {
    font-size: 11px;
    opacity: 0.45;
    white-space: nowrap;
    flex-shrink: 0;
}
.announcement-card__chevron {
    flex-shrink: 0;
    opacity: 0.45;
    transition: transform 0.2s ease;
}
.announcement-card[open] .announcement-card__chevron { transform: rotate(180deg); }
.announcement-card__body {
    font-size: 13px;
    line-height: 1.55;
    opacity: 0.75;
    margin-top: 10px;
}
.announcement-card__body p { margin: 0 0 8px; }
.announcement-card__body p:last-child { margin-bottom: 0; }
.announcement-card__body ul,
.announcement-card__body ol { margin: 0 0 8px 20px; }

/* Linked variant -- card is a <div>; the title is the real <a> and its
   ::after pseudo-element stretches over the whole card so the entire
   surface is clickable. Used by the What's New feed.
   (Canonical Bootstrap "stretched-link" pattern -- robust across
   browsers and screen readers.) */
.announcement-card--linked {
    position: relative;
    margin-bottom: 12px;
    transition: transform 0.12s ease, box-shadow 0.12s ease,
                border-color 0.12s ease;
}
.announcement-card--linked:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.announcement-card__title-link {
    /* Inherit the same look as a plain title span, but stay semantically
       an anchor. The flex/ellipsis behaviour matches .announcement-card__title. */
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    text-decoration: none;
}
.announcement-card__title-link:hover { color: var(--accent); }
.announcement-card__title-link::after {
    /* The real click target: an invisible overlay covering the card.
       Anywhere on the card routes to this link. */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 1;
}
.announcement-card__title-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.announcement-card__summary {
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.7;
    margin: 8px 0 0;
    /* Clamp the teaser to two lines so cards stay the same height. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Narrow screens: hide the date so the chip, title and chevron fit on
   one line. The title keeps its flex/ellipsis behaviour and truncates
   gracefully if long, instead of collapsing to zero width. */
@media (max-width: 600px) {
    .announcement-card__date { display: none; }
}
