/**
 * WTD Search Styles
 * Updated to match Figma design - Node 1013:3922 & 1013:3947
 */

/* Search Toggle Button */
.wtd-search-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #000;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wtd-search-toggle:hover {
    opacity: 0.7;
} 

.wtd-search-toggle svg {
    width: 20px;
    height: 20px;
}

/* ================================
   Search Overlay
   ================================ */
.wtd-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ecebe8;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.wtd-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ================================
   Search Container
   ================================ */
.wtd-search-container {
    position: relative;
    max-width: 1328px;
    margin: 0 auto;
    padding: 100px 200px;
    min-height: 100vh;
}

/* Close Button - Top Right */
.wtd-search-close {
    position: fixed;
    top: 100px;
    right: calc((100% - 1328px) / 2 + 24px);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #000;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    width: 24px;
    height: 24px;
    z-index: 10;
}

.wtd-search-close:hover {
    opacity: 1;
}

.wtd-search-close svg {
    width: 24px;
    height: 24px;
}

/* ================================
   Search Inner Layout
   ================================ */
.wtd-search-inner {
    margin-top: 80px;
}

/* Search Label */
.wtd-search-label {
    font-family: 'Manrope', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #5a5a5a;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 38px;
}

.wtd-search-label::before {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: #5a5a5a;
    margin-left: -70px;
}

/* ================================
   Search Form & Input
   ================================ */
.wtd-search-form {
    position: relative;
    margin-bottom: 40px;
}

.wtd-search-input {
    width: 100%;
    padding: 0;
    font-size: 72px;
    font-family: 'biennale', Georgia, serif;
    font-weight: 400;
    line-height: 100px;
    background: none;
    border: none;
    outline: none;
    color: #0c0c0c;
    caret-color: #0c0c0c;
}

.wtd-search-input::placeholder {
    color: rgba(0, 0, 0, 0.15);
}

/* Hide browser's default clear button on search inputs */
.wtd-search-input::-webkit-search-cancel-button,
.wtd-search-input::-webkit-search-decoration,
.wtd-search-input::-webkit-search-results-button,
.wtd-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.wtd-search-input::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

/* Horizontal line separator */
.wtd-search-separator {
    width: 100%;
    height: 1px;
    background: #bababa;
    margin-top: 40px;
}

/* Search Suggestions - Disabled */
.wtd-search-suggestions {
    display: none !important;
}

/* ================================
   Search Filters / Tabs
   ================================ */
.wtd-search-filters {
    display: flex;
    gap: 0;
    margin-top: 40px;
    margin-bottom: 48px;
    font-family: 'Manrope', -apple-system, sans-serif;
}

.wtd-filter-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0 0 12px 0;
    margin-right: 32px;
    cursor: pointer;
    color: #797979;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    text-transform: lowercase;
}

.wtd-filter-btn:first-child {
    width: 40px;
}

.wtd-filter-btn:hover {
    color: #5a5a5a;
}

.wtd-filter-btn.active {
    color: #0c0c0c;
    border-bottom-color: #0c0c0c;
}

/* ================================
   Search Results
   ================================ */
.wtd-search-results {
    min-height: 200px;
}

.wtd-search-empty,
.wtd-search-loading,
.wtd-search-error {
    padding: 60px 0;
    font-family: 'Manrope', -apple-system, sans-serif;
    color: #797979;
}

.wtd-search-empty p,
.wtd-search-error p {
    font-size: 16px;
    font-weight: 400;
}

/* Loading Spinner */
.wtd-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid #e6e5e1;
    border-top-color: #666;
    border-radius: 50%;
    animation: wtd-spin 0.8s linear infinite;
}

@keyframes wtd-spin {
    to { transform: rotate(360deg); }
}

/* ================================
   Results Grid - 3 Column Cards
   ================================ */
.wtd-search-results-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

/* Result Card */
.wtd-search-result {
    flex: 0 0 calc(33.333% - 16px);
    max-width: calc(33.333% - 16px);
    background: rgba(246, 245, 241, 0.6);
    border: 1px solid #f9f9f9;
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    min-height: 195px;
}

.wtd-search-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Result Meta */
.wtd-result-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.wtd-result-type {
    font-family: 'Manrope', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #797979;
    text-transform: capitalize;
}

/* Result Title */
.wtd-result-title {
    font-family: 'Manrope', -apple-system, sans-serif;
    font-size: 20px;
    font-weight: 400;
    margin: 0;
    color: #0c0c0c;
    line-height: 1.3;
}

.wtd-result-title mark {
    background: rgba(255, 220, 0, 0.3);
    color: inherit;
    padding: 0 2px;
}

/* Result Excerpt - limited to 4 lines */
.wtd-result-excerpt {
    font-family: 'Manrope', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #5a5a5a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Result Date */
.wtd-result-date {
    font-family: 'Manrope', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #898989;
}

/* Hide old icon styling */
.wtd-result-icon {
    display: none;
}

.wtd-result-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* Result Lock */
.wtd-result-lock {
    font-size: 14px;
    color: #898989;
}

.wtd-search-result.wtd-result-restricted {
    opacity: 0.7;
}

/* ================================
   Pagination
   ================================ */
.wtd-search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 48px;
    font-family: 'Manrope', -apple-system, sans-serif;
}

.wtd-page-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    color: #797979;
    font-size: 14px;
    transition: color 0.3s ease;
    text-transform: lowercase;
}

.wtd-page-btn:hover {
    color: #0c0c0c;
}

.wtd-page-info {
    color: #898989;
    font-size: 14px;
}

/* ================================
   Responsive Styles
   ================================ */
@media (max-width: 1600px) {
    .wtd-search-container {
        padding: 100px 100px;
    }
    
    .wtd-search-close {
        right: 100px;
    }
    
    .wtd-search-label::before {
        margin-left: -48px;
    }
}

@media (max-width: 1200px) {
    .wtd-search-container {
        padding: 80px 48px;
    }
    
    .wtd-search-close {
        right: 48px;
        top: 80px;
    }
    
    .wtd-search-inner {
        margin-top: 100px;
    }
    
    .wtd-search-input {
        font-size: 56px;
        line-height: 80px;
    }
    
    .wtd-search-label::before {
        display: none;
    }
    
    /* 2 column grid */
    .wtd-search-result {
        flex: 0 0 calc(50% - 12px);
        max-width: calc(50% - 12px);
    }
}

@media (max-width: 768px) {
    .wtd-search-container {
        padding: 60px 24px;
    }
    
    .wtd-search-close {
        position: absolute;
        top: 24px;
        right: 24px;
    }
    
    .wtd-search-inner {
        margin-top: 80px;
    }
    
    .wtd-search-input {
        font-size: 36px;
        line-height: 48px;
    }
    
    .wtd-search-label {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .wtd-search-filters {
        gap: 0;
        flex-wrap: wrap;
        margin-top: 24px;
        margin-bottom: 32px;
    }
    
    .wtd-filter-btn {
        font-size: 14px;
        margin-right: 16px;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    /* Single column on mobile */
    .wtd-search-result {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .wtd-result-title {
        font-size: 18px;
    }
    
    .wtd-result-excerpt {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .wtd-search-input {
        font-size: 28px;
        line-height: 40px;
    }
    
    .wtd-filter-btn {
        font-size: 13px;
        margin-right: 12px;
    }
}

/* Mobile Menu Search Icon */
@media (max-width: 768px) {
    .nav-section.search-mobile {
        margin-top: 20px;
    }
    
    .nav-section.search-mobile a {
        display: flex;
        align-items: center;
        gap: 10px;
    }
}
