/*
 * Posts archive Style 4: modern card grid with an overlapping content panel.
 * Selectors stay at or below the specificity of the Customizer archive typography rules
 * (.post-index article h3, .post-index article .excerpt p, .post-index article .meta ...) so those options still apply.
 */
.archive-template-4 {
    --ah-a4-radius: calc(var(--ahura-content-radius, 10px) + 8px);
    --ah-a4-accent: var(--ahura-theme-primary, #3f3492);
}

.archive-template-4 .cat-heading {
    text-align: center;
    margin: 24px 0 8px;
}

.archive-template-4 .cat-heading h1 {
    position: relative;
    display: inline-block;
    padding-bottom: 14px;
}

.archive-template-4 .cat-heading h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 48px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--ah-a4-accent), color-mix(in srgb, var(--ah-a4-accent) 35%, transparent));
    transform: translateX(-50%);
}

.archive-template-4 .cat-heading p {
    color: var(--ahura-c-text-secondary);
    margin-top: 13px;
}

.archive-template-4 .archive4-grid {
    margin-top: 32px;
}

.archive-template-4 .archive4-row {
    row-gap: 32px;
}

.archive4-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}

.archive4-card:hover {
    transform: translateY(-6px);
}

/* Media */
.archive4-card .archive4-media {
    position: relative;
    flex: 0 0 auto;
}

.archive4-card .archive4-thumb {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    height: var(--ahura-archive-thumb-height, auto);
    overflow: hidden;
    border-radius: var(--ah-a4-radius);
    background-color: var(--ahura-c-bg-secondary, #eef0f3);
    isolation: isolate;
}

.archive4-card .archive4-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 12, 20, .28) 0%, rgba(10, 12, 20, 0) 34%, rgba(10, 12, 20, 0) 62%, rgba(10, 12, 20, .22) 100%);
    pointer-events: none;
}

.archive4-card .archive4-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.archive4-card:hover .archive4-thumb img {
    transform: scale(1.07);
}

.archive4-card .archive4-badges {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 60%;
    pointer-events: none;
}

.archive4-card .archive4-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 12px;
    line-height: 1.7;
    color: #1f2328;
    background-color: rgba(255, 255, 255, .9);
    border-radius: 999px;
}

.archive4-card .archive4-badge img {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.archive4-card .archive4-badge-new {
    color: #fff;
    background-color: #e5383b;
}

.archive4-card .archive4-category {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    z-index: 2;
    max-width: calc(100% - 28px);
    padding: 5px 13px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.6;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
    background-color: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    transition: background-color .2s ease;
}

.archive4-card .archive4-category:hover {
    color: #fff;
    background-color: var(--ah-a4-accent);
    border-color: transparent;
}

/* Panel */
.archive4-card .archive4-panel {
    position: relative;
    z-index: 3;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    margin: -44px 14px 0;
    padding: 20px 20px 16px;
    background-color: var(--ahura-c-bg-primary, #fff);
    border: 1px solid color-mix(in srgb, var(--ahura-c-border-primary, #ccc) 35%, transparent);
    border-radius: calc(var(--ah-a4-radius) - 4px);
    box-shadow: 0 14px 34px -12px rgba(15, 23, 42, .18);
    transition: box-shadow .3s ease;
}

.archive4-card:hover .archive4-panel {
    box-shadow: 0 22px 44px -14px rgba(15, 23, 42, .28);
}

.archive4-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.75;
    color: var(--ahura-c-text-primary, #191919);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive4-card h3 a {
    color: inherit;
    transition: color .2s ease;
}

.archive4-card:hover h3 a {
    color: var(--ah-a4-accent);
}

.archive4-card .excerpt p {
    margin: 0;
    font-size: 14px;
    line-height: 1.9;
    text-align: start;
    color: var(--ahura-c-text-secondary, #737374);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.archive4-card .archive4-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px dashed color-mix(in srgb, var(--ahura-c-border-primary, #ccc) 70%, transparent);
}

.archive4-card .meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.archive4-card .post-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ahura-c-text-primary, #191919);
}

.archive4-card .post-author img {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--ahura-c-bg-primary, #fff), 0 0 0 3px color-mix(in srgb, var(--ah-a4-accent) 40%, transparent);
}

.archive4-card .post-meta {
    font-size: 12px;
    color: var(--ahura-c-text-secondary, #737374);
}

.archive4-card .post-author + .post-meta {
    padding-inline-start: 38px;
}

.archive4-card .archive4-more {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-inline-start: auto;
    color: var(--ah-a4-accent);
    background-color: color-mix(in srgb, var(--ah-a4-accent) 10%, transparent);
    border-radius: 50%;
    transition: background-color .25s ease, color .25s ease, transform .25s ease;
}

.archive4-card .archive4-more svg {
    width: 18px;
    height: 18px;
}

.archive4-card:hover .archive4-more,
.archive4-card .archive4-more:focus-visible {
    color: #fff;
    background-color: var(--ah-a4-accent);
    transform: translateX(-3px);
}

.ltr .archive4-card:hover .archive4-more,
.ltr .archive4-card .archive4-more:focus-visible {
    transform: translateX(3px);
}

.archive4-card .archive4-more .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .archive4-card,
    .archive4-card .archive4-thumb img,
    .archive4-card .archive4-more,
    .archive4-card h3 a {
        transition: none;
    }

    .archive4-card:hover,
    .archive4-card:hover .archive4-thumb img,
    .archive4-card:hover .archive4-more {
        transform: none;
    }
}
