/* @import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap'); */

:root {
    /* Step 1: Tell the browser both modes are supported */
    color-scheme: light dark;

    /* Step 2: Define your theme colors */
    --bg-color: light-dark(#ffffff, #121212);
    --text-color: light-dark(#1a1a1a, #e0e0e0);
    --article-color: light-dark(#dddddd, #232323);
}

/* Step 3: Force the theme if a data attribute is present (for manual toggle) */
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: Figtree, system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    transition: background-color 0.3s, color 0.3s; /* Smooth transition */
}

h1 {
    margin: 0 auto;
    text-align: center;
    text-size-adjust: 100%;
    font-size: 5rem;
}

/* The Grid Container */
.article-grid {
    display: grid;
    gap: 24px;
    padding: max(3vw, 1rem);
    max-width: 1250px;
    margin: 0 auto;

    /* 1. Center the grid columns within the 1500px container */
    justify-content: center;

    /* 2. Default: Single column (for mobile/small screens)
       It will be 700px max, but shrink to 100% of the screen */
    grid-template-columns: minmax(min(100%, 200px), 500px);
}

/* 3. The Breakpoint: Switch to 2 columns when there is room
   (400px + 400px + 24px gap = 824px) */
@media (min-width: 800px) {
    .article-grid {
        grid-template-columns: repeat(2, minmax(400px, 500px));
    }
}

/* The Article Cards */
.article-grid > article {
    display: flex;
    flex-direction: column;
    /*background: var(--article-color);*/
    border-radius: 12px;
    overflow: hidden;
    padding: 1rem;


    /* Modern way to ensure it's a tall rectangle */
    aspect-ratio: 3 / 3.5;

    /* Smooth transition for a modern feel */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

/* Hover effect for 2026 standard interactivity */
.article-grid > article:hover {
    transform: translateY(-4px);
}

/* Internal elements */
.article-grid > article img {
    width: 80%;
    height: 60%; /* Image takes up the top half */
    min-height: 60%;
    object-fit: contain;
    padding: 1rem;
    margin: 0 auto;
    aspect-ratio: 13 / 10;
}

.article-grid > article h3 {
    text-decoration: underline;
    padding-top: 5px;
    margin: 0 auto;
    font-size: 2rem;
    /* Limits title to 2 lines for consistency */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.article-grid > article p {
    padding: 0 1rem 1rem 1rem;
    /*overflow: hidden;*/
    text-align: center;
    font-size: 1.25rem;
}