/**
 * Sidebar Styles with Sticky Position
 * Modern widget design with enhanced visuals
 */

/* Sidebar Container */
.hvn-theme-sidebar-area {
    position: relative;
    height: 100%;
}

/* Sticky Sidebar - Main Class */
.hvn-theme-sidebar {
    position: sticky;
    top: 30px;
    height: auto;
}

/* Desktop sticky positioning */
@media (min-width: 992px) {
    .hvn-theme-sidebar-area {
        align-self: start;
    }
    
    .hvn-theme-sidebar {
        position: sticky !important;
        top: 100px !important;
    }
    
    /* Admin bar offset */
    .admin-bar .hvn-theme-sidebar {
        top: 132px !important;
    }
}

/* Disable sticky on mobile/tablet */
@media (max-width: 991px) {
    .hvn-theme-sidebar {
        position: static !important;
        top: auto !important;
        margin-top: 2rem;
    }
}

/* ============================================
   MODERN WIDGET STYLES
   ============================================ */

/* Widget Container - Modern Card Design */
.hvn-theme-widget {
    background: var(--hvn-theme-color-white);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

/* Subtle gradient border effect on hover */
.hvn-theme-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hvn-theme-brand-primary), var(--hvn-theme-brand-primary-light), transparent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}

.hvn-theme-widget:hover::before {
    transform: scaleX(1);
}

.hvn-theme-widget:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
    border-color: rgba(108, 96, 254, 0.1);
}

.hvn-theme-widget:last-child {
    margin-bottom: 0;
}

/* Widget Title - Modern with accent */
.hvn-theme-widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    position: relative;
    color: var(--hvn-theme-text-primary);
    letter-spacing: -0.02em;
    display: inline-block;
}

.hvn-theme-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--hvn-theme-brand-primary), var(--hvn-theme-brand-primary-light));
    border-radius: 3px;
}

.hvn-theme-widget-title::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--hvn-theme-border-color-light);
}

/* ============================================
   SEARCH WIDGET - Modern Design
   ============================================ */

