/* Custom Color Palette
   - Light Cream: #F1EFEC
   - Warm Beige: #D4C9BE
   - Deep Blue: #123458
   - Black: #030303
*/

/* Typography and Root Variables */
:root {
    --color-light-cream: #F1EFEC;
    --color-warm-beige: #D4C9BE;
    --color-deep-blue: #123458;
    --color-black: #030303;

    /* Typography Scale */
    --font-base: 16px;
    --font-scale: 1.25; /* Major Third scale */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', 'Arial', sans-serif;
    line-height: 1.6;
    background-color: var(--color-light-cream);
    color: var(--color-black);
    font-size: var(--font-base);
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Arial', sans-serif;
    color: var(--color-deep-blue);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: calc(var(--font-base) * var(--font-scale) * var(--font-scale) * var(--font-scale) * var(--font-scale));
    font-weight: 700;
}

h2 {
    font-size: calc(var(--font-base) * var(--font-scale) * var(--font-scale) * var(--font-scale));
    font-weight: 600;
}

h3 {
    font-size: calc(var(--font-base) * var(--font-scale) * var(--font-scale));
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Header */
header {
    background-color: var(--color-light-cream);
    padding: 20px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-deep-blue);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    text-decoration: none;
    color: var(--color-deep-blue);
    transition: color 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--color-deep-blue);
}

/* Hero Section */
.hero {
    background-color: var(--color-deep-blue);
    color: white;
    text-align: center;
    padding: 100px 0;
}

.hero h1 {
    font-size: calc(var(--font-base) * var(--font-scale) * var(--font-scale) * var(--font-scale) * var(--font-scale) * var(--font-scale));
    margin-bottom: 20px;
    color: white;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 600;
}

.btn-light {
    background-color: white;
    color: var(--color-deep-blue);
}

