:root {
    --home-bg: #ffffff;
    --text-color: #111111;
}

[data-theme="dark"] {
    --home-bg: #000000;
    --text-color: #ffffff;
}

body {
    background-color: var(--home-bg) !important;
    color: var(--text-color);
    transition: background-color 0.4s ease, color 0.4s ease;
}

[data-theme="dark"] .search-box,
[data-theme="dark"] .blog-card,
[data-theme="dark"] .section1 {
    background-color: #000000 !important;
}

[data-theme="dark"] body,
[data-theme="dark"] p,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] span,
[data-theme="dark"] li,
[data-theme="dark"] a,
[data-theme="dark"] label,
[data-theme="dark"] small,
[data-theme="dark"] strong {
    color: #ffffff !important;
}

[data-theme="dark"] .dropdown-menu li a {
    color: #000000 !important;
}

[data-theme="dark"] .dropdown-menu li:hover a {
    color: #000000 !important;
}

[data-theme="dark"] .profile .menu span {
    color: #000000 !important;
}

body {
    font-family: archivo;
}

.hero {
    background:
        url("images/home-imgs/bg8.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 95vh;
    color: white;
}

.start {
    background-color: #0548d7;
    color: white;
    padding: 17px 35px;
    border-radius: 8px;
    font-size: 18px;
    border: 2px solid #0548d7;
    margin-top: 20px;
    margin-left: 660px;
    cursor: pointer;
}

.start:hover {
    background-color: white;
    color: #0548d7;
    font-weight: 700;
}

/* SECTION1 */
.filters {
    width: 90%;
    margin: 40px auto 10px;
}

.search {
    position: sticky;
}

.search-box {
    width: 500px;
    height: 20px;
    padding: 15px;
    padding-left: 48px;
    border-radius: 12px;
    border: 2px solid #d3d9e4;
    font-size: 16px;
    outline: none;
    background: white;
    background-image: url('https://cdn-icons-png.flaticon.com/512/149/149852.png');
    background-repeat: no-repeat;
    background-size: 20px;
    background-position: 15px center;
    transition: 0.3s;
    margin-left: 80px;
    margin-right: 50px;
    margin-top: 20px;
}

.search-box:focus {
    border-color: #0548d7;
    box-shadow: 0 0 6px rgba(255, 209, 0, 0.4);
}

.categories {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    padding: 10px 22px;
    border-radius: 25px;
    background: white;
    border: 2px solid #e6e8ec;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: #0548d7;
    border-color: #0548d7;
    font-weight: bold;
    color: white;
}

.blogs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-left: 40px;
    margin-bottom: 50px;
}

.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e4e8f0;
    transition: 0.3s ease;
    width: 450px;
    margin-top: 40px;
    height: 480px;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.15);
}

.img-box {
    width: 100%;
    height: 280px;
    overflow: hidden;
    border-bottom: 1px solid #ddd;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content {
    padding: 15px 18px;
    text-align: center;
}

.content h1 {
    font-size: 20px;
    margin-bottom: 5px;
    color: #0548d7;
}

.content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.content p {
    font-size: 14px;
    color: #555;
}

.view {
    background-color: #0548d7;
    color: white;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 15px;
    border: 2px solid #0548d7;
    cursor: pointer;
    margin-top: 10px;
}

.view:hover {
    background-color: white;
    color: #0548d7;
    font-weight: 700;
}

/* Hidden class for filtering */
.blog-card.hidden {
    display: none;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* CENTER HEADINGS IN RTL */
body.rtl .hero h1,
body.rtl .hero p {
    text-align: center !important;
}
body.rtl .start{
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
}
/* CENTER CATEGORY BUTTONS */
body.rtl .categories {
    justify-content: center !important;
}

/* CENTER GRID IN RTL */
body.rtl .blogs {
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-items: center; 
}

/* CENTER EACH CARD */
body.rtl .blog-card {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ALIGN TEXT INSIDE CARD */
body.rtl .blog-card .content {
    text-align: center !important;
}
/* RESPONSIVE */
@media (max-width:1280px){
.start{
    margin: auto;
    display: flex;
}
.blogs{
    margin: 100px;
    grid-template-columns: repeat(2, 1fr);
    gap: 100px;
}
}
/* RESPONSIVE FOR 1024px */
@media (max-width: 1024px) {
    .blogs {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
        gap: 25px;
        margin: 50px;
    }

    .blog-card {
        max-width: 100%; /* let cards fill grid column */
        height: auto;    /* auto height for responsive content */
    }

    .img-box {
        height: 220px;  /* adjust image height for smaller screens */
    }

    .hero h1 {
        font-size: 50px; /* adjust hero heading */
        padding-top: 300px !important;
    }

    .hero p {
        font-size: 22px; /* adjust hero paragraph */
    }

    .start {
        margin-left: auto;
        margin-right: auto;
        display: block;
        font-size: 16px;
        padding: 12px 25px;
    }
}

@media (max-width:820px){
.hero h1{
    padding-top: 300px !important;
}
.blogs{
    margin:50px 180px;
    grid-template-columns: repeat(1, 1fr);
    gap: 50px;
}
.search {
        flex-direction: column !important;
        align-items: stretch !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    .search-box {
        width: 95% !important;
        margin: 10px 0 !important;
        padding: 10px 15px !important;
        background-position: 10px  !important;
        font-size: 14px !important;
    }
    input::placeholder{
        padding: 30px;
    }
    
    .categories {
        justify-content: center !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .filter-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}
@media(max-width:768px){
    .blogs{
    margin:50px 150px;
    }
}

@media (max-width: 412px) {
    /* HERO SECTION */
    .hero{
        min-height: 80vh;
    }
    .hero h1 {
        font-size: 30px !important;
    }

    .hero p {
        font-size: 14px !important;
    }

    .start {
        font-size: 14px !important;
        padding: 10px 20px !important;
    }

    .search-box {
        width: 90% !important;
    }

    /* BLOG GRID */
    .blogs {
        display: grid !important;
        grid-template-columns: 1fr !important; /* single column */
        gap: 15px !important;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }

    .blog-card {
        width: 99% !important;
        height: auto !important;
        margin-top: 20px !important;
    }

    .img-box {
        height: 200px !important;
    }

    .img-box img {
        height: 100% !important;
        object-fit: cover !important;
    }

    .content h1 {
        font-size: 16px !important;
    }

    .content h3 {
        font-size: 14px !important;
    }

    .content p {
        font-size: 12px !important;
    }

    .view {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    body.rtl .blog-card{
        width: 90% !important;
    }
}
