/* Base Body & Container */
body {
    background: #fff;
    margin: 0;
    padding: 0;
   
    font-family: "Poppins", "Inter", "Segoe UI", sans-serif;
    color: #333;
    line-height: 1.6;
}

main.content-container {
    max-width: 880px;
    min-height: 350px;
    margin: 100px auto 60px;
    padding: 0 16px;
}

/* Page Title */
h1.page-title {
    font-weight: 700;
    font-size: 2rem;
    text-align: center;
    margin: 120px 0 10px;
    letter-spacing: 0.15em;
    background: linear-gradient(90deg, #4a6fa5, #3b8d99);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    user-select: none;
    text-transform: uppercase;
}

h1.page-title span {
    color: #950e47;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

/* Filter Wrapper (Dropdown + Search) */
.filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0 30px;
    justify-content: center;
}

#topicSelector,
#articleSearch {
    padding: 10px 14px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1.8px solid #4a6fa5;
    outline-offset: 2px;
    transition: border-color 0.3s ease;
    min-width: 220px;
    max-width: 320px;
}

#topicSelector:focus,
#articleSearch:focus {
    border-color: #e54926;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* Article Card */
.article-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.article-card:hover,
.article-card:focus {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-3px);
    outline: none;
}

.article-card h3 {
    margin: 0 0 14px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a6fa5;
    line-height: 1.3;
    word-break: break-word;
}

.article-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    flex-grow: 1;
}

.article-card a.read-more {
    margin-top: 14px;
    font-weight: 600;
    font-size: 0.87rem;
    color: #e54926;
    text-decoration: none;
    user-select: none;
    align-self: flex-start;
    transition: color 0.2s ease;
}

.article-card a.read-more:hover,
.article-card a.read-more:focus {
    color: #222;
    text-decoration: underline;
    outline: none;
}

/* Pagination */
.pagination {
    max-width: 880px;
    margin: 32px auto 60px;
    text-align: center;
    user-select: none;
}

.pagination button {
    background: #4a6fa5;
    border: none;
    color: white;
    font-weight: 600;
    margin: 0 6px 6px 0;
    padding: 9px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s ease;
    min-width: 40px;
    font-size: 0.95rem;
}

.pagination button:hover,
.pagination button:focus {
    background-color: #3b8d99;
    outline: none;
}

.pagination button.active {
    background-color: #e54926;
}

.pagination button[disabled] {
    background-color: #999;
    cursor: not-allowed;
}

/* Article Display (Full Article) */
.article-display {
    max-width: 880px;
    margin: 40px auto 80px;
    padding: 32px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
    font-family: "Poppins", "Inter", "Segoe UI", sans-serif;
    color: #222;
    line-height: 1.8;
    width: 100%;
    box-sizing: border-box;
}

.article-display h2,
.article-display h3,
.article-display h4 {
    margin-top: 32px;
    margin-bottom: 12px;
    color: #2e5c8c;
    line-height: 1.3;
}

.article-display p {
    font-size: 1rem;
    margin-bottom: 18px;
    text-align: justify;
    letter-spacing: 0.02em;
}

.article-display a {
    color: #1565c0;
    text-decoration: underline;
}

.article-display a:hover,
.article-display a:focus {
    color: #e54926;
    outline: none;
}

/* Responsive Tables in Article */
.article-display table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 1rem;
}

.article-display th,
.article-display td {
    border: 1px solid #ccc;
    padding: 10px 14px;
    text-align: left;
}

.article-display th {
    background-color: #f2f7ff;
    color: #2e5c8c;
}
.social-floating-panel {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the row horizontally */
    gap: 16px;
    margin-top: -10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #fafafa;
}


.social-floating-panel a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background-color 0.3s ease;
    text-decoration: none;
}

.social-floating-panel a:hover {
    transform: scale(1.1);
    background-color: #f0f0f0;
}

.social-floating-panel img {
    width: 24px;
    height: 24px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .social-floating-panel {
       margin-top: 70px;
    }
    .article-display {
        padding: 24px 20px;
        margin: 30px 16px 60px;
    }

    .article-display p {
        font-size: 0.95rem;
    }

    .article-display table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
        scrollbar-color: #aaa #eee;
        margin-bottom: 1.5rem;
    }

    .article-display th,
    .article-display td {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .article-display table::-webkit-scrollbar {
        height: 6px;
    }

    .article-display table::-webkit-scrollbar-thumb {
        background: #aaa;
        border-radius: 10px;
    }

    .article-display table::-webkit-scrollbar-track {
        background: #eee;
    }
}

/* General Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: #f2f2f2;
}

.single-article{
    margin-top: 100px;
    margin: 100px;
    font-family: Poppins !important;
    line-height: 1.9 !important;
  letter-spacing: 0.03em !important;
}


/* Responsive Layout Adjustments */
@media (max-width: 480px) {
   
    main.content-container {
        margin: 10px 8px 20px !important; /* much smaller vertical and horizontal margin */
        padding: 0 8px !important; /* minimal horizontal padding */
    }

    #topicSelector,
    #articleSearch {
        max-width: 100%;
        min-width: unset;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .article-card {
        min-height: auto;
        padding: 14px 16px;
    }

    .article-card h3 {
        font-size: 1rem;
    }

    .pagination {
        margin: 20px 8px !important; /* smaller margin around pagination */
    }

    .pagination button {
        padding: 7px 10px;
        min-width: 32px;
        margin: 0 4px 4px 0;
    }

    /* Article display tweaks for small screens */
    .article-display {
        margin: 20px 8px !important; /* remove big vertical margins */
        padding: 16px 12px !important; /* reduce padding */
        font-size: 0.95rem;
    }

    .article-display p {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 16px;
    }
    .single-article{
        position: relative;
        top: 80px;
        margin: 15px;
    }
}
