/*
 * Articles list (services/teleconsultation/front/articles.php).
 * Same palette and type as the home and download pages: blues #2563eb / #1e40af,
 * gradient #667eea → #764ba2, Inter (IBM Plex Sans Arabic for Arabic).
 * articles.css stays for article-detail.php.
 */

:root {
    --blue: #2563eb;
    --blue-dark: #1e40af;
    --grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-blue: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --ink: #0f172a;
    --text: #1f2937;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.08);
    --line-blue: rgba(37, 99, 235, 0.14);
    --surface: #f8fafc;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --radius-lg: 24px;
    --radius-md: 18px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -16px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.04), 0 28px 56px -24px rgba(37, 99, 235, 0.35);
    --ring: var(--blue);
    /* per content type */
    --c-article: #2563eb;
    --c-event: #d97706;
    --c-story: #db2777;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
    scroll-padding-top: calc(var(--nav-offset, 4rem) + 5rem);
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    color: var(--text);
    background: #ffffff;
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

[lang="ar"] body {
    font-family: 'IBM Plex Sans Arabic', 'Inter', 'Segoe UI', Tahoma, sans-serif;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3, p {
    margin: 0;
}

[hidden] {
    display: none !important;
}

.wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding-inline: var(--gutter);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: fixed;
    top: 10px;
    inset-inline-start: 10px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--ink);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: none;
}

/* ---------------------------------------------------------------- Focus */
:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 3px;
}

.hero,
.cta-band,
.site-foot {
    --ring: #ffffff;
}

.hero .search {
    --ring: var(--blue);
}

.navbar .nav-cta:focus-visible {
    outline-color: var(--blue);
}

#results:focus {
    outline: none;
}

/* --------------------------------------------------------------- Hero */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #ffffff;
    background: var(--grad);
    padding: calc(var(--nav-offset, 4rem) + clamp(2.5rem, 7vw, 4.5rem)) 0 clamp(3rem, 7vw, 4.75rem);
    text-align: center;
}

.hero-light {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.hero-light span {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
}

.hero-light span:nth-child(1) {
    width: 42vmax;
    height: 42vmax;
    left: -14vmax;
    top: -20vmax;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.9), transparent 65%);
    animation: drift-a 30s ease-in-out infinite alternate;
}

.hero-light span:nth-child(2) {
    width: 36vmax;
    height: 36vmax;
    right: -12vmax;
    bottom: -22vmax;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.8), transparent 65%);
    animation: drift-b 36s ease-in-out infinite alternate;
}

/* faint dotted texture, like paper */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

@keyframes drift-a {
    to { transform: translate(12vmax, 8vmax) scale(1.15); }
}

@keyframes drift-b {
    to { transform: translate(-10vmax, -8vmax) scale(1.2); }
}

.hero-inner {
    max-width: 860px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    margin-bottom: 1.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.hero h1 {
    font-size: clamp(2.1rem, 1.1rem + 3.6vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 800;
    text-wrap: balance;
}

[lang="ar"] .hero h1 {
    letter-spacing: 0;
    line-height: 1.3;
}

.hero .lead {
    margin: 1.1rem auto 0;
    max-width: 36em;
    font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    text-wrap: pretty;
}

/* Search */
.search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 640px;
    margin: 2rem auto 0;
    padding: 6px;
    padding-inline-start: 52px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 24px 50px -22px rgba(15, 23, 42, 0.6), 0 0 0 6px rgba(255, 255, 255, 0.14);
    transition: box-shadow 0.3s ease;
}

.search:focus-within {
    box-shadow: 0 24px 50px -22px rgba(15, 23, 42, 0.6), 0 0 0 6px rgba(255, 255, 255, 0.32);
}

.search-icon {
    position: absolute;
    inset-inline-start: 22px;
    color: var(--muted);
    font-size: 1.05rem;
    pointer-events: none;
}

.search input {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    outline: none;
}

.search input::placeholder {
    color: #94a3b8;
}

.search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.search input:focus-visible {
    outline: none;
}

.search-clear {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-inline-end: 6px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-clear:hover {
    background: #e2e8f0;
    color: var(--ink);
}

.search-go {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--grad-blue);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
    box-shadow: 0 10px 22px -12px rgba(37, 99, 235, 0.9);
}

.search-go:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -12px rgba(37, 99, 235, 1);
}

[dir="rtl"] .search-go i,
[dir="rtl"] .read-more i {
    transform: scaleX(-1);
}

.hero-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 1.6rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.93rem;
    color: rgba(255, 255, 255, 0.85);
}

.hero-stats strong {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.hero-stats li + li {
    position: relative;
}

.hero-stats li + li::before {
    content: "";
    position: absolute;
    inset-inline-start: -16px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%);
}

