/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Sniglet:wght@400;600&display=swap');

/* Color Palette & Variables */
:root {
    --bg-color: #f7f3fd;
    --card-bg: #ffffff;
    --primary-purple: #6b46c1;
    --soft-purple: #e9d8fd;
    --btn-bg: #f472b6;
    --btn-hover: #ec4899;  
    --text-color: #6b1fad;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Sniglet', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Navigation */
header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--primary-purple);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.2s ease;
}

nav a:hover, nav a.active {
    background-color: var(--soft-purple);
}

/* Layout Container */
main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Typography */
h1 {
    color: #6b1fad;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

p {
    font-size: 1.1rem;
    color: #4a5568;
}

/* Hero Section */
.hero {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.hero img {
    max-width: 250px;
    height: auto;
    border-radius: 12px;
}

/* Buttons */
.btn-container {
    text-align: center;
    margin-top: 1.5rem;
}

.btn {
    display: inline-block;
    background-color: var(--btn-bg);
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 0.8rem 1.8rem;
    border-radius: 30px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    box-shadow: var(--shadow);
}

.btn:hover {
    background-color: var(--btn-hover);
}

/* 3-Column Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.grid-card {
    background-color: var(--card-bg);
    border: 2px solid var(--soft-purple);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grid-card:hover {
    transform: translateY(-4px);
}

.grid-card img {
    width: 100%;
    height: 220px;          
    object-fit: cover;       
    border-radius: 8px;
    margin-bottom: 0.8rem;
}

.grid-card h3 {
    color: var(--primary-purple);
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

/* Responsive adjustments for phones & smaller screens */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;     
    }
}

/* About Page Side-by-Side Layout */
.about-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.about-content img {
    width: 220px;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.about-text p {
    margin-bottom: 1rem;
    text-align: left;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .about-text p {
        text-align: center;
    }
}
/* Hover Image Rotation Gallery */
.hover-gallery {
    position: relative;
    width: 100%;
    height: 350px; 
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.hover-gallery img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    margin-bottom: 0;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* Default state: Show only the 1st image */
.hover-gallery img:nth-child(1) {
    opacity: 1;
}

/* On hover: Start rotating through images using keyframes */
.grid-card:hover .hover-gallery img {
    animation: rotateImages 4.5s infinite;
}

/* Timing setup */
.grid-card:hover .hover-gallery img:nth-child(1) {
    animation-delay: 0s;
}

.grid-card:hover .hover-gallery img:nth-child(2) {
    animation-delay: 1.5s;
}

.grid-card:hover .hover-gallery img:nth-child(3) {
    animation-delay: 3s;
}

/* Fallback: if there are only 2 images in the folder, split 50/50 */
.grid-card:hover .hover-gallery img:nth-child(1):last-child,
.grid-card:hover .hover-gallery img:nth-child(2):last-child {
    animation: rotateTwoImages 3s infinite;
}

.grid-card:hover .hover-gallery img:nth-child(1):last-child { animation-delay: 0s; }
.grid-card:hover .hover-gallery img:nth-child(2):last-child { animation-delay: 1.5s; }

@keyframes rotateTwoImages {
    0% { opacity: 0; }
    15% { opacity: 1; }
    50% { opacity: 1; }
    65% { opacity: 0; }
    100% { opacity: 0; }
}

/* Home Page 2-Card Layout */
.home-grid {
    grid-template-columns: repeat(2, minmax(0, 320px)); /* Limits card width */
    justify-content: center;                             /* Centers the 2 cards */
}

/* Optional: Make text-only cards padded nicely since images were removed */
.home-grid .grid-card {
    padding: 2.5rem 1.5rem;
    justify-content: center;
}

/* Responsive adjustment for phones */
@media (max-width: 600px) {
    .home-grid {
        grid-template-columns: 1fr; /* Stacks into 1 column on mobile */
    }
}