/**
 * Blog Over Customizer Controls
 * 
 * Styles for custom Customizer controls
 *
 * @package Blog_Over
 */

/* ==========================================================================
   Toggle Switch Control
   ========================================================================== */

.blog-over-toggle-wrapper {
    margin-bottom: 12px;
}

.blog-over-toggle-switch {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.blog-over-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.blog-over-toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.blog-over-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.blog-over-toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.blog-over-toggle-input:checked+.blog-over-toggle-label .blog-over-toggle-slider {
    background-color: #2271b1;
}

.blog-over-toggle-input:checked+.blog-over-toggle-label .blog-over-toggle-slider::before {
    transform: translateX(24px);
}

.blog-over-toggle-input:focus+.blog-over-toggle-label .blog-over-toggle-slider {
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.4);
}

/* ==========================================================================
   Radio Image Control
   ========================================================================== */

.blog-over-radio-image-wrapper {
    margin-bottom: 12px;
}

.blog-over-radio-image-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.blog-over-radio-image-item {
    position: relative;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.blog-over-radio-image-item:hover {
    border-color: #999;
}

.blog-over-radio-image-item.selected,
.blog-over-radio-image-item:has(.blog-over-radio-image-input:checked) {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.blog-over-radio-image-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.blog-over-radio-image-item img {
    display: block;
    width: 80px;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

/* ==========================================================================
   Alpha Color Control
   ========================================================================== */

.blog-over-alpha-color-wrapper {
    margin-bottom: 12px;
}

.blog-over-alpha-color-picker {
    margin-top: 8px;
}

.blog-over-alpha-color-input {
    width: 100%;
    max-width: 100%;
}

/* Color picker overrides */
.blog-over-alpha-color-wrapper .wp-picker-container {
    display: block;
}

.blog-over-alpha-color-wrapper .wp-picker-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-over-alpha-color-wrapper .wp-picker-holder {
    position: absolute;
    z-index: 100;
}

/* ==========================================================================
   Section Title Control
   ========================================================================== */

.blog-over-section-title {
    margin: 20px 0 10px;
    padding: 15px 0 10px;
    border-top: 1px solid #ddd;
}

.blog-over-section-title:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.blog-over-section-heading {
    margin: 0 0 5px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-over-section-description {
    margin: 0;
    font-size: 12px;
    color: #757575;
    font-style: italic;
}

/* ==========================================================================
   Customizer Panel Improvements
   ========================================================================== */

.customize-control {
    margin-bottom: 15px;
}

.customize-control-title {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #1e1e1e;
}

.customize-control-description {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: #757575;
    line-height: 1.4;
}

/* ==========================================================================
   Menu Layout Radio Images - 3 Column Grid
   ========================================================================== */

/* Target the menu layout radio image control */
#customize-control-Blog_Over_config-blog_over_menu_layout .blog-over-radio-image-options,
.customize-control[id*="menu_layout"] .kirki-image-options,
.customize-control[id*="menu_layout"] .image-selector-wrap {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}

/* The parent control (hidden generic) contains the label - show it inline */
.customize-control-kirki-generic:has(input[type="hidden"]) {
    display: inline-block !important;
    width: auto !important;
    max-width: 45% !important;
    vertical-align: top !important;
    margin-right: 90px !important;
    margin-bottom: 15px !important;
    padding-top: 4px !important;
}

/* Note: Gradient Colors control uses default Kirki styling to preserve active_callback hide/show */
/* Make images smaller and uniform */
#customize-control-Blog_Over_config-blog_over_menu_layout .blog-over-radio-image-item img,
.customize-control[id*="menu_layout"] .kirki-image-options label img,
.customize-control[id*="menu_layout"] .image-selector-wrap label img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 50px !important;
    object-fit: contain !important;
}

/* Ensure labels take full width */
#customize-control-Blog_Over_config-blog_over_menu_layout .kirki-image-options label,
.customize-control[id*="menu_layout"] .kirki-image-options label,
.customize-control[id*="menu_layout"] .image-selector-wrap label {
    display: block !important;
    width: 100% !important;
}

/* ==========================================================================
   Section Separator
   ========================================================================== */

.blog-over-customizer-separator {
    margin: 20px -12px;
    padding: 0;
    border: 0;
    border-top: 1px solid #ddd;
}

/* ==========================================================================
   Radio Buttonset Control Styling
   ========================================================================== */

.customize-control-kirki-radio-buttonset .buttonset .switch-label {
    border: 2px solid #f0f0f1;
}

/* ==========================================================================
   Kirki Multicolor Tooltip Fix
   ========================================================================== */

/* Fix tooltip text visibility on dark background */
.customize-control-kirki-react-colorful .kirki-label-tooltip,
.customize-control-kirki-multicolor .kirki-label-tooltip {
    color: #ffffff !important;
}

/* Ensure tooltip container has proper contrast */
.kirki-label-tooltip {
    color: #ffffff !important;
    background-color: #1e1e1e !important;
}


/* ==========================================================================
   ICON STYLE - 2x2 Grid Layout
   ========================================================================== */

/* Target Icon Style radio buttonset for 2x2 grid */
#customize-control-Blog_Over_config-blog_over_social_icon_style .buttonset-wrap,
#customize-control-Blog_Over_config-blog_over_social_icon_style .kirki-input-container,
#customize-control-Blog_Over_config-blog_over_social_icon_style .kirki-controls-wrap>div {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
}



/* Style the radio labels as clear buttons */
#customize-control-Blog_Over_config-blog_over_social_icon_style .switch-label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 8px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    text-transform: capitalize !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

/* Active state for Icon Style */
#customize-control-Blog_Over_config-blog_over_social_icon_style .switch-input:checked+.switch-label {
    background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3) !important;
}

