/**
 * Karma Memorial Widget Styles
 * 
 * Utilizza le variabili CSS del tema per adattarsi automaticamente ai colori
 * 
 * @package KarmaMemorials
 * @since 1.0.0
 */

/* ==========================================================================
   Widget Container - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial {
    /* Utilizza le variabili del tema per i colori */
    color: var(--wp--preset--color--foreground, #333);
}

.widget_karma_memorial .widget-title {
    color: var(--wp--preset--color--foreground, #333);
    border-bottom: 1px solid var(--wp--preset--color--secondary, #ddd);
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}

/* ==========================================================================
   Lista Memoriali - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .karma-memorial-sidebar-list {
    list-style: none !important;
    margin: 1rem 0 !important;
    padding: 0 !important;
}

.widget_karma_memorial .karma-memorial-sidebar-list li {
    list-style: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    margin: 0 0 1.75em 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid var(--wp--preset--color--tertiary, #f0f0f0);
    padding-bottom: 1em;
}

.widget_karma_memorial .karma-memorial-sidebar-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.widget_karma_memorial .karma-memorial-sidebar-list li:before,
.widget_karma_memorial .karma-memorial-sidebar-list li:after {
    content: none !important;
    display: none !important;
}

/* ==========================================================================
   Thumbnail - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .memorial-sidebar-thumbnail {
    flex: 0 0 80px !important;
    width: 80px !important;
    height: 80px !important;
    margin-right: 15px !important;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--wp--preset--color--tertiary, #f5f5f5);
}

.widget_karma_memorial .memorial-sidebar-thumbnail img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 4px !important;
    transition: transform 0.2s ease !important;
    object-fit: contain !important;
    object-position: top !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--wp--preset--color--tertiary, #f5f5f5) !important;
}

.widget_karma_memorial .memorial-sidebar-item:hover .memorial-sidebar-thumbnail img,
.widget_karma_memorial .karma-memorial-sidebar-list > li:hover .memorial-sidebar-thumbnail img {
    transform: scale(1.05) !important;
}

/* ==========================================================================
   Contenuto Testuale - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .memorial-sidebar-content {
    flex: 1 !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
}

/* ==========================================================================
   Data - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .memorial-sidebar-date {
    text-transform: uppercase !important;
    font-size: .8rem !important;
    font-weight: 400 !important;
    margin: 0 0 .75em 0 !important;
    color: var(--wp--preset--color--foreground-alt, #666) !important;
    line-height: 1.2 !important;
    display: block !important;
}

/* ==========================================================================
   Titolo - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .memorial-sidebar-title,
.widget_karma_memorial .memorial-sidebar-title h4,
.widget_karma_memorial .memorial-sidebar-title .bt_bb_headline_content span {
    margin: 0 0 0.25em 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: var(--wp--preset--color--foreground, #333) !important;
}

.widget_karma_memorial .memorial-sidebar-title a,
.widget_karma_memorial .memorial-sidebar-title a:visited {
    color: var(--wp--preset--color--foreground, #333) !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.widget_karma_memorial .memorial-sidebar-title a:hover,
.widget_karma_memorial .memorial-sidebar-title a:focus {
    color: var(--wp--preset--color--primary, #0073aa) !important;
    text-decoration: none !important;
}

/* ==========================================================================
   Estratto - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .memorial-sidebar-excerpt {
    margin: 0 0 0.5em 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    color: var(--wp--preset--color--foreground-alt, #666) !important;
    display: block !important;
}

/* ==========================================================================
   Località - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .memorial-sidebar-location {
    margin: 0 0 0.25em 0 !important;
    font-size: 0.85rem !important;
    color: var(--wp--preset--color--foreground-alt, #666) !important;
    display: block !important;
}

/* ==========================================================================
   Date - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .memorial-sidebar-dates {
    margin: 0 !important;
    font-size: 0.8rem !important;
    color: var(--wp--preset--color--foreground-alt, #666) !important;
    display: block !important;
}

/* ==========================================================================
   Link e Hover Effects - Adattamento ai colori del tema
   ========================================================================== */

.widget_karma_memorial .memorial-sidebar-item {
    transition: background-color 0.2s ease !important;
    padding: 0.5em !important;
    margin: 0 0 1em 0 !important;
    border-radius: 4px;
}

.widget_karma_memorial .memorial-sidebar-item:hover {
    background-color: var(--wp--preset--color--tertiary, rgba(0, 0, 0, 0.05)) !important;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 480px) {
    .widget_karma_memorial .memorial-sidebar-item {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
    }
    
    .widget_karma_memorial .memorial-sidebar-thumbnail {
        flex: 0 0 auto !important;
        width: 100px !important;
        margin-right: 0 !important;
        margin-bottom: 10px !important;
    }
    
    .widget_karma_memorial .memorial-sidebar-content {
        flex: 0 0 auto !important;
        text-align: center !important;
        align-items: center !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   Tema Chiaro - Testi scuri su sfondo chiaro
   ========================================================================== */

.widget_karma_memorial.karma-memorial-theme-light {
    color: #333 !important;
}

.widget_karma_memorial.karma-memorial-theme-light .widget-title {
    color: #333 !important;
    border-bottom: 1px solid #ddd !important;
}

.widget_karma_memorial.karma-memorial-theme-light .karma-memorial-sidebar-list li {
    border-bottom: 1px solid #eee !important;
}

.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-date,
.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-excerpt,
.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-location,
.widget_karma-memorial.karma-memorial-theme-light .memorial-sidebar-dates {
    color: #333 !important;
}

.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-title,
.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-title a,
.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-title h4,
.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-title .bt_bb_headline_content span,
.widget_karma_memorial.karma-memorial-theme-light .karma-memorial-sidebar-list h4,
.widget_karma_memorial.karma-memorial-theme-light .karma-memorial-sidebar-list h4 a {
    color: #333 !important;
}

.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-title a:hover,
.widget_karma_memorial.karma-memorial-theme-light .karma-memorial-sidebar-list h4 a:hover {
    color: #0073aa !important;
}

.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-thumbnail {
    background-color: #f5f5f5 !important;
}

.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-thumbnail img {
    background-color: #f5f5f5 !important;
}

.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-item:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Forza reset di tutti i colori ereditati dal tema per il tema chiaro */
.widget_karma_memorial.karma-memorial-theme-light * {
    color: inherit !important;
}

.widget_karma_memorial.karma-memorial-theme-light .memorial-sidebar-content *:not(.memorial-sidebar-title):not(.memorial-sidebar-title a):not(.memorial-sidebar-title h4) {
    color: #333 !important;
}

/* ==========================================================================
   Tema Scuro - Testi chiari su sfondo scuro - SPECIFICITÀ MASSIMA
   ========================================================================== */

.widget_karma_memorial.karma-memorial-theme-dark {
    color: #ffffff !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .widget-title {
    color: #ffffff !important;
    border-bottom: 1px solid #555 !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .karma-memorial-sidebar-list li {
    border-bottom: 1px solid #444 !important;
}

/* Forza i colori per tutti gli elementi di testo nel tema scuro */
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-date,
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-excerpt,
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-location,
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-dates,
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-content div,
.widget_karma_memorial.karma-memorial-theme-dark .karma-memorial-sidebar-list div,
.widget_karma_memorial.karma-memorial-theme-dark .karma-memorial-sidebar-list span,
.widget_karma_memorial.karma-memorial-theme-dark .karma-memorial-sidebar-list p {
    color: #cccccc !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-title,
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-title a,
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-title h4,
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-title .bt_bb_headline_content span,
.widget_karma_memorial.karma-memorial-theme-dark .karma-memorial-sidebar-list h4,
.widget_karma_memorial.karma-memorial-theme-dark .karma-memorial-sidebar-list h4 a {
    color: #ffffff !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-title a:hover,
.widget_karma_memorial.karma-memorial-theme-dark .karma-memorial-sidebar-list h4 a:hover {
    color: #66b3ff !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-thumbnail {
    background-color: #333 !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-thumbnail img {
    background-color: #333 !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Forza reset di tutti i colori ereditati dal tema */
.widget_karma_memorial.karma-memorial-theme-dark * {
    color: inherit !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-content *:not(.memorial-sidebar-title):not(.memorial-sidebar-title a):not(.memorial-sidebar-title h4) {
    color: #cccccc !important;
}

/* CSS ULTRA-SPECIFICO per forzare i colori nel tema scuro */
.widget_karma_memorial.karma-memorial-theme-dark {
    background-color: #1a1a1a !important;
}

.widget_karma_memorial.karma-memorial-theme-dark * {
    color: #ffffff !important;
}

.widget_karma-memorial.karma-memorial-theme-dark .memorial-sidebar-content *,
.widget_karma_memorial.karma-memorial-theme-dark .karma-memorial-sidebar-list *,
.widget_karma_memorial.karma-memorial-theme-dark div,
.widget_karma-memorial.karma-memorial-theme-dark span,
.widget_karma_memorial.karma-memorial-theme-dark p {
    color: #cccccc !important;
}

.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-title,
.widget_karma_memorial.karma-memorial-theme-dark .memorial-sidebar-title *,
.widget_karma_memorial.karma-memorial-theme-dark h4,
.widget_karma-memorial.karma-memorial-theme-dark h4 * {
    color: #ffffff !important;
}

/* ==========================================================================
   Wrapper del tema scuro per lo shortcode
   ========================================================================== */

.karma-memorial-theme-dark {
    color: #ffffff !important;
}

.karma-memorial-theme-dark .karma-memorial-sidebar-list li {
    border-bottom: 1px solid #444 !important;
}

.karma-memorial-theme-dark .memorial-sidebar-date,
.karma-memorial-theme-dark .memorial-sidebar-excerpt,
.karma-memorial-theme-dark .memorial-sidebar-location,
.karma-memorial-theme-dark .memorial-sidebar-dates,
.karma-memorial-theme-dark .memorial-sidebar-content div,
.karma-memorial-theme-dark .karma-memorial-sidebar-list div,
.karma-memorial-theme-dark .karma-memorial-sidebar-list span,
.karma-memorial-theme-dark .karma-memorial-sidebar-list p {
    color: #cccccc !important;
}

.karma-memorial-theme-dark .memorial-sidebar-title,
.karma-memorial-theme-dark .memorial-sidebar-title a,
.karma-memorial-theme-dark .memorial-sidebar-title h4,
.karma-memorial-theme-dark .memorial-sidebar-title .bt_bb_headline_content span,
.karma-memorial-theme-dark .karma-memorial-sidebar-list h4,
.karma-memorial-theme-dark .karma-memorial-sidebar-list h4 a {
    color: #ffffff !important;
}

.karma-memorial-theme-dark .memorial-sidebar-title a:hover,
.karma-memorial-theme-dark .karma-memorial-sidebar-list h4 a:hover {
    color: #66b3ff !important;
}

.karma-memorial-theme-dark .memorial-sidebar-thumbnail {
    background-color: #333 !important;
}

.karma-memorial-theme-dark .memorial-sidebar-thumbnail img {
    background-color: #333 !important;
}

.karma-memorial-theme-dark .memorial-sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Forza reset di tutti i colori ereditati dal tema per il wrapper */
.karma-memorial-theme-dark * {
    color: inherit !important;
}

.karma-memorial-theme-dark .memorial-sidebar-content *:not(.memorial-sidebar-title):not(.memorial-sidebar-title a):not(.memorial-sidebar-title h4) {
    color: #cccccc !important;
}

/* CSS ULTRA-SPECIFICO per il wrapper del tema scuro */
.karma-memorial-theme-dark {
    background-color: #1a1a1a !important;
}

.karma-memorial-theme-dark * {
    color: #ffffff !important;
}

.karma-memorial-theme-dark .memorial-sidebar-content *,
.karma-memorial-theme-dark .karma-memorial-sidebar-list *,
.karma-memorial-theme-dark div,
.karma-memorial-theme-dark span,
.karma-memorial-theme-dark p {
    color: #cccccc !important;
}

.karma-memorial-theme-dark .memorial-sidebar-title,
.karma-memorial-theme-dark .memorial-sidebar-title *,
.karma-memorial-theme-dark h4,
.karma-memorial-theme-dark h4 * {
    color: #ffffff !important;
}

/* ==========================================================================
   Wrapper del tema chiaro per lo shortcode
   ========================================================================== */

.karma-memorial-theme-light {
    color: #333 !important;
}

.karma-memorial-theme-light .karma-memorial-sidebar-list li {
    border-bottom: 1px solid #eee !important;
}

.karma-memorial-theme-light .memorial-sidebar-date,
.karma-memorial-theme-light .memorial-sidebar-excerpt,
.karma-memorial-theme-light .memorial-sidebar-location,
.karma-memorial-theme-light .memorial-sidebar-dates,
.karma-memorial-theme-light .memorial-sidebar-content div,
.karma-memorial-theme-light .karma-memorial-sidebar-list div,
.karma-memorial-theme-light .karma-memorial-sidebar-list span,
.karma-memorial-theme-light .karma-memorial-sidebar-list p {
    color: #333 !important;
}

.karma-memorial-theme-light .memorial-sidebar-title,
.karma-memorial-theme-light .memorial-sidebar-title a,
.karma-memorial-theme-light .memorial-sidebar-title h4,
.karma-memorial-theme-light .memorial-sidebar-title .bt_bb_headline_content span,
.karma-memorial-theme-light .karma-memorial-sidebar-list h4,
.karma-memorial-theme-light .karma-memorial-sidebar-list h4 a {
    color: #333 !important;
}

.karma-memorial-theme-light .memorial-sidebar-title a:hover,
.karma-memorial-theme-light .karma-memorial-sidebar-list h4 a:hover {
    color: #0073aa !important;
}

.karma-memorial-theme-light .memorial-sidebar-thumbnail {
    background-color: #f5f5f5 !important;
}

.karma-memorial-theme-light .memorial-sidebar-thumbnail img {
    background-color: #f5f5f5 !important;
}

.karma-memorial-theme-light .memorial-sidebar-item:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Forza reset di tutti i colori ereditati dal tema per il wrapper chiaro */
.karma-memorial-theme-light * {
    color: inherit !important;
}

.karma-memorial-theme-light .memorial-sidebar-content *:not(.memorial-sidebar-title):not(.memorial-sidebar-title a):not(.memorial-sidebar-title h4) {
    color: #333 !important;
}

/* Selettori ultra-specifici per forzare i colori nel tema chiaro */
.karma-memorial-theme-light .karma-memorial-sidebar-list *,
.karma-memorial-theme-light .memorial-sidebar-item *,
.karma-memorial-theme-light .memorial-sidebar-content *,
.karma-memorial-theme-light div,
.karma-memorial-theme-light span,
.karma-memorial-theme-light p {
    color: #333 !important;
}

.karma-memorial-theme-light .memorial-sidebar-title,
.karma-memorial-theme-light .memorial-sidebar-title *,
.karma-memorial-theme-light h4,
.karma-memorial-theme-light h4 * {
    color: #333 !important;
}

/* ==========================================================================
   Fallback per temi senza variabili CSS (Automatico)
   ========================================================================== */

.widget_karma_memorial {
    /* Fallback colors se le variabili del tema non sono disponibili */
    --fallback-foreground: #333;
    --fallback-primary: #0073aa;
    --fallback-secondary: #ddd;
    --fallback-tertiary: #f5f5f5;
    --fallback-foreground-alt: #666;
}

.widget_karma_memorial .widget-title {
    color: var(--wp--preset--color--foreground, var(--fallback-foreground)) !important;
}

.widget_karma_memorial .memorial-sidebar-date,
.widget_karma_memorial .memorial-sidebar-excerpt,
.widget_karma_memorial .memorial-sidebar-location,
.widget_karma_memorial .memorial-sidebar-dates {
    color: var(--wp--preset--color--foreground-alt, var(--fallback-foreground-alt)) !important;
}

.widget_karma_memorial .memorial-sidebar-title,
.widget_karma_memorial .memorial-sidebar-title a {
    color: var(--wp--preset--color--foreground, var(--fallback-foreground)) !important;
}

.widget_karma_memorial .memorial-sidebar-title a:hover {
    color: var(--wp--preset--color--primary, var(--fallback-primary)) !important;
}