/* ------------------------------------------------------- Filter bar */
.filterbar {
    position: sticky;
    top: var(--nav-offset, 4rem);
    z-index: 900;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.filterbar.is-stuck {
    border-bottom-color: var(--line);
    box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.45);
}

.filterbar-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-block: 16px 14px;
}

/* type: segmented control */
.tabs {
    display: flex;
    gap: 4px;
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    padding: 5px;
    border-radius: 16px;
    background: #eef2ff;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar,
.chips::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    color: #475569;
    font-size: 0.93rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.tab i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.tab:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.6);
}

.tab.is-active {
    background: #ffffff;
    color: var(--blue-dark);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px -8px rgba(37, 99, 235, 0.45);
}

.tab.is-active i {
    opacity: 1;
}

.tab-count {
    min-width: 24px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.tab.is-active .tab-count {
    background: var(--blue);
    color: #ffffff;
}

/* categories: one scrollable line with soft edges */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 2px 4px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    padding-inline: 18px;
}

/* centred when everything fits */
.chips > :first-child {
    margin-inline-start: auto;
}

.chips > :last-child {
    margin-inline-end: auto;
}

.chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: #475569;
    font-size: 0.87rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.chip:hover {
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--blue-dark);
}

.chip.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #ffffff;
}

/* ---------------------------------------------------------- Results */
.results {
    padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(4rem, 8vw, 6rem);
    background:
        radial-gradient(1200px 400px at 50% 0, rgba(238, 242, 255, 0.9), transparent 70%),
        #ffffff;
    min-height: 40vh;
}

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 1.25rem;
}

.results-count {
    color: var(--muted);
    font-size: 0.95rem;
}

.results-count strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.reset {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 2px;
    color: var(--blue);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.reset:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ------------------------------------------------------ Media block */
.media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #eef2ff;
}

.media-ph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 2.6rem;
    background: var(--grad);
}

.media-ph::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 18px 18px;
}

.media-ph i {
    position: relative;
    filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.25));
}

.media.t-event .media-ph {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.media.t-story .media-ph {
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
}

.media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease);
}

.type-badge {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--c-article);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 16px -8px rgba(15, 23, 42, 0.5);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.type-badge.t-event {
    color: var(--c-event);
}

.type-badge.t-story {
    color: var(--c-story);
}

/* ------------------------------------------------------------- Meta */
/* dots sit in the gap; a dot that would start a wrapped line falls
   outside the box and is clipped */
.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 17px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
}

.meta > * {
    position: relative;
    white-space: nowrap;
}

.meta > * + *::before {
    content: "·";
    position: absolute;
    inset-inline-start: -11px;
    color: #cbd5e1;
}

.meta-cat {
    color: var(--blue-dark);
    font-weight: 600;
}

/* ----------------------------------------------------------- Author */
.author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.avatar {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--grad-blue);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.author-name {
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-role {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* the whole card is the link (title link stretched over it) */
.card-link {
    color: inherit;
    text-decoration: none;
}

.card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--radius-lg);
}

.card-link:focus-visible {
    outline: none;
}

.card-link:focus-visible::after {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

/* -------------------------------------------------------- Lead story */
.lead-card {
    position: relative;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    border-radius: 28px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.4s ease, transform 0.4s var(--ease);
}

.lead-card .media {
    aspect-ratio: auto;
    min-height: 340px;
}

.lead-card .media-ph {
    font-size: 4rem;
}

.lead-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(1.5rem, 3.5vw, 2.75rem);
}

.lead-flag {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.8rem;
    font-weight: 700;
}

