/* =====================================================================
   BLOG PAGE (new UI) — classes prefixed "bl-"
   ===================================================================== */

.bl-page {
    background: #f8f9fc;
    color: #1e293b;
    line-height: 1.6;
    font-family: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.bl-page h1,
.bl-page h2,
.bl-page h3 { font-family: inherit; margin: 0; }
.bl-page p { margin: 0; }

/* ---------- Hero banner ---------- */
.bl-hero {
    position: relative;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    color: #fff;
    text-align: center;
}

.bl-hero h1 {
    margin-bottom: 0.25rem;
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.bl-hero p {
    max-width: 600px;
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

/* ---------- Grid ---------- */
.bl-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.bl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.bl-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: #64748b;
}

.bl-empty i {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 2.5rem;
    color: #cbd5e1;
}

/* ---------- Card ---------- */
.bl-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bl-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.bl-card-image {
    flex-shrink: 0;
    height: 200px;
    background-color: #e2e8f0;
    background-position: center;
    background-size: cover;
}

.bl-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.5rem 1.8rem;
}

.bl-tag {
    align-self: flex-start;
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.9rem;
    border-radius: 50px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.bl-card-body h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

.bl-card-body p {
    flex: 1;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    color: #475569;
}

.bl-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.bl-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.bl-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.4rem;
    border: none;
    border-radius: 50px;
    background: #1e293b;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease;
}

.bl-btn-view i { font-size: 0.75rem; }

.bl-btn-view:hover {
    background: #0f172a;
    transform: scale(1.03);
}

/* ---------- Pagination ---------- */
.bl-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.bl-pagination .page-link { color: #1e293b; }

.bl-pagination .page-item.active .page-link {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}

/* ---------- Modal ---------- */
.bl-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: blFadeIn 0.3s ease;
}

.bl-modal-overlay.active { display: flex; }

.bl-modal {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    animation: blSlideUp 0.35s ease;
}

.bl-modal-image {
    flex-shrink: 0;
    width: 100%;
    height: 280px;
    background-color: #cbd5e1;
    background-position: center;
    background-size: cover;
}

.bl-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem 2.5rem;
}

.bl-modal-content .bl-tag:empty { display: none; }

.bl-modal-content h2 {
    margin-bottom: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.bl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: #64748b;
}

.bl-meta i { margin-right: 0.3rem; }

/* Post body — HTML written in the admin's rich-text editor */
.bl-full-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #334155;
    overflow-wrap: anywhere;
}

