﻿#container {
    box-shadow: 0 15px 30px 1px grey;
    background: rgba(255, 255, 255, 0.90);
    text-align: center;
    border-radius: 5px;
    overflow: hidden;
    margin: auto auto 2rem auto;
    max-width: 1000px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
}

.product-details {
    position: relative;
    text-align: left;
    overflow: hidden;
    padding: 30px;
    flex: 1 1 40%;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}

#container .product-details h1 {
    font-family: 'Bebas Neue', cursive;
    display: inline-block;
    position: relative;
    font-size: 30px;
    color: #344055;
    margin: 0;
}

    #container .product-details h1:before {
        position: absolute;
        content: '';
        right: 0%;
        top: 0%;
        transform: translate(25px, -15px);
        font-family: 'Bree Serif', serif;
        display: inline-block;
        background: #ffe6e6;
        border-radius: 5px;
        font-size: 14px;
        padding: 5px;
        color: white;
        margin: 0;
        animation: chan-sh 6s ease infinite;
    }

#container .product-details > p {
    font-family: 'EB Garamond', serif;
    text-align: center;
    font-size: 18px;
    color: #7d7d7d;
}

.product-image {
    transition: all 0.3s ease-out;
    position: relative;
    overflow: hidden;
    flex: 1 1 60%;
    min-width: 300px;
    min-height: 300px;
}

#container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info {
    background: rgba(27, 26, 26, 0.9);
    font-family: 'Bree Serif', serif;
    transition: all 0.3s ease-out;
    transform: translateX(-100%);
    position: absolute;
    line-height: 1.8;
    text-align: left;
    font-size: 105%;
    cursor: no-drop;
    color: #FFF;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
}

    .info h2 {
        text-align: center; 
        color: #FFF;
    }

/* Image always fills container */
.product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease-out;
}

/* Info starts hidden with height 0 but expands smoothly */
.product-image .info {
    background: rgba(27, 26, 26, 0.9);
    font-family: 'Bree Serif', serif;
    color: #FFF;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.4s ease;
    line-height: 1.6;
    padding: 0 1rem; /* collapsed padding */
}

/* On hover, reveal info + expand parent */
.product-image:hover .info {
    opacity: 1;
    max-height: 500px; /* enough to fit text; can adjust */
    padding: 1rem;
}

/* Optional: subtle zoom on image when hovered */
.product-image:hover img {
    transform: scale(1.1);
}

.product-image:hover .info {
    transform: translateX(0);
}

.info ul li {
    transition: 0.3s ease;
}

    .info ul li:hover {
        transform: translateX(15%) scale(1.3);
    }

.product-image:hover img {
    transition: all 0.3s ease-out;
}

.product-image:hover .info {
    transform: translateX(0);
}

.product-image:hover img {
    transform: scale(1.2);
}

@media (max-width: 768px) {
    #container {
        flex-direction: column-reverse; /* 👈 image on top, details below */
    }

    .product-image,
    .product-details {
        width: 100%;
        flex: 1 1 100%;
        min-width: 100%;
    }

    .product-image {
        min-height: 260px;
    }

    .product-details {
        text-align: center;
        padding: 20px;
    }

    .product-image .info {
        max-height: 0;
    }

    .product-image:hover .info {
        max-height: 1000px; /* allow more height for mobile */
    }

    .product-image .info .p-3 {
        padding: 0 !important;
    }

    .info {
        font-size: 95%;
    }
}

.previous-tournaments {
    text-align: center;
    margin: 2rem auto;
    padding: 1rem;
    max-width: 1200px;
}

.previous-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #4E3AAC;
    margin-bottom: 1rem;
    /*text-transform: uppercase;*/
    letter-spacing: 1px;
}

.tournament-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.2rem;
    justify-items: center;
}

.tournament-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
    max-width: 200px;
    position: relative;
}

    .tournament-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }

.tournament-thumb-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.tournament-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tournament-card:hover .tournament-thumb {
    transform: scale(1.1);
}

/* Centered overlay */
.tournament-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: rgba(78, 58, 172, 0.85);
    color: #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease, width 0.3s, height 0.3s;
    z-index: 2;
}

.tournament-card:hover .tournament-overlay {
    transform: translate(-50%, -50%) scale(1.2);
    background: rgba(78, 58, 172, 1);
    width: 70px;
    height: 70px;
}

.tournament-year {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.tournament-name {
    margin-top: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

/* Small screen optimization */
@media (max-width: 600px) {
    .previous-title {
        font-size: 1.4rem;
    }

    .tournament-gallery {
        gap: 0.8rem;
    }

    .tournament-card {
        max-width: 140px;
    }

    .tournament-overlay {
        width: 50px;
        height: 50px;
    }

    .tournament-card:hover .tournament-overlay {
        width: 60px;
        height: 60px;
    }

    .tournament-year {
        font-size: 0.85rem;
    }
}