/* ==========================================================================
   blog-cards.css — Blog teaser card grid styling
   ========================================================================== */

/* ---------- Card Grid ---------- */
.ha-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .ha-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .ha-card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* ---------- Card ---------- */
/* Modern look: WHITE cards on a light-gray archive background (inverted from the
   old gray-card-on-white). A faint shadow gives the white cards definition. */
.ha-card {
    position: relative;   /* anchor for the stretched link overlay */
    background-color: #ffffff;
    border-radius: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(20, 56, 82, 0.06), 0 1px 2px rgba(20, 56, 82, 0.04);
}

/* No card lift on hover — only the image scales and the CTA arrow slides
   (see .ha-card:hover .ha-card__image and .ha-card__cta svg below). */

/* ---------- Stretched link (whole card clickable) ----------
   One real link (the title) covers the card via ::after, so the accessible
   name is the post title — no empty/duplicate anchors. The category badge
   sits above the overlay so it stays independently clickable. */
.ha-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

/* ---------- Card Image ---------- */
.ha-card__image-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--ha-gray-200, rgb(230, 232, 235));
}

.ha-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;   /* favor the top so faces/heads aren't cropped */
    transition: transform 0.4s ease;
}

.ha-card:hover .ha-card__image {
    transform: scale(1.05);
}

.ha-card__image-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--ha-gray-200, rgb(230, 232, 235));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Card Body ---------- */
.ha-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* ---------- Category Badge ---------- */
.ha-card__badge {
    position: relative;   /* lift above the stretched-link overlay */
    z-index: 2;
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    background-color: var(--ha-blue-100, rgb(204, 237, 249));
    color: var(--ha-blue-600, rgb(46, 124, 192));  /* dark blue on light blue */
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    margin-bottom: 0.375rem;  /* tighter gap to headline */
    width: fit-content;
}

/* Hover inverts like the footer social icons */
.ha-card__badge:hover {
    background-color: var(--ha-blue-600, rgb(46, 124, 192));
    color: var(--ha-blue-100, rgb(204, 237, 249));
}

/* ---------- Card Title ---------- */
.ha-card__title {
    font-family: var(--ha-font-heading, 'Nexa', sans-serif);
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.3;
    color: var(--ha-gray-800, rgb(38, 45, 53));
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    hyphens: auto;
}

.ha-card__title a {
    color: inherit;
    text-decoration: none;
}

.ha-card:hover .ha-card__title {
    color: var(--ha-blue-500, rgb(0, 167, 225));
}

/* ---------- Card Excerpt ---------- */
.ha-card__excerpt {
    font-family: var(--ha-font-body, 'BrutalType', sans-serif);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ha-gray-600, rgb(125, 129, 134));
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* ---------- Card Footer ---------- */
.ha-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

/* ---------- Card CTA (decorative — the whole card is the link) ---------- */
.ha-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--ha-blue-500, rgb(0, 167, 225));
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    pointer-events: none;   /* never intercept the card click */
}

.ha-card:hover .ha-card__cta {
    color: var(--ha-blue-600, rgb(46, 124, 192));
}

.ha-card__cta svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s;
}

.ha-card:hover .ha-card__cta svg {
    transform: translateX(3px);
}

/* ---------- Card Date ---------- */
.ha-card__date {
    font-size: 0.75rem;
    color: var(--ha-gray-600, rgb(125, 129, 134));
    white-space: nowrap;
}

/* ---------- Blog Archive Section ---------- */
/* Light-gray band behind the white cards (inverted scheme). */
.ha-blog-archive {
    background-color: rgb(245, 246, 247);
    padding-top: 3rem;
    padding-bottom: 3.5rem;
}

/* ---------- Ajax filter swap (assets/js/blog-filter.js) ---------- */
/* The grid fades/lifts during a fetch; cards stagger back in. JS drives the
   per-card timing inline; this is the base transition + the loading guard. */
.ha-card-grid {
    transition: opacity 0.26s ease, transform 0.26s ease;
    will-change: opacity, transform;
}

.ha-card-grid.is-loading {
    pointer-events: none;
}

/* Smoother, calmer tile state changes for the filter band. */
.ha-blog-filter__tile {
    transition: background-color 0.2s ease, color 0.2s ease,
        border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .ha-card-grid,
    .ha-card-grid .ha-card,
    .ha-blog-filter__tile {
        transition: none !important;
        transform: none !important;
    }
}

/* ── Blätter-Navigation (2026-08-07) ───────────────────────────────────
 *
 * paginate_links() gibt eine <ul> aus. Ohne Styles zeigt der Browser sie als
 * Aufzählung untereinander, genau so ist sie beim Einbau der Paginierung
 * kurzzeitig live gegangen.
 *
 * Formensprache von .ha-blog-filter__tile übernommen: volle Pille, weiß,
 * 1px Rand, Text in Grau-800. Die aktive Seite kehrt das um (dunkler Grund,
 * weiße Schrift) statt das Hausblau zu verwenden — dessen Kontrast liegt bei
 * 2,75:1 und würde hier eine weitere Verletzung anlegen. So sind es 12,6:1
 * in beide Richtungen und damit AAA.
 */
.ha-blog-pagination {
    margin: 2.5rem 0 0.5rem;
}

.ha-blog-pagination:empty {
    display: none;
}

.ha-blog-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ha-blog-pagination li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ha-blog-pagination a.page-numbers,
.ha-blog-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgb(229, 231, 234);
    background: #fff;
    color: var(--ha-gray-800, rgb(38, 45, 53));
    font-family: var(--ha-font-body, 'BrutalType', sans-serif);
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ha-blog-pagination a.page-numbers:hover,
.ha-blog-pagination a.page-numbers:focus-visible {
    background: rgb(241, 242, 244);
    border-color: rgb(203, 207, 212);
}

.ha-blog-pagination a.page-numbers:focus-visible {
    outline: 2px solid var(--ha-gray-800, rgb(38, 45, 53));
    outline-offset: 2px;
}

/* Aktuelle Seite: umgekehrt, damit sie ohne Farbe erkennbar bleibt. */
.ha-blog-pagination span.page-numbers.current {
    background: var(--ha-gray-800, rgb(38, 45, 53));
    border-color: var(--ha-gray-800, rgb(38, 45, 53));
    color: #fff;
    font-weight: 700;
}

/* Auslassungspunkte sind keine Schaltfläche und sehen auch nicht so aus. */
.ha-blog-pagination span.page-numbers.dots {
    border-color: transparent;
    background: transparent;
    min-width: 1.5rem;
    padding: 0 0.25rem;
    color: var(--ha-gray-600, rgb(125, 129, 134));
}

@media (prefers-reduced-motion: reduce) {
    .ha-blog-pagination a.page-numbers {
        transition: none;
    }
}
