/**
 * Author Page Specific Styles - Enhanced with Complete Responsive Design
 * Handles the custom layout for author pages with fixed image positioning
 * MATCHES book-page.css styling and behavior
 */

/* Author Page Main Container */
.author-page-main {
    min-height: 100vh;
    background-color: #F8F9FA;
    padding: 0;
    margin: 0;
}

/* Author Page Wrapper - Enhanced for Ultra-Wide Screens */
.author-page-wrapper {
    min-width: 800px;  /* Minimum width to prevent too narrow content */
    max-width: 1400px; /* Maximum width to prevent content from spreading too much */
    margin: 0 auto;
    background-color: #F8F9FA;
    position: relative;
}

.author-content-area {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

/* Force all blocks and their contents to have light gray background */
.author-page-main .wp-block-group,
.author-page-main .wp-block-custom-author-block,
.author-page-main [class*="wp-block-"],
.author-page-main .ha-books-carousel,
.author-page-main .wp-block-ha-books-carousel,
.author-page-main .wp-block-custom-quotes,
.author-page-main .wp-block-ha-media-interviews,
.author-page-main .wp-block-custom-author-media,
.author-page-main .wp-block-custom-available-stores,
.author-page-main .wp-block-ha-books-author-biography,
.author-page-main .wp-block-custom-available-stores .store-item,
.author-page-main .wp-block-custom-available-stores .stores-container,
.author-page-main .wp-block-ha-media-interviews .media-item,
.author-page-main .wp-block-custom-author-media .media-item,
.author-page-main .wp-block-ha-books-carousel .book-item,
.author-page-main .wp-block-custom-quotes .quote-item,
.author-page-main .wp-block-ha-books-author-biography .author-bio-content,
.author-page-main .book-details,
.author-page-main .book-info,
.author-page-main .book-meta,
.author-page-main .author-info,
.author-page-main .store-link,
.author-page-main .media-content,
.author-page-main .quote-content,
.author-page-main .carousel-item,
.author-page-main .content-block,
.author-page-main .inner-block,
.author-page-main div[class*="wp-block"],
.author-page-main article,
.author-page-main section {
    background-color: #F8F9FA !important;
}

/* Ensure nested elements also get the background, but exclude images AND social icons */
.author-page-main *:not(.author-featured-image):not(.author-featured-image *):not(img):not(figure):not(.wp-block-image):not(.author-social-links):not(.author-social-links *):not(.social-links):not(.social-links *):not([class*="social"]):not([class*="social"] *) {
    background-color: #F8F9FA !important;
}

/* Specifically ensure images and their containers remain transparent */
.author-page-main .author-featured-image,
.author-page-main .author-featured-image *,
.author-page-main img,
.author-page-main figure,
.author-page-main .wp-block-image,
.author-page-main .image-container {
    background: none !important;
    background-color: transparent !important;
}

/* Override any white backgrounds that might be set elsewhere */
.author-page-main .has-white-background-color,
.author-page-main .has-background-color,
.author-page-main [style*="background-color: white"],
.author-page-main [style*="background-color: #fff"],
.author-page-main [style*="background-color: #ffffff"],
.author-page-main [style*="background: white"],
.author-page-main [style*="background: #fff"],
.author-page-main [style*="background: #ffffff"] {
    background-color: #F8F9FA !important;
}

/* Special handling for common WordPress block classes */
.author-page-main .wp-block,
.author-page-main .wp-container,
.author-page-main .wp-element,
.author-page-main .block-editor-block-list__block,
.author-page-main .wp-block-group__inner-container,
.author-page-main .wp-block-columns,
.author-page-main .wp-block-column {
    background-color: #F8F9FA !important;
}

/* ==========================================================================
   DESKTOP LAYOUT (1025px+) - Fixed Image Positioning with Ultra-Wide Support
   ========================================================================== */

.author-page-main .wp-block-custom-author-block .author-featured-image {
    position: fixed;
    top: 160px;
    right: calc((100vw - min(62vw, 1300px)) / 2 + 30px);
    transform: translateY(0);
    width: min(calc(62vw * 0.3 - 60px), 280px);
    max-width: 280px;
    min-width: 200px;
    z-index: 10;
    transition: top 0.2s ease-out;
    background: none !important;
    background-color: transparent !important;
}

/* Ensure the image itself and any container doesn't have background */
.author-page-main .wp-block-custom-author-block .author-featured-image img,
.author-page-main .wp-block-custom-author-block .author-featured-image .image-container,
.author-page-main .wp-block-custom-author-block .author-featured-image .wp-block-image,
.author-page-main .wp-block-custom-author-block .author-featured-image figure {
    background: none !important;
    background-color: transparent !important;
}

/* Make space for the fixed image in hero section content - Desktop */
.author-page-main .wp-block-custom-author-block .author-content-container {
    margin-right: min(30%, 350px);
    width: calc(100% - min(30%, 350px));
    max-width: 900px;
}

/* Apply layout styling to OTHER blocks (not hero section) - Desktop */
.author-page-main .wp-block-group > *:not(.wp-block-custom-author-block) {
    margin-right: min(30%, 350px);
    width: calc(100% - min(30%, 350px));
    max-width: 900px;
}

/* ==========================================================================
   HORIZONTAL SCROLLABLE MEDIA SECTIONS
   ========================================================================== */

.author-page-main .wp-block-ha-media-interviews,
.author-page-main .wp-block-custom-author-media,
.author-page-main .wp-block-custom-available-stores {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 20px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}

.author-page-main .wp-block-ha-media-interviews .media-interviews-container,
.author-page-main .wp-block-custom-author-media .media-container,
.author-page-main .wp-block-custom-available-stores .stores-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 25px;
    min-width: fit-content;
    padding: 0 15px;
    align-items: flex-start;
}