.lead-title {
    font-size: clamp(1.45rem, 1.05rem + 1.4vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-wrap: balance;
}

[lang="ar"] .lead-title {
    letter-spacing: 0;
    line-height: 1.45;
}

.lead-excerpt {
    color: #475569;
    font-size: 1.02rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lead-foot {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    transition: gap 0.3s var(--ease), background-color 0.3s ease;
}

.lead-card:hover {
    box-shadow: var(--shadow-lg);
}

.lead-card:hover .media img {
    transform: scale(1.04);
}

.lead-card:hover .read-more {
    gap: 14px;
    background: var(--blue);
}

/* -------------------------------------------------------------- Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2.4vw, 1.75rem);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s var(--ease), box-shadow 0.4s ease, border-color 0.4s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--line-blue);
    box-shadow: var(--shadow-lg);
}

.card:hover .media img {
    transform: scale(1.06);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px 20px;
}

.card-title {
    font-size: 1.14rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

[lang="ar"] .card-title {
    letter-spacing: 0;
    line-height: 1.55;
}

.card:hover .card-title {
    color: var(--blue-dark);
}

.card-excerpt {
    color: var(--muted);
    font-size: 0.93rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 51px;
}

.foot-end {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-inline-start: auto;
}

.read-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.star {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fef3c7;
    color: #d97706;
    font-size: 0.8rem;
}

/* entrance, staggered inside each batch */
.js .card.is-in,
.js .lead-card {
    animation: card-in 0.6s var(--ease) backwards;
    animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- States */
.state {
    max-width: 480px;
    margin: clamp(1.5rem, 5vw, 3.5rem) auto;
    text-align: center;
}

.state-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 1.25rem;
    border-radius: 24px;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: var(--blue);
    background: #eef2ff;
    box-shadow: inset 0 0 0 1px var(--line-blue);
}

.state-icon.is-warn {
    color: #d97706;
    background: #fffbeb;
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.2);
}

.state h3 {
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1.3;
}

.state p {
    margin-top: 0.5rem;
    color: var(--muted);
}

.state .btn {
    margin-top: 1.5rem;
}

/* ---------------------------------------------------------- Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 24px;
    border-radius: 999px;
    border: 0;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--grad-blue);
    color: #ffffff;
    box-shadow: 0 12px 26px -14px rgba(37, 99, 235, 0.95);
}

.btn-ghost {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
    border-color: rgba(37, 99, 235, 0.4);
}

.btn-light {
    background: #ffffff;
    color: var(--ink);
    box-shadow: 0 16px 34px -16px rgba(15, 23, 42, 0.6);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: #ffffff;
}

.more {
    display: flex;
    justify-content: center;
    margin-top: clamp(2rem, 4vw, 2.75rem);
}

/* ------------------------------------------------------ CTA band */
.cta-band {
    width: calc(min(1180px, 100%) - 2 * var(--gutter));
    margin: 0 auto clamp(3rem, 7vw, 5rem);
    border-radius: 32px;
    padding: clamp(2rem, 5vw, 3.25rem);
    background: var(--grad);
    color: #ffffff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.cta-band::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    inset-inline-end: -100px;
    top: -140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 65%);
    z-index: -1;
}

.cta-band h2 {
    font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.cta-band p {
    margin-top: 0.5rem;
    max-width: 34em;
    color: rgba(255, 255, 255, 0.88);
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ------------------------------------------------------------ Footer */
.site-foot {
    background: #1f2937;
    color: #cbd5e1;
    padding: 1.75rem 0;
    font-size: 0.9rem;
}

.site-foot .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.site-foot a {
    color: #e2e8f0;
    text-decoration: none;
}

.site-foot a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.site-foot nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

/* ---------------------------------------------------- Hero entrance */
.hero .enter {
    animation: rise 1s var(--ease) backwards;
    animation-delay: var(--d, 0s);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------- Responsive */
@media (max-width: 1023px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .lead-card {
        grid-template-columns: 1fr;
    }

    .lead-card .media {
        aspect-ratio: 16 / 9;
        min-height: 0;
    }

    .cta-band {
        justify-content: center;
        text-align: center;
    }

    .cta-band p {
        margin-inline: auto;
    }

    .cta-actions {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .search {
        padding-inline-start: 44px;
    }

    .search-icon {
        inset-inline-start: 18px;
    }

    /* the icon-only button keeps the field wide */
    .search-go {
        width: 48px;
        padding: 0;
        justify-content: center;
    }

    .search-go span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .tabs {
        width: 100%;
    }

    .tab {
        flex: 1 0 auto;
        justify-content: center;
        padding: 0 12px;
    }

    .tab i {
        display: none;
    }

    /* four tabs must fit a 360px phone: only the active one keeps its count */
    .tab {
        gap: 6px;
        padding: 0 10px;
        font-size: 0.88rem;
    }

    .tab:not(.is-active) .tab-count {
        display: none;
    }
}

@media (max-width: 400px) {
    .tab {
        padding: 0 8px;
        font-size: 0.85rem;
    }

    .tab-count {
        display: none;
    }

    .filterbar-inner {
        padding-block: 12px 10px;
        gap: 10px;
    }

    .chips {
        margin-inline: calc(-1 * var(--gutter));
        padding-inline: var(--gutter);
    }

    .lead-foot .read-more {
        display: none;
    }

    .cta-actions,
    .cta-actions .btn {
        width: 100%;
    }

    .site-foot .wrap {
        justify-content: center;
        text-align: center;
    }
}

/* ---------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-light span,
    .hero .enter,
    .js .card.is-in,
    .js .lead-card {
        animation: none !important;
    }

    .card:hover,
    .btn:hover,
    .search-go:hover {
        transform: none;
    }

    .card:hover .media img,
    .lead-card:hover .media img {
        transform: none;
    }
}
