/* ===================================
   PATRIOTS NATION CSS (Refactored)
   University of the Cumberlands Fan Site
   =================================== */

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

/* === IMPORT GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&family=Lato:wght@400;700&display=swap');

/* === VARIABLES === */
:root {
    /* Colors */
    --navy-blue: #002D62;
    --patriot-red: #C8102E;
    --light-gray: #F4F4F4;
    --white: #FFFFFF;
    --charcoal: #333333;
    --medium-gray: #666666;
    
    /* Typography */
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Lato', sans-serif;
    
    /* Spacing */
    --spacing-small: 8px;
    --spacing-medium: 16px;
    --spacing-large: 24px;
    --spacing-xlarge: 32px;
    
    /* NEW: Variables for repeated values */
    --nav-height: 70px;
    --overlay-color: rgba(0, 45, 98, 0.7);

    /* NEW: Border Radii */
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 24px;
    --radius-round: 50%;
    
    /* NEW: Box Shadows */
    --shadow-light: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.2);
    --shadow-heavy: 0 6px 20px rgba(0,0,0,0.1);
    
    /* NEW: Breakpoints for Media Queries */
    --bp-md: 768px;
    --bp-sm: 480px;
}

/* === BASE === */
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--charcoal);
    background-color: var(--light-gray);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === NAVBAR === */
nav {
    background-color: var(--navy-blue);
    padding: var(--spacing-medium) var(--spacing-xlarge);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* UPDATED: Ensures nav height is consistent for mobile menu positioning */
    min-height: var(--nav-height);
}

.logo img {
    /* UPDATED: Using a variable for height */
    height: var(--nav-height);
    transition: transform 0.3s ease;
}
.logo img:hover {
    transform: scale(1.05);
}

nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-small);
}
nav ul li a {
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-decoration: none;
    text-transform: uppercase;
    padding: var(--spacing-small) var(--spacing-medium);
    border-radius: var(--radius-small);
}
nav ul li a:hover,
nav ul li a.active { /* UPDATED: Combined hover and active state */
    background-color: var(--patriot-red);
}

/* === HERO === */
figure.hero {
    width: 100%;
    height: 600px;
    margin: 0;
    position: relative;
    overflow: hidden;
}
figure.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    /* UPDATED: Fluid font size that scales with the viewport */
    font-size: clamp(1.8rem, 5vw + 1rem, 3.5rem);
    color: var(--white);
    text-shadow: 3px 3px 8px rgba(0,0,0,0.7);
    text-transform: uppercase;
    text-align: center;
    width: 90%;
}
figure.hero figcaption {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: var(--white);
    padding: 4px 12px;
    border-radius: var(--radius-small);
    font-size: 0.8rem;
}

/* === GENERIC COMPONENTS & SECTIONS === */
.intro-text {
    max-width: 800px;
    margin: var(--spacing-large) auto;
    text-align: center;
    font-size: 1.2rem;
    color: var(--charcoal);
}

section h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--navy-blue);
    text-align: center;
    margin-bottom: var(--spacing-large);
    text-transform: uppercase;
}

/* A shared style for white container boxes */
.content-box {
    padding: var(--spacing-xlarge);
    background: var(--white);
    margin: var(--spacing-xlarge) auto;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-light);
}

/* Game Center */
.game-center {
padding: var(--spacing-xlarge);
background: var(--white);
margin: var(--spacing-xlarge) auto;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
border-radius: 8px;
max-width: 1100px;
}
.scorestream-widget-container {
height: 600px;
margin: 0 auto;
width: auto;
}

.social-section {
    padding: var(--spacing-xlarge);
    background: var(--white);
    text-align: center;
}
.social-buttons-uniform {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}
.social-btn-uniform {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--patriot-red);
    color: var(--white);
    min-width: 200px;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--radius-large);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.social-btn-uniform:hover {
    background: var(--navy-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* === PAGE SPECIFIC STYLES: BLOG === */
.blog-hero, .contact-hero {
    position: relative;
    background: url('images/stadium-banner.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}
.blog-hero::before, .contact-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    /* UPDATED: Using a variable for the overlay color */
    background: var(--overlay-color);
}
.blog-hero-content, .contact-hero h1, .contact-hero p {
    position: relative;
    z-index: 2;
}
.blog-hero {
    height: 300px;
}
.blog-hero-content {
    max-width: 800px;
    padding: 0 20px;
}
.blog-hero h1, .contact-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4vw + 1rem, 3rem); /* UPDATED: Fluid font size */
    margin-bottom: var(--spacing-small);
    text-transform: uppercase;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
}
.blog-hero p, .contact-hero p {
    font-size: 1.3rem;
    color: #ddd;
}

.blog-list {
    margin: var(--spacing-xlarge) auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xlarge);
    max-width: 900px;
    padding: 0 var(--spacing-medium);
}
.blog-post {
    display: flex;
    gap: var(--spacing-medium);
    background: var(--white);
    padding: var(--spacing-medium);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.blog-post:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}