.author-page-main .wp-block-ha-media-interviews .media-item,
.author-page-main .wp-block-custom-author-media .media-item,
.author-page-main .wp-block-custom-available-stores .store-item {
    flex: 0 0 auto;
    min-width: 280px;
    max-width: 350px;
    scroll-snap-align: start;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Hover effects for media items */
.author-page-main .wp-block-ha-media-interviews .media-item:hover,
.author-page-main .wp-block-custom-author-media .media-item:hover,
.author-page-main .wp-block-custom-available-stores .store-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Custom scrollbar styling for media sections */
.author-page-main .wp-block-ha-media-interviews::-webkit-scrollbar,
.author-page-main .wp-block-custom-author-media::-webkit-scrollbar,
.author-page-main .wp-block-custom-available-stores::-webkit-scrollbar {
    height: 10px;
}

.author-page-main .wp-block-ha-media-interviews::-webkit-scrollbar-track,
.author-page-main .wp-block-custom-author-media::-webkit-scrollbar-track,
.author-page-main .wp-block-custom-available-stores::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 6px;
    margin: 0 15px;
}

.author-page-main .wp-block-ha-media-interviews::-webkit-scrollbar-thumb,
.author-page-main .wp-block-custom-author-media::-webkit-scrollbar-thumb,
.author-page-main .wp-block-custom-available-stores::-webkit-scrollbar-thumb {
    background: #c8c8c8;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.author-page-main .wp-block-ha-media-interviews::-webkit-scrollbar-thumb:hover,
.author-page-main .wp-block-custom-author-media::-webkit-scrollbar-thumb:hover,
.author-page-main .wp-block-custom-available-stores::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Fixed image scroll limit states */
.author-page-main .wp-block-custom-author-block .author-featured-image.fixed-top {
    top: 160px !important;
    transform: translateY(0) !important;
}

.author-page-main .wp-block-custom-author-block .author-featured-image.fixed-bottom {
    top: auto !important;
    bottom: 150px !important;
    transform: translateY(0) !important;
}

/* ==========================================================================
   ENHANCED BREAKPOINT STRATEGY - Ultra-Wide Screen Support
   ========================================================================== */

/* Extra Ultra-Wide Desktop - 2100px+ (PERFECT BEHAVIOR) */
@media (min-width: 2100px) {
    .author-page-wrapper {
        max-width: 1500px;
    }
    
    .author-page-main .wp-block-custom-author-block .author-featured-image {
        margin-left: auto !important;
        width: min(calc(55vw * 0.28), 300px);
        max-width: 300px;
    }
    
    .author-page-main .wp-block-custom-author-block .author-content-container {
        margin-right: min(28%, 205px);
        width: calc(100% - min(28%, 380px));
        max-width: 1000px;
        margin-top: 110px;
    }
    
    .author-page-main .wp-block-group > *:not(.wp-block-custom-author-block) {
        margin-right: min(28%, 380px);
        width: calc(100% - min(28%, 380px));
        max-width: 1000px;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 320px;
        max-width: 400px;
    }

    .book-display__counter {
        margin-left: 102px !important;
    }
}

/* Ultra-Wide Desktop - 1600px to 2099px (NEW - CUSTOMIZE THIS) */
@media (max-width: 2099px) and (min-width: 1600px) {
    .book-display__counter {
        margin-left: 102px !important;
    }
    .author-page-wrapper {
        max-width: 1500px;
    }
    
    .author-page-main .wp-block-custom-author-block .author-featured-image {
        position: fixed !important;
        top: 160px;
        right: calc((100vw - min(1500px, 1800px)) / 2 + 30px);
        transform: translateY(0);
        width: min(calc(62vw * 0.28), 290px);
        max-width: 290px;
        z-index: 10;
        transition: top 0.2s ease-out;
        /* CUSTOMIZE: Adjust right position and width as needed */
    }
    
    .author-page-main .wp-block-custom-author-block .author-content-container {
        margin-right: min(28%, 150px);
        width: calc(100% - min(28%, 320px));
        max-width: 1000px;
        margin-top: 110px;
        /* CUSTOMIZE: Adjust spacing for 1600-2099px range */
    }
    
    .author-page-main .wp-block-group > *:not(.wp-block-custom-author-block) {
        margin-right: min(28%, 320px);
        width: calc(100% - min(28%, 320px));
        max-width: 1000px;
        /* CUSTOMIZE: Adjust content width for 1600-2099px range */
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 320px;
        max-width: 400px;
        /* CUSTOMIZE: Adjust media item sizes for 1600-2099px range */
    }
}

/* Large Desktop - 1441px to 1599px */
@media (max-width: 1599px) and (min-width: 1441px) {
    .author-page-wrapper {
        max-width: 1400px;
    }
    
    .author-page-main .wp-block-custom-author-block .author-featured-image {
        right: calc((100vw - min(1250px, 1400px)) / 2 + 30px);
    }
    
    .author-page-main .wp-block-custom-author-block .author-content-container {
        margin-right: min(29%, 230px);
        width: calc(100% - min(29%, 360px));
        max-width: 950px;
        margin-top: 110px;
    }
    
    .author-page-main .wp-block-group > *:not(.wp-block-custom-author-block) {
        margin-right: min(29%, 360px);
        width: calc(100% - min(29%, 360px));
        max-width: 950px;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 300px;
        max-width: 380px;
    }
        .book-display__counter {
        margin-left: 55px !important;
    }
}

/* PROBLEMATIC RANGE - 1040px to 1440px - STACKED LAYOUT TO PREVENT OVERLAP */
@media (max-width: 1440px) and (min-width: 1040px) {
    .book-display__counter {
        margin-left: 7px !important;
    }
    .author-page-wrapper {
        max-width: 1200px;
    }
    
    /* SWITCH TO STACKED LAYOUT to eliminate overlapping */
    .author-page-main .wp-block-custom-author-block {
        flex-direction: column !important;
        gap: 40px !important;
    }
    
    .author-page-main .wp-block-custom-author-block .author-featured-image {
        position: static !important;
        transform: none !important;
        
        max-width: 350px !important;
        margin-top: 80px !important;
        order: 1 !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: 1 !important;
    }
    
    .author-page-main .wp-block-custom-author-block .author-content-container {
        width: 100% !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
        order: 2 !important;
        display: flex !important;
        flex-direction: column !important;
        
        margin-left: auto !important;
        margin-top: 80px;
    }
    
    .author-page-main .wp-block-group > *:not(.wp-block-custom-author-block) {
        margin-right: 25px !important;
        width: 100% !important;
        padding-right: 0 !important;
        
        margin-left: auto !important;
    }
    
    /* Media section adjustments for this range */
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 280px;
        max-width: 340px;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-interviews-container,
    .author-page-main .wp-block-custom-author-media .media-container,
    .author-page-main .wp-block-custom-available-stores .stores-container {
        gap: 22px;
        padding: 0 12px;
    }
}

/* Standard Desktop/Tablet - 1025px to 1039px - STACKED LAYOUT */
@media (max-width: 1039px) and (min-width: 1025px) {
    .author-page-wrapper {
        max-width: 1100px;
    }
    
    /* SWITCH TO STACKED LAYOUT like tablet */
    .author-page-main .wp-block-custom-author-block {
        flex-direction: column !important;
        gap: 40px !important;
    }
    
    .author-page-main .wp-block-custom-author-block .author-featured-image {
        position: static !important;
        transform: none !important;
        max-width: 350px !important;
        margin-top: 80px !important;
        order: 1 !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: 1 !important;
    }
    
    .author-page-main .wp-block-custom-author-block .author-content-container {
        width: 100% !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
        order: 2 !important;
        display: flex !important;
        flex-direction: column !important;
        max-width: 800px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 80px;
    }
    
/* Exclude quotes-block from the general rule */
.author-page-main .wp-block-group > *:not(.wp-block-custom-author-block):not(.wp-block-custom-quotes) {
    width: 100% !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Special margin for quotes-block with higher specificity */
.author-page-main .wp-block-group > .wp-block-custom-quotes {
    margin-right: 50px !important;
    margin-left: 0 !important;
    width: 100% !important;
    padding-right: 0 !important;
    max-width: 800px !important;
}
    
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 260px;
        max-width: 320px;
    }
}

/* TABLET - 769px to 1024px - STACKED LAYOUT (FIXED OVERLAPPING ISSUE) */
@media (max-width: 1024px) and (min-width: 769px) {

    
    /* STACKED LAYOUT - Same as mobile to eliminate overlapping */
    .author-page-main .wp-block-custom-author-block {
        flex-direction: column !important;
        gap: 35px !important;
    }
    
    .author-page-main .wp-block-custom-author-block .author-featured-image {
        position: static !important;
        transform: none !important;
        
        max-width: 320px !important;
        margin-top: 80px !important;
        order: 1 !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: 1 !important;
    }
    
    .author-page-main .wp-block-custom-author-block .author-content-container {
        width: 100% !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
        order: 2 !important;
        margin-top: 80px;
    }
    
    .author-page-main .wp-block-group > *:not(.wp-block-custom-author-block) {
        margin-right: 0 !important;
        width: 100% !important;
        padding-right: 0 !important;
    }
    
    /* Books carousel - Display 3 books per row */
    .author-page-main .wp-block-ha-books-carousel--grid .book-display__row {
        gap: 50px !important;
        justify-content: flex-start !important;
        padding-right: 100px;
    }
    
    .author-page-main .wp-block-ha-books-carousel .book-display__header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 16px !important;
        padding-right: 20px;
    }
    
    .author-page-main .wp-block-ha-books-carousel--grid .book-display__row .book-display__item:nth-child(4),
    .author-page-main .wp-block-ha-books-carousel--grid .book-display__row .book-display__item:nth-child(n+5) {
        display: none !important;
    }
    
    .author-page-main .wp-block-ha-books-carousel--grid .book-display__item {
        flex: 0 0 180px !important;
        max-width: 180px !important;
        min-width: 180px !important;
    }
    
    /* Media section adjustments for tablet */
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 250px;
        max-width: 320px;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-interviews-container,
    .author-page-main .wp-block-custom-author-media .media-container,
    .author-page-main .wp-block-custom-available-stores .stores-container {
        gap: 20px;
        padding: 0 10px;
    }
}