.hvn-theme-widget .wp-block-search__inside-wrapper,
.hvn-theme-widget .search-form {
    display: flex;
    gap: 0.75rem;
    background: var(--hvn-theme-color-gray-100);
    border-radius: 60px;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.hvn-theme-widget .wp-block-search__inside-wrapper:focus-within,
.hvn-theme-widget .search-form:focus-within {
    background: var(--hvn-theme-color-white);
    box-shadow: 0 0 0 3px rgba(108, 96, 254, 0.1);
    outline: none;
}

.hvn-theme-widget .wp-block-search__input,
.hvn-theme-widget .search-field {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    border-radius: 60px;
    transition: all 0.2s ease;
}

.hvn-theme-widget .wp-block-search__input:focus,
.hvn-theme-widget .search-field:focus {
    outline: none;
    background: transparent;
}

.hvn-theme-widget .wp-block-search__button,
.hvn-theme-widget .search-submit {
    background: var(--hvn-theme-brand-primary);
    border: none;
    border-radius: 60px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hvn-theme-widget .wp-block-search__button:hover,
.hvn-theme-widget .search-submit:hover {
    background: var(--hvn-theme-brand-primary-dark);
    transform: translateY(-1px);
}

/* ============================================
   RECENT POSTS - Modern Card Style
   ============================================ */

.hvn-theme-widget .wp-block-latest-posts__list,
.hvn-theme-widget ul:not(.wp-block-categories-list):not(.wp-block-archives-list) {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hvn-theme-widget .wp-block-latest-posts__list li,
.hvn-theme-widget ul:not(.wp-block-categories-list):not(.wp-block-archives-list) li {
    margin-bottom: 0.875rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--hvn-theme-border-color-light);
    transition: all 0.2s ease;
}

.hvn-theme-widget .wp-block-latest-posts__list li:last-child,
.hvn-theme-widget ul:not(.wp-block-categories-list):not(.wp-block-archives-list) li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.hvn-theme-widget .wp-block-latest-posts__list li:hover,
.hvn-theme-widget ul:not(.wp-block-categories-list):not(.wp-block-archives-list) li:hover {
    transform: translateX(4px);
}

.hvn-theme-widget .wp-block-latest-posts__post-title,
.hvn-theme-widget ul:not(.wp-block-categories-list):not(.wp-block-archives-list) li a {
    color: var(--hvn-theme-text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    display: block;
    line-height: 1.45;
}

.hvn-theme-widget .wp-block-latest-posts__post-title:hover,
.hvn-theme-widget ul:not(.wp-block-categories-list):not(.wp-block-archives-list) li a:hover {
    color: var(--hvn-theme-brand-primary);
}

/* Post date styling for recent posts */
.hvn-theme-widget .wp-block-latest-posts__post-date {
    display: block;
    font-size: 0.75rem;
    color: var(--hvn-theme-text-muted);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* ============================================
   RECENT COMMENTS - Modern Design
   ============================================ */

.hvn-theme-widget .wp-block-latest-comments {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hvn-theme-widget .wp-block-latest-comments__comment {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--hvn-theme-border-color-light);
}

.hvn-theme-widget .wp-block-latest-comments__comment:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.hvn-theme-widget .wp-block-latest-comments__comment-meta {
    font-size: 0.875rem;
    line-height: 1.5;
}

.hvn-theme-widget .wp-block-latest-comments__comment-author {
    color: var(--hvn-theme-brand-primary);
    font-weight: 600;
    text-decoration: none;
}

.hvn-theme-widget .wp-block-latest-comments__comment-author:hover {
    text-decoration: underline;
}

.hvn-theme-widget .wp-block-latest-comments__comment-link {
    color: var(--hvn-theme-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hvn-theme-widget .wp-block-latest-comments__comment-link:hover {
    color: var(--hvn-theme-brand-primary);
}

.hvn-theme-widget .wp-block-latest-comments__comment-excerpt p {
    font-size: 0.8125rem;
    color: var(--hvn-theme-text-secondary);
    margin-top: 0.375rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* ============================================
   ARCHIVES WIDGET - Modern Styling
   ============================================ */

.hvn-theme-widget .wp-block-archives-list,
.hvn-theme-widget .wp-block-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hvn-theme-widget .wp-block-archives-list li,
.hvn-theme-widget .wp-block-categories-list li {
    margin-bottom: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--hvn-theme-border-color-light);
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hvn-theme-widget .wp-block-archives-list li:last-child,
.hvn-theme-widget .wp-block-categories-list li:last-child {
    border-bottom: none;
}

.hvn-theme-widget .wp-block-archives-list li:hover,
.hvn-theme-widget .wp-block-categories-list li:hover {
    transform: translateX(4px);
}

.hvn-theme-widget .wp-block-archives-list a,
.hvn-theme-widget .wp-block-categories-list a {
    color: var(--hvn-theme-text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
    font-weight: 500;
}

.hvn-theme-widget .wp-block-archives-list a:hover,
.hvn-theme-widget .wp-block-categories-list a:hover {
    color: var(--hvn-theme-brand-primary);
}

/* Category count badge */
.hvn-theme-widget .wp-block-categories-list .count,
.hvn-theme-widget .cat-item .count {
    background: linear-gradient(135deg, var(--hvn-theme-brand-primary-light), var(--hvn-theme-brand-primary));
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    min-width: 28px;
    text-align: center;
    display: inline-block;
}

/* ============================================
   TAG CLOUD WIDGET - Modern Design
   ============================================ */

.hvn-theme-widget .tagcloud,
.hvn-theme-widget .wp-block-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 0.5rem;
}

.hvn-theme-widget .tagcloud a,
.hvn-theme-widget .wp-block-tag-cloud a {
    display: inline-block;
    background: var(--hvn-theme-color-gray-100);
    color: var(--hvn-theme-text-secondary);
    padding: 0.375rem 1rem;
    border-radius: 40px;
    font-size: 0.8125rem !important;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    border: 1px solid transparent;
}

.hvn-theme-widget .tagcloud a:hover,
.hvn-theme-widget .wp-block-tag-cloud a:hover {
    background: var(--hvn-theme-brand-primary);
    color: white;
    transform: translateY(-2px);
    border-color: var(--hvn-theme-brand-primary);
    box-shadow: 0 4px 12px rgba(108, 96, 254, 0.25);
}

/* ============================================
   CALENDAR WIDGET - Modern Design
   ============================================ */

.hvn-theme-widget .wp-block-calendar,
.hvn-theme-widget .wp-calendar-table {
    width: 100%;
    font-size: 0.875rem;
    border-radius: 16px;
    overflow: hidden;
}

.hvn-theme-widget .wp-calendar-table caption {
    font-weight: 700;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--hvn-theme-color-gray-100);
    border-radius: 12px;
    color: var(--hvn-theme-text-primary);
}

.hvn-theme-widget .wp-calendar-table th {
    background: var(--hvn-theme-color-gray-100);
    padding: 0.625rem 0.25rem;
    font-weight: 600;
    text-align: center;
    font-size: 0.75rem;
}

.hvn-theme-widget .wp-calendar-table td {
    text-align: center;
    padding: 0.5rem 0.25rem;
    border: 1px solid var(--hvn-theme-border-color-light);
    transition: all 0.2s ease;
}

.hvn-theme-widget .wp-calendar-table td:hover {
    background: rgba(108, 96, 254, 0.05);
}

.hvn-theme-widget .wp-calendar-table #today {
    background: var(--hvn-theme-brand-primary);
    color: white;
    font-weight: 700;
    border-radius: 8px;
}

.hvn-theme-widget .wp-calendar-table a {
    color: var(--hvn-theme-brand-primary);
    text-decoration: none;
    font-weight: 600;
}

.hvn-theme-widget .wp-calendar-table a:hover {
    text-decoration: underline;
}

.hvn-theme-widget .wp-calendar-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.5rem;
}

.hvn-theme-widget .wp-calendar-nav a {
    color: var(--hvn-theme-brand-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

/* ============================================
   RSS WIDGET - Modern Design
   ============================================ */

.hvn-theme-widget .widget_rss .rsswidget img {
    vertical-align: middle;
}

.hvn-theme-widget .widget_rss .rss-date {
    display: block;
    font-size: 0.75rem;
    color: var(--hvn-theme-text-muted);
    margin: 0.25rem 0;
}

.hvn-theme-widget .widget_rss cite {
    font-size: 0.8125rem;
    color: var(--hvn-theme-brand-primary);
    font-style: normal;
    font-weight: 500;
}

/* ============================================
   TEXT WIDGET - Modern Design
   ============================================ */

.hvn-theme-widget .textwidget {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--hvn-theme-text-secondary);
}

.hvn-theme-widget .textwidget p:last-child {
    margin-bottom: 0;
}

/* ============================================
   GROUP BLOCK STYLING
   ============================================ */

.hvn-theme-widget .wp-block-group__inner-container > :first-child {
    margin-top: 0;
}

.hvn-theme-widget .wp-block-group__inner-container > :last-child {
    margin-bottom: 0;
}

/* ============================================
   DROPDOWN STYLING (Archives, Categories)
   ============================================ */

.hvn-theme-widget select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--hvn-theme-border-color);
    border-radius: 12px;
    background: var(--hvn-theme-color-white);
    font-size: 0.9375rem;
    color: var(--hvn-theme-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hvn-theme-widget select:focus {
    outline: none;
    border-color: var(--hvn-theme-brand-primary);
    box-shadow: 0 0 0 3px rgba(108, 96, 254, 0.1);
}

/* ============================================
   RESPONSIVE SIDEBAR
   ============================================ */

@media (max-width: 991px) {
    .hvn-theme-widget {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hvn-theme-widget-title {
        font-size: 1.125rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
}

@media (max-width: 576px) {
    .hvn-theme-widget {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .hvn-theme-widget .wp-block-search__inside-wrapper,
    .hvn-theme-widget .search-form {
        flex-direction: column;
        background: transparent;
        gap: 0.5rem;
    }
    
    .hvn-theme-widget .wp-block-search__input,
    .hvn-theme-widget .search-field {
        background: var(--hvn-theme-color-gray-100);
        border-radius: 60px;
    }
    
    .hvn-theme-widget .wp-block-search__button,
    .hvn-theme-widget .search-submit {
        width: 100%;
        justify-content: center;
    }
}