.blog-post img {
    width: 220px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-small);
}
.blog-content {
    flex: 1;
}
.blog-content h2 {
    font-family: var(--font-heading);
    color: var(--navy-blue);
    margin-bottom: var(--spacing-small);
}
.blog-content p {
    margin-bottom: var(--spacing-small);
}
.post-meta {
    font-size: 0.9rem;
    color: var(--medium-gray);
    margin-bottom: var(--spacing-small);
}
.read-more, .back-to-blog {
    font-family: var(--font-heading);
    color: var(--patriot-red);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}
.read-more:hover, .back-to-blog:hover {
    color: var(--navy-blue);
}
.back-to-blog {
    display: inline-block;
    margin-top: var(--spacing-large);
}

.post-detail {
    max-width: 800px;
    margin: var(--spacing-xlarge) auto;
    background: var(--white);
    padding: var(--spacing-xlarge);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-light);
}
/* NOTE: The parent element of this figcaption (likely a <figure>) should have 'position: relative;' */
.post-detail figcaption {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.5);
    color: var(--white);
    padding: 4px 12px;
    border-radius: var(--radius-small);
    font-size: 0.8rem;
}
.post-detail img.post-hero {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-medium);
    margin-bottom: var(--spacing-large);
}
.post-detail p {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-medium);
}

/* === PAGE SPECIFIC STYLES: CONTACT & EVENTS === */
.contact-hero {
    height: 250px;
    flex-direction: column;
}

.events-page {
    padding: var(--spacing-xlarge) var(--spacing-medium);
}
.events-page .scorestream-widget-container {
  width: 100%;
  height: 900px;
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-light);
  overflow: hidden;
}

/* === UTILITY & ACCESSIBILITY === */

/* NEW: Safer, opt-in image loading animation */
.fade-in-image {
    opacity: 0;
    transition: opacity 0.5s ease;
}
.fade-in-image.loaded {
    opacity: 1;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--navy-blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-round);
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--patriot-red);
    transform: translateY(-5px);
}

/* NEW: Focus styles for keyboard accessibility */
a:focus-visible,
button:focus-visible,
.social-btn-uniform:focus-visible {
    outline: 3px solid var(--patriot-red);
    outline-offset: 2px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}
.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--white);
    margin: 5px 0;
    transition: 0.3s;
}
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* === FOOTER === */
footer {
    background: var(--charcoal);
    color: #bbb;
    text-align: center;
    padding: var(--spacing-large);
    font-size: 0.9rem;
    /* This is the magic rule that pushes the footer to the bottom */
    margin-top: auto; 
}

/* === RESPONSIVE STYLES === */
/* UPDATED: Media queries are now grouped and use variables */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
    }
    figure.hero {
        height: 400px;
    }
    
    .blog-post {
        flex-direction: column;
        align-items: center;
    }
    .blog-post img {
        width: 100%;
        height: auto;
        max-width: 400px;
    }

    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: block;
        /* Position it in the top right corner within the nav */
        position: absolute;
        top: 15px;
        right: var(--spacing-xlarge);
    }
    nav ul {
        position: fixed;
        top: var(--nav-height); /* UPDATED */
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height)); /* UPDATED */
        background: var(--navy-blue);
        flex-direction: column;
        padding: var(--spacing-large);
        transition: left 0.3s ease;
    }
    nav ul.active {
        left: 0;
    }
    nav ul li {
        width: 100%;
    }
    nav ul li a {
        display: block;
        padding: 15px;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    figure.hero {
        height: 300px;
    }
    .intro-text {
        font-size: 1rem;
    }
    .scorestream-widget-container {
        height: 400px;
    }
}

/* NEW: Accessibility for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}