/* --- Base Variables & Reset --- */
:root {
    --primary-color: #021a40;
    --accent-color: #DA9345;
    --bg-color: #CDCDCD;
    --text-color: #000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-image: url("../RoadBridge.jpg");
    background-color: var(--bg-color);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Layout Containers --- */
.container {
	background: 
        /* The faint diagonal mesh pattern */
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.15) 10px, rgba(255, 255, 255, 0.15) 12px),
        /* Bumped up opacity for better text readability */
        linear-gradient(to bottom right, rgba(218, 147, 69, 0.92), rgba(255, 255, 255, 0.90));
        
    max-width: 1024px;
    width: 95%;
    margin: 2rem auto;
    border: 4px solid #000;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* --- Navigation (Flexbox) --- */
.top-nav {
    /* Hardcoded fallback colors added here just in case variables fail */
    background-color: #021a40; 
    background-color: var(--primary-color); 
    border-bottom: 3px solid #DA9345;
    border-bottom: 3px solid var(--accent-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style-type: none;
}

.menu li {
    position: relative;
}

.menu li a {
    display: block;
    color: #fafafa;
    padding: 1.2rem 1.5rem;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease, background-color 0.2s;
}

/* Desktop Animated Underline */
@media (min-width: 769px) {
    .menu li a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 3px;
        bottom: 0;
        left: 50%;
        background-color: #DA9345;
        background-color: var(--accent-color);
        transition: width 0.3s ease, left 0.3s ease;
    }

    .menu li a:hover {
        color: #fff;
    }

    .menu li a:hover::after,
    .menu li a.active::after {
        width: 100%;
        left: 0;
    }
}

.menu li a.active {
    color: var(--accent-color);
}

/* --- Main Content Area --- */
.content {
    padding: 2rem 1.5rem;
    text-align: center;
}

/* --- Proper List Formatting --- */
.text-content ul {
    padding-left: 2rem; /* Pushes the bullets in to align with standard text */
    margin-bottom: 1.5rem; /* Gives space before the next paragraph starts */
}

.text-content li {
    margin-bottom: 0.5rem; /* Adds a little breathing room between each bullet item */
}

/* --- HERO SECTION with Banner --- */
.hero {
    margin-bottom: 2rem;
}

.main-banner {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 0 auto 1.5rem auto;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.membership-callout {
    font-size: 1.6rem;
    margin: 1rem 0;
    font-weight: bold;
}

h3 { font-size: 1.2rem; margin: 1em 0; border-bottom: 2px solid #000; display: inline-block; padding-bottom: 5px;}

.cta-button {
    display: inline-block;
    margin: 1rem 0;
    padding: 1rem 2rem;
    background-color: #000;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.2s ease, background-color 0.2s;
}

.cta-button:hover {
    transform: scale(1.05);
    background-color: var(--primary-color);
    color: #FF0;
}

/* --- CSS Grid Data Table (Homepage) --- */
.waters-info {
    margin: 3rem 0;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    text-align: left;
}

.grid-item {
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    border: 1px solid #3A3A3A;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    font-size: 15px;
}

.grid-item strong {
    color: var(--primary-color);
}

/* --- Rules Section (Homepage) --- */
.rules hr {
    max-width: 300px;
    margin: 1.5rem auto;
    border: 0;
    height: 2px;
    background: #000;
}

.highlight {
    color: #990000;
    font-size: 1.4rem;
}

/* --- About Us Page Specific Styles --- */
.text-content {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.text-content p {
    margin-bottom: 1.5rem;
}

.title-divider {
    max-width: 100px;
    margin: 1rem 0 2rem 0;
    border: 0;
    height: 3px;
    background: var(--accent-color);
}

.image-wrapper {
    margin: 3rem auto;
    padding: 15px;
    width: 100%;
    text-align: center;
}

.image-wrapper a {
    display: inline-block;
    max-width: 100%;
}

.content-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 3px solid #000;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.content-image:hover {
    transform: scale(1.02);
}

/* --- Footer & Utilities --- */
.footer {
    background-color: #000;
    color: #fafafa;
    text-align: center;
    padding: 1.5rem;
    font-weight: bold;
    font-size: 0.85rem;
}

/* --- Mobile Media Queries (Responsiveness) --- */
@media (max-width: 768px) {
    .container {
        border-radius: 20px;
        border-width: 2px;
        margin: 1rem auto;
        width: 98%;
    }

    .top-nav {
        background-color: #021a40;
    }

    .menu {
        flex-direction: column;
    }

    .menu li a {
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem;
    }

    /* Simpler mobile hover state instead of animated lines */
    .menu li a:hover, 
    .menu li a.active {
        background-color: rgba(218, 147, 69, 0.2);
        color: #FF0;
    }

    .main-banner {
        border-radius: 10px;
    }

    .membership-callout { font-size: 1.3rem; }
    .highlight { font-size: 1.1rem; }
}

/* --- Table & Calendar Styles --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.85);
    text-align: left;
    min-width: 600px; /* Forces scrolling on very small screens to preserve layout */
}

.modern-table th {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 15px;
    font-size: 1.05rem;
    text-transform: uppercase;
}

.modern-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #ccc;
    font-size: 0.95rem;
}

