/* ==========================================================================
   Blog Archive — Card grid for category & date archives
   Theme: ALONSO-Art · Dark/Light compatible

   © 2025 ALONSO-Art — A WordPress Theme Developed and Designed by DESiGNiA Web
   @version 1.0.4
   @author  DESiGNiA Web — https://designiawebspain.com/
   ========================================================================== */

/* --- Header --- */
.aa-archive-header {
    text-align: center;
}

/* --- Title --- */
.aa-archive-title {
    font-family: var(--wp--preset--font-family--heading);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 300;
    font-style: normal;
    line-height: 1.15;
    text-align: center;
    letter-spacing: -0.01em;
    margin: 0 0 0.75rem;
    color: var(--aa-text-primary);
}

/* --- Separator between title & subtitle --- */
.aa-archive-separator {
    max-width: 120px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    border: none !important;
    height: 1px !important;
    opacity: 0.6;
}

/* --- Subtitle — both templates produce <h4> via .aa-archive-subtitle --- */
/* Font-size references theme.json preset var (medium = 0.9375rem–1rem fluid) */
/* Font-family + weight + line-height inherited from theme.json h4/heading element */
.aa-archive-subtitle,
.aa-archive-header .taxonomy-description {
    margin-top: 0;
    margin-bottom: 0;
}

.aa-archive-header h4,
.aa-archive-header .taxonomy-description h4 {
    margin: 0;
    font-size: var(--wp--preset--font-size--medium);
}

/* --- Grid --- */
.aa-archive-grid {
    gap: clamp(1.5rem, 3vw, 2rem) !important;
}

.aa-archive-grid.is-layout-grid > * {
    display: flex;
}

/* --- Card --- */
.aa-archive-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--aa-bg-card);
    border: 1px solid var(--aa-border);
    border-radius: var(--aa-radius-lg, 6px);
    overflow: hidden;
    transition:
        box-shadow var(--aa-transition),
        border-color var(--aa-transition);
    position: relative;
}

.aa-archive-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--aa-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.aa-archive-card:hover {
    box-shadow: var(--aa-shadow);
    border-color: var(--aa-border-hover);
}

.aa-archive-card:hover::after {
    transform: scaleX(1);
}

/* --- Card image: 1:1 --- */
.aa-archive-card .wp-block-post-featured-image {
    overflow: hidden;
    margin: 0;
}

.aa-archive-card .wp-block-post-featured-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.aa-archive-card:hover .wp-block-post-featured-image img:not(.scp-watermark-img) {
    transform: scale(1.05);
}

/* --- Card body --- */
.aa-archive-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aa-archive-card__body .wp-block-post-title {
    margin: 0;
}

.aa-archive-card__body .wp-block-post-title a {
    color: var(--aa-text-primary);
    text-decoration: none;
    transition: color var(--aa-transition);
}

.aa-archive-card__body .wp-block-post-title a:hover {
    color: var(--aa-accent);
}

.aa-archive-card__body .wp-block-post-excerpt {
    margin: 0;
}

.aa-archive-card__body .wp-block-post-excerpt__excerpt {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Card placeholder for missing featured images --- */
.aa-archive-card .wp-block-post-featured-image a:has(.aa-artwork-placeholder) {
    display: block;
    width: 100%;
}

.aa-archive-card .aa-artwork-placeholder {
    aspect-ratio: 1 / 1;
    border-radius: var(--aa-radius-lg, 6px) var(--aa-radius-lg, 6px) 0 0;
}

.aa-archive-card:hover .aa-artwork-placeholder {
    border-color: var(--aa-border-hover);
}

.aa-archive-card:hover .aa-artwork-placeholder__icon {
    opacity: 0.45;
}

.aa-archive-card:hover .aa-artwork-placeholder__passepartout {
    opacity: 0.2;
}

/* --- Card footer --- */
.aa-archive-card__footer {
    margin-top: auto;
    border-top: none !important;
}

.aa-archive-card__footer .wp-block-read-more {
    text-decoration: none;
    transition: color var(--aa-transition);
}

.aa-archive-card__footer .wp-block-read-more:hover {
    color: var(--aa-accent-hover) !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .aa-archive-grid {
        columns: 1 !important;
    }

    .aa-archive-grid.is-layout-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .aa-archive-grid.is-layout-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================================================
   Author Archive — Profile header
   ========================================================================== */

.aa-author-header {
    padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem) 0;
    text-align: center;
}

.aa-author-header__profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 560px;
    margin: 0 auto;
}

/* Avatar */
.aa-author-header__avatar-wrap {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--aa-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: border-color var(--aa-transition);
}

.aa-author-header__avatar-wrap:hover {
    border-color: var(--aa-accent);
}

.aa-author-header__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Name */
.aa-author-header__name {
    font-family: var(--wp--preset--font-family--body);
    font-size: clamp(1.75rem, 4vw, 2.25rem) !important;
    font-weight: 500 !important;
    font-style: normal !important;
    line-height: 1.2;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    margin: 0.5rem 0 0;
    color: var(--aa-text-secondary);
}

/* Bio */
.aa-author-header__bio {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--aa-text-secondary);
    margin: 0;
    max-width: 480px;
}

/* Website */
.aa-author-header__website {
    font-size: 0.8125rem;
    color: var(--aa-accent);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color var(--aa-transition);
}

.aa-author-header__website:hover {
    color: var(--aa-accent-hover);
}

/* Social icons */
.aa-author-header__social {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.aa-author-header__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    overflow: hidden;
    flex-shrink: 0;
    color: var(--aa-text-muted);
    transition: color var(--aa-transition);
}

.aa-author-header__icon:hover {
    color: var(--aa-accent);
}

.aa-author-header__icon svg {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    flex-shrink: 0;
    display: block;
}

/* Post count */
.aa-author-header__count {
    font-size: var(--wp--preset--font-size--small);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--aa-text-primary);
    margin-top: 0.25rem;
}

/* Separator */
.aa-author-header__separator {
    width: 100%;
    max-width: 120px;
    height: 1px;
    border: none;
    background: var(--aa-accent);
    opacity: 0.5;
    margin: clamp(1.5rem, 3vw, 2.5rem) auto clamp(2rem, 4vw, 3.5rem);
}
