/* ==========================================================================
   Shortcodes: [uag_editorial_authors] & [uag_author_profile]
   ========================================================================== */

/* --- Authors Carousel & Search --- */
.uag-authors-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.uag-authors-search-box {
    position: relative;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    padding: 5px 20px;
    border: 1px solid #eee;
    transition: box-shadow 0.3s, border-color 0.3s;
    box-sizing: border-box;
}

.uag-authors-search-box:focus-within {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #ddd;
}

.uag-authors-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 10px 5px;
    margin: 0;
    font-size: 16px;
    width: 100%;
    flex: 1;
    outline: none;
    color: #333;
    appearance: none;
    border-radius: 0;
}

.uag-search-clear {
    background: #f0f0f0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #888;
    line-height: 1 !important;
    display: none;
    margin-left: 10px;
    transition: all 0.2s;
    flex-shrink: 0;
    min-width: 28px;
}

.uag-search-clear:hover {
    background: #e0e0e0;
    color: #d32f2f;
}

.uag-authors-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.uag-author-grid-item,
a.uag-author-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.uag-author-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.uag-author-grid-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    background-color: #eee;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.uag-author-grid-img-fallback {
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
}

.uag-author-grid-item.hidden {
    display: none;
}

.uag-authors-carousel {
    position: relative;
    overflow: hidden;
    padding: 0 40px;
}

.uag-authors-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

.uag-author-slide {
    flex: 0 0 auto;
    box-sizing: border-box;
    padding: 0 10px;
}

.uag-author-card,
a.uag-author-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background-color: #eee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: block;
}

.uag-author-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.uag-author-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ccc;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
}

.uag-author-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
    padding: 40px 15px 15px 15px;
    box-sizing: border-box;
}

.uag-author-name-overlay h4 {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    text-align: center;
}

.uag-ac-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
    font-size: 18px;
    color: #333;
}

.uag-ac-btn:hover {
    background: #fff;
    color: #000;
}

.uag-ac-prev {
    left: 0;
}

.uag-ac-next {
    right: 0;
}

/* --- Single Author Profile --- */
.uag-author-profile-container {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.uag-author-header {
    text-align: center;
    margin-bottom: 50px;
}

.uag-author-title {
    color: var(--uag-primary, rgb(121, 36, 47));
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
    position: relative;
    display: inline-block;
}

.uag-author-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--uag-primary, rgb(121, 36, 47));
    margin: 15px auto 0;
}

.uag-author-content {
    overflow: hidden;
}

.uag-author-bio {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    text-align: justify;
}

.uag-author-bio p {
    margin-bottom: 20px;
}

.uag-author-image-wrapper {
    width: 100%;
    max-width: 350px;
    margin: 0 auto 20px;
}

.uag-author-image {
    width: 100%;
    height: auto;
    display: block;
}

@media (min-width: 768px) {
    .uag-author-content {
        overflow: visible;
    }

    .uag-author-content::after {
        content: '';
        display: table;
        clear: both;
    }

    .uag-author-image-wrapper {
        float: right;
        margin: 4px 0 20px 40px;
    }
}
