/* site.css - General website styles for header, footer, and pages */

:root {
    --primary-dark: #1a1d29;
    --primary-green: #2d5016;
    --accent-green: #3d7a1f; /* Darker green for better contrast with white text (4.5:1) */
    --accent-green-light: #6ec043; /* Lighter green for better contrast on dark backgrounds */
    --light-bg: #f5f5f5;
    --text-light: #ffffff;
    --text-dark: #333333;
    --border-color: #e0e0e0;
}

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

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
    padding-top: 0; /* No padding needed since header is transparent over hero */
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: transparent; /* Transparent by default */
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 2rem;
}

/* Header when scrolled */
header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Header text colors when transparent */
header:not(.scrolled) .logo,
header:not(.scrolled) nav a {
    color: var(--text-light);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Header text colors when scrolled */
header.scrolled .logo,
header.scrolled nav a {
    color: var(--text-dark);
    text-shadow: none;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav a:hover {
    opacity: 0.7;
}

nav a.active {
    background-color: var(--accent-green);
    color: var(--text-light) !important;
    text-shadow: none !important;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    transition: all 0.3s ease;
    border-radius: 2px;
}

header.scrolled .menu-toggle span {
    background: var(--text-dark);
}

/* Hamburger animation when open */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Footer Styles */
footer {
    background-color: var(--primary-dark);
    color: var(--text-light);
    padding: 2rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-green);
}

.footer-copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Main Content Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem; /* Extra top padding for overlap effect */
    background: var(--light-bg);
    border-radius: 30px 30px 0 0; /* Rounded top corners */
    position: relative;
    z-index: 1; /* Ensure container is above hero */
}

/* Container for pages WITHOUT hero (rules, about) - needs top spacing for fixed header */
body:not(:has(.hero)) {
    background: var(--primary-dark); /* Dark background for pages without hero */
}

body:not(:has(.hero)) .container {
    padding-top: 6rem; /* Space for fixed header */
    border-radius: 0; /* No rounded corners on pages without hero */
    background: #1a1d29; 
}

/* Landing Page Styles */
.hero {
    text-align: center;
    padding: 12rem 2rem 10rem; /* Increased height - more padding top and bottom */
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), /* Dark overlay for text readability - 65% opacity */
        url('../images/hero.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-light);
    width: 100%;
    position: relative;
    margin-bottom: -4rem; /* Pull the next section up to overlap */
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8); /* Strong shadow for better readability */
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.8); /* Shadow for paragraph text */
    opacity: 1; /* Remove opacity to maintain contrast */
}

.cta-button {
    display: inline-block;
    padding: 1rem 3rem;
    background-color: var(--accent-green);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Content Sections */
.content-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.content-section h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--primary-green);
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content-section ul,
.content-section ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* Board diagram styles for rules page */
.board-example {
    display: grid;
    grid-template-columns: repeat(8, 40px);
    grid-template-rows: repeat(8, 40px);
    gap: 1px;
    background-color: #000;
    margin: 1rem auto;
    width: fit-content;
    border: 2px solid #000;
}

.board-cell {
    background-color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-cell.black {
    background: radial-gradient(circle, #333 60%, #000 100%);
}

.board-cell.white {
    background: radial-gradient(circle, #fff 60%, #ddd 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row; /* Keep horizontal for logo and hamburger */
        gap: 0;
    }

    /* Show hamburger menu on mobile */
    .menu-toggle {
        display: flex;
        flex-wrap: wrap;
        align-content: flex-end;
    }

    /* Hide navigation by default on mobile */
    nav {
        position: fixed;
        top: 0;
        right: -100%; /* Hidden off-screen to the right */
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        padding-top: 5rem;
    }

    /* Show navigation when menu is active */
    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    nav a {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        color: var(--text-dark) !important;
        text-shadow: none !important;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }

    nav a:hover {
        background-color: var(--light-bg);
        opacity: 1;
    }

    nav a.active {
        background-color: var(--accent-green);
        color: var(--text-light) !important;
    }

    .hero {
        padding: 6rem 1rem 5rem; /* Adjusted for tablet */
        margin-bottom: -2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .container {
        border-radius: 20px 20px 0 0; /* Smaller radius on tablets */
    }

    .features {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .hero {
        padding: 5rem 1rem 4rem; /* Adjusted for mobile */
        margin-bottom: -1.5rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .cta-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }

    .container {
        padding: 2rem 1rem 1rem;
        border-radius: 15px 15px 0 0; /* Even smaller radius on mobile */
    }
}
