/* WritingLaw Author Box - Frontend Styles */

:root {
    --wl-primary: #008080;
    --wl-primary-dark: #006666;
    --wl-primary-light: #00a3a3;
    --wl-text-primary: #1f2937;
    --wl-text-secondary: #6b7280;
    --wl-text-light: #9ca3af;
    --wl-border: #e5e7eb;
    --wl-bg-light: #f9fafb;
    --wl-bg-lighter: #f3f4f6;
    --wl-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --wl-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --wl-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --wl-radius: 8px;
    --wl-radius-lg: 12px;
    --wl-transition: all 0.3s ease;
    --wl-bg-color: #ffffff;
    --wl-text-color: #000000;
}

/* Container */
.wl-author-boxes-container {
    margin: 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Container query for responsive design */
    container-type: inline-size;
}

/* Author Box Base */
.wl-author-box {
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 24px;
    align-items: flex-start;
    box-shadow: var(--wl-shadow);
    transition: var(--wl-transition);
    /* Performance: prevent layout recalculation */
    contain: layout style paint;
    /* Smooth GPU acceleration for hover state */
    will-change: box-shadow, border-color;
}

.wl-author-box:hover {
    box-shadow: var(--wl-shadow-lg);
    border-color: var(--wl-primary-light);
}

/* Profile Image */
.wl-author-box-profile {
    display: flex;
    justify-content: center;
}

.wl-author-box-image-link {
    display: inline-block;
    border-radius: 50%;
    overflow: hidden;
    width: 100px;
    height: 100px;
    transition: var(--wl-transition);
    flex-shrink: 0;
    /* Default style is ring */
    border: 3px solid var(--wl-primary);
}

.wl-author-box-image-link:hover {
    transform: scale(1.05);
}

/* Image Style Variations */
.wl-img-style-ring {
    border: 3px solid var(--wl-primary);
}

.wl-img-style-ring:hover {
    border-color: var(--wl-primary-dark);
}

.wl-img-style-shadow {
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wl-img-style-shadow:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.wl-img-style-none {
    border: none !important;
    box-shadow: none;
}

.wl-author-box-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Performance optimization */
    contain: content;
    /* Prevent layout shift */
    aspect-ratio: 1 / 1;
}

/* Content Section */
.wl-author-box-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.wl-author-box-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.wl-author-box-header {
    margin-bottom: 8px;
}

.wl-author-box-name {
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

.wl-author-box-name a {
    color: inherit;
    text-decoration: none;
    transition: color var(--wl-transition);
    border-bottom: 2px solid transparent;
    transition: var(--wl-transition);
}

.wl-author-box-name a:hover {
    color: var(--wl-primary);
    border-bottom-color: var(--wl-primary);
}

.wl-author-box-title {
    margin: 4px 0 0 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

.wl-author-box-bio {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Social Links */
.wl-author-box-social {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.wl-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--wl-bg-light);
    border: 1px solid var(--wl-border);
    border-radius: 50%;
    color: var(--wl-text-secondary);
    text-decoration: none;
    transition: var(--wl-transition);
    font-size: 16px;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
}

.wl-social-link i {
    font-style: normal;
    font-weight: normal;
}

.wl-social-link:hover {
    background: var(--wl-primary);
    border-color: var(--wl-primary);
    color: white;
    transform: translateY(-2px);
}

/* Elegant Theme */
.wl-author-box.elegant-theme {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 32px;
}

.wl-author-box.elegant-theme:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* Responsive Design - Below 768px switch to vertical layout */
@media (max-width: 768px) {
    .wl-author-box {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 20px !important;
    }

    .wl-author-box-profile {
        display: flex !important;
        justify-content: center !important;
        margin-bottom: 8px !important;
        width: 100% !important;
    }

    .wl-author-box-image-link {
        width: 70px !important;
        height: 70px !important;
    }

    .wl-author-box-header {
        text-align: center !important;
        width: 100% !important;
    }

    .wl-author-box-name {
        font-size: calc(1em * 0.85) !important;
    }

    .wl-author-box-title {
        text-align: center !important;
    }

    .wl-author-box-label {
        text-align: center !important;
    }

    .wl-author-box-content {
        width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .wl-author-box-bio {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        max-width: 100% !important;
    }

    .wl-author-box-social {
        gap: 8px !important;
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    .wl-social-link {
        width: 32px !important;
        height: 32px !important;
    }
}

/* Container Query - More reliable than media query for responsive author box */
/* Applies when the author box container is narrower than 520px */
@container (max-width: 520px) {
    .wl-author-box {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 16px !important;
        display: grid !important;
    }

    .wl-author-box-profile {
        display: flex !important;
        justify-content: center !important;
        margin-bottom: 8px !important;
        width: 100% !important;
    }

    .wl-author-box-image-link {
        width: 70px !important;
        height: 70px !important;
    }

    .wl-author-box-header {
        text-align: center !important;
        width: 100% !important;
    }

    .wl-author-box-name {
        font-size: calc(1em * 0.85) !important;
    }

    .wl-author-box-title {
        text-align: center !important;
    }

    .wl-author-box-label {
        font-size: 11px !important;
        text-align: center !important;
    }

    .wl-author-box-content {
        width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .wl-author-box-bio {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        max-width: 100% !important;
    }

    .wl-author-box-social {
        gap: 8px !important;
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    .wl-social-link {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .wl-author-box,
    .wl-author-box-image-link,
    .wl-author-box-name a,
    .wl-social-link {
        transition: none;
    }
}

/* Print styles */
@media print {
    .wl-author-boxes-container {
        break-inside: avoid;
    }

    .wl-social-link {
        display: none;
    }
}