.modern-table tr:hover {
    background-color: rgba(218, 147, 69, 0.15); /* Soft tan highlight on hover */
}

.modern-table a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
}

.modern-table a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- Archive Dropdown Selector --- */
.archive-selector {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid #ccc;
    text-align: center;
}

.archive-selector select {
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 5px;
    border: 2px solid var(--primary-color);
    margin-left: 10px;
    cursor: pointer;
}

/* --- Modern Image Gallery --- */
.photo-gallery {
    display: grid;
    /* Automatically fits as many 200px columns as possible, then expands them to fill the space */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.photo-gallery a {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background-color: #000;
    
    /* Forces all thumbnails to be a uniform 4:3 landscape shape, regardless of the original photo size */
    aspect-ratio: 4 / 3; 
    
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.photo-gallery a:hover {
    transform: scale(1.05); /* Slight zoom when hovered */
    border-color: var(--accent-color);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.photo-gallery img {
    width: 100%;
    height: 100%;
    
    /* Acts like "UniformToFill" - scales the image to cover the box without squishing or stretching it */
    object-fit: cover; 
    display: block;
    transition: opacity 0.3s ease;
}

.photo-gallery a:hover img {
    opacity: 0.85; /* Dims slightly on hover to highlight the border */
}

/* --- Mobile Table Card Layout --- */
@media (max-width: 768px) {
    /* Remove the forced horizontal scroll and make the table transparent */
    .modern-table {
        min-width: 100%;
        background-color: transparent; 
    }

    /* Hide the top header row */
    .modern-table thead {
        display: none;
    }

    /* Turn each row into an individual card */
    .modern-table tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 2px solid var(--primary-color);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

    /* Keep mobile cards solid on hover instead of going transparent */
    .modern-table tr:hover {
        background-color: #fdf5eb; /* A solid, very light tan */
        box-shadow: 0 6px 12px rgba(0,0,0,0.15); /* Slightly lifts the card */
    }

    /* Stack cells vertically and align text to the right */
    .modern-table td {
        display: block;
        text-align: right;
        padding: 12px 15px 12px 40%;
        position: relative;
        border-bottom: 1px solid #ddd;
    }

    .modern-table td:last-child {
        border-bottom: none;
    }

    /* Dynamically insert the column names as labels on the left side of the card */
    .modern-table td::before {
        position: absolute;
        left: 15px;
        top: 12px;
        width: 35%;
        text-align: left;
        font-weight: bold;
        color: var(--primary-color);
        text-transform: uppercase;
        font-size: 0.85rem;
    }

    /* Define the labels for each specific column */
    .modern-table td:nth-of-type(1)::before { content: "Date"; }
    .modern-table td:nth-of-type(2)::before { content: "Type"; }
    .modern-table td:nth-of-type(3)::before { content: "Match"; }
    .modern-table td:nth-of-type(4)::before { content: "Venue"; }
    .modern-table td:nth-of-type(5)::before { content: "Meet"; }
}