/* Theme Colors for Kalamin Karangal */
:root {
    /* Primary Color: Knowledge & Trust (Deep Blue) */
    --primary-color: #0056b3;
    --primary-hover: #004494;
    
    /* Secondary Color: Hope & Optimism (Golden Yellow) */
    --secondary-color: #ffc107;
    --secondary-hover: #e0a800;
    
    /* Accent Color: Growth & Harmony (Green) */
    --accent-color: #28a745;
    
    /* Dark Theme Colors for Header/Footer */
    --dark-blue-start: #1a237e;
    --dark-blue-end: #283593;

    /* Neutral Colors */
    --text-color: #333333;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --gray: #616161;

    /* Map style.css variables to theme variables */
    --primary: var(--primary-color);
    --accent: var(--secondary-color);
    --dark: var(--dark-blue-start);
    --light: var(--bg-light);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Open Sans', system-ui, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
}

h2 {
    font-family: 'Poppins', sans-serif;
    text-align: center;
    font-size: 2.6rem;
    margin-bottom: 3rem;
    position: relative;
}

h2::after {
    content: '';
    width: 80px;
    height: 4px;
    background: var(--accent);
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
}

/* Links */
a {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-hover);
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 600;
    padding: 1rem 2.2rem;
    border-radius: 50px;
    text-decoration: none;
    margin: 0.5rem;
    transition: all 0.3s;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--white);
}

.btn-warning, .btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-color);
    box-shadow: 0 5px 15px rgba(251,192,45,0.35);
}

.btn-warning:hover, .btn-secondary:hover {
    background-color: var(--secondary-hover);
    border-color: var(--secondary-hover);
    color: var(--text-color);
    box-shadow: 0 12px 30px rgba(251,192,45,0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--text-color);
}

/* Header & Nav */
header {
    background: linear-gradient(135deg, var(--dark-blue-start) 0%, var(--dark-blue-end) 100%);
    color: var(--white);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
}

.logo span { color: var(--white); }

.logo img {
    height: 50px;
    width: auto;
    display: block;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--accent); }

/* Hero */
.hero {
    background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
                url('https://images.unsplash.com/photo-1529390079861-591de3547d13?ixlib=rb-4.0.3&auto=format&fit=crop&w=2340&q=80') center/cover no-repeat;
    color: var(--white);
    text-align: center;
    padding: 12rem 5% 8rem;
}

.hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3.8rem;
    margin-bottom: 1.2rem;
    text-shadow: 0 3px 12px rgba(0,0,0,0.6);
    color: var(--white);
}

.hero p {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
}

/* Page Header */
.page-header {
    background-color: var(--bg-light);
    text-align: center;
    padding: 6rem 5%;
}
.page-header h1 {
    font-size: 3rem;
    color: var(--primary);
}
.page-header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 1rem auto 0;
}

/* Sections */
section {
    padding: 6rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Grids & Cards */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.card:hover { transform: translateY(-10px); }

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.team-card img {
    height: 320px; /* Taller height for portrait photos */
    width: 100%;
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
    object-position: center top; /* Prioritizes the top part of the image (usually the face) */
}

.card-content {
    padding: 1.8rem;
    text-align: center;
}

/* Impact Stats */
.impact-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4rem;
    text-align: center;
    background: var(--bg-light);
    padding: 4rem 5%;
    border-radius: 16px;
    margin: 4rem auto;
    max-width: 1100px;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Donation Details */
.donation-details {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
    border-left: 5px solid var(--accent);
    max-width: 700px;
    margin: 2rem auto;
}

/* Contact Form */
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 1rem;
}

.contact-form button {
    width: 100%;
    border: none;
    cursor: pointer;
}

.social-links a {
    margin-right: 1rem;
    text-decoration: none;
    font-weight: 600;
    color: var(--primary);
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-blue-start) 0%, var(--dark-blue-end) 100%);
    color: var(--white);
    text-align: center;
    padding: 1rem 2% 1rem;
}

footer a {
    color: var(--secondary-color);
    margin: 0 1rem;
    text-decoration: none;
}

footer a:hover {
    color: var(--white);
}

/* Media Queries */
@media (max-width: 768px) {
    .hero { padding: 8rem 5% 6rem; }
    .hero h1 { font-size: 2.8rem; }
    .nav-links { display: none; }
}