
/* Main stylesheet for the freeskins CS2 bonus site */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #0b0d16;
    color: #f5f5f5;
    line-height: 1.5;
}

a {
    color: #35c5f5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

header {
    background: #11121a;
    padding: 16px 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Logo area styling */
a.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
a.logo img {
    width: 40px;
    height: 40px;
}
a.logo .logo-text {
    font-size: 1.6rem;
    color: #ff7a00;
    font-weight: bold;
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
    color: #ff7a00;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    /* reduce horizontal gap slightly to allow more items on one row */
    gap: 0.7rem;
    /* allow items to wrap on smaller screens */
    flex-wrap: wrap;
    /* add vertical spacing when items wrap onto a new line */
    row-gap: 0.5rem;
}

/* Beautify navigation links */
/*
 * Navigation styling
 *
 * The navigation bar sits on a dark background so each link is rendered as a pill shaped
 * button with a subtle border and shadow. A slightly lighter fill colour helps the
 * items stand out against the header, while the border ties them into the overall
 * colour palette. On hover, the buttons become a bit lighter and the text turns
 * white for better contrast.
 */
nav ul li a {
    /* reduce horizontal padding slightly so more items fit on a single line */
    padding: 6px 10px;
    border-radius: 5px;
    /* lighter dark tone so links stand out on the almost black header */
    background-color: #1c2138;
    /* add a subtle border to delineate individual buttons */
    border: 1px solid #2c3150;
    /* shadow for depth */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease, color 0.3s ease;
    color: #35c5f5;
    font-weight: 500;
}
nav ul li a:hover {
    /* brighten on hover */
    background-color: #263059;
    color: #ffffff;
}

nav li {
    position: relative;
}

nav li ul.dropdown {
    display: none;
    position: absolute;
    background: #11121a;
    padding: 8px;
    margin: 0;
    list-style: none;
    top: 100%;
    left: 0;
    min-width: 180px;
    border: 1px solid #24273c;
    z-index: 999;
}

nav li:hover ul.dropdown {
    display: block;
}

nav li ul.dropdown li {
    padding: 8px;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.hero {
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center;
    padding: 80px 32px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 13, 22, 0.7);
}

.hero h2 {
    position: relative;
    font-size: 2.4rem;
    margin: 0;
    color: #ffffff;
    z-index: 1;
}

.hero p {
    position: relative;
    font-size: 1.2rem;
    margin-top: 16px;
    color: #dfe7fb;
    z-index: 1;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Improve readability of news list by using a responsive grid */
.news-content ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
}
.news-content li {
    background: #11121a;
    border: 1px solid #24273c;
    border-radius: 6px;
    padding: 8px 12px;
}
.news-content li a {
    color: #35c5f5;
    display: block;
}
.news-content li a:hover {
    color: #ffffff;
    text-decoration: none;
}

/* Date styling in news list */
.news-content li a .date {
    display: block;
    font-size: 0.75rem;
    color: #9fa8c7;
    margin-bottom: 4px;
}

/* Sorting container above cards */
.sort-container {
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #9fa8c7;
}
.sort-container label {
    color: #9fa8c7;
}
.sort-container select {
    background: #1c2138;
    border: 1px solid #2c3150;
    color: #35c5f5;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}
.post-date {
    font-size: 0.85rem;
    color: #9fa8c7;
    margin: 4px 0 12px;
}

.card {
    background: #11121a;
    border: 1px solid #24273c;
    border-radius: 8px;
    padding: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card.top {
    border-color: #ff7a00;
    box-shadow: 0 0 10px rgba(255,122,0,0.4);
}

/*
 * Card logo styling
 *
 * Many card thumbnail images vary in aspect ratio. To prevent stretching
 * or blurriness, we fix the height and let the width adjust
 * automatically. Using object-fit: contain ensures the entire image
 * remains visible within the given height. We also removed a strict
 * width to allow responsiveness and added a margin for separation.
 */
.card img.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    max-width: 100%;
    margin-bottom: 12px;
}

.card h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: #35c5f5;
}

.card .badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

    .card .badge {
        background: #24273c;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.75rem;
        color: #9fa8c7;
    }
    /* Generic badges outside of cards (e.g. on site pages) */
    .badges {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 8px;
    }
    .badges .badge {
        background: #24273c;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.75rem;
        color: #9fa8c7;
    }

.card .desc {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #ccd1e8;
}

.card .promo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card .promo span.code {
    background: #24273c;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #ff7a00;
}

.card .promo button {
    background: #35c5f5;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    color: #0b0d16;
    cursor: pointer;
    font-size: 0.8rem;
}

.card .promo button:active {
    transform: translateY(1px);
}

    /* Highlighted bonus summary on cards */
    .card .bonus {
        font-size: 0.85rem;
        color: #ffd966;
        margin-bottom: 6px;
        font-weight: bold;
    }

.card .actions {
    margin-top: auto;
}

.card .actions a.button {
    display: block;
    text-align: center;
    background: #ff7a00;
    color: #0b0d16;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s;
}

.card .actions a.button:hover {
    background: #e76700;
}

/* SEO text block styling */
.seo-text {
    margin-top: 24px;
    font-size: 0.9rem;
    color: #ccd1e8;
    line-height: 1.6;
}
.seo-text ul {
    margin: 8px 0 8px 20px;
    list-style: disc;
}
.seo-text li {
    margin-bottom: 8px;
}

/* Promotional banner section */
.promos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}
.promos img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Ads container for single banner on index and ad blocks on other pages */
.ads {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 32px 0;
}
.ads a {
    /* Allow ads to sit side-by-side on wider screens and wrap on small screens.
     * Each banner grows to fill available space while ensuring at least
     * roughly half the container width. This helps align banners neatly
     * rather than stacking awkwardly on medium viewports.
     */
    flex: 1 1 45%;
    max-width: 420px;
}
.ads img {
    /*
     * Set a fixed height for ad images to ensure that banners of
     * different aspect ratios align neatly next to each other. The
     * object-fit property crops the image towards the centre while
     * maintaining its proportions. Width is kept at 100% of its
     * container to make use of the available space. Rounded corners
     * and shadows match the card aesthetic.
     */
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.site-content, .category-content, .news-content {
    background: #11121a;
    padding: 24px;
    border: 1px solid #24273c;
    border-radius: 8px;
    margin-bottom: 32px;
}

.site-content h2, .category-content h2, .news-content h2 {
    margin-top: 0;
    color: #ff7a00;
}

.site-content p, .category-content p, .news-content p {
    margin: 16px 0;
    color: #ccd1e8;
}

.footer {
    background: #11121a;
    color: #9fa8c7;
    padding: 24px;
    text-align: center;
    border-top: 1px solid #24273c;
}

/*
 * Responsive tweaks for small screens
 *
 * Previously the header switched to a column layout at very narrow widths and
 * stacked all of the navigation links on top of each other. With many menu
 * items this resulted in the navigation occupying more than half of the
 * viewport height on mobile devices. To improve usability we instead keep
 * the header content in a single row and allow the navigation list to
 * horizontally scroll. Each list item retains its pill‑shaped styling but
 * shrinks only as much as needed to fit its text. White‑space is prevented
 * from wrapping so the menu remains one continuous line.
 */
@media (max-width: 600px) {
    header {
        /* arrange header contents horizontally */
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    /* Hide the burger button on small screens since we keep the menu visible */
    .nav-toggle {
        display: none;
    }
    /* Always show navigation on small screens */
    header nav {
        display: block;
        width: 100%;
    }
    /* Arrange the list items in a row and allow horizontal scrolling */
    header nav ul {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        gap: 0.5rem;
        padding: 4px 0;
    }
    header nav li {
        flex: 0 0 auto;
    }
    /* Reduce the hero title size on small screens */
    .hero h2 {
        font-size: 1.8rem;
    }
}

/* Screen reader only class to hide text visually but keep it accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* Promo banner styling */
.promo-banner {
    text-align: center;
    margin-bottom: 32px;
}
.promo-banner img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Ensure article images do not float next to text.
 * Without this rule, if a post's main image is missing a closing tag or
 * lacks explicit block-level styling, the surrounding text could wrap
 * around the image. By forcing images inside .news-content to be block
 * elements with centered margins and full width, the layout remains
 * predictable and the text stays below the image. */
.news-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 16px auto;
}


/* hide h1 */
h1 { display: none; }