.bl-full-text p,
.bl-full-text ul,
.bl-full-text ol,
.bl-full-text blockquote { margin: 0 0 1rem; }
.bl-full-text h2,
.bl-full-text h3,
.bl-full-text h4 { margin: 1.5rem 0 0.75rem; font-weight: 700; color: #0f172a; }
.bl-full-text h2 { font-size: 1.5rem; }
.bl-full-text h3 { font-size: 1.25rem; }
.bl-full-text img { max-width: 100%; height: auto; border-radius: 12px; }
.bl-full-text a { color: #4f46e5; }
.bl-full-text blockquote {
    padding: 0.5rem 1rem;
    border-left: 4px solid #4f46e5;
    background: #f8fafc;
    font-style: italic;
}
.bl-full-text table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.bl-full-text td,
.bl-full-text th { padding: 0.5rem; border: 1px solid #e2e8f0; }

.bl-modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    color: #0f172a;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.bl-modal-close:hover {
    background: #fff;
    transform: rotate(90deg);
}

.bl-modal-content::-webkit-scrollbar { width: 6px; }
.bl-modal-content::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.bl-modal-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.bl-modal-content::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

@keyframes blFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes blSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .bl-grid { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
    .bl-hero h1 { font-size: 2.8rem; }
    .bl-modal-content { padding: 1.75rem 2rem 2rem; }
    .bl-modal-content h2 { font-size: 1.7rem; }
}

@media (max-width: 768px) {
    .bl-hero { height: 200px; padding: 0 1rem; }
    .bl-hero h1 { font-size: 2.2rem; }
    .bl-hero p { max-width: 90%; font-size: 1rem; }
    .bl-container { padding: 1.5rem 1rem 3rem; }
    .bl-grid { gap: 1.25rem; }
    .bl-card-image { height: 160px; }
    .bl-card-body { padding: 1.2rem 1.2rem 1.4rem; }
    .bl-card-body h3 { font-size: 1.1rem; }
    .bl-modal { max-width: 100%; max-height: 98vh; border-radius: 16px; }
    .bl-modal-image { height: 200px; }
    .bl-modal-content { padding: 1.5rem 1.5rem 2rem; }
    .bl-modal-content h2 { font-size: 1.5rem; }
    .bl-modal-close { top: 0.8rem; right: 1rem; width: 38px; height: 38px; font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .bl-hero { height: 180px; }
    .bl-hero h1 { font-size: 1.7rem; }
    .bl-hero p { font-size: 0.9rem; }
    .bl-container { padding: 1rem 0.75rem 2.5rem; }
    .bl-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .bl-card-image { height: 180px; }
    .bl-card-body h3 { font-size: 1.2rem; }
    .bl-modal-overlay { padding: 0.5rem; }
    .bl-modal { max-height: 100vh; border-radius: 12px; }
    .bl-modal-image { height: 160px; }
    .bl-modal-content { padding: 1.25rem 1.25rem 1.75rem; }
    .bl-modal-content h2 { font-size: 1.3rem; }
    .bl-meta { gap: 0.75rem; font-size: 0.8rem; }
    .bl-modal-close { top: 0.6rem; right: 0.8rem; width: 34px; height: 34px; font-size: 1rem; }
    .bl-btn-view { padding: 0.4rem 1.1rem; font-size: 0.8rem; }
    .bl-date { font-size: 0.7rem; }
}

@media (max-width: 360px) {
    .bl-hero h1 { font-size: 1.4rem; }
    .bl-hero p { font-size: 0.8rem; }
    .bl-card-body h3 { font-size: 1rem; }
    .bl-card-body p { font-size: 0.85rem; }
}

/* =====================================================================
   HOVER EFFECTS (scroll reveals come from data-reveal)
   ===================================================================== */

/* Image zooms inside its frame (pseudo-element so it never overlaps the text) */
.bl-card-image {
    position: relative;
    overflow: hidden;
}

.bl-card-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    transition: transform 0.7s ease;
}

.bl-card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.35), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bl-card:hover .bl-card-image::before { transform: scale(1.1); }
.bl-card:hover .bl-card-image::after { opacity: 1; }

/* Tag fills, title colours, underline grows */
.bl-tag { transition: background 0.3s ease, color 0.3s ease; }
.bl-card:hover .bl-tag { background: #4f46e5; color: #fff; }
.bl-card-body h3 { transition: color 0.3s ease; }
.bl-card:hover .bl-card-body h3 { color: #4f46e5; }

.bl-card-footer { position: relative; }

.bl-card-footer::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #a855f7);
    transition: width 0.5s ease;
}

.bl-card:hover .bl-card-footer::before { width: 100%; }

/* View button: arrow slides, light sweep */
.bl-btn-view { position: relative; overflow: hidden; isolation: isolate; }
.bl-btn-view i { transition: transform 0.3s ease; }
.bl-btn-view:hover i { transform: translateX(5px); }

.bl-btn-view::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    z-index: -1;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

.bl-btn-view:hover::after { left: 130%; }

/* Date icon */
.bl-date i { transition: transform 0.4s ease; }
.bl-card:hover .bl-date i { transform: rotate(-12deg) scale(1.15); }

@media (prefers-reduced-motion: reduce) {
    .bl-btn-view::after { display: none; }
}
