/**
 * Title Section Pro V1 Widget Styles
 * @package PickFolio Elementor Elements
 * @version 1.0.0
 */

/* Widget Container */
.custom-heading-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Widget-level alignment */
.custom-heading-wrapper[style*="text-align: left"] {
    align-items: flex-start;
}

.custom-heading-wrapper[style*="text-align: center"] {
    align-items: center;
}

.custom-heading-wrapper[style*="text-align: right"] {
    align-items: flex-end;
}

/* Individual Element Styling */
.custom-title {
    display: block;
    width: 100%;
    margin: 0;
}

.custom-text {
    display: block;
    width: 100%;
    margin: 0;
}

.custom-button-wrapper {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
}

.custom-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background-color: #007cba;
    color: #ffffff;
}

/* Button Width Options */
.custom-button.button-full-width {
    width: 100%;
    flex: 1 1 100%;
}

.custom-button:hover {
    background-color: #005a87;
    transform: translateY(-2px);
}

.custom-heading-media {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
}

.custom-heading-media-img-wrap {
    display: inline-block;
    width: 100%;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.custom-heading-media-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.custom-heading-media-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #007cba;
    transition: all 0.3s ease;
}

.custom-heading-media-icon:hover {
    transform: scale(1.1);
}

/* Element Order System */
.custom-heading-wrapper[data-element-order="media-title-text-button"] .custom-heading-media { order: 1; }
.custom-heading-wrapper[data-element-order="media-title-text-button"] .custom-title { order: 2; }
.custom-heading-wrapper[data-element-order="media-title-text-button"] .custom-text { order: 3; }
.custom-heading-wrapper[data-element-order="media-title-text-button"] .custom-button-wrapper { order: 4; }

.custom-heading-wrapper[data-element-order="title-media-text-button"] .custom-title { order: 1; }
.custom-heading-wrapper[data-element-order="title-media-text-button"] .custom-heading-media { order: 2; }
.custom-heading-wrapper[data-element-order="title-media-text-button"] .custom-text { order: 3; }
.custom-heading-wrapper[data-element-order="title-media-text-button"] .custom-button-wrapper { order: 4; }

.custom-heading-wrapper[data-element-order="title-text-media-button"] .custom-title { order: 1; }
.custom-heading-wrapper[data-element-order="title-text-media-button"] .custom-text { order: 2; }
.custom-heading-wrapper[data-element-order="title-text-media-button"] .custom-heading-media { order: 3; }
.custom-heading-wrapper[data-element-order="title-text-media-button"] .custom-button-wrapper { order: 4; }

.custom-heading-wrapper[data-element-order="title-text-button-media"] .custom-title { order: 1; }
.custom-heading-wrapper[data-element-order="title-text-button-media"] .custom-text { order: 2; }
.custom-heading-wrapper[data-element-order="title-text-button-media"] .custom-button-wrapper { order: 3; }
.custom-heading-wrapper[data-element-order="title-text-button-media"] .custom-heading-media { order: 4; }

.custom-heading-wrapper[data-element-order="media-title-button-text"] .custom-heading-media { order: 1; }
.custom-heading-wrapper[data-element-order="media-title-button-text"] .custom-title { order: 2; }
.custom-heading-wrapper[data-element-order="media-title-button-text"] .custom-button-wrapper { order: 3; }
.custom-heading-wrapper[data-element-order="media-title-button-text"] .custom-text { order: 4; }

.custom-heading-wrapper[data-element-order="button-media-title-text"] .custom-button-wrapper { order: 1; }
.custom-heading-wrapper[data-element-order="button-media-title-text"] .custom-heading-media { order: 2; }
.custom-heading-wrapper[data-element-order="button-media-title-text"] .custom-title { order: 3; }
.custom-heading-wrapper[data-element-order="button-media-title-text"] .custom-text { order: 4; }

/* Layout Direction */
.custom-heading-wrapper[data-direction="row"] {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}

.custom-heading-wrapper[data-direction="row-reverse"] {
    flex-direction: row-reverse;
    flex-wrap: wrap;
    align-items: center;
}

.custom-heading-wrapper[data-direction="column"] {
    flex-direction: column;
}

