/* ============================================
   SEARCH MODAL STYLES
   ============================================ */

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

.search-modal.active {
    opacity: 1;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.search-modal-content {
    position: relative;
    max-width: 700px;
    width: 90%;
    margin: 15vh auto 0;
    background: #fff;
    padding: 48px;
    border-radius: 8px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.search-modal.active .search-modal-content {
    transform: translateY(0);
}

.search-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3a352e;
    transition: color 0.2s ease;
    padding: 0;
}

.search-modal-close svg {
    width: 24px;
    height: 24px;
}

.search-modal-close:hover {
    color: #2c3cbb;
}

.search-modal-inner h2 {
    margin-bottom: 24px;
    color: #3a352e;
    font-size: 2.8rem;
}

body.search-modal-open {
    overflow: hidden;
}

/* ============================================
   SEARCH FORM STYLES
   ============================================ */

.relevanssi-search-form,
.search-form {
    position: relative;
    width: 100%;
}

.search-form-inner {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-field {
    flex: 1;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #b6ada0;
    border-radius: 4px;
    font-family: "ballinger", sans-serif;
    transition: border-color 0.2s ease;
    min-height: 56px;
    box-sizing: border-box;
}

.search-field:focus {
    outline: none;
    border-color: #2c3cbb;
}

.search-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 16px 24px 16px 56px;
    font-size: 16px;
    min-height: 56px;
    flex: 0 0 auto;
}

.search-submit svg {
    width: 20px;
    height: 20px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   SEARCH HERO STYLES
   ============================================ */

.search-hero {
    background: #000;
    padding: clamp(6.4rem, 10vw, 12.8rem) 0 clamp(4.8rem, 8vw, 9.6rem);
}

.search-hero-content {
    max-width: 800px;
}

.search-hero .breadcrumbs {
    margin-bottom: 2.4rem;
    color: rgba(255, 255, 255, 0.7);
}

.search-hero .breadcrumbs a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-hero .breadcrumbs a:hover {
    color: #fff;
}

.search-hero .breadcrumbs .separator {
    margin: 0 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.search-hero h1 {
    color: #fff;
    margin-bottom: 1.6rem;
}

.search-hero .search-query {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

.search-hero .search-query strong {
    color: #8fff3e;
}

.search-hero .search-form-container {
    margin-top: 3.2rem;
    max-width: 100%;
}

.search-hero .search-field {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.search-hero .search-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-hero .search-field:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #8fff3e;
}

/* ============================================
   SEARCH RESULTS PAGE STYLES
   ============================================ */

.search-results-section {
    padding: clamp(4.8rem, 8vw, 12.8rem) 0;
    background: #f3efe7;
}

.search-results-header {
    margin-bottom: 4.8rem;
}

.search-results-header h1 {
    margin-bottom: 1.6rem;
}

.search-query {
    font-size: 1.8rem;
    margin-bottom: 3.2rem;
}

.search-query strong {
    color: #2c3cbb;
}

.search-form-container {
    max-width: 600px;
    margin-top: 3.2rem;
}

.search-results-count {
    margin-bottom: 3.2rem;
}

.search-results-count p {
    color: #3a352e;
}

.search-results-grid {
    display: flex;
    flex-direction: column;
    gap: 3.2rem;
}

.search-result-item {
    background: #fff;
    padding: clamp(2.4rem, 3vw, 4rem);
    border-radius: 8px;
    border: 1px solid #b6ada0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-result-item.has-thumbnail {
    display: flex;
    gap: 2.4rem;
    align-items: flex-start;
}

.search-result-item:hover {
    border-color: #2c3cbb;
    box-shadow: 0 4px 12px rgba(44, 60, 187, 0.1);
}

.result-thumbnail {
    flex-shrink: 0;
    width: 160px;
    height: 120px;
    overflow: hidden;
    border-radius: 4px;
}

.result-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-item:hover .result-image {
    transform: scale(1.05);
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    margin-bottom: 1.2rem;
}

.result-title a {
    color: #3a352e;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-title a:hover {
    color: #2c3cbb;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.6rem;
    font-size: 1.4rem;
    color: #49443b;
}

.post-type {
    text-transform: uppercase;
    font-weight: 600;
}

.result-excerpt {
    margin-bottom: 1.6rem;
    line-height: 1.6;
    color: #49443b;
}

.result-excerpt p {
    margin-bottom: 0;
}

/* Relevanssi highlight styling */
.relevanssi-highlight,
.result-excerpt strong {
    background: #8fff3e;
    color: #000;
    padding: 2px 4px;
    border-radius: 2px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: #2c3cbb;
    text-decoration: none;
    font-weight: 600;
    transition: gap 0.2s ease;
}

.read-more:hover {
    gap: 0.8rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 6.4rem 0;
}

.no-results h2 {
    margin-bottom: 1.6rem;
}

.did-you-mean {
    margin-top: 2.4rem;
    padding: 2.4rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #b6ada0;
}

.did-you-mean p {
    margin: 0;
}

.did-you-mean a {
    color: #2c3cbb;
    text-decoration: underline;
}

.did-you-mean a:hover {
    text-decoration: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 4.8rem;
    flex-wrap: wrap;
}

.pagination .nav-links {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination a,
.pagination span {
    padding: 1.6rem 2.4rem;
    background: #fff;
    border: 2px solid #b6ada0;
    border-radius: 4px;
    text-decoration: none;
    color: #3a352e;
    transition: all 0.2s ease;
    font-size: 1.6rem;
    font-weight: 600;
    min-width: 52px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    padding: 1.6rem 3.2rem;
}

.pagination a:hover {
    background: #2c3cbb;
    border-color: #2c3cbb;
    color: #fff;
}

.pagination .current {
    background: #2c3cbb;
    border-color: #2c3cbb;
    color: #fff;
}

.pagination .dots {
    border: none;
    background: transparent;
    padding: 1.6rem 0.8rem;
    min-width: auto;
}

/* Mobile Responsive */
@media (max-width: 700px) {
    .search-modal-content {
        margin: 5vh 16px 0;
        padding: 32px 24px;
        width: calc(100% - 32px);
    }

    .search-modal-inner h2 {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }

    .search-form-inner {
        flex-direction: column;
    }

    .search-field {
        width: 100%;
    }

    .search-submit {
        width: 100%;
        justify-content: center;
    }

    .result-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-result-item.has-thumbnail {
        flex-direction: column;
    }

    .result-thumbnail {
        width: 100%;
        height: 180px;
    }

    .search-hero {
        padding: 48px 0 32px;
    }

    .search-hero .search-form-inner {
        flex-direction: column;
    }

    .search-hero .search-submit {
        width: 100%;
    }

    .pagination a,
    .pagination span {
        padding: 1.2rem 1.6rem;
        font-size: 1.4rem;
        min-width: 44px;
    }

    .pagination .page-numbers.prev,
    .pagination .page-numbers.next {
        padding: 1.2rem 2rem;
    }
}

/* ============================================
   ARCHIVE PAGE STYLES
   ============================================ */

.archive-hero {
    background: #000;
    padding: clamp(6.4rem, 10vw, 12.8rem) 0 clamp(4.8rem, 8vw, 9.6rem);
}

.archive-hero-content {
    max-width: 800px;
}

.archive-hero .breadcrumbs {
    margin-bottom: 2.4rem;
    color: rgba(255, 255, 255, 0.7);
}

.archive-hero .breadcrumbs a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.archive-hero .breadcrumbs a:hover {
    color: #fff;
}

.archive-hero .breadcrumbs .separator {
    margin: 0 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.archive-hero h1 {
    color: #fff;
    margin-bottom: 1.6rem;
}

.archive-hero .archive-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

.archive-hero .archive-description p {
    margin-bottom: 0;
}

.archive-results-section {
    padding: clamp(4.8rem, 8vw, 12.8rem) 0;
    background: #f3efe7;
}

.archive-results-count {
    margin-bottom: 3.2rem;
}

.archive-results-count p {
    color: #3a352e;
}

.archive-results-grid {
    display: flex;
    flex-direction: column;
    gap: 3.2rem;
}

.archive-result-item {
    background: #fff;
    padding: clamp(2.4rem, 3vw, 4rem);
    border-radius: 8px;
    border: 1px solid #b6ada0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.archive-result-item.has-thumbnail {
    display: flex;
    gap: 2.4rem;
    align-items: flex-start;
}

.archive-result-item:hover {
    border-color: #2c3cbb;
    box-shadow: 0 4px 12px rgba(44, 60, 187, 0.1);
}

.archive-result-item:hover .result-image {
    transform: scale(1.05);
}

/* Mobile Responsive for Archives */
@media (max-width: 700px) {
    .archive-hero {
        padding: 48px 0 32px;
    }

    .archive-result-item.has-thumbnail {
        flex-direction: column;
    }

    .archive-result-item .result-thumbnail {
        width: 100%;
        height: 180px;
    }
}
