html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "Segoe UI", "Poppins", Arial, sans-serif;
    background: linear-gradient(120deg, #edf4fb 0%, #fdefef 60%, #f5faff 100%);
    color: #1d2939;
    line-height: 1.8;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.ad-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
}

 /* Popup Styling */
  .popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    z-index: 1000;
  }

  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  .modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 300px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
  }

  .modal[data-type] {
    display: block;
  }

  .modalDialog {
    margin: auto;
    padding: 25px;
    background-color: white;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .grantButtons,
  .rewardButtons {
    display: none;
  }

  .modal[data-type="grant"] .grantButtons,
  .modal[data-type="reward"] .rewardButtons {
    display: block;
  }

  .modal input[type="button"] {
    padding: 0.5rem;
    background: blue;
    border: none;
    border-radius: 4px;
    margin: 4px;
    color: white;
  }

/* Blog detail layout */
.blog-detail-container {
    max-width: 800px;
    margin: 2.5rem auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 20px #00223e18;
    padding: 2.3rem 2.5rem;
    transition: background 0.2s;
}
.blog-article .blog-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 0;
    padding: 20px;
    border-radius: 20px;
    background-color: white;
}
.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1em;
    justify-content: center;
    color: #0097c2;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.blog-category {
    background: #e8f2ff;
    color: #095fa2;
    padding: 2px 12px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.98rem;
}
.blog-title {
    font-size: 2.2rem;
    color: #1d2939;
    font-weight: 800;
    margin-bottom: 1.1rem;
    text-wrap: balance;
    letter-spacing: -0.01em;
}
.blog-header .blog-hero {
    width: 100%;
    max-height: 370px;
    object-fit: cover;
    border-radius: 10px;
    margin: 2rem 0 0 0;
    box-shadow: 0 6px 32px #2957be12;
}
.blog-content {
    line-height: 1.8;
    color: #35445a;
    font-size: 1.15rem;
    padding: 20px;
}
.blog-content h2 {
    font-size: 1.3rem;
    margin: 2rem 0 0.7rem 0;
    color: #0c465e;
    font-weight: 700;
}
.blog-content ul {
    padding-left: 1.4rem;
    margin-bottom: 1.1rem;
}
.blog-content ul li {
    margin: 0.35em 0;
    font-size: 1.03rem;
}
.blog-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 10px;
    margin: 1.6rem 0;
    box-shadow: 0 8px 40px #003d3910;
}

@media (max-width: 950px) {
    .blog-detail-container {
        padding: 1.2rem 0.8rem;
    }
    .blog-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 650px) {
    .blog-detail-container {
        max-width: 99vw;
        margin: 1.1rem 1vw;
        padding: 0.7rem 0.1rem;
        border-radius: 8px;
    }
    .blog-content {
        font-size: 1.06rem;
        padding-left: 2vw;
        padding-right: 2vw;
    }
    .blog-article .blog-header {
        margin-bottom: 1.3rem;
    }
    .blog-header .blog-hero {
        max-height: 210px;
    }
    .blog-content h2 {
        font-size: 1.1rem;
    }
}

/* Optional: Dark mode for mobile (see your preferences) */
@media (max-width: 650px) and (prefers-color-scheme: dark) {
    .blog-detail-container {
        background: #17181b;
        color: #e5e9f1;
        box-shadow: 0 2px 14px #000b;
        border: 1px solid #24252d;
    }
    .blog-author-bio {
        color: #9db0bd;
    }
}
.related-blogs {
    margin: 3rem auto 2rem auto;
    background: #fff;
    border-radius: 17px;
    box-shadow: 0 1px 20px #0a233018;
    padding: 2rem 2.1rem;
    max-width: 950px;
}
.related-title {
    font-size: 1.4rem;
    color: #205a85;
    font-weight: 700;
    margin-bottom: 1.7rem;
    text-align: center;
}
.related-list {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}
.related-card {
    background: #f8fbfd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px #003d3912;
    width: 250px;
    min-width: 190px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.18s;
}
.related-card:hover {
    box-shadow: 0 6px 28px #0088dd29;
    transform: translateY(-5px) scale(1.025);
}
.related-card img {
    width: 100%;
    height: 124px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}
.related-content {
    padding: 1.08rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.related-link {
    color: #205a85;
    font-weight: 700;
    font-size: 1.04rem;
    text-decoration: none;
    transition: color 0.21s;
}
.related-link:hover {
    color: #fa5a47;
}
.related-meta {
    font-size: 0.93rem;
    color: #6b7a8e;
}

/* Responsive styling for tablets/mobile */
@media (max-width: 950px) {
    .related-blogs {
        padding: 1.2rem 1vw;
    }
    .related-list {
        gap: 1.2rem;
    }
    .related-card {
        width: 46vw;
        min-width: 135px;
    }
}
@media (max-width: 650px) {
    .related-list {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .related-card {
        width: 85vw;
        max-width: 345px;
    }
    .related-blogs {
        padding: 0.9rem 0vw;
    }
    .related-title {
        font-size: 1.13rem;
    }
}
.blog-main-layout {
    display: flex;
    align-items: flex-start;
    gap: 2.6rem;
    justify-content: space-between;
    margin-top: 80px;
    margin-bottom: 80px;
}

.blog-detail-content {
    flex: 1 1 0;
    min-width: 0;
    background-color: white;
    /* padding: 40px; */
    border-radius: 20px;
}

.related-blogs {
    flex: 0 0 330px;
    max-width: 330px;
    width: 100%;
    margin: 0;
    background: #fff;
    border-radius: 17px;
    box-shadow: 0 1px 20px #0a233018;
    padding: 2rem 1.2rem;
    /* Position sticky for nice UX */
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

@media (max-width: 1100px) {
    .blog-main-layout {
        gap: 1.2rem;
    }
    .related-blogs {
        max-width: 270px;
        padding: 1.1rem 0.5rem;
    }
}

@media (max-width: 950px) {
    .blog-main-layout {
        flex-direction: column;
        gap: 0;
    }
    .related-blogs {
        position: static;
        max-width: 100vw;
        width: 100%;
        margin-top: 2.2rem;
        border-radius: 15px;
        box-shadow: 0 1px 10px #15534e18;
    }
}
@media (max-width: 650px) {
    .related-blogs {
        padding: 0.8rem 0vw;
        margin-top: 1.2rem;
        border-radius: 10px;
    }
    .related-title {
        font-size: 1.13rem;
    }
}

.blog-detail-content {
    width: 100%;
}
