/**
 * 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
   ========================================================================== */

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

/* CORRECT SELECTOR - Force flex inline layout */
.customize-control-kirki-radio-image>.image {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
}

/* Each label container - equal width */
.customize-control-kirki-radio-image>.image>label,
#customize-control-Blog_Over_config-blog_over_menu_layout 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-kirki-radio-image>.image>label:hover,
#customize-control-Blog_Over_config-blog_over_menu_layout label:hover {
    border-color: #6b7280 !important;
    background: #ffffff !important;
}

/* SELECTED STATE - Strong blue border */
.customize-control-kirki-radio-image>.image>input:checked+label,
#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-kirki-radio-image>.image img,
#customize-control-Blog_Over_config-blog_over_menu_layout img {
    width: 100% !important;
    height: auto !important;
    /* max-height: 35px !important; */
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

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

/* Hide the radio inputs */
.customize-control-kirki-radio-image>.image>input[type="radio"],
#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;
}