:root {
    --primary-color: orange;
    --bg-dark: #3d2b1f;
    --text-light: #f5f5f5;
}

html { scroll-behavior: smooth; }

/* Telugu Language Scaling */
html.lang-te { font-size: 115%; }
html.lang-te body { line-height: 1.8; }

* { margin: 0; padding: 0; box-sizing: border-box; }
body { line-height: 1.6; color: #333; }
a { text-decoration: none; color: inherit; }

/* Navbar */
.navbar {
    position: fixed; top: 0; width: 100%;
    background: white; padding: 15px 5%;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 1000;
    transition: background 0.3s;
}
.navbar.scrolled { background: rgba(255,255,255,0.95); backdrop-filter: blur(5px); }
.logo { display: flex; align-items: center; gap: 15px; }
.logo-image { width: 50px; border-radius: 50%; }
.logo-text { display: flex; flex-direction: column; font-weight: bold; }
.logo-main { color: var(--primary-color); }
.logo-sub { font-size: 0.85rem; color: #555; }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-link.active { color: var(--primary-color); font-weight: bold; }
.lang-toggle-btn {
    padding: 5px 12px; border: 2px solid var(--primary-color);
    border-radius: 20px; background: white; color: var(--primary-color);
    cursor: pointer; font-weight: bold;
}

.nav-content { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 5px; z-index: 1001; }
.hamburger span { display: block; width: 25px; height: 3px; background-color: var(--primary-color); border-radius: 3px; transition: all 0.3s ease; }

/* Hero */
.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; background: #fff9e6; padding-top: 100px; padding-bottom: 40px;
}
.hero-content { max-width: 800px; padding: 20px; }
.hero-shloka { margin-bottom: 25px; }
.shloka-wrapper { display: inline-block; text-align: center; }
.shloka-text { font-size: 1.5rem; color: var(--bg-dark); white-space: pre-wrap; font-weight: bold; margin-bottom: 5px; line-height: 1.5; }
.shloka-caption { font-size: 1rem; color: #555; text-align: right; font-style: italic; margin-bottom: 15px; }
.shloka-meaning { display: block; font-size: 0.95rem; color: #555; max-width: 650px; margin: 0 auto; font-style: italic; line-height: 1.6; }
.hero-trust-name { font-size: 2.5rem; color: var(--primary-color); margin: 15px 0; }

.hero-subtitle { margin-bottom: 30px; font-size: 1.1rem; line-height: 1.6; }
.hero-buttons { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }

/* Buttons */
.btn { padding: 10px 20px; border-radius: 5px; font-weight: bold; cursor: pointer; border: none; transition: all 0.3s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: #d68910; }
.btn-secondary { background: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-secondary:hover { background: var(--primary-color); color: white; }

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed; bottom: 30px; right: 30px; background: var(--primary-color); color: white;
    width: 45px; height: 45px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease; z-index: 999;
}
.scroll-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-to-top.show:hover { background: var(--bg-dark); transform: translateY(-3px); }

/* Sections */
.section-padding { padding: 80px 5%; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-title { font-size: 2.2rem; color: #333; }
.section-tag { color: var(--primary-color); font-weight: bold; text-transform: uppercase; }

/* Programs */
.programs { background: #fdfdfd; }
.programs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-top: 30px; }
.program-card { padding: 35px; background: white; border-radius: 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); border: 2px solid transparent; transition: all 0.3s ease; overflow: hidden; }
.program-card:hover { transform: translateY(-8px); border-color: var(--primary-color); }
.program-card h3 { background: var(--primary-color); color: white; margin: -35px -35px 20px -35px; padding: 20px 35px; font-size: 1.3rem; border-bottom: 3px solid var(--bg-dark); }
.program-features { list-style: none; padding-left: 0; margin-top: 15px; }
.program-features li { margin-bottom: 8px; padding-left: 20px; position: relative; color: #555; }
.program-features li::before { content: '✓'; position: absolute; left: 0; color: var(--primary-color); font-weight: bold; }

/* Events */
.events-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 30px; }
.event-card { display: flex; flex-direction: column; background: white; border-radius: 10px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-left: 5px solid var(--primary-color); transition: all 0.3s ease; }
.event-card:hover { transform: translateY(-3px); border-color: #d68910; box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.event-date { font-size: 0.9rem; color: var(--primary-color); font-weight: 600; margin-bottom: 8px; }
.event-info { padding: 0; }
.event-info h3 { margin-bottom: 0; color: #333; font-size: 1.15rem; }

/* Event Card Links & Gallery Page */
.event-gallery-link {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    background-color: #f1c40f; /* Match your trust theme */
    color: #3d2b1f;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: transform 0.2s;
}

.event-gallery-link:hover {
    transform: scale(1.05);
    background-color: #d4ac0d;
}
.gallery-page-container { padding: 60px 5%; background: #fdfdfd; min-height: 50vh; }
.gallery-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; max-width: 1200px; margin: 0 auto; }
.gallery-item { overflow: hidden; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); cursor: pointer; aspect-ratio: 4/3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; background-color: #eee; }
.gallery-item:hover img { transform: scale(1.08); }

/* Lightbox Modal */
.lightbox {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.9);
    justify-content: center; align-items: center; backdrop-filter: blur(5px);
}
.lightbox.active { display: flex; }
.lightbox-content {
    margin: auto; display: block; max-width: 90%; max-height: 90vh;
    border-radius: 8px; animation: zoom 0.3s ease; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
@keyframes zoom { from {transform:scale(0.8); opacity:0;} to {transform:scale(1); opacity:1;} }
.lightbox-close {
    position: absolute; top: 20px; right: 35px; color: #f1f1f1;
    font-size: 45px; font-weight: bold; cursor: pointer; transition: 0.3s; z-index: 2001;
}
.lightbox-close:hover { color: var(--primary-color); }
.lightbox-prev, .lightbox-next {
    cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%);
    padding: 16px; color: white; font-weight: bold; font-size: 24px; z-index: 2001;
    transition: 0.3s ease; border-radius: 5px; background: rgba(0,0,0,0.5); border: none;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(0,0,0,0.8); color: var(--primary-color); }

/* Donate */
.donate { background: #fef5e7; padding-bottom: 100px; }
.donate-content { text-align: center; max-width: 850px; margin: 0 auto; font-size: 1.1rem; line-height: 1.8; color: #444; }
.donate-content p { margin-bottom: 20px; }

/* Grids */
.about-grid {
    display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 50px; align-items: center;
}
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.responsive-img { width: 100%; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); object-fit: cover; }

/* About specific styles */
.about-intro { margin-bottom: 15px; font-size: 1.1rem; }
.values-list { margin-top: 20px; }
.value-item { display: flex; gap: 15px; margin-bottom: 25px; }
.value-icon { font-size: 1.8rem; flex-shrink: 0; }
.value-content h3 { margin-bottom: 8px; color: var(--bg-dark); }

/* About Carousel */
.carousel-container { position: relative; width: 100%; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); aspect-ratio: 4/3; }
.carousel-slide { display: none; width: 100%; height: 100%; }
.carousel-slide.active { display: block; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.fade { animation: fadeEffect 0.8s; }
@keyframes fadeEffect { from { opacity: 0.6; } to { opacity: 1; } }
.carousel-prev, .carousel-next {
    cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%);
    padding: 12px 18px; color: white; font-weight: bold; font-size: 1.2rem;
    transition: 0.3s ease; border-radius: 0 5px 5px 0; background: rgba(0,0,0,0.3); border: none; z-index: 2;
}
.carousel-next { right: 0; border-radius: 5px 0 0 5px; }
.carousel-prev:hover, .carousel-next:hover { background: rgba(0,0,0,0.8); }
.carousel-dots { position: absolute; bottom: 15px; width: 100%; text-align: center; z-index: 2; }
.dot { cursor: pointer; height: 10px; width: 10px; margin: 0 5px; background: rgba(255,255,255,0.5); border-radius: 50%; display: inline-block; transition: 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.dot.active, .dot:hover { background: var(--primary-color); }

/* Forms */
.contact-form {
    background: white; padding: 30px; border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 15px;
}
.form-input { padding: 12px; border: 1px solid #ddd; border-radius: 5px; width: 100%; font-family: inherit; }

/* Footer */
.footer-v2 { background: var(--bg-dark); color: var(--text-light); padding: 60px 5% 20px; }
.footer-content { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; }
.footer-box { background: rgba(255, 255, 255, 0.05); padding: 25px; border-radius: 8px; border-left: 3px solid var(--primary-color); margin-bottom: 25px; }
.footer-box:last-child { margin-bottom: 0; }
.footer-box h4 { color: var(--primary-color); margin-bottom: 15px; font-size: 1.15rem; }
.inline-footer-links p { font-size: 0.95rem; line-height: 1.8; }
.inline-footer-links a { color: #ffd085; font-weight: bold; transition: all 0.3s ease; }
.inline-footer-links a:hover { color: white; text-decoration: underline; }
.inline-footer-links .separator { margin: 0 10px; color: rgba(255, 255, 255, 0.3); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; padding-top: 20px; text-align: center; }
.footer-bottom a { color: var(--primary-color); }

.contact-item { margin-bottom: 25px; }
.contact-item:last-child { margin-bottom: 0; }
.contact-item h4 { margin-bottom: 5px; color: var(--primary-color); }


.social-icon { width: 35px; height: 35px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; color: var(--text-light); transition: all 0.3s ease; }
.social-icon:hover { background: var(--primary-color); transform: translateY(-3px); color: white; }
.social-icon svg { width: 16px; height: 16px; fill: currentColor; }

@media(max-width: 768px) {
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; gap: 40px; }
    .hamburger { display: flex; }
    .nav-links {
        position: absolute; top: 100%; left: 0; width: 100%; background: white;
        flex-direction: column; padding: 20px; box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s ease;
    }
    .nav-links.active { opacity: 1; visibility: visible; transform: translateY(0); display: flex; }
    .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ========== History Page ========== */
.history-page { background: #fdfdfd; min-height: 100vh; }
.history-hero { background: linear-gradient(135deg, #1C1917 0%, #44403C 50%, #78350F 100%); color: white; padding: 3rem 2rem 4rem; text-align: center; position: relative; }
.history-hero-content { max-width: 800px; margin: 0 auto; }
.history-sanskrit { font-size: 1.2rem; opacity: 0.7; margin-bottom: 1rem; letter-spacing: 2px; }
.history-title { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 0.5rem; line-height: 1.2; }
.history-epithet { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-style: italic; opacity: 0.85; color: var(--primary-color); }

.history-layout { display: grid; grid-template-columns: 260px 1fr; max-width: 1200px; margin: 0 auto; gap: 2rem; padding: 2rem; }
.history-sidebar { position: sticky; top: 20px; height: fit-content; }
.history-nav h4 { font-size: 1.3rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--primary-color); }
.history-nav ul { list-style: none; }
.history-nav ul li { margin-bottom: 0.25rem; }
.history-nav-link { display: block; padding: 0.5rem 0.75rem; color: #555; text-decoration: none; border-radius: 8px; transition: all 0.2s; }
.history-nav-link:hover { background: #fff9e6; color: #333; }
.history-nav-link.active { background: var(--primary-color); color: white; font-weight: bold; }

.history-content { background: white; border-radius: 20px; padding: 3rem; box-shadow: 0 4px 16px rgba(0,0,0,0.1); text-align: justify; }
.history-chapter { margin-bottom: 2.5rem; }
.chapter-title { font-size: 1.6rem; margin-bottom: 1.2rem; padding-bottom: 0.5rem; border-bottom: 2px solid #ffd085; display: flex; align-items: baseline; gap: 0.75rem; }
.chapter-num { font-size: 2.2rem; color: var(--primary-color); min-width: 2rem; }
.history-content p { font-size: 1.05rem; line-height: 1.7; color: #444; margin-bottom: 1rem; }

.highlight-quote { background: #fff9e6; border-left: 4px solid var(--primary-color); padding: 1.2rem 1.5rem; border-radius: 0 12px 12px 0; font-style: italic; color: #333; font-weight: 500; }
.invocation-block { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); border: 1px solid #ffd085; border-radius: 16px; padding: 2rem; text-align: center; }
.sanskrit-verse { font-size: 1.05rem; line-height: 1.7; color: #78350F; font-style: italic; margin-bottom: 0.75rem; text-align: center; }

.sibling-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; margin-top: 0.5rem; }
.sibling-card { background: #fdfdfd; border: 1px solid rgba(217, 119, 6, 0.15); border-radius: 14px; padding: 1.5rem; }
.sibling-card h4 { font-size: 1.25rem; color: #B45309; margin-bottom: 0.5rem; }

.history-footer-block { text-align: center; padding: 2rem; margin-top: 1rem; border-top: 2px solid #ffd085; }
.history-temple-name { font-size: 1.4rem; font-weight: bold; color: #B45309; margin-bottom: 0.3rem; }
.legal-back-btn { display: inline-block; color: white; text-decoration: none; padding: 0.5rem 1.2rem; border: 1px solid rgba(255,255,255,0.4); border-radius: 8px; margin-bottom: 20px; }
.legal-back-btn:hover { background: rgba(255,255,255,0.15); }

@media(max-width: 900px) {
    .history-layout { grid-template-columns: 1fr; }
    .history-sidebar { display: none; }
    .history-content { padding: 2rem 1.5rem; }
}

/* ========== Legal Pages (Privacy & Terms) ========== */
.legal-content-wrapper { max-width: 900px; margin: -3rem auto 3rem; padding: 3rem; background: white; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); position: relative; z-index: 10; }
.legal-section { margin-bottom: 2rem; text-align: justify; }
.legal-section h2 { font-size: 1.5rem; color: var(--bg-dark); margin-bottom: 1rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 0.5rem; }
.legal-section h3 { font-size: 1.2rem; color: var(--primary-color); margin: 1.5rem 0 0.5rem; }
.legal-section p { margin-bottom: 1rem; color: #444; }
.legal-section ul { padding-left: 1.5rem; margin-bottom: 1rem; color: #444; }
.legal-section ul li { margin-bottom: 0.5rem; }
.legal-contact { background: #fff9e6; padding: 1.5rem; border-left: 4px solid var(--primary-color); border-radius: 0 8px 8px 0; margin-top: 1rem; }
@media(max-width: 768px) { .legal-content-wrapper { padding: 1.5rem; margin: -2rem 1rem 2rem; } }
