/* ==========================================================
   GLOBAL DESIGN SYSTEM & STANDARDIZED TYPOGRAPHY
   Shree Vrundavan Jivdaya Gaushala
   ========================================================== */

:root {
    /* ==========================================================
       BRAND COLOR SYSTEM
       ========================================================== */
    --cream: #F9F6F0;
    /* Light cream background */
    --warm-ivory: #FFFBF2;
    /* Lighter ivory for contrast */
    --dark-brown: #4A3B32;
    /* Primary text color */
    --golden-brown: #B58548;
    /* Brand gold accent */
    --golden-brown-hover: #9c6e35;
    --sage-green: #65794A;
    /* Organic accent */
    --white: #FFFFFF;
    /* Card & overlay background */
    --border-light: #EFE7DA;
    --text-muted: #6C5543;

    /* ==========================================================
       CENTRALIZED GLOBAL TYPOGRAPHY SYSTEM (Section 3 & 4)
       - Main Page Heading (H1): 48px desktop, 30px mobile
       - Section Heading (H2): 35px desktop, 26px mobile
       - Subheading (H3): 21px desktop, 19px tablet, 18px mobile
       - Card Heading: 18px
       - Normal Paragraph: 16px desktop, 15px mobile
       - Labels: 14px
       - Buttons: 15px
       - Navigation: 15px
       - Table Content: 14px
       - Small Helper Text: 13px
       ========================================================== */
    --font-family-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-heading: var(--font-family-heading);
    --font-body: var(--font-family-body);
    --font-family: var(--font-family-body);

    /* Responsive Font Scale */
    --font-h1: clamp(30px, 1.5rem + 1.6vw, 48px);
    --font-hero-subtitle: clamp(16px, 0.95rem + 0.25vw, 18px);
    --font-devotional: clamp(12px, 0.7rem + 0.25vw, 14px);
    --font-h2: clamp(26px, 1.4rem + 1vw, 35px);
    --font-h3: clamp(18px, 1.05rem + 0.25vw, 21px);
    --font-card-title: 18px;
    --font-h4: 18px;
    --font-body-size: clamp(15px, 0.92rem + 0.1vw, 16px);
    --font-paragraph: var(--font-body-size);
    --font-label: 14px;
    --font-btn: 15px;
    --font-nav: 15px;
    --font-table: 14px;
    --font-small: 13px;

    /* Line Heights */
    --line-height-heading: 1.3;
    --line-height-body: 1.6;

    /* Elevation, Transitions & Radii */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 30px rgba(74, 59, 50, 0.12);
    --transition: all 0.3s ease;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
}

/* Reset & Responsive Sizing */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
    position: relative;
    width: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-body-size);
    color: var(--dark-brown);
    background-color: var(--cream);
    line-height: var(--line-height-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#root {
    overflow-x: clip;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at top left, #ffffff, #F9F6F0 70%);
}

/* ==========================================================
   STANDARDIZED HEADINGS & TYPOGRAPHY SYSTEM
   ========================================================== */

/* Main Page Heading (H1) */
h1:not(.logo-text h1):not(.footer-logo h1):not(.admin-app-layout *):not(.admin-login-body *):not(.admin-topbar *):not(.admin-sidebar *),
.hero-title,
.about-header h1,
.activities-hero h1,
.hosp-hero-title,
.cows-hero h1,
.gallery-hero h1,
.rsvp-hero-section h1,
.contact-hero h1,
.page-title,
.auth-title {
    font-family: var(--font-heading) !important;
    font-size: var(--font-h1) !important;
    line-height: var(--line-height-heading) !important;
    font-weight: 700;
    color: var(--dark-brown);
    margin-bottom: 0.75rem;
}

/* Section Heading (H2) */
h2:not(.hero-subtitle):not(.admin-app-layout *):not(.admin-login-body *):not(.admin-topbar *):not(.admin-sidebar *),
.section-title,
.about-section h2,
.activities-section h2,
.cows-section h2,
.contact-card-title,
.events-main-title,
.dept-showcase-title,
.dashboard-section-title {
    font-family: var(--font-heading) !important;
    font-size: var(--font-h2) !important;
    line-height: var(--line-height-heading) !important;
    font-weight: 700;
    color: var(--dark-brown);
    margin-bottom: 0.75rem;
}

/* Subheading (H3) */
h3:not(.info-card h3):not(.info-card-text h3):not(.footer-logo h3):not(.admin-app-layout *):not(.admin-login-body *):not(.admin-topbar *):not(.admin-sidebar *),
.sub-heading,
.story-title,
.section-header-center h3,
.dept-card h3,
.cow-card h3,
.activity-card h3,
.dashboard-card-title,
.stat-card-title {
    font-family: var(--font-heading) !important;
    font-size: var(--font-h3) !important;
    line-height: var(--line-height-heading) !important;
    font-weight: 600;
    color: var(--dark-brown);
    margin-bottom: 0.5rem;
}

/* Card Heading (H4) */
h4:not(.admin-app-layout *):not(.admin-login-body *):not(.admin-topbar *):not(.admin-sidebar *),
.card-title,
.card-heading,
.gallery-card-title,
.event-card h4,
.testimonial-card h4,
.admin-card-title {
    font-family: var(--font-heading) !important;
    font-size: var(--font-card-title) !important;
    line-height: var(--line-height-heading) !important;
    font-weight: 600;
    color: var(--dark-brown);
    margin-bottom: 0.5rem;
}

/* Eyebrow / Subtitle Badges */
.section-subtitle,
.story-subtitle,
.section-sub,
.hosp-section-sub,
.activities-hero-badge,
.hero-badge,
.cows-hero-badge,
.gallery-hero-badge,
.contact-hero-badge,
.rsvp-hero-badge {
    font-family: var(--font-body);
    font-size: var(--font-devotional, clamp(12px, 0.7rem + 0.25vw, 14px)) !important;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--golden-brown);
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Normal Paragraphs */
p,
.section-desc,
.about-content>p,
.who-we-are-content .section-desc,
.gau-seva-content>p,
.section-header>p,
.section-header-center>p,
.story-content>p,
.events-subtitle,
.activity-desc,
.dept-showcase-desc,
.hero-desc {
    font-family: var(--font-body);
    font-size: var(--font-body-size);
    line-height: var(--line-height-body);
    color: var(--dark-brown);
    margin-bottom: 1rem;
}

/* Navigation Links */
.desktop-nav a,
.desktop-nav button.nav-donate-link,
.mobile-menu a,
.navbar a,
.nav-link {
    font-family: var(--font-body);
    font-size: var(--font-nav) !important;
    font-weight: 500;
    line-height: 1.4;
}

/* Standardized Buttons */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-submit-volunteer,
.btn-submit-contact,
.btn-submit-rsvp,
.auth-btn-primary,
.btn-sponsor,
.btn-details,
.btn-sponsor-dept,
.btn-dept-inquiry,
.btn-sponsor-tier,
.hosp-btn-emergency,
.hosp-btn-secondary,
.emergency-btn,
.btn-lang-proceed,
.btn-receipt,
.btn-print,
.btn-book-slot,
.btn-nav-donate,
.event-card-footer .btn-sm {
    font-family: var(--font-body);
    font-size: var(--font-btn) !important;
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-family: var(--font-body);
    font-size: var(--font-btn);
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-primary {
    background: linear-gradient(135deg, #E2C99D, #A65D20);
    color: #000;
    box-shadow: 0 4px 10px rgba(226, 201, 157, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(226, 201, 157, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--golden-brown);
    border: 2px solid var(--golden-brown);
}

.btn-secondary:hover {
    background-color: var(--golden-brown);
    color: var(--white);
}

/* Form Controls & Labels */
label,
.form-label,
.admin-label {
    font-family: var(--font-body);
    font-size: var(--font-label) !important;
    font-weight: 500;
    color: var(--dark-brown);
    display: inline-block;
    margin-bottom: 6px;
}

input,
select,
textarea {
    font-family: var(--font-body);
    font-size: var(--font-body-size);
    color: var(--dark-brown);
    max-width: 100%;
    box-sizing: border-box;
}

/* Standardized Tables */
.table-responsive,
.donation-table-wrapper,
.admin-table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
}

table th {
    font-family: var(--font-body);
    font-size: var(--font-table) !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    font-family: var(--font-body);
    font-size: var(--font-table) !important;
    vertical-align: middle;
}

/* Helper & Small Text */
small,
.help-text,
.form-hint,
.field-error-text,
.caption,
.admin-text-muted,
.stat-sub {
    font-family: var(--font-body);
    font-size: var(--font-small) !important;
}

/* Fluid responsive media handling */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* ==========================================================
   RESPONSIVE CONTAINERS & SECTION PADDING
   Across All Device Widths (320px to 1920px+)
   ========================================================== */

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.section-padding {
    padding: 60px 0;
}

/* Ultra-Wide (1920px and above) */
@media (min-width: 1920px) {
    .container {
        max-width: 1560px;
        padding: 0 32px;
    }

    .section-padding {
        padding: 80px 0;
    }
}

/* 2K / 4K Ultra-Wide (2560px and above) */
@media (min-width: 2560px) {
    .container {
        max-width: 1800px;
        padding: 0 40px;
    }

    .section-padding {
        padding: 95px 0;
    }
}

/* Laptops & Standard Desktop (1280px - 1440px) */
@media (max-width: 1440px) {
    .container {
        max-width: 1280px;
        padding: 0 24px;
    }
}

/* Tablets Landscape (1024px) */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }

    .section-padding {
        padding: 48px 0;
    }
}

/* Tablets Portrait (768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .section-padding {
        padding: 40px 0;
    }

    .btn {
        padding: 10px 22px;
    }
}

/* Mobile Devices (<= 480px, 430px, 390px, 375px) */
@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }

    .section-padding {
        padding: 34px 0;
    }

    .btn {
        padding: 10px 18px;
    }
}

/* Extra Small Mobile (<= 360px & 320px) */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }

    .section-padding {
        padding: 28px 0;
    }

    .btn {
        padding: 9px 14px;
    }
}

/* Universal React Form Validation Styling */
.has-error,
input.has-error,
select.has-error,
textarea.has-error,
.auth-input.has-error,
.form-control.has-error,
.admin-input-wrapper.has-error input {
    border-color: #dc2626 !important;
    background-color: #fff8f8 !important;
}

.has-error:focus,
input.has-error:focus,
select.has-error:focus,
textarea.has-error:focus,
.auth-input.has-error:focus,
.form-control.has-error:focus,
.admin-input-wrapper.has-error input:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
    outline: none !important;
}

.field-error-text {
    color: #dc2626 !important;
    font-size: var(--font-small) !important;
    font-weight: 500 !important;
    margin-top: 5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    line-height: 1.3 !important;
    text-align: left !important;
}

.field-error-text i {
    font-size: 0.75rem !important;
    flex-shrink: 0;
}