/* ============================================================
   LISTAGENS — categoria, tag, autor, busca e todos os artigos
   (components/archive/archive.php). Usa os tokens e peças de
   page-home.css (.ah, .ah-card, .ah-chip, .ah-btn...).
   ============================================================ */

/* ---------- Cabeçalho ---------- */

.ah-ar-hero {
    position: relative;
    padding-block: 36px 40px;
    background:
        radial-gradient(55% 90% at 90% 0%, rgba(var(--ah-accent-rgb), 0.2), transparent 70%),
        radial-gradient(35% 80% at 0% 100%, rgba(61, 226, 255, 0.09), transparent 70%);
    border-bottom: 1px solid var(--ah-line);
}

.ah-ar-hero .ah-speedlines {
    background: repeating-conic-gradient(from 0deg at 85% 30%, rgba(243, 239, 250, 0.04) 0deg 0.8deg, transparent 0.8deg 5deg);
    -webkit-mask-image: radial-gradient(closest-side at 85% 30%, transparent 25%, #000 100%);
    mask-image: radial-gradient(closest-side at 85% 30%, transparent 25%, #000 100%);
}

.ah-ar-hero-in {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ah-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ah-muted);
}

.ah-crumbs a {
    color: var(--ah-text);
    transition: color 0.2s ease;
}

.ah-crumbs a:hover {
    color: var(--ah-accent);
}

.ah-crumbs span[aria-hidden] {
    color: var(--ah-accent);
    font-weight: 700;
}

.ah-ar-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 48px;
}

.ah-ar-title-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    max-width: 820px;
}

.ah-ar-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ah-muted);
}

.ah-ar-eyebrow .ah-jp {
    padding: 4px 10px;
    letter-spacing: 0.2em;
    color: #fff;
    background: var(--ah-accent);
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.ah-ar-title {
    margin: 0;
    font-family: var(--ah-display);
    font-weight: 400;
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: var(--ah-text);
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.ah-ar-desc {
    max-width: 62ch;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(243, 239, 250, 0.8);
}

.ah-ar-desc p {
    margin: 0;
}

.ah-ar-desc p + p {
    margin-top: 10px;
}

/* Números da listagem */
.ah-ar-stats {
    display: flex;
    gap: 10px;
    margin: 0;
}

.ah-ar-stats div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 128px;
    padding: 14px 18px;
    background: rgba(22, 17, 31, 0.75);
    border: 1px solid var(--ah-line);
}

.ah-ar-stats dt {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ah-muted);
}

.ah-ar-stats dd {
    margin: 0;
    font-family: var(--ah-display);
    font-size: 26px;
    line-height: 1;
    color: var(--ah-text);
    font-variant-numeric: tabular-nums;
}

.ah-ar-stats div + div dd {
    font-family: var(--ah-body);
    font-size: 18px;
    font-weight: 700;
    line-height: 26px;
}

/* Busca grande (página de busca) */
.ah-ar-search {
    display: flex;
    gap: 10px;
    max-width: 720px;
}

.ah-ar-search input {
    flex: 1;
    min-width: 0;
    height: 52px;
    margin: 0;
    padding: 0 18px;
    font-family: var(--ah-body);
    font-size: 16px;
    color: var(--ah-text);
    background: rgba(243, 239, 250, 0.06);
    border: 1px solid var(--ah-line);
    border-radius: 0;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.ah-ar-search input::placeholder {
    color: var(--ah-muted);
}

.ah-ar-search input:focus {
    outline: none;
    border-color: var(--ah-accent);
    background: rgba(var(--ah-accent-rgb), 0.08);
}

.ah-ar-search .ah-btn {
    height: 52px;
}

/* Chip da categoria atual */
.ah-chip.is-current {
    background: var(--ah-accent);
    border-color: var(--ah-accent);
    color: #fff;
}

.ah-chip.is-current span {
    color: rgba(255, 255, 255, 0.8);
}

/* ---------- Conteúdo ---------- */

.ah-ar-body {
    margin-top: 32px;
}

.ah-ar-feature {
    min-height: 440px;
    margin-bottom: 40px;
    clip-path: polygon(0 0, calc(100% - var(--ah-cut)) 0, 100% var(--ah-cut), 100% 100%, 0 100%);
}

.ah-ar-feature .ah-latest-media::after {
    background:
        radial-gradient(rgba(13, 10, 20, 0.5) 1.1px, transparent 1.6px) 0 0 / 7px 7px,
        linear-gradient(15deg, rgba(13, 10, 20, 0.96) 15%, rgba(13, 10, 20, 0.5) 50%, rgba(13, 10, 20, 0) 80%);
}

.ah-ar-feature .ah-latest-body {
    max-width: 760px;
    padding: 40px;
    gap: 14px;
}

.ah-ar-feature .ah-latest-title {
    font-size: clamp(26px, 3.2vw, 42px);
}

.ah-ar-feature-excerpt {
    max-width: 60ch;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(243, 239, 250, 0.82);
}

.ah-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px 22px;
}

.ah-card--grid .ah-card-media {
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

.ah-card--grid .ah-kicker {
    margin-top: 4px;
    justify-self: start;
    transition: color 0.2s ease;
}

.ah-card--grid .ah-kicker:hover {
    color: var(--ah-accent);
}

.ah-card-title {
    margin: 0;
    font-family: var(--ah-body);
    color: var(--ah-text);
}

.ah-card--grid .ah-card-title {
    -webkit-line-clamp: 3;
    font-size: 17px;
}

.ah-card--grid:hover .ah-img {
    transform: scale(1.05);
}

/* Itens que chegam pelo "Carregar mais" */
.ah-grid > .ah-card {
    animation: ah-rise 0.4s ease both;
}

@keyframes ah-rise {
    from { opacity: 0.4; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Sem resultados ---------- */

.ah-ar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 56px 20px;
    margin-bottom: 56px;
    text-align: center;
    background: var(--ah-surface);
    border: 1px dashed rgba(243, 239, 250, 0.16);
}

.ah-ar-empty-face {
    font-size: 40px;
    color: var(--ah-cyan);
}

.ah-ar-empty h2 {
    margin: 0;
    font-family: var(--ah-display);
    font-weight: 400;
    font-size: 28px;
    color: var(--ah-text);
}

.ah-ar-empty p {
    max-width: 48ch;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ah-muted);
}

/* ---------- Responsivo ---------- */

@media (max-width: 1100px) {
    .ah-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .ah-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px 16px;
    }
    .ah-ar-feature {
        min-height: 380px;
    }
}

@media (max-width: 640px) {
    .ah-ar-hero {
        padding-block: 24px 28px;
    }
    .ah-ar-stats {
        width: 100%;
    }
    .ah-ar-stats div {
        flex: 1;
        min-width: 0;
    }
    .ah-ar-search {
        flex-direction: column;
    }
    .ah-ar-search .ah-btn {
        justify-content: center;
    }
    .ah-ar-feature {
        min-height: 340px;
        --ah-cut: 18px;
    }
    .ah-ar-feature .ah-latest-body {
        padding: 22px;
    }
    .ah-ar-feature-excerpt {
        display: none;
    }
}

@media (max-width: 480px) {
    .ah-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ah-grid > .ah-card {
        animation: none;
    }
}
