/*
Theme Name: The Family
Author: Minihosting Technologies
Version: 1.0.0
*/

:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --background-color: #f5f7fa;
    --border-color: #e1e8ed;
    --header-height: 80px;
    --header-shrink-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--background-color);
    padding-top: var(--header-height);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== STICKY HEADER ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
    padding: 15px 0;
    transition: all 0.3s ease;
}

/* Header Shrink Effect */
.site-header.shrink .header-inner {
    padding: 8px 0;
}

.site-header.shrink .site-title {
    font-size: 1.2rem;
}

.site-header.shrink .site-logo img {
    max-height: 40px;
    width: auto;
    transition: all 0.3s ease;
}

/* Header Scroll Effect */
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Header Hidden on Scroll Down */
.site-header.hidden {
    transform: translateY(-100%);
}

/* Header Visible Animation */
.site-header.visible {
    transform: translateY(0);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Progress Bar */
.header-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-color);
    transition: width 0.1s linear;
    z-index: 10000;
}

/* Header Layout */
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    font-size: 1.5rem;
    margin: 0;
    transition: all 0.3s ease;
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-logo img {
    max-height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

/* Navigation */
.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.3s;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-icon {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--secondary-color);
    margin: 5px 0;
    transition: all 0.3s;
}

/* Search */
.header-search {
    position: relative;
    flex-shrink: 0;
}

.search-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    color: var(--secondary-color);
    transition: color 0.3s;
}

.search-toggle:hover {
    color: var(--primary-color);
}

.search-form-container {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 15px;
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.search-form-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-field {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-submit:hover {
    background: var(--secondary-color);
}

.search-type {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.search-suggestions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.clear-recent {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
}

.recent-searches li, .popular-list li {
    padding: 6px 0;
    cursor: pointer;
    font-size: 13px;
    list-style: none;
}

.recent-searches li:hover, .popular-list li:hover {
    color: var(--primary-color);
}

/* Mobile Menu */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .site-header .container {
        flex-wrap: wrap;
    }
    
    .menu-toggle {
        display: block;
        order: 2;
    }
    
    .header-search {
        order: 3;
        margin-left: auto;
    }
    
    .main-navigation {
        width: 100%;
        order: 4;
        display: none;
        margin-top: 15px;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-navigation ul li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-navigation ul li a {
        display: block;
        padding: 12px 0;
    }
    
    .search-form-container {
        position: fixed;
        top: 60px;
        left: 20px;
        right: 20px;
        width: auto;
    }
}

/* Transparent Header for Homepage */
.home .site-header {
    background: transparent;
    box-shadow: none;
}

.home .site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.home .site-header:not(.scrolled) .site-title a,
.home .site-header:not(.scrolled) .main-navigation a,
.home .site-header:not(.scrolled) .search-toggle {
    color: white;
}

.home .site-header:not(.scrolled) .menu-icon {
    background: white;
}

.home .site-header:not(.scrolled) .search-toggle:hover {
    color: rgba(255,255,255,0.8);
}

/* Footer */
.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Search Results */
.search-results-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 40px;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.search-result-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.search-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.search-result-thumbnail {
    height: 200px;
    overflow: hidden;
}

.search-result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    padding: 20px;
}

.search-result-meta {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.search-result-title {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.search-result-title a {
    color: var(--secondary-color);
    text-decoration: none;
}

.search-result-excerpt {
    color: #555;
    margin-bottom: 15px;
}

.search-result-link {
    color: var(--primary-color);
    text-decoration: none;
}

.search-highlight {
    background: rgba(74,144,226,0.2);
    padding: 0 2px;
    border-radius: 3px;
}

.no-search-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--secondary-color);
}

.pagination a:hover, .pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}