/* ==========================================
   Tag Page Styles
   ========================================== */

/* Tag Header */
.tag-header {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tag-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.tag-hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    z-index: 2;
}

.tag-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
}

.tag-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.tag-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.tag-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Tag Content */
.tag-content {
    padding: 4rem 0;
    background: white;
}

/* Two Column Layout */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

.main-content {
    min-width: 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
}

/* Tag Filter Widget */
.tag-filter-content {
    max-height: 600px;
    overflow-y: auto;
}

.filter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.clear-filters {
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.clear-filters:hover {
    background: #e55555;
    transform: translateY(-1px);
}

.tag-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tag-filter-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.tag-filter-item:hover {
    background: #f0f0f0;
    transform: translateX(3px);
}

.tag-filter-item.active {
    background: var(--gradient-primary);
    color: white;
}

.tag-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
}

.tag-label {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}

.tag-count {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-left: 0.5rem;
}

.tag-filter-item.active .tag-count {
    opacity: 0.9;
}

/* Hidden posts for filtering */
.post-card.hidden {
    display: none;
}

/* No results message */
.no-results {
    display: none;
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 15px;
    margin: 2rem 0;
}

.no-results.show {
    display: block;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.no-results p {
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.empty-content {
    max-width: 600px;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.empty-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    z-index: 1;
}

.empty-content > * {
    position: relative;
    z-index: 2;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.empty-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
}

.empty-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.empty-suggestions {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
}

.empty-suggestions h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
}

.empty-suggestions ul {
    list-style: none;
    padding: 0;
}

.empty-suggestions li {
    padding: 0.5rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.empty-suggestions li:last-child {
    border-bottom: none;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-arrow {
    font-size: 1.2rem;
    transition: var(--transition);
}

.back-home-btn:hover .btn-arrow {
    transform: translateX(5px);
}

/* Newsletter Background Update */
.newsletter-section {
    position: relative;
}

.newsletter-box {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

.newsletter-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.newsletter-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.newsletter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
    z-index: 2;
}

.newsletter-content {
    position: relative;
    z-index: 3;
    padding: 3rem;
    text-align: center;
    color: white;
}

.newsletter-title {
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.newsletter-description {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.newsletter-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

.newsletter-input::placeholder {
    color: var(--text-light);
}

.newsletter-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.newsletter-button {
    background: var(--gradient-gold);
    color: var(--text-primary);
    font-weight: 700;
    text-shadow: none;
}

.newsletter-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: relative;
        top: 0;
        margin-top: 2rem;
    }
    
    .tag-filter-widget {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .tag-header {
        height: 50vh;
        min-height: 300px;
    }
    
    .tag-title {
        font-size: 2rem;
    }
    
    .tag-description {
        font-size: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .empty-content {
        margin: 0 1rem;
        padding: 2rem;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
    
    .empty-title {
        font-size: 1.5rem;
    }
    
    .newsletter-content {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .tag-content {
        padding: 2rem 0;
    }
    
    .empty-suggestions {
        padding: 1rem;
    }
    
    .back-home-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}