/* ==========================================================================
   Base & Resets
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-weight: 400;
    background-color: #000000;
    color: #f0f0f0;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    vertical-align: middle; /* Prevents bottom space */
}

a {
    color: #eee;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #fff;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    color: #fff;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}

h1 { font-size: 2.2em; }
h2 { font-size: 1.8em; }
h3 { font-size: 1.4em; }

p {
    margin-top: 0;
    margin-bottom: 1em;
}

ul {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 1.5em;
}

li {
    margin-bottom: 0.5em;
}

.results-year-heading {
     margin-top: 2em;
     margin-bottom: 1em; /* More space below year */
     padding-bottom: 0.3em;
     border-bottom: 2px solid #fff;
     color: #fff;
     display: inline-block;
}

/* ==========================================================================
   Layout & Structure
   ========================================================================== */
main {
    padding: 2em 1em;
    max-width: 1000px; /* Consistent max width */
    margin: 0 auto;
}

header {
    padding: 1em 0;
    border-bottom: 1px solid #333;
}

header nav, footer .footer-content {
    max-width: 1000px; /* Consistent max width */
    margin: 0 auto;
    padding: 0 1em;
}

footer {
    text-align: center;
    padding: 2em 1em;
    margin-top: 3em;
    border-top: 1px solid #333;
    color: #aaa;
    font-size: 0.9em;
}

.page-content {
    margin-top: 1em;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5em;
}

header nav ul li a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    padding: 0.5em 0;
    border-bottom: 2px solid transparent;
}

header nav ul li a:hover,
header nav ul li a.active {
    color: #fff;
    border-bottom-color: #fff;
}

.social-icon a {
    font-size: 1.2em;
    border-bottom: none;
}
.social-icon a:hover {
     color: #ccc;
     border-bottom: none;
}

/* ==========================================================================
   Tables (Frontend - Upcoming, Results)
   ========================================================================== */
.content-table-wrapper {
    overflow-x: auto;
    margin-top: 1.5em;
    margin-bottom: 2em;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.content-table th,
.content-table td {
    border: none;
    font-size: .9em;
    padding: 0.9em 1em 0.4em 1em;
    text-align: left;
    border-bottom: 1px solid #444;
    vertical-align: middle;
}

.content-table thead th {
    background-color: #000;
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    white-space: nowrap;
    border-bottom: 1px solid #555;
}

 .content-table tbody tr:last-child td {
    border-bottom: none;
 }

/* ==========================================================================
   Homepage Styles
   ========================================================================== */
.hero-section {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    min-height: 120vh; /* Adjust as needed */
    padding: 3em;
    text-align: left;
    position: relative;
    overflow: hidden;
    background-color: #111;
}

.hero-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('/images/hp_background.jpg'); /* Ensure path correct */
    background-size: cover; background-position: top center; z-index: 1;
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.45); z-index: 2;
}

.hero-content { position: relative; z-index: 3; }
.hero-content h1 {
    font-size: 4.5em; color: #fff; margin: 0; font-family: 'Montserrat', sans-serif;
    font-weight: 600; line-height: 1.2; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Bio Page Styles
   ========================================================================== */
.bio-layout {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2em; margin-top: 2em;
}
.bio-text h3 {
    margin-top: 1.5em; color: #eee; border-bottom: 1px solid #444; padding-bottom: 0.3em; font-size: 1.3em;
}
.bio-text ul { list-style: disc; margin-left: 1.5em; padding-left: 0.5em; }
.bio-text ul li { margin-bottom: 0.5em; }
.bio-text p { margin-bottom: 1em; }
.bio-images {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1em; align-content: start;
}
.bio-images img { border: 1px solid #444; width: 100%; height: auto; }


/* ==========================================================================
   Gallery Styles (Public - for Masonry)
   ========================================================================== */
.gallery-grid-public {
    margin-top: 2em;
    position: relative; /* Required by Masonry */
}

.gallery-image-item {
    overflow: hidden; /* Keep */
    background-color: #222; /* Keep */
    width: 32%;
    margin-bottom: 1em; /* Keep */
    box-sizing: border-box; /* Add this if not present - helps consistency */
}
.gallery-image-item a { display: block; }
 
.gallery-image-item img {
    display: block;
    width: 100%; /* Fill item width */
    height: auto; /* Use natural aspect ratio */
    transition: opacity 0.3s ease; /* Use opacity for hover */
}
 .gallery-image-item a:hover img {
    opacity: 0.85; /* Fade slightly on hover */
    /* transform: scale(1.05); */ /* Remove scale if it causes issues with Masonry positioning */
 }
 .gallery-caption {
    font-size: 0.9em; color: #ccc; padding: 0.5em; text-align: center;
 }

/* ==========================================================================
   Video Styles (Public - Flexbox Layout)
   ========================================================================== */
.more-videos-link-wrapper { text-align: center; margin: 1em 0 2em 0; }
.more-videos-link-wrapper a { text-decoration: underline; font-weight: bold; }
.more-videos-link-wrapper a:hover { text-decoration: none; color: #fff; }

.video-grid {
    display: flex; flex-wrap: wrap; gap: 2.5em; margin-top: 2em; justify-content: center;
}
.video-item {
    flex: 0 1 calc(50% - 1.25em); max-width: calc(50% - 1.25em); box-sizing: border-box;
}
.video-embed-container {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
    max-width: 100%; background: #000; margin-bottom: 0.8em;
}
.video-embed-container iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.video-title {
    font-size: 1.1em; text-align: center; color: #eee; margin-top: 0; margin-bottom: 1em;
}

/* ==========================================================================
   General Error Messages (Frontend)
   ========================================================================== */
.error-message {
    color: #f8d7da; background-color: #721c24; border: 1px solid #f5c6cb;
    padding: 0.8em 1em; margin: 1.5em 0; border-radius: 4px;
}

/* ==========================================================================
   Responsiveness / Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    /* Tablet adjustments - Masonry columnWidth may need JS update */
}

@media (max-width: 768px) {
    main { padding: 1.5em 1em; }
    h1 { font-size: 1.9em; } h2 { font-size: 1.6em; }
    .bio-layout { grid-template-columns: 1fr; }
    .bio-images { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-top: 2em; }
    .video-grid { gap: 2em; }
    .video-item { flex-basis: 100%; max-width: 100%; }
    .hero-content h1 { font-size: 3em; }
    .hero-section { min-height: calc(80vh - 66px); padding: 2em; }
    /* Gallery: Masonry columnWidth needs JS update for fewer columns */
}

@media (max-width: 480px) {
    main { padding: 1em 0.8em; }
    h1 { font-size: 1.6em; } h2 { font-size: 1.4em; }
    .bio-images { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2.2em; }
    .hero-section { padding: 1.5em; }
     /* Gallery: Masonry columnWidth needs JS update for 1 column */
}