@charset "utf-8";

/* ============================================================
   1. CORE FOUNDATION & VARIABLES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --pinstripe: 1.5px solid #ffffff;
    --cc-blue: #3a6c85;
    --cc-dark: #2a3439;
    --cc-slate: #69828f;
    --cc-green: #009444;
    --cc-wta: #814885;
    --gold-gradient: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
}

* {
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0; padding: 0;
    background-color: #f4f4f4;
    color: var(--cc-dark);
}

/* ============================================================
   2. MAIN GRID SHELL
   ============================================================ */
.grid {
    max-width: 950px;
    margin: auto;
    display: grid;
    min-height: 100vh;
    grid-template-columns: 100%;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: 
        "hd" 
        "nav" 
        "art" 
        "ft";
}

@media (min-width: 768px) {
    .grid {
        box-shadow: 0 0 10px rgba(0,0,0,0.05);
        background-color: #ffffff;
    }
}

/* ============================================================
   3. HEADER & NAVIGATION
   ============================================================ */
header {
    grid-area: hd;
    background-color: var(--cc-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23ffffff' fill-opacity='0.09' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    padding: 15px 0;
}

.logo { margin: 0 auto; display: block; width: 85%; max-width: 450px; height: auto; }

.desktop-nav, .mobile-nav {
    grid-area: nav;
    background-color: var(--cc-blue);
    border-top: var(--pinstripe);
    border-bottom: var(--pinstripe);
}

.desktop-nav { display: none; }
.mobile-nav { display: block; }

@media (min-width: 768px) {
    .desktop-nav { display: block; }
    .mobile-nav { display: none; }
    .desktop-nav ul { text-align: center; padding: 10px 0; margin: 0; list-style: none; }
    .desktop-nav li { display: inline-block; margin: 0 12px; }
    .desktop-nav a { text-decoration: none; color: #ffffff; font-size: 16px; font-weight: 600; transition: 0.3s ease; }
    .desktop-nav a:hover { color: #f4f4f4; text-decoration: none; border-bottom: 2px solid #ffffff; }
}

.accordion { background-color: var(--cc-blue); color: #ffffff; padding: 18px; width: 100%; border: none; text-transform: uppercase; font-size: 18px; font-weight: 600; cursor: pointer; }

.mobile-nav .panel {
    display: none;
    background-color: var(--cc-slate);
    text-align: center;
    padding: 0;
    overflow: hidden;
}

.mobile-nav .panel ul { padding: 0; margin: 0; list-style: none; }
.mobile-nav .panel li { padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.mobile-nav .panel li:last-child { border-bottom: none; }
.mobile-nav .panel a { color: #ffffff; text-decoration: none !important; display: block; font-size: 18px; font-weight: 600; }

/* ============================================================
   4. HOME MOSAIC SYSTEM
   ============================================================ */
.home-mosaic-wrapper {
    grid-area: art;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5px;
    background-color: #ffffff;
}

.mosaic-box { width: 100%; overflow: hidden; background-color: var(--cc-blue); contain: paint; }
.mosaic-box a { text-decoration: none !important; display: flex; flex-direction: column; height: 100%; border: none !important; outline: none; }
.mosaic-box img { width: 100%; height: auto; display: block; object-fit: cover; border-bottom: var(--pinstripe); transition: filter 0.3s ease; }
.mosaic-box:hover img { filter: brightness(90%); }

.mosaic-sub-row { display: grid; grid-template-columns: 1fr; gap: 1.5px; width: 100%; }
@media (min-width: 768px) { .mosaic-sub-row { grid-template-columns: 1fr 1fr; gap: 1.5px; } }

.mosaic-text {
    background-color: var(--cc-blue);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%232a3439' fill-opacity='0.20' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    padding: 22px 25px 32px 25px; flex-grow: 1; text-decoration: none !important;
}

.home-headline { color: #ffffff; font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; }
.home-subhead { color: #ffffff; font-weight: 400; line-height: 1.5; margin: 12px 0 0 0; opacity: 0.95; }

.hero-head { font-size: 1.85rem; }
.hero-subhead { font-size: 1.15rem; }

@media (min-width: 768px) {
    .hero-head { font-size: 2.3rem; }
    #story-2 .home-headline, #story-3 .home-headline { font-size: 1.4rem; }
}

/* ============================================================
   5. RANKINGS SECTION
   ============================================================ */
.rankings-wrapper { background: #ffffff; display: grid; grid-template-columns: 100%; padding-top: 5px; }
@media (min-width: 768px) { .rankings-wrapper { grid-template-columns: 1fr 1fr; } }

.rank-column { padding: 20px 20px 40px 20px; }
.rank-title { text-align: center; text-transform: uppercase; letter-spacing: 1.5px; font-size: 1.3rem; font-weight: 700; margin-bottom: -5px; }
.atp { color: var(--cc-blue); }
.wta { color: var(--cc-wta); }
.date { text-align: center; font-size: 0.8rem; color: var(--cc-slate); margin: 2px 0 15px 0; }

.rank-headshot {
    width: 140px; height: 140px; display: block; margin: 0 auto; 
    border-radius: 50%; object-fit: cover; padding: 4px; 
    background: var(--gold-gradient); box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

table { width: 100%; border-collapse: collapse; margin: 0 auto !important; width: 90%; max-width: 400px; }
.column-headers th { font-size: 0.75rem; text-transform: uppercase; color: #99abb4; padding: 10px 5px; border-bottom: 1px solid #eee; text-align: center; }
td { padding: 12px 5px; border-bottom: 1px solid #f9f9f9; text-align: center; }

/* ============================================================
   6. UPCOMING TOURNAMENTS SECTION
   ============================================================ */
.events-wrapper { background-color: #ffffff; padding: 20px 20px 20px 20px; border-top: 1px solid #f0f0f0; }
.events-container { max-width: 1000px; margin: 0 auto; }
.section-title-black { text-align: center; color: #000000; text-transform: uppercase; letter-spacing: 3px; font-size: 1.6rem; margin-bottom: 45px; font-weight: 800; }
.events-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }
@media (min-width: 768px) { .events-grid { grid-template-columns: repeat(3, 1fr); } }

.event-card {
    position: relative; background: #fdfdfd; border: 1.5px solid #eeeeee;
    border-radius: 12px; padding: 45px 20px 35px 20px; text-align: center; overflow: hidden;
}

.corner-badge { position: absolute; top: 0; left: 0; padding: 7px 14px; font-size: 10px; font-weight: 800; text-transform: uppercase; color: #ffffff; border-radius: 0 0 12px 0; }
.atp-bg { background-color: var(--cc-blue); }
.wta-bg { background-color: var(--cc-wta); }
.loc, .date { color: var(--cc-slate); font-size: 0.9rem; }

/* ============================================================
   7. NEWSLETTER SECTION (FIXED 3-COLUMN LAYOUT)
   ============================================================ */
#newsletter-section {
    background-color: var(--cc-dark);
    padding: 30px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: stretch;
    border-radius: 8px;
    margin: 20px 0;
}

@media (min-width: 900px) {
    #newsletter-section {
        grid-template-columns: 1fr 1.3fr 1fr;
        max-width: 950px;
        margin: 20px auto;
        padding: 40px 20px;
        gap: 20px;
    }
}

#newsletter-description { 
    color: white; text-align: center; border-right: 1px solid rgba(255,255,255,0.1); 
    display: flex; flex-direction: column; justify-content: center; padding: 0 15px; 
}

/* Fix for Bullets and Spacing */
.feature-list { list-style: none !important; padding: 0; margin: 0; }
.feature-list li {
    font-size: 0.85rem; font-weight: 600; margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05); letter-spacing: 1px; line-height: 1.4;
    text-transform: uppercase;
}

/* Styled Newsletter Signup Box */
.signup { 
    background-color: var(--cc-green); padding: 35px 25px; border-radius: 20px; 
    text-align: center; box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    display: flex; flex-direction: column; justify-content: center;
}
.signup h2 { color: white; font-size: 1.2rem; margin-bottom: 25px; font-weight: 800; }

.mailchimp input[type="text"],
.mailchimp input[type="email"] {
    width: 100%; height: 45px; border-radius: 25px; border: none;
    margin-bottom: 15px; text-align: center; font-size: 1rem;
}

.mailchimp .button {
    background-color: var(--cc-blue); color: white; width: 100%; height: 50px; border-radius: 25px;
    border: 2px solid white; font-weight: 800; cursor: pointer; transition: 0.3s ease;
}
.mailchimp .button:hover { background: white; color: var(--cc-green); }

/* Testimonials Spacing */
#testimonials { 
    color: white; text-align: center; border-left: 1px solid rgba(255,255,255,0.1); 
    display: flex; flex-direction: column; justify-content: center; padding: 0 15px; gap: 15px;
}
.testimonial-item { margin: 0; }
.quote { display: block; font-style: italic; font-size: 0.85rem; line-height: 1.4; margin-bottom: 3px; }
.attrib { font-size: 0.75rem; color: var(--cc-slate); font-weight: 700; }

.disclaimer, .spec-link a { color: white !important; font-size: 12px; margin-top: 15px; }

/* Hide divider lines on small screens */
@media (max-width: 899px) {
    #newsletter-description, #testimonials { border: none; padding: 15px 0; }
}

/* ============================================================
   8. BLUESKY SOCIAL BREAK
   ============================================================ */
#bsky-social-break { width: 100%; margin: 40px 0 20px 0; padding: 0 5%; min-height: 550px; }
.bsky-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

.bsky-scroll-window {
    height: 500px !important; overflow-y: auto !important; background: #ffffff !important;
    border-radius: 8px; border: 3px solid var(--cc-blue); padding: 20px 10px 10px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); display: flex; flex-direction: column;
}

bsky-embed::part(container) { display: flex !important; flex-direction: column !important; gap: 15px !important; padding-top: 15px !important; }
bsky-embed::part(post) { width: 100% !important; border: 1px solid #f0f4f8 !important; border-radius: 8px !important; background-color: #ffffff !important; }

/* ============================================================
   9. FOOTER
   ============================================================ */
footer {
    grid-area: ft;
    background-color: var(--cc-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23ffffff' fill-opacity='0.05' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    padding: 50px 20px; color: #aebfc7; text-align: center; border-top: var(--pinstripe);
}
footer ul { list-style: none; padding: 0; margin: 0 auto 25px auto; }
footer li { display: inline-block; margin: 0 15px; }
footer a { color: #aebfc7; text-decoration: none; font-weight: 600; text-transform: uppercase; }
footer p { font-size: 11px; margin-top: 35px; opacity: 0.6; }
/* ============================================================
   10. ULTRA-NARROW MOBILE REFINEMENTS (< 380px)
   ============================================================ */
@media (max-width: 380px) {
    footer ul {
        display: flex;
        flex-direction: column; /* Stacks links vertically */
        gap: 15px; /* Adds consistent space between links */
        margin-bottom: 20px;
    }

    footer li {
        display: block; /* Removes inline-block behavior */
        margin: 0; /* Resets horizontal margins */
    }

    footer a {
        font-size: 14px; /* Slightly larger for easier tapping on small screens */
        letter-spacing: 1px;
    }
}

/* ============================================================
   11. BACK TO TOP BUTTON (TRUE CENTERED CIRCLE)
   ============================================================ */
#backToTop {
    display: none; /* Initially hidden by JS */
    position: fixed; 
    bottom: 25px; 
    left: 25px; 
    z-index: 99; 
    
    /* 1. Force equal dimensions */
    width: 50px;
    height: 50px;
    
    /* 2. Reset everything that causes "The Lean" */
    padding: 0 !important; 
    margin: 0;
    text-indent: 0;
    
    background-color: var(--cc-green); 
    color: #ffffff; 
    border: none;
    border-radius: 50%; 
    
    /* 3. The centering "Power Trio" */
    display: flex !important; /* Overrides the JS .style.display if needed */
    align-items: center;
    justify-content: center;
    
    /* 4. Typography */
    font-size: 24px; 
    font-weight: bold;
    text-decoration: none;
    line-height: 1; /* Prevents line-height from pushing the arrow down */
    
    box-shadow: 2px 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

#backToTop:hover {
    background-color: var(--cc-dark);
    transform: scale(1.1);
}