/* =============================================== */
/* UNIVERSAL CSS - HistoricRacing.com              */
/* =============================================== */

/* ---------- RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    background-color: #85a4ad;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

a {
    text-decoration: none;
}

/* ---------- GRID CONTAINER ---------- */
.grid-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* ---------- 3xN GRID - PERFECT SQUARES ---------- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-cell {
    background-color: #00a0a0;
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    display: block;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: none;
}

.grid-cell-link {
    text-decoration: none;
    display: block;
    height: 100%;
    width: 100%;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.grid-cell:hover {
    transform: none;
    box-shadow: none;
}

.grid-cell:active {
    transform: none;
}

.grid-cell:focus-visible {
    outline: 2px solid #004c4c;
    outline-offset: 2px;
    border-radius: 1.5rem;
}

/* ---------- SLIDE CONTAINER ---------- */
.slide-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Image wrapper - sits on top, slides left on hover */
.image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    transition: transform 0.4s ease-out;
    z-index: 2;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1rem;
    display: block;
}

/* Text wrapper - sits behind the image */
.text-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    text-align: center;
    color: white;
    z-index: 1;
    overflow-y: auto;
}

.text-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    word-break: break-word;
}

.text-desc {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.92;
    max-width: 90%;
    font-weight: 500;
}

/* HOVER EFFECT: image slides left and hides, revealing text */
.grid-cell:hover .image-wrapper {
    transform: translateX(-100%);
}

/* ---------- TEXT WRAPPER SCROLLBAR ---------- */
.text-wrapper::-webkit-scrollbar {
    width: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.text-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

/* ---------- NO SHADOWS ANYWHERE ---------- */
.grid-cell,
.grid-cell-link,
.slide-container,
.image-wrapper,
.text-wrapper,
img {
    box-shadow: none !important;
}

/* ---------- OTD BANNER ---------- */
.otd-banner {
    background: linear-gradient(135deg, #1a1a2e, #2c3e50);
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.otd-banner h4 {
    margin: 0;
}

.otd-banner p {
    margin: 0.5rem 0 0 0;
    opacity: 0.8;
}

.otd-banner .btn-otd {
    background: #c0392b;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.otd-banner .btn-otd:hover {
    background: #e74c3c;
}

/* ---------- FOOTER ---------- */
.site-footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 3px solid #c0392b;
}

.site-footer .footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.site-footer small {
    display: block;
    line-height: 1.6;
}

.site-footer .text-muted {
    color: rgba(255, 255, 255, 0.6);
}

/* ---------- RESPONSIVE BREAKPOINTS ---------- */

/* Tablet landscape */
@media (max-width: 1024px) {
    .grid-container {
        padding: 1.5rem;
    }
    .menu-grid {
        gap: 1.2rem;
    }
    .text-title {
        font-size: 1.3rem;
    }
    .text-desc {
        font-size: 0.85rem;
    }
    .image-wrapper {
        padding: 1rem;
    }
    .text-wrapper {
        padding: 1.2rem;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .text-title {
        font-size: 1.2rem;
    }
    .text-desc {
        font-size: 0.8rem;
    }
    .image-wrapper {
        padding: 0.9rem;
    }
    .text-wrapper {
        padding: 1rem;
    }
    .otd-banner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* Mobile landscape */
@media (max-width: 640px) {
    .grid-container {
        padding: 1rem;
    }
    .menu-grid {
        gap: 0.875rem;
    }
    .text-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    .text-desc {
        font-size: 0.7rem;
    }
    .image-wrapper {
        padding: 0.75rem;
    }
    .image-wrapper img {
        border-radius: 0.75rem;
    }
    .text-wrapper {
        padding: 0.875rem;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 400px;
        margin: 0 auto 2rem auto;
    }
    .text-title {
        font-size: 1.25rem;
    }
    .text-desc {
        font-size: 0.8rem;
    }
    .image-wrapper {
        padding: 1rem;
    }
    .text-wrapper {
        padding: 1rem;
    }
    .otd-banner {
        padding: 1.25rem;
    }
    .otd-banner h4 {
        font-size: 1.1rem;
    }
}

/* Small mobile */
@media (max-width: 380px) {
    .text-title {
        font-size: 1rem;
    }
    .text-desc {
        font-size: 0.7rem;
    }
    .image-wrapper {
        padding: 0.75rem;
    }
    .text-wrapper {
        padding: 0.75rem;
    }
}