/* ================================================= */
/* 🚀 SECTION 1: CUSTOMIZABLE CSS VARIABLES         */
/* ================================================= */

/* Junior Dev Tip: This is the BEST place to change colors! 
   You only change it here, and it updates everywhere in the file! */
:root {
    --primary-bg: #FFFFFF;      /* Primary Background: White */
    --secondary-bg: #F0F0F0;    /* Tile Background: Light Gray for contrast */
    --text-color: #1A1A1A;      /* Main Text/Nav Background: Near Black */
    --accent-color: #007BFF;    /* ACCENT COLOR: Bright Blue! */
    --hover-color: #0056b3;     /* Darker Blue for a nice hover effect */
    --nav-width: 600px;         /* NEW WIDTH: Width of the side navigation menu when open */
    --grid-max-width: 960px;    /* The maximum width for our tile grid (fits 4 nicely) */
}

/* ================================================= */
/* 🌐 SECTION 2: GLOBAL AND CORE STYLES             */
/* ================================================= */
* {
    /* DevSec Best Practice: Ensures padding and borders don't ruin our element sizes! */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    /* Smoothly animates the main content when the menu opens/closes */
    transition: margin-left 0.3s ease; 
}

/* --- Fixed Header Bar --- */
.main-header {
    background-color: var(--text-color);
    color: var(--primary-bg);
    display: flex;
    align-items: center;
    padding: 10px 20px;
    position: fixed; /* Keeps it locked at the top of the screen */
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000; /* Ensures the header is always on top of everything */
}

.site-title {
    font-size: 1.8em;
    margin-left: 15px;
}

/* Menu Toggle Button (The three lines/X) */
.menu-toggle {
    background: none;
    border: none;
    color: var(--primary-bg);
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle .fa-times {
    color: var(--accent-color); /* Makes the 'X' icon blue */
}


/* ================================================= */
/* 🚪 SECTION 3: SIDE NAVIGATION MENU STYLES         */
/* ================================================= */
.side-nav {
    height: 100%;
    width: 0; /* STARTS CLOSED! This is the magic. */
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    background-color: var(--text-color);
    overflow-x: hidden;
    padding-top: 70px; /* Pushes links down below the fixed header */
    transition: 0.3s; /* Smooth sliding transition */
}

/* This is the class added by JavaScript to OPEN the menu! */
.side-nav.open {
    width: var(--nav-width);
}

.side-nav ul {
    list-style-type: none;
}

.side-nav a {
    padding: 15px 20px;
    text-decoration: none;
    font-size: 1.1em;
    color: var(--primary-bg);
    display: block; /* Makes the entire block clickable */
    transition: 0.3s;
}

.side-nav a:hover {
    background-color: var(--accent-color);
    color: var(--text-color);
}


/* ================================================= */
/* 🧱 SECTION 4: MAIN CONTENT & TILE GRID STYLES     */
/* ================================================= */
.main-content {
    padding: 80px 20px 20px 20px; /* Space below the fixed header */
    transition: margin-left 0.3s;
}

/* This is the class added by JavaScript to shift content when menu is open */
.main-content.shifted {
    margin-left: var(--nav-width);
}

/* NEW: Style for the centered header text above the tiles */
.content-header {
    /* Junior Dev Tip: We use the same max width as the grid (960px) 
       so the text and tiles line up perfectly! */
    max-width: var(--grid-max-width); 
    margin: 0 auto; /* Centers the block container horizontally */
    padding-bottom: 20px; /* Space below the paragraph */
    text-align: center; /* Centers the actual text inside the block */
    border-bottom: 2px solid var(--secondary-bg); /* A subtle divider line */
}

/* --- Text Container (For Article Layout) --- */
.text-grid {
    /* Junior Dev Tip: We set a max-width and use 'margin: 0 auto' to CENTER the grid itself 
       on a very wide screen! */
    max-width: var(--grid-max-width); 
    margin: 0 auto; 
    
    display: grid;
    gap: 20px;
	padding-top: 40px;
    
}


/* --- Cache Grid Container (For 4-Per-Row Layout) --- */
.cache-grid {
    /* Junior Dev Tip: We set a max-width and use 'margin: 0 auto' to CENTER the grid itself 
       on a very wide screen! */
    max-width: var(--grid-max-width); 
    margin: 0 auto; 
    
    display: grid;
    gap: 20px;
    padding: 20px 0;
    
    /* Default Responsive Grid: Auto-fit as many tiles as possible,
       with a minimum width of 200px per tile. */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
}

/* Media Query: When the screen is wide enough (like a desktop), 
   we force it to display exactly 4 columns! */
@media (min-width: 840px) {
    .cache-grid {
        grid-template-columns: repeat(4, 1fr); 
    }
}

/* --- The Individual Cache Tiles (Square Buttons) --- */
.cache-tile {
    /* The trick to make it a square! Height is 0, but padding-bottom stretches it 
       to be the same size as its width. Fun, right? */
    height: 0; 
    padding-bottom: 100%; 
    position: relative; 
    
    background-color: var(--secondary-bg);
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--text-color);
	box-shadow: 0 5px 2.5px rgba(0, 0, 0, 0.2);
    
    /* Text centering rules: */
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    
    transition: background-color 0.3s, border-color 0.3s, transform 0.2s;
}

.cache-tile:hover {
    background-color: var(--accent-color); 
    color: var(--primary-bg);
    border-color: var(--accent-color);
    transform: translateY(-5px); /* Little lift effect! */
	box-shadow: 0 0px 0px rgba(0, 0, 0, 0.2);
}

/* NEW FIX FOR CENTERING: Used to position the content correctly within the square tile. */
.cache-tile > * {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centers the element perfectly */
    width: 90%;
}

/* ================================================= */
/* 🦶 SECTION 5: FOOTER STYLES                      */
/* ================================================= */

.main-footer {
    /* Adding some extra space after the tiles, so you have to scroll! */
    margin-top: 100px; 
    padding: 20px 0 40px; /* Top, no side padding, and a nice big bottom pad */
    background-color: var(--primary-bg);
}

.footer-content {
    /* The core centering and max-width magic! This aligns it with the cache-grid */
    max-width: var(--grid-max-width);
    margin: 0 auto;
    text-align: center;
	border-top: 2px solid var(--secondary-bg); /* A subtle divider line */
}

.gc-logo {
    width: 50px; /* Small, classy size for the logo */
    height: 50px;
    margin: 0 auto 10px; /* Center it and add space below */
}

.gc-logo svg {
    width: 100%;
    height: 100%;
}

.main-footer p {
    margin: 10px 0;
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.7; /* Subtler text */
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0 10px;
    font-size: 0.9em;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- End of style.css --- */