/**
 * PUBLICATIONS - BENTO GRID DESIGN
 * Optimized for high engagement and visual appeal
 * Updated: Softer background for reduced eye strain
 */

/* Override body background for this page */
body {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
}

/* Search Container */
.search-container {
    margin: 2.5rem 0 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-bar:focus-within {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

.search-icon {
    color: #d4af37;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.clear-btn {
    background: rgba(212, 175, 55, 0.2);
    border: none;
    color: #d4af37;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    transform: scale(1.1);
}

.search-results-count {
    text-align: center;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Publications Grid - Bento/Masonry Style */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: auto;
    /* Changed from 280px to auto - cards now grow with content */
    gap: 1.5rem;
    margin-top: 3rem;
    grid-auto-flow: dense;
    /* Fill gaps intelligently */
}

/* Card Base Styles */
.article-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem 2rem;
    min-height: 380px;
    /* Added base height */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Gradient Overlay for Readability */
.article-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.95) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
    transition: opacity 0.4s ease;
}

.article-card:hover::before {
    opacity: 0.7;
}

/* Glassmorphism Accent on Hover */
.article-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(212, 175, 55, 0.08);
    backdrop-filter: blur(10px);
    opacity: 0;
    z-index: 2;
    transition: opacity 0.4s ease;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
}

.article-card:hover::after {
    opacity: 1;
}

.article-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.2);
}

/* Card Size Variants */
.card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.card-wide {
    grid-column: span 2;
}

.card-tall {
    grid-row: span 2;
}

/* Content Positioning */
.article-card>* {
    position: relative;
    z-index: 3;
}

/* Category Badge with Color Coding */
.article-category {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 20px;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Category Color Palette (subtle, premium) */
.article-card[data-category="Ceza Hukuku"] .article-category {
    background: rgba(185, 28, 28, 0.3);
    color: #fca5a5;
}

.article-card[data-category="Bilişim Hukuku"] .article-category {
    background: rgba(6, 95, 70, 0.3);
    color: #6ee7b7;
}

.article-card[data-category="Ticaret Hukuku"] .article-category,
.article-card[data-category="İcra ve İflas Hukuku"] .article-category {
    background: rgba(30, 64, 175, 0.3);
    color: #93c5fd;
}

.article-card[data-category="Gayrimenkul"] .article-category {
    background: rgba(120, 53, 15, 0.3);
    color: #fdba74;
}

.article-card[data-category="Aile Hukuku"] .article-category {
    background: rgba(147, 51, 234, 0.3);
    color: #d8b4fe;
}

.article-card[data-category="İş Hukuku"] .article-category {
    background: rgba(88, 28, 135, 0.3);
    color: #e9d5ff;
}

.article-card[data-category="Diğer"] .article-category {
    background: rgba(107, 114, 128, 0.3);
    color: #d1d5db;
}

/* Title */
.article-title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: #fff;
    font-family: 'Cinzel', serif;
    text-transform: none;
    letter-spacing: 0.02em;
}

.card-large .article-title {
    font-size: 2rem;
}

/* Excerpt */
.article-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.25rem;
    /* Removed line-clamp to show full excerpt */
}

.card-large .article-excerpt {
    font-size: 1rem;
    /* Removed line-clamp to show full excerpt */
}

/* Metadata Row */
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.article-date,
.article-read-time {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.article-read-time::before {
    content: '📖';
    font-size: 1rem;
}

.article-date::before {
    content: '📅';
    font-size: 1rem;
}

.article-link {
    color: #d4af37;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.article-link:hover {
    color: #f0d990;
    transform: translateX(4px);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .publications-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        grid-auto-rows: auto;
        /* Changed from 260px to auto */
        gap: 1rem;
    }

    .card-large,
    .card-wide {
        grid-column: span 1;
    }

    .card-tall {
        grid-row: span 1;
    }
}

@media (max-width: 640px) {
    .publications-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        /* Changed from 320px to auto */
    }

    .article-card {
        padding: 1.5rem;
    }
}

/* Principles Section Updates (if needed) */
.principles-section {
    padding: var(--spacing-md) 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95), rgba(20, 20, 20, 0.95));
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.principle-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.principle-item:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.2);
    transform: translateY(-4px);
}

.principle-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 0.5rem;
    font-family: 'Cinzel', serif;
}

.principle-desc {
    display: block;
    font-size: 0.9rem;
    color: #888;
    line-height: 1.5;
}