/*
Theme Name: CRTC Play
Theme URI: https://github.com/crtc-play
Author: Gemini
Description: Un thème WordPress moderne, sombre et épuré pour galerie d'art rétro (Amstrad CPC / C64). Respecte les ratios d'affichage d'origine et intègre un compteur de téléchargements.
Version: 1.0.3
License: GNU General Public License v2 or later
Text Domain: crtc-play
*/

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: #0f1115; /* Fond ultra-sombre style c64gfx */
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    color: #38bdf8;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #7dd3fc;
}

/* Header & Banner */
.site-header {
    background-color: #07080a;
    border-bottom: 1px solid #1f242e;
    padding: 30px 20px;
    text-align: center;
}

.site-title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #facc15; /* Jaune rétro subtil */
    text-shadow: 3px 3px 0px #1e40af; /* Ombre bleue rétro */
}

/* Introduction Section */
.site-intro {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
}

.site-intro h2 {
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 15px;
}

.site-intro p {
    font-size: 1.1rem;
    color: #94a3b8;
}

/* Main Gallery Grid */
.gallery-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.retro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Retro Image Card */
.retro-card {
    background-color: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.retro-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: #38bdf8;
}

/* Conteneur d'image respectant le ratio Amstrad CPC */
.retro-image-wrapper {
    position: relative;
    width: 100%;
    background-color: #000000;
}

/* Ratio par défaut 384x272 (24:17) */
.ratio-384-272 {
    aspect-ratio: 24 / 17;
}

/* Ratio alternatif 160x200 (4:5) */
.ratio-160-200 {
    aspect-ratio: 4 / 5;
}

.retro-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Évite toute déformation */
    display: block;
    /* Rendu pixel-art parfait sans flou */
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Styles pour les deux lignes d'infos sous l'image (Style C64gfx) */
.retro-card-info {
    padding: 15px;
    background-color: #11141a; /* Légère nuance pour détacher l'info */
    border-top: 1px solid #1f242e;
}

.retro-card-title {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff; /* Titre blanc propre, non cliquable */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.retro-card-download {
    font-size: 0.85rem;
}

/* Alignement du bouton et de son compteur */
.download-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-btn {
    display: inline-block;
    color: #38bdf8; /* Bleu moderne */
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.download-btn:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* Le petit compteur de téléchargements à droite */
.download-counter {
    color: #64748b; /* Gris doux */
    font-size: 0.8rem;
    font-weight: bold;
    background: #1f242e;
    padding: 2px 8px;
    border-radius: 12px;
}

.no-file {
    color: #475569; /* Gris foncé si pas de fichier .dsk */
    font-style: italic;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid #1f242e;
    color: #475569;
    font-size: 0.9rem;
}