/* Media Layout Specific */
.custom-heading-wrapper[data-direction="row"] .custom-heading-media,
.custom-heading-wrapper[data-direction="row-reverse"] .custom-heading-media {
    flex-shrink: 0;
    width: auto;
}

.custom-heading-wrapper[data-direction="row"] .custom-title,
.custom-heading-wrapper[data-direction="row-reverse"] .custom-title,
.custom-heading-wrapper[data-direction="row"] .custom-text,
.custom-heading-wrapper[data-direction="row-reverse"] .custom-text {
    flex: 1;
}

/* Individual Element Alignment Overrides */
.custom-title[style*="text-align: left"] {
    text-align: left !important;
}

.custom-title[style*="text-align: center"] {
    text-align: center !important;
}

.custom-title[style*="text-align: right"] {
    text-align: right !important;
}

.custom-title[style*="text-align: justify"] {
    text-align: justify !important;
}

.custom-text[style*="text-align: left"] {
    text-align: left !important;
}

.custom-text[style*="text-align: center"] {
    text-align: center !important;
}

.custom-text[style*="text-align: right"] {
    text-align: right !important;
}

.custom-text[style*="text-align: justify"] {
    text-align: justify !important;
}

/* Button Alignment */
.custom-button-wrapper[style*="text-align: left"] {
    text-align: left !important;
}

.custom-button-wrapper[style*="text-align: center"] {
    text-align: center !important;
}

.custom-button-wrapper[style*="text-align: right"] {
    text-align: right !important;
}

/* Media Alignment */
.custom-heading-media[style*="justify-content: flex-start"] {
    justify-content: flex-start !important;
}

.custom-heading-media[style*="justify-content: center"] {
    justify-content: center !important;
}

.custom-heading-media[style*="justify-content: flex-end"] {
    justify-content: flex-end !important;
}