/* ==========================================================================
   MENU LAYOUT - 3 Column Inline Grid
   All 3 layout options in ONE ROW, smaller images, clear selection border
   SCOPED strictly to Menu Layout control only — does NOT affect other
   radio-image controls (Featured Links, Blog Style, etc.)
   ========================================================================== */

/* Main control container */
#customize-control-Blog_Over_config-blog_over_menu_layout {
    padding: 0 !important;
}

/* Force flex inline layout — ONLY for menu layout */
#customize-control-Blog_Over_config-blog_over_menu_layout .image {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
}

/* Each label container - equal width */
#customize-control-Blog_Over_config-blog_over_menu_layout .image>label {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 8px 6px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 8px !important;
    background: #f9fafb !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    text-align: center !important;
}

/* Hover state */
#customize-control-Blog_Over_config-blog_over_menu_layout .image>label:hover {
    border-color: #6b7280 !important;
    background: #ffffff !important;
}

/* SELECTED STATE - Strong blue border */
#customize-control-Blog_Over_config-blog_over_menu_layout input:checked+label {
    border-color: #2563eb !important;
    border-width: 3px !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}

/* Images - smaller for inline display */
#customize-control-Blog_Over_config-blog_over_menu_layout img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Hide text labels for cleaner look */
#customize-control-Blog_Over_config-blog_over_menu_layout .image>label span {
    display: none !important;
}

/* Hide the radio inputs */
#customize-control-Blog_Over_config-blog_over_menu_layout input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* ==========================================================================
   RESPONSIVE - Allow wrapping on small screens
   ========================================================================== */

@media (max-width: 320px) {

    .customize-control-kirki-multicolor,
    .customize-control-kirki-color {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .customize-control-kirki-multicolor .kirki-input-container,
    .customize-control-kirki-multicolor .kirki-multicolor-wrap,
    .customize-control-kirki-color .kirki-input-container {
        justify-content: flex-start !important;
        width: 100% !important;
        margin-top: 6px !important;
    }
}

/* ==========================================================================
   KIRKI SORTABLE CONTROL - CURSOR & UX STYLES
   - Drag handle (dashicons-menu): ns-resize cursor (up-down arrows)
   - Visibility toggle (eye icon): pointer cursor (hand)
   - Text: default cursor
   ========================================================================== */

/* Base list item - default cursor for text */
.customize-control-kirki-sortable ul.sortable li,
.customize-control-kirki-sortable .kirki-sortable-item {
    cursor: default !important;
    position: relative;
}

/* Drag handle icon (3 lines) - ns-resize cursor (up-down arrows) */
.customize-control-kirki-sortable li i.dashicons.dashicons-menu,
.customize-control-kirki-sortable .kirki-sortable-item i.dashicons-menu {
    cursor: ns-resize !important;
    padding: 6px !important;
    margin: 0px !important;
    margin-left: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    color: #94a3b8 !important;
}

/* Hover effect for drag handle - blue highlight + ns-resize stays */
.customize-control-kirki-sortable li i.dashicons.dashicons-menu:hover,
.customize-control-kirki-sortable .kirki-sortable-item i.dashicons-menu:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
    cursor: ns-resize !important;
}

/* Active/dragging state - grabbing cursor */
.customize-control-kirki-sortable li.ui-sortable-helper,
.customize-control-kirki-sortable li.ui-sortable-helper i.dashicons-menu {
    cursor: grabbing !important;
}

/* Visibility toggle (eye icon) - pointer cursor (hand for click) */
.customize-control-kirki-sortable li i.dashicons.dashicons-visibility,
.customize-control-kirki-sortable li i.visibility,
.customize-control-kirki-sortable .kirki-sortable-item i.dashicons-visibility,
.customize-control-kirki-sortable .kirki-sortable-item i.visibility {
    cursor: pointer !important;
    padding: 6px !important;
    margin: 0px !important;
    margin-right: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

/* Hover effect for visibility toggle - blue highlight + pointer stays */
.customize-control-kirki-sortable li i.dashicons.dashicons-visibility:hover,
.customize-control-kirki-sortable li i.visibility:hover,
.customize-control-kirki-sortable .kirki-sortable-item i.dashicons-visibility:hover,
.customize-control-kirki-sortable .kirki-sortable-item i.visibility:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
    cursor: pointer !important;
}

/* Text content after icons - default cursor */
.customize-control-kirki-sortable ul.sortable li::after,
.customize-control-kirki-sortable .kirki-sortable-item {
    cursor: default !important;
}

/* ==========================================================================
   FEATURED IMAGE TOGGLE - Styled like sortable item but fixed
   ========================================================================== */

#customize-control-Blog_Over_config-Blog_Over_show_thumbnail {
    background: #f8f9fa !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 12px 15px !important;
    margin: 0 -12px 8px -12px !important;
    position: relative;
}

#customize-control-Blog_Over_config-Blog_Over_show_thumbnail::before {
    content: "📌";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

#customize-control-Blog_Over_config-Blog_Over_show_thumbnail .customize-control-title {
    padding-left: 25px;
    font-weight: 600 !important;
    color: #1e293b !important;
}

#customize-control-Blog_Over_config-Blog_Over_show_thumbnail .customize-control-description {
    padding-left: 25px;
    font-size: 11px !important;
    color: #64748b !important;
    font-style: italic;
}

/* Make sortable items visually connected below Featured Image */
#customize-control-Blog_Over_config-Blog_Over_entry_elements {
    margin-top: 0 !important;
}

/* ==========================================================================
   Info Notice Control (Pro Feature Awareness)
   Subtle, WordPress-native styled informational notices
   ========================================================================== */

.blog-over-info-notice {
    background: #f0f6fc;
    border-left: 3px solid #72aee6;
    border-radius: 0 4px 4px 0;
    padding: 10px 12px;
    margin: 8px 0;
}

.blog-over-info-text {
    margin: 0 0 6px;
    font-size: 12px;
    color: #1e1e1e;
    line-height: 1.5;
}

.blog-over-info-text:last-child {
    margin-bottom: 0;
}

.blog-over-info-link {
    display: inline-block;
    font-size: 12px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.blog-over-info-link:hover,
.blog-over-info-link:focus {
    color: #135e96;
    text-decoration: underline;
}

/* ==========================================================================
   PRO Feature Card Control — Gold Badge Style
   Beautiful gold card shown in each Customizer section for non-Pro users.
   Completely separate from .blog-over-info-notice — no legacy conflicts.
   ========================================================================== */

.blog-over-pro-card {
    background: linear-gradient(160deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    border-left: 4px solid #f59e0b;
    border-radius: 0 6px 6px 0;
    padding: 13px 13px 11px;
    margin: 10px 0 4px;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.12);
}

/* Card Header Row */
.blog-over-pro-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    flex-wrap: wrap;
}

/* PRO Badge Pill */
.blog-over-pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.9px;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    line-height: 1.6;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(180, 83, 9, 0.35);
}

.blog-over-pro-badge-star {
    font-size: 9px;
    line-height: 1;
}

/* Card Section Title */
.blog-over-pro-card-title {
    font-size: 11.5px;
    font-weight: 600;
    color: #92400e;
    line-height: 1.3;
}

/* Feature List */
.blog-over-pro-features-list {
    margin: 0 0 10px 0;
    padding: 0;
    list-style: none;
}

.blog-over-pro-features-list li {
    font-size: 11.5px;
    color: #78350f;
    padding: 2px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.45;
}

/* Diamond bullet */
.blog-over-pro-features-list li::before {
    content: "\2726";
    /* ✦ */
    color: #f59e0b;
    font-size: 9px;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Upgrade Button */
.blog-over-pro-card-link {
    display: block;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff !important;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none !important;
    padding: 7px 14px;
    border-radius: 4px;
    transition: opacity 0.2s ease, transform 0.15s ease;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
    letter-spacing: 0.2px;
}

.blog-over-pro-card-link:hover,
.blog-over-pro-card-link:focus {
    opacity: 0.88;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.45);
}

/* Reduce margin when card is the very last control in a section */
.customize-control:last-child .blog-over-pro-card {
    margin-bottom: 0;
}

/* ==========================================================================
   Standard Radio Button Alignment Fix
   ========================================================================== */

/* Fix the slight upward vertical alignment of standard radio inputs */
/* We MUST exclude .screen-reader-text so we don't override its position: absolute and cause layout gaps */
.customize-control-radio input[type="radio"]:not(.screen-reader-text),
.customize-control-kirki-radio input[type="radio"]:not(.screen-reader-text) {
    margin-top: 0 !important;
    vertical-align: middle !important;
    position: relative !important;
    top: -2px !important;
    /* Adjust based on line-height to center it exactly */
}

/* Ensure the label has proper spacing but DON'T use flex which breaks WP core HTML structure */
.customize-control-radio label,
.customize-control-kirki-radio label {
    margin-bottom: 8px !important;
    line-height: 1.5 !important;
}

/* ==========================================================================
   Kirki Toggle Alignment Fix
   ========================================================================== */

/* The global .customize-control-title block adds margin-bottom and display: block, 
   which pushes the Kirki toggle switch upwards or breaks its inline layout. */
.customize-control-kirki-toggle .customize-control-title {
    display: inline-block !important;
    margin-bottom: 0 !important;
    vertical-align: middle !important;
}

/* Make the main label wrapper flex to align title and switch on opposite sides */
.customize-control-kirki-toggle label {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
}

/* The actual toggle switch pill MUST remain inline-block, otherwise flex hides or breaks it */
.customize-control-kirki-toggle .kirki-control-form label,
.customize-control-kirki-toggle .kirki-toggle-switch-label,
.customize-control-kirki-toggle .switch {
    display: inline-block !important;
    width: auto !important;
    margin-left: auto !important;
    margin-bottom: 0 !important;
}