/*
  _matches.css: This stylesheet contains styles specific to the matches list and detail pages.
*/

/* Matches List Page */
.matches-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

.match-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}

.match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.match-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- FIX 1: LOGO FITTING --- */
.match-card-image {
    width: 100%;
    height: 180px; /* Consistent height with other cards */
    
    /* 'contain' ensures the whole logo is visible and not cut off */
    background-size: contain; 
    background-repeat: no-repeat;
    background-position: center;
    
    /* Dark background looks best for fitting varying game logo sizes */
    background-color: var(--color-process-black); 
    
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-grey);
    border-bottom: 1px solid var(--color-light);
}

/* --- FIX 2: TEXT CENTERING & SIZING --- */
.match-card-content {
    padding: 1.5rem;
    text-align: center; /* Centers all text */
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.match-date-time {
    font-size: 0.85rem; /* Smaller, metadata size */
    color: #4a4a4a; /* was --color-grey: ~2.2:1 on the white card */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.match-game {
    font-size: 1.2rem; /* Main focus */
    font-weight: 700;
    color: var(--color-process-black);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.score-summary {
    display: flex;
    justify-content: center; /* Center the score row */
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 0;
    background-color: var(--color-mh-light-grey);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.score-summary .team-name {
    font-size: 0.9rem;
    color: var(--color-process-black);
}

.score-summary .score {
    font-size: 1.2rem;
    color: var(--color-primary-red);
    font-weight: 800;
}

.score-summary .vs-text {
    font-size: 0.8rem;
    color: #555; /* was --color-grey: too faint on the light score bar */
    text-transform: lowercase;
}

.match-summary-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-process-black);
    margin-top: auto; /* Push to bottom if flex spacing allows */
}

.match-summary-excerpt .read-more {
    color: var(--color-primary-red);
    font-weight: 600;
    font-size: 0.85rem;
}


/* Responsive Grid */
@media (min-width: 48em) {
    .matches-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 64em) {
    .matches-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- MATCH DETAIL PAGE STYLES --- */
.match-detail {
    max-width: 900px;
    margin: 0 auto;
}

.match-header {
    text-align: center;
    margin-bottom: 2rem;
}

.match-game-banner {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.match-game-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.match-page-title {
    font-size: 2.5rem;
    color: var(--color-process-black);
    margin-bottom: 0.5rem;
}

.match-meta {
    font-size: 1.1rem;
    color: var(--color-grey);
}

.match-score-board {
    background-color: var(--color-process-black);
    color: var(--color-white);
    padding: 2rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 2rem;
}

.team-block {
    text-align: center;
}
.team-block .team-label {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}
.team-block .team-name {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}
.team-block .team-record {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.2rem;
    opacity: 0.7;
}

.score-block {
    text-align: center;
}
.score-block .final-score {
    font-size: 3rem;
    font-weight: 900;
    color: var(--color-primary-red);
    letter-spacing: 2px;
}
.score-block .status {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.roster-card {
    background: var(--color-mh-light-grey);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
}
.roster-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
}

.match-media img, .match-media video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.pagination {
    text-align: center;
    margin-top: 3rem;
}