/* --- STYLE BLOG MODERN & RESPONSIVE --- */

/* 1. HERO SECTION */
.blog-hero {
    position: relative;
    padding-top: calc(var(--header-height) + 3rem);
    padding-bottom: 4rem;
    background-color: #0f172a;
    border-bottom: 1px solid #1e293b;
    overflow: hidden;
}

/* 2. MENIU CATEGORII (STICKY) */
.blog-nav-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: var(--header-height);
    z-index: 40;
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.blog-nav-scroll {
    display: flex;
    overflow-x: auto;
    gap: 0.8rem;
    padding: 0.25rem 1rem;
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
    mask-image: linear-gradient(to right, transparent, black 20px, black 95%, transparent);
}
.blog-nav-scroll::-webkit-scrollbar { display: none; }

.blog-cat-link {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
}
.blog-cat-link:hover {
    background-color: #eff6ff;
    color: var(--primary-blue);
    border-color: #bfdbfe;
    transform: translateY(-1px);
}
.blog-cat-link.active {
    background-color: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25);
}

/* 3. Grid Articole */
.section-blog-grid { padding: 3rem 0; }
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
}
.blog-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #bfdbfe;
}
.blog-card-img-wrapper {
    position: relative;
    padding-top: 60%; 
    overflow: hidden;
    background: #f1f5f9;
}
.blog-card-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.blog-card:hover .blog-card-img { transform: scale(1.08); }
.blog-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.blog-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--primary-blue);
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    background: #eff6ff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    width: fit-content;
}
.blog-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.blog-card:hover .blog-title { color: var(--primary-blue); }
.blog-excerpt {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}
.blog-footer {
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* 4. EDITOR & POSTARE */
.blog-tag-pill {
    background: var(--primary-blue);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.article-content p { margin-bottom: 1.5rem; }
.article-content h2 { 
    font-size: 1.8rem; font-weight: 800; color: #0f172a; 
    margin: 2.5rem 0 1rem; line-height: 1.2;
}
.article-content h3 { font-size: 1.5rem; font-weight: 700; color: #1e293b; margin: 2rem 0 1rem; }
.article-content ul, .article-content ol { margin-bottom: 1.5rem; padding-left: 1.5rem; color: #334155; }
.article-content ul { list-style-type: disc; }
.article-content ol { list-style-type: decimal; }
.article-content li { margin-bottom: 0.5rem; padding-left: 0.5rem; }
.article-content blockquote {
    border-left: 4px solid var(--primary-blue);
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-radius: 0 12px 12px 0;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.1rem;
    color: #475569;
}
.article-content img {
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    margin: 2rem auto;
    max-width: 100%;
}
.article-content iframe {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.editor-wrapper {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}
.editor-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    position: sticky; top: 0; z-index: 20;
}
.editor-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.editor-btn:hover { background: #e0f2fe; color: var(--primary-blue); }
.editor-content { flex-grow: 1; padding: 2rem; outline: none; overflow-y: auto; }

/* 5. NOU: GALERIE & LIGHTBOX (FIXED) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

.gallery-item {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.gallery-item:hover { border-color: var(--primary-blue); transform: scale(1.02); }
.gallery-item img, .gallery-item video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.gallery-video-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: white;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    pointer-events: none;
}

/* Lightbox - Default Hidden */
.lightbox-overlay {
    display: none; /* Ascuns implicit */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000; /* Foarte sus */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Lightbox - Active State */
.lightbox-overlay.active { 
    display: flex; /* Vizibil la activare */
    opacity: 1; 
}

.lightbox-content-wrapper {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}
.lightbox-media {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: -50px; right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10001;
    background: rgba(255,255,255,0.1);
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* Editor Gallery Upload Boxes */
.upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}
.upload-box:hover { border-color: var(--primary-blue); background: #eff6ff; }
.upload-box.filled { border-style: solid; border-color: #e2e8f0; }
.upload-box img, .upload-box video {
    width: 100%; height: 100%; object-fit: cover;
}
.remove-btn {
    position: absolute;
    top: 5px; right: 5px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
}

/* --- 2. FILTRARE CATEGORII (DROPDOWN STILIZAT) --- */
.blog-nav-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: var(--header-height);
    z-index: 40;
    padding: 1rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.blog-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
}

.blog-filter-btn:hover, .blog-filter-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* Dropdown Menu */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

/* Meniul în sine */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%; 
    left: 0;
    margin-top: 0.5rem;
    width: 16rem;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    z-index: 50;
    animation: fadeInDown 0.2s ease-out;
}

/* Afișare la hover pe wrapper */
.dropdown-wrapper:hover .dropdown-menu {
    display: block;
}

/* Fix pentru a nu se închide dropdown-ul */
.dropdown-wrapper::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 1rem;
    background: transparent;
    z-index: 49;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 3. ACTUALIZĂRI CARD ARTICOL --- */
.blog-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #bfdbfe;
}

.blog-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 0; /* Spațiu gestionat de container flex */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-excerpt {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--primary-blue);
    font-weight: 800;
    letter-spacing: 0.5px;
    background: #eff6ff;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
}

/* --- 3.1. ACTUALIZĂRI PAGINA ARTICOL (BLOG_POST) --- */
.post-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-title-main {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
    flex-grow: 1;
}

.admin-actions-compact {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.admin-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.admin-icon-btn.edit {
    color: #f59e0b; /* Amber 500 */
    background-color: #fffbeb; /* Amber 50 */
}
.admin-icon-btn.edit:hover {
    color: #d97706; /* Amber 600 */
    background-color: #fef3c7; /* Amber 100 */
}

.admin-icon-btn.delete {
    color: #ef4444; /* Red 500 */
    background-color: #fef2f2; /* Red 50 */
}
.admin-icon-btn.delete:hover {
    color: #dc2626; /* Red 600 */
    background-color: #fee2e2; /* Red 100 */
}