.btn-dark {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-light:hover {
    background-color: var(--color-warm-beige);
}

.btn-dark:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* About Section */
.about {
    background-color: var(--color-light-cream);
    padding: 100px 0;
    text-align: center;
}

.about h2 {
    color: var(--color-deep-blue);
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.about p {
    max-width: 800px;
    margin: 0 auto;
    color: var(--color-black);
}

/* What We Do Section */
.what-we-do {
    background-color: white;
    padding: 100px 0;
    text-align: center;
}

.what-we-do h2 {
    color: var(--color-deep-blue);
    margin-bottom: 50px;
    font-size: 2.5rem;
}

.what-we-do-content {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.what-we-do-item {
    flex: 1;
    background-color: var(--color-light-cream);
    padding: 30px;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.what-we-do-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(18, 52, 88, 0.1);
}

.what-we-do-item h3 {
    color: var(--color-deep-blue);
    margin-bottom: 15px;
}

/* Main Content */
main {
    flex: 1 0 auto; /* Grow to fill available space */
}

/* Footer */
footer {
    background-color: var(--color-deep-blue);
    color: white;
    text-align: center;
    padding: 20px 0;
    flex-shrink: 0; /* Prevent footer from shrinking */
}

/* Games Page */
.games {
    padding: 50px 0;
}

.games h1 {
    color: var(--color-deep-blue);
    text-align: center;
    margin-bottom: 20px;
}

.games > .container > p {
    text-align: center;
    color: var(--color-black);
    max-width: 600px;
    margin: 0 auto 50px;
}

.games-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

.game-card {
    display: flex;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(18, 52, 88, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 250px; /* Minimum height instead of fixed */
    max-width: 900px; /* Optional: limit maximum width */
    margin: 0 auto; /* Center the card if desired */
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(18, 52, 88, 0.2);
}

.game-image {
    flex: 0 0 25%; /* Slightly narrower image section */
    position: relative;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-content {
    flex: 1;
    padding: 20px; /* Reduced padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-content h2 {
    color: var(--color-deep-blue);
    margin-bottom: 10px;
    font-size: 1.3rem; /* Slightly smaller heading */
}

.game-content p {
    color: var(--color-black);
    margin-bottom: 15px;
    flex-grow: 1;
    font-size: 0.95rem; /* Slightly smaller text */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.game-content .btn {
    align-self: flex-start;
    padding: 8px 16px; /* Smaller button */
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.game-content .btn-dark {
    background-color: var(--color-deep-blue);
    color: white;
}

.game-content .btn-dark:hover {
    background-color: var(--color-black);
}

/* Itch io promo section */
.itch-io-promo {
    margin-top: 40px;
    padding: 20px;
    background-color: var(--color-deep-blue);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(18, 52, 88, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.itch-io-promo:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(18, 52, 88, 0.2);
}

.itch-io-promo .promo-content {
    padding: 10px;
}

.itch-io-promo p {
    color: white;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 500;
}

.itch-io-promo a {
    color: var(--color-warm-beige);
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.itch-io-promo a:hover {
    color: var(--color-light-cream);
}

/* Burger Menu */
.burger-menu {
    display: none;
    cursor: pointer;
}

.burger-icon {
    width: 30px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.burger-icon span {
    width: 100%;
    height: 3px;
    background-color: var(--color-deep-blue);
    transition: all 0.3s ease;
}

/* Articles Page Styles */
.articles {
    padding: 50px 0;
    background-color: var(--color-light-cream);
}

.articles h1 {
    color: var(--color-deep-blue);
    text-align: center;
    margin-bottom: 20px;
}

.articles > .container > p {
    text-align: center;
    color: var(--color-black);
    max-width: 600px;
    margin: 0 auto 50px;
}

/* UPDATED Articles Grid Styles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Changed from 5 to 3 columns */
    gap: 30px; /* Increased from 20px to 30px for more spacing */
    max-width: 1200px; /* Increased from 1100px for wider content */
    margin: 0 auto;
}

.article-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(18, 52, 88, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(18, 52, 88, 0.2);
}

.article-image {
    height: 200px; /* Increased from 160px for larger images */
    position: relative;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 20px; /* Increased from 15px for more internal spacing */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-content h2 {
    color: var(--color-deep-blue);
    margin-bottom: 10px; /* Increased from 8px */
    font-size: 1.2rem; /* Increased from 1.1rem */
}

.article-meta {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 10px;
    font-style: italic;
}

.article-preview {
    color: var(--color-black);
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.5;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-content .btn {
    align-self: flex-start;
    padding: 8px 15px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}

.article-content .btn-dark {
    background-color: var(--color-deep-blue);
    color: white;
}

.article-content .btn-dark:hover {
    background-color: var(--color-black);
}

/* Article Single Page Styles */
.article-single {
    padding: 50px 0;
    background-color: var(--color-light-cream);
}

.article-single .container {
    max-width: 900px;
}

/* Article Header */
.article-header {
    margin-bottom: 30px;
}

.article-header h1 {
    color: var(--color-deep-blue);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: left;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Author Info */
.article-author {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid var(--color-deep-blue);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-deep-blue);
}

.author-title {
    font-size: 0.9rem;
    color: #666;
}

/* Article Details */
.article-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.article-date, .article-read-time {
    font-size: 0.9rem;
    color: #666;
}

/* Featured Image */
.article-featured-image {
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(18, 52, 88, 0.1);
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Article Content */
.article-single .article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-black);
    padding: 0; /* Reset padding for single article content */
}

.article-single .article-content h2 {
    color: var(--color-deep-blue);
    font-size: 1.8rem;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-warm-beige);
}

.article-single .article-content h3 {
    color: var(--color-deep-blue);
    font-size: 1.4rem;
    margin: 30px 0 15px;
}

.article-single .article-content p {
    margin-bottom: 25px;
}

.article-single .article-content ul, .article-single .article-content ol {
    margin-bottom: 25px;
    padding-left: 30px;
}

.article-single .article-content li {
    margin-bottom: 10px;
}

.article-single .article-content a {
    color: var(--color-deep-blue);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.article-single .article-content a:hover {
    color: var(--color-black);
}

.article-single .article-content blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background-color: var(--color-warm-beige);
    border-left: 5px solid var(--color-deep-blue);
    font-style: italic;
    border-radius: 5px;
}

.article-single .article-content img {
    max-width: 100%;
    height: auto;
    margin: 30px 0;
    border-radius: 5px;
    box-shadow: 0 3px 8px rgba(18, 52, 88, 0.1);
}

/* Code Blocks */
.article-single .article-content pre {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 25px 0;
    border: 1px solid #ddd;
}

.article-single .article-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--color-deep-blue);
}

.article-single .article-content p code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--color-warm-beige);
}

.tag {
    background-color: var(--color-warm-beige);
    color: var(--color-deep-blue);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Article Navigation */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--color-warm-beige);
}

.prev-article, .next-article {
    display: flex;
    flex-direction: column;
    max-width: 45%;
    text-decoration: none;
}

.next-article {
    text-align: right;
}

.nav-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.nav-title {
    color: var(--color-deep-blue);
    font-weight: 600;
    transition: color 0.3s ease;
}

.prev-article:hover .nav-title,
.next-article:hover .nav-title {
    color: var(--color-black);
}

/* Responsive Adjustments */
/* Medium screens (tablets) */
@media (min-width: 768px) and (max-width: 1023px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .game-card {
        flex-direction: column;
        height: auto;
    }

    .game-image {
        flex: none;
        height: 180px;
    }

    .game-content {
        padding: 15px;
    }

    /* Articles grid for tablets */
    .articles-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
        gap: 20px;
    }
}

/* Large screens (desktops) */
@media (min-width: 1024px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .game-card {
        flex-direction: row;
        min-height: 250px;
    }

    .game-image {
        flex: 0 0 25%;
        height: auto;
    }
}

/* Medium-small screens */
@media (max-width: 992px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
        gap: 20px;
    }
}

/* Small screens (mobile) */
@media (max-width: 768px) {
    :root {
        --font-base: 14px; /* Slightly smaller base font for mobile */
    }

    /* Navigation */
    nav {
        position: relative;
    }

    .burger-menu {
        display: block;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: var(--color-light-cream);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        height: 100vh;
        padding-top: 80px;
        z-index: 50;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 20px 0;
    }

    .nav-menu li a {
        font-size: 1.5rem;
    }

    /* Burger icon animation when menu is open */
    .burger-menu.active .burger-icon span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .burger-menu.active .burger-icon span:nth-child(2) {
        opacity: 0;
    }

    .burger-menu.active .burger-icon span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    /* Games Page */
    .game-card {
        flex-direction: column;
        height: auto;
    }

    .game-image {
        flex: none;
        height: 200px;
    }

    .game-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .game-content {
        padding: 15px;
    }

    /* What We Do Section */
    .what-we-do-content {
        flex-direction: column;
    }

    .what-we-do-item {
        margin-bottom: 20px;
    }

    /* Responsive itch.io promo */
    .itch-io-promo p {
        font-size: 1rem;
    }

    /* Articles grid for mobile */
    .articles-grid {
        grid-template-columns: 1fr; /* 1 column for mobile */
        gap: 15px;
    }

    .article-image {
        height: 180px;
    }

    .article-content {
        padding: 15px;
    }

    .article-content h2 {
        font-size: 1.1rem;
    }

    /* Article Single Page */
    .article-single {
        padding: 30px 0;
    }

    .article-header h1 {
        font-size: 2rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .article-details {
        align-items: flex-start;
    }

    .article-single .article-content {
        font-size: 1rem;
    }

    .article-single .article-content h2 {
        font-size: 1.6rem;
    }

    .article-single .article-content h3 {
        font-size: 1.3rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .articles-grid {
        grid-template-columns: 1fr; /* 1 column for very small screens */
    }

    .article-navigation {
        flex-direction: column;
        gap: 20px;
    }

    .prev-article, .next-article {
        max-width: 100%;
    }

    .next-article {
        text-align: left;
    }
}