/* Enhanced Responsive Behavior */
@media (max-width: 768px) {
    .custom-heading-wrapper[data-direction="row"],
    .custom-heading-wrapper[data-direction="row-reverse"] {
        flex-direction: column;
    }
    
    .custom-heading-wrapper[data-direction="row"] .custom-heading-media,
    .custom-heading-wrapper[data-direction="row-reverse"] .custom-heading-media {
        width: 100%;
    }
    
    .custom-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .custom-button-wrapper {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .custom-button {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .custom-button .button-icon-before,
    .custom-button .button-icon-after {
        font-size: 14px;
    }
}

/* Animation Classes */
.custom-heading-wrapper * {
    transition: all 0.3s ease;
}

/* Hover Effects */
.custom-heading-wrapper:hover .custom-heading-media-img {
    transform: scale(1.02);
}

.custom-heading-wrapper:hover .custom-title {
    color: #007cba;
}

/* Focus States for Accessibility */
.custom-title a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.excerpt-toggle:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .custom-heading-wrapper {
        break-inside: avoid;
    }
    
    .custom-title a {
        color: #000 !important;
    }
}

/* Excerpt Toggle Button */
.excerpt-toggle {
    background: none;
    border: none;
    color: #007cba;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 0;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.excerpt-toggle:hover {
    color: #005a87;
}

.excerpt-toggle i {
    font-size: 12px;
}

/* Button Icon Spacing */
.custom-button .button-icon-before {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.custom-button .button-icon-after {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.custom-button .button-text {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Button Icon SVG Support */
.custom-button i,
.custom-button svg {
    display: inline-block;
    vertical-align: middle;
}

.custom-button svg {
    fill: currentColor;
}

/* Utility Classes */
.custom-heading-wrapper * {
    box-sizing: border-box;
}

.custom-heading-wrapper .elementor-repeater-item {
    margin-bottom: 0;
}
/* ========================================
   Search Box Styles
======================================== */

.custom-search-container {
    display: flex;
    width: 100%;
    margin: 0;
}

.custom-search-wrapper {
    width: 100%;
}

.custom-search-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

.custom-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #ddd;
    background-color: #ffffff;
    color: #333333;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.custom-search-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px rgba(0, 124, 186, 0.2);
}

.custom-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #007cba;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.custom-search-button:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.custom-search-button:active {
    transform: translateY(0);
}

.search-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.search-button-text {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.custom-search-button i,
.custom-search-button svg {
    display: inline-block;
    vertical-align: middle;
}

.custom-search-button svg {
    fill: currentColor;
}

/* Search Element Order */
.custom-heading-wrapper[data-element-order*="search"] .custom-search-container {
    order: 0;
}

.custom-heading-wrapper[data-element-order="search-media-title-text-button"] .custom-search-container { order: 1; }
.custom-heading-wrapper[data-element-order="search-media-title-text-button"] .custom-heading-media { order: 2; }
.custom-heading-wrapper[data-element-order="search-media-title-text-button"] .custom-title { order: 3; }
.custom-heading-wrapper[data-element-order="search-media-title-text-button"] .custom-text { order: 4; }
.custom-heading-wrapper[data-element-order="search-media-title-text-button"] .custom-button-wrapper { order: 5; }

.custom-heading-wrapper[data-element-order="media-search-title-text-button"] .custom-heading-media { order: 1; }
.custom-heading-wrapper[data-element-order="media-search-title-text-button"] .custom-search-container { order: 2; }
.custom-heading-wrapper[data-element-order="media-search-title-text-button"] .custom-title { order: 3; }
.custom-heading-wrapper[data-element-order="media-search-title-text-button"] .custom-text { order: 4; }
.custom-heading-wrapper[data-element-order="media-search-title-text-button"] .custom-button-wrapper { order: 5; }

.custom-heading-wrapper[data-element-order="media-title-search-text-button"] .custom-heading-media { order: 1; }
.custom-heading-wrapper[data-element-order="media-title-search-text-button"] .custom-title { order: 2; }
.custom-heading-wrapper[data-element-order="media-title-search-text-button"] .custom-search-container { order: 3; }
.custom-heading-wrapper[data-element-order="media-title-search-text-button"] .custom-text { order: 4; }
.custom-heading-wrapper[data-element-order="media-title-search-text-button"] .custom-button-wrapper { order: 5; }

.custom-heading-wrapper[data-element-order="title-search-text-button"] .custom-title { order: 1; }
.custom-heading-wrapper[data-element-order="title-search-text-button"] .custom-search-container { order: 2; }
.custom-heading-wrapper[data-element-order="title-search-text-button"] .custom-text { order: 3; }
.custom-heading-wrapper[data-element-order="title-search-text-button"] .custom-button-wrapper { order: 4; }

.custom-heading-wrapper[data-element-order="title-text-search-button"] .custom-title { order: 1; }
.custom-heading-wrapper[data-element-order="title-text-search-button"] .custom-text { order: 2; }
.custom-heading-wrapper[data-element-order="title-text-search-button"] .custom-search-container { order: 3; }
.custom-heading-wrapper[data-element-order="title-text-search-button"] .custom-button-wrapper { order: 4; }

.custom-heading-wrapper[data-element-order="media-title-text-search-button"] .custom-heading-media { order: 1; }
.custom-heading-wrapper[data-element-order="media-title-text-search-button"] .custom-title { order: 2; }
.custom-heading-wrapper[data-element-order="media-title-text-search-button"] .custom-text { order: 3; }
.custom-heading-wrapper[data-element-order="media-title-text-search-button"] .custom-search-container { order: 4; }
.custom-heading-wrapper[data-element-order="media-title-text-search-button"] .custom-button-wrapper { order: 5; }

.custom-heading-wrapper[data-element-order="media-title-text-button-search"] .custom-heading-media { order: 1; }
.custom-heading-wrapper[data-element-order="media-title-text-button-search"] .custom-title { order: 2; }
.custom-heading-wrapper[data-element-order="media-title-text-button-search"] .custom-text { order: 3; }
.custom-heading-wrapper[data-element-order="media-title-text-button-search"] .custom-button-wrapper { order: 4; }
.custom-heading-wrapper[data-element-order="media-title-text-button-search"] .custom-search-container { order: 5; }

/* Responsive Search Adjustments */
@media (max-width: 767px) {
    .custom-search-form {
        flex-wrap: wrap;
    }

    .custom-search-input {
        flex: 1 1 100%;
        margin-bottom: 10px;
    }

    .custom-search-button {
        flex: 1 1 100%;
        width: 100%;
    }
}