/* NTBT Main Website - Core Styles
 * Theravada Buddhist Temple Theme
 * Saffron robes, gold stupas, Bodhi greens, serene & sacred
 * Mobile-first responsive design
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Primary - Saffron (Theravada monk robes) */
    --color-primary: #C45E1A;
    --color-primary-light: #E07830;
    --color-primary-dark: #8B3E0F;

    /* Secondary - Temple Gold (stupas, Buddha statues) */
    --color-secondary: #C9A534;
    --color-secondary-light: #E5C94B;
    --color-secondary-dark: #9E7E1A;

    /* Accent - Bodhi Green & Maroon */
    --color-accent-green: #3A6B35;
    --color-accent-green-light: #5A9153;
    --color-accent-maroon: #6B2737;

    /* Neutrals - Warm temple tones */
    --color-background: #FAF6F0;
    --color-background-warm: #F5EDE0;
    --color-surface: #FFFFFF;
    --color-text: #2D2420;
    --color-text-light: #5C4F47;
    --color-text-muted: #8C7E75;
    --color-border: #DDD2C4;
    --color-border-light: #EDE6DB;

    /* Status */
    --color-success: #3A6B35;
    --color-warning: #C9A534;
    --color-error: #B83232;
    --color-info: #2E6B8A;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Typography */
    --font-family: 'Noto Sans', 'Noto Sans Sinhala', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.75rem;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(45, 36, 32, 0.08);
    --shadow-md: 0 4px 12px rgba(45, 36, 32, 0.1);
    --shadow-lg: 0 12px 24px rgba(45, 36, 32, 0.12);
    --shadow-glow: 0 0 30px rgba(201, 165, 52, 0.15);

    /* Misc */
    --touch-target: 48px;
    --container-max: 1200px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sinhala, [lang="si"] {
    font-family: 'Noto Sans Sinhala', 'Iskoola Pota', sans-serif;
    line-height: 1.8;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p { margin-bottom: var(--space-md); }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.main-content {
    flex: 1;
}

.section {
    padding: var(--space-3xl) 0;
}

.section-alt {
    background-color: var(--color-background-warm);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-header h2 {
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-secondary);
    margin: var(--space-sm) auto 0;
    border-radius: 2px;
}

.section-header p {
    color: var(--color-text-light);
    font-size: var(--font-size-lg);
    max-width: 600px;
    margin: var(--space-md) auto 0;
}

/* Decorative divider */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    color: var(--color-secondary);
}

.divider::before,
.divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: linear-gradient(to right, transparent, var(--color-border), transparent);
}

.divider img {
    width: 28px;
    height: 28px;
    opacity: 0.6;
}

/* Grid */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(to right, var(--color-primary-dark), var(--color-primary), var(--color-primary-dark));
    color: white;
    padding: var(--space-sm) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(139, 62, 15, 0.3);
}

/* Gold accent line under header */
.header::after {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--color-secondary), var(--color-secondary-light), var(--color-secondary), transparent);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: white;
}

.header-logo:hover {
    text-decoration: none;
    color: white;
}

.header-logo .dharma-icon {
    width: 40px;
    height: 40px;
    color: var(--color-secondary);
}

.header-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-secondary-light);
    margin: 0;
    letter-spacing: 1px;
}

.header-subtitle {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.header-nav {
    display: flex;
    gap: var(--space-xs);
}

.header-nav a {
    color: rgba(255, 255, 255, 0.9);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.header-nav a:hover,
.header-nav a.active {
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--color-secondary-light);
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: var(--space-sm);
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.lang-toggle {
    background: rgba(201, 165, 52, 0.2);
    border: 1px solid rgba(201, 165, 52, 0.4);
    color: var(--color-secondary-light);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    min-height: 32px;
    transition: all 0.2s;
}

.lang-toggle:hover {
    background: rgba(201, 165, 52, 0.35);
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-primary-dark);
        flex-direction: column;
        padding: var(--space-md);
        border-top: 2px solid var(--color-secondary);
    }

    .header-nav.active { display: flex; }
}

/* ============================================
   HERO
   ============================================ */
.hero {
    background: linear-gradient(160deg, var(--color-primary-dark) 0%, #5A2D0A 30%, #3D1E08 70%, #2A1505 100%);
    color: white;
    padding: var(--space-4xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle lotus/dharma pattern overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(201, 165, 52, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(201, 165, 52, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(201, 165, 52, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

/* Gold glow at bottom */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(to right, transparent, var(--color-secondary), var(--color-secondary-light), var(--color-secondary), transparent);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-dharma-wheel {
    width: 64px;
    height: 64px;
    color: var(--color-secondary);
    margin: 0 auto var(--space-lg);
    opacity: 0.7;
    animation: slowSpin 60s linear infinite;
}

@keyframes slowSpin {
    to { transform: rotate(360deg); }
}

.hero h1 {
    color: white;
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
}

.hero .sinhala-title {
    font-size: var(--font-size-xl);
    color: var(--color-secondary);
    margin-bottom: var(--space-lg);
    font-weight: 400;
}

.hero-description {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.85);
    max-width: 680px;
    margin: 0 auto var(--space-xl);
    line-height: 1.8;
}

/* Sub-page hero (smaller) */
.hero-sub {
    padding: var(--space-2xl) 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: linear-gradient(to bottom, #2A1505, #1A0D03);
    color: white;
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: auto;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--color-secondary), var(--color-secondary-light), var(--color-secondary), transparent);
}

.footer-content {
    display: grid;
    gap: var(--space-xl);
}

.footer h4 {
    color: var(--color-secondary);
    margin-bottom: var(--space-md);
    font-size: var(--font-size-base);
    letter-spacing: 0.5px;
}

.footer p {
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.7);
}

.footer a {
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--color-secondary-light);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid rgba(201, 165, 52, 0.15);
    padding-top: var(--space-lg);
    margin-top: var(--space-xl);
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--font-size-xs);
}

.footer-lotus {
    width: 40px;
    height: 32px;
    color: var(--color-secondary);
    opacity: 0.3;
    margin: 0 auto var(--space-sm);
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.text-saffron { color: var(--color-primary); }
.text-gold { color: var(--color-secondary); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ============================================
   LOADING
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   IMAGE PLACEHOLDERS
   ============================================ */
.img-placeholder {
    background: linear-gradient(135deg, var(--color-background-warm) 0%, var(--color-border-light) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 3rem;
    min-height: 250px;
    position: relative;
    overflow: hidden;
}

.img-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    margin: var(--space-sm);
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    :root {
        --font-size-3xl: 1.75rem;
        --font-size-4xl: 2.1rem;
    }
    .hero { padding: var(--space-2xl) 0; }
    .hero-sub { padding: var(--space-xl) 0; }
}

@media (min-width: 768px) {
    .container { padding: 0 var(--space-lg); }
}

@media (min-width: 1024px) {
    .container { padding: 0 var(--space-xl); }
}

@media print {
    .header, .footer { display: none !important; }
    .card { box-shadow: none; border: 1px solid var(--color-border); }
}
