/* General & Basic Styles */

/* Basic Reset and Body Styling */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif; 
    font-weight: 400; 
    line-height: 1.7; 
    color: #eee; 
    background-color: #1a1a1a; 
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='40'%20height='40'%3E%3Cpath%20d='M20%200%20Q15%205%2010%2010%20Q5%2015%200%2020%20Q5%2025%2010%2030%20Q15%2035%2020%2040%20Q25%2035%2030%2030%20Q35%2025%2040%2020%20Q35%2015%2030%2010%20Q25%205%2020%200%20Z'%20fill='rgba(222,222,222,0.03)'/%3E%3C/svg%3E");
    overflow-x: hidden; 
}

.container {
    width: 90%; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

/* --- Typographic Hierarchy --- */

/* Headings on Mighty Bunkin Page & General Fallbacks: Lora */
.story-title, 
.homepage-main h3, 
.homepage-main h4,
.homepage-main h5,
.homepage-main h6 {
    font-family: 'Lora', serif;
    color: #fff; 
    margin-top: 1.5em; 
    margin-bottom: 0.6em; 
    line-height: 1.3;
    font-weight: 700; 
}
.story-title { 
    font-size: 2.5em;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
}
.homepage-main h3 { 
    font-size: 1.8em;
    color: #f0f0f0;
}


/* MAIN PAGE (index.html) SPECIFIC TYPOGRAPHY */
header h1 { 
    font-family: 'Lora', serif; 
    font-size: 2.2em; 
    font-weight: 700;
    margin: 0; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

h2.page-title { 
    font-family: 'Lora', serif; 
    font-size: 2.8em; 
    font-weight: 700;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    text-transform: uppercase; 
    font-variant: small-caps; 
    letter-spacing: 2px; 
    color: #fff;
}

p.tagline { 
    font-family: 'Lora', serif; 
    font-style: italic;
    font-size: 1.3em;
    color: #bbb;
    text-align: center;
    margin-bottom: 50px; 
}

/* Tile Titles on index.html */
.tile-title {
    font-family: 'Lora', serif; 
    font-size: 1.5em; 
    font-weight: 700;
    color: #fff !important; /* Ensured white color, important to override potential link styles */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    text-transform: uppercase; 
    font-variant: small-caps; 
    letter-spacing: 1px; 
    margin: 0; /* Reset margin for the title itself */
}


/* Paragraphs & Body Text (Applies to Mighty Bunkin page primarily for story text) */
.homepage-main p { 
    margin-bottom: 1.2em; 
    max-width: 800px; 
    margin-left: auto; 
    margin-right: auto;
    font-size: 1em; 
    color: #ccc; 
    font-family: 'Roboto', sans-serif; 
}

main.homepage-main > .container > p:not(.tagline) {
    font-family: 'Roboto', sans-serif;
    color: #ccc;
}


/* --- Navigation & Footer Typography (Applies to both pages) --- */
nav ul li a {
    font-family: 'Roboto', sans-serif; 
    text-decoration: none;
    color: #bbb;
    font-weight: 400; 
    font-size: 1em;
    transition: color 0.3s ease;
    padding: 5px 0; 
}

nav ul li a:hover {
    color: #fff;
}

footer p {
    font-family: 'Roboto', sans-serif; 
    color: #bbb;
    font-size: 0.9em;
}


/* General Image Styles (for Mighty Bunkin page primarily) */
.homepage-main img { 
    max-width: 100%; 
    height: auto; 
    display: block; 
    margin: 25px auto; 
    border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); 
}


/* Header Styles */
header {
    background-color: #222; 
    padding: 20px 0; 
    border-bottom: 1px solid #333; 
    position: sticky; 
    top: 0;
    z-index: 1000; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); 
}

header .container {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}


header h1 a {
    text-decoration: none; 
    color: #fff; 
}

/* Navigation Styling */
nav ul {
    list-style: none; 
    padding: 0;
    margin: 0;
    display: flex; 
}

nav ul li {
    margin-left: 25px; 
}

nav ul li:first-child {
    margin-left: 0; 
}

/* Homepage Specific Main Content Styling */
.homepage-main {
   padding: 30px 0; 
}


/* --- Tile Gallery Styles (for index.html) --- */
.tile-gallery-container {
    margin-top: 30px;
    margin-bottom: 30px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
}

.tile-link {
    text-decoration: none;
    color: inherit;
    display: block; 
    position: relative; /* Crucial for positioning the absolute overlay inside it */
    border-radius: 8px; 
    overflow: hidden; /* Clips image corners to match tile rounding */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Explicitly set height to match the image height to ensure overlay context is correct */
    /* Desktop height will be set by JS or can be fixed if all images are same aspect ratio */
}

.tile-link:hover {
    transform: translateY(-5px) scale(1.02); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.45);
}

.tile-link img { 
    width: 100%;
    height: 280px; /* Default height for desktop */
    object-fit: cover; 
    display: block; /* Remove extra space below image */
    margin: 0; 
    border-radius: 0; 
    box-shadow: none; 
    transition: transform 0.4s ease; 
}

.tile-link:hover img {
    transform: scale(1.1); 
}

.tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0; /* Makes it span the full width of .tile-link */
    box-sizing: border-box; /* Include padding in width/height calculations */
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0) 100%); 
    padding: 20px 15px 15px; /* Adjusted padding */
    display: flex;           /* Using flex to better align title at the bottom */
    flex-direction: column;
    justify-content: flex-end; /* Pushes title to the bottom of overlay */
    align-items: flex-start;   /* Aligns title to the left */
    min-height: 30%; /* Overlay takes at least 30% of the tile height */
    height: auto; /* Allow it to grow if text wraps */
    opacity: 0; /* Hidden by default on desktop */
    transition: opacity 0.4s ease; 
}

.tile-link:hover .tile-overlay {
    opacity: 1; /* Show overlay on hover (desktop) */
}


/* Footer Styling */
footer {
    background-color: #222; 
    color: #bbb; 
    text-align: center;
    padding: 25px 0; 
    margin-top: 40px;
    border-top: 1px solid #333; 
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    header {
        position: static; 
    }

    header .container {
        flex-direction: column; 
    }

    header h1 {
        margin-bottom: 15px; 
        font-size: 2em; 
    }

    nav ul {
        flex-direction: column; 
        align-items: center; 
    }

    nav ul li {
        margin: 8px 0; 
        margin-left: 0; 
    }

    h2.story-title { 
        font-size: 2em; 
        margin-top: 30px;
        margin-bottom: 30px;
    }
    h2.page-title { 
        font-size: 2.2em; 
    }
    
    .homepage-main h3 { 
        font-size: 1.6em; 
    }

    .homepage-main p { 
        font-size: 0.95em; 
    }
    
    p.tagline {
        font-size: 1.1em;
    }

    .homepage-main img { 
        margin: 20px auto; 
    }

    .tile-grid {
        grid-template-columns: 1fr; 
    }
    .tile-link img { 
        height: 220px; /* Specific height for mobile tile images */
    }
    .tile-title {
        font-size: 1.2em; /* Adjusted for mobile */
    }
    .tile-overlay { 
        opacity: 1 !important; /* Overlay always visible on mobile for tappability - !important to ensure override */
        background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0) 100%); /* Slightly stronger gradient for mobile */
        padding: 15px; /* Adjusted padding for mobile */
        min-height: 25%; /* Adjusted min-height for mobile overlay */
    }
}