/* MOBILE - 768px and below */
@media (max-width: 768px) {
    .author-page-wrapper {
        width: 95%;
        min-width: 0;
        padding-top: 40px;
    }

    /* Stack layout on mobile */
    .author-page-main .wp-block-custom-author-block {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .author-page-main .wp-block-custom-author-block .author-featured-image {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        max-width: 214px !important;
        margin: 40px auto 0 auto !important;
        order: 1 !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: 1 !important;
    }

    .author-page-main .wp-block-custom-author-block .author-content-container {
        width: 100% !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
        order: 2 !important;
        text-align: right !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
    }

    /* Right-align text content on mobile */
    .author-page-main .wp-block-custom-author-block .author-title,
    .author-page-main .wp-block-custom-author-block h1,
    .author-page-main .wp-block-custom-author-block h2,
    .author-page-main .wp-block-custom-author-block .author-bio,
    .author-page-main .wp-block-custom-author-block .author-description,
    .author-page-main .wp-block-custom-author-block p {
        text-align: right !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Right-align social links on mobile */
    .author-page-main .wp-block-custom-author-block .author-social-links,
    .author-page-main .wp-block-custom-author-block .social-links {
        justify-content: flex-end !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        display: flex !important;
        gap: 15px !important;
    }

    .author-page-main .wp-block-group > *:not(.wp-block-custom-author-block) {
        margin-right: 0 !important;
        width: 100% !important;
        padding-right: 0 !important;
    }

    /* Books carousel - 2-column grid on mobile */
    .author-page-main .wp-block-ha-books-carousel--grid .book-display__content--grid {
        gap: 20px !important;
    }

    .author-page-main .wp-block-ha-books-carousel--grid .book-display__row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    .author-page-main .wp-block-ha-books-carousel--grid .book-display__item {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: none !important;
    }

    .author-page-main .wp-block-ha-books-carousel--grid .book-display__item .card--book,
    .author-page-main .wp-block-ha-books-carousel--grid .book-display__item .card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 80% !important;
    }

    .author-page-main .wp-block-ha-books-carousel--grid .book-display__item .card__image {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 30 / 47;
    }

    .author-page-main .wp-block-ha-books-carousel--grid .book-display__item .card__title,
    .author-page-main .wp-block-ha-books-carousel--grid .book-display__item .card__author {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Align title and counter on same line */
    .author-page-main .wp-block-ha-books-carousel .book-display__header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 16px !important;
        padding-right: 20px;
    }

    .author-page-main .wp-block-ha-books-carousel .book-display__title {
        flex: 0 1 auto !important;
        margin: 0 !important;
    }

    .author-page-main .wp-block-ha-books-carousel .book-display__counter {
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    /* Mobile media section adjustments */
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 220px;
        max-width: 280px;
    }

    .author-page-main .wp-block-ha-media-interviews .media-interviews-container,
    .author-page-main .wp-block-custom-author-media .media-container,
    .author-page-main .wp-block-custom-available-stores .stores-container {
        gap: 18px;
        padding: 0 8px;
    }

    /* Smaller scrollbar for mobile */
    .author-page-main .wp-block-ha-media-interviews::-webkit-scrollbar,
    .author-page-main .wp-block-custom-author-media::-webkit-scrollbar,
    .author-page-main .wp-block-custom-available-stores::-webkit-scrollbar {
        height: 8px;
    }
}

/* Small Mobile - 480px and below */
@media (max-width: 480px) {
    .author-page-wrapper {
        width: 98%;
        min-width: 0;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 200px;
        max-width: 250px;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-interviews-container,
    .author-page-main .wp-block-custom-author-media .media-container,
    .author-page-main .wp-block-custom-available-stores .stores-container {
        gap: 15px;
        padding: 0 5px;
    }
}

/* Very Small Mobile - 360px and below */
@media (max-width: 360px) {
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        min-width: 180px;
        max-width: 220px;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-interviews-container,
    .author-page-main .wp-block-custom-author-media .media-container,
    .author-page-main .wp-block-custom-available-stores .stores-container {
        gap: 12px;
    }
}

/* ==========================================================================
   PERFORMANCE & ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Smooth scrolling for better UX */
html {
    scroll-behavior: smooth;
}

/* Performance optimization for fixed positioning */
.author-page-main .wp-block-custom-author-block .author-featured-image {
    will-change: transform, top, bottom;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduced motion support - Accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }
    
    .author-page-main .wp-block-custom-author-block .author-featured-image {
        transition: none !important;
    }
    
    .author-page-main .wp-block-ha-media-interviews,
    .author-page-main .wp-block-custom-author-media,
    .author-page-main .wp-block-custom-available-stores {
        scroll-behavior: auto !important;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        transition: none !important;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-item:hover,
    .author-page-main .wp-block-custom-author-media .media-item:hover,
    .author-page-main .wp-block-custom-available-stores .store-item:hover {
        transform: none !important;
    }
}

/* Dark mode support for scrollbars */
@media (prefers-color-scheme: dark) {
    .author-page-main .wp-block-ha-media-interviews::-webkit-scrollbar-track,
    .author-page-main .wp-block-custom-author-media::-webkit-scrollbar-track,
    .author-page-main .wp-block-custom-available-stores::-webkit-scrollbar-track {
        background: #2a2a2a;
    }
    
    .author-page-main .wp-block-ha-media-interviews::-webkit-scrollbar-thumb,
    .author-page-main .wp-block-custom-author-media::-webkit-scrollbar-thumb,
    .author-page-main .wp-block-custom-available-stores::-webkit-scrollbar-thumb {
        background: #555;
    }
    
    .author-page-main .wp-block-ha-media-interviews::-webkit-scrollbar-thumb:hover,
    .author-page-main .wp-block-custom-author-media::-webkit-scrollbar-thumb:hover,
    .author-page-main .wp-block-custom-available-stores::-webkit-scrollbar-thumb:hover {
        background: #777;
    }
}

/* Print optimization - Media sections revert to block layout */
@media print {
    .author-page-main .wp-block-custom-author-block .author-featured-image {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 20px 0 !important;
        page-break-inside: avoid;
    }
    
    .author-page-main .wp-block-custom-author-block .author-content-container,
    .author-page-main .wp-block-group > *:not(.wp-block-custom-author-block) {
        width: 100% !important;
        margin-right: 0 !important;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-interviews-container,
    .author-page-main .wp-block-custom-author-media .media-container,
    .author-page-main .wp-block-custom-available-stores .stores-container {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .author-page-main .wp-block-ha-media-interviews .media-item,
    .author-page-main .wp-block-custom-author-media .media-item,
    .author-page-main .wp-block-custom-available-stores .store-item {
        width: 100% !important;
        max-width: none !important;
        min-width: auto !important;
        page-break-inside: avoid;
    }
    
    .author-page-main .wp-block-ha-media-interviews,
    .author-page-main .wp-block-custom-author-media,
    .author-page-main .wp-block-custom-available-stores {
        overflow: visible !important;
        padding-bottom: 0 !important;
    }
}

/* ==========================================================================
   EXISTING STYLES - Block Editor & Separators
   ========================================================================== */

/* Block Editor Override */
.block-editor-block-list__layout .wp-block-custom-author-block .author-block-container {
    max-width: none !important;
}

/* Ensure proper spacing between blocks with separators */
.author-page-main .wp-block-group > * {
    margin-bottom: 0;
    position: relative;
}

.author-page-main .wp-block-group > * + * {
    margin-top: 40px;
}

/* === Remove bottom separators between blocks === */
.author-page-main .wp-block-group > *::after {
  content: none !important;
}

/* Focus states for accessibility */
.author-page-main .wp-block-ha-media-interviews .media-item:focus,
.author-page-main .wp-block-custom-author-media .media-item:focus,
.author-page-main .wp-block-custom-available-stores .store-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* === Add top border to selected content blocks === */

/* Media interviews */
.author-page-main .wp-block-ha-media-interviews {
  border-top: 1px solid #E0E0E0;
}

/* Quotes */
.author-page-main .wp-block-custom-quotes {
  border-top: 1px solid #E0E0E0;
}

/* Books carousel */
.author-page-main .wp-block-ha-books-carousel {
  border-top: 1px solid #E0E0E0;
}

/* Author media / general media block */
.author-page-main .wp-block-custom-author-media {
  border-top: 1px solid #E0E0E0;
}