/* Global Font System - Apply to All Pages */
/* Consistent Typography across entire website (65+ pages) */
/* THIS FILE MUST LOAD LAST - See templates/base.html */

/* Import Inter font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* AGGRESSIVE GLOBAL FONT APPLICATION - Overrides everything! */
/* Using multiple selectors for maximum specificity */

/* Universal selector with highest priority */
*, *::before, *::after {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif !important;
}

/* Body Base Typography */
html, body {
    font-family: 'Inter', sans-serif !important;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* All Heading Styles - Maximum Specificity */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
h1.hero-title, h2.section-title, h3.card-title {
    font-family: 'Inter', sans-serif !important;
}

/* Heading Weights */
h1, .h1, h1.hero-title {
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.025em !important;
}

h2, .h2 {
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.02em !important;
}

h3, .h3 {
    font-weight: 600 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.015em !important;
}

h4, .h4 {
    font-weight: 500 !important;
    line-height: 1.5 !important;
}

h5, .h5, h6, .h6 {
    font-weight: 500 !important;
    line-height: 1.5 !important;
}

/* Paragraph and Text */
p, span, div, a, li, td, th, label, input, textarea, select, button {
    font-family: 'Inter', sans-serif !important;
}

p, .paragraph, .text {
    font-weight: 400 !important;
    line-height: 1.6 !important;
}

/* Links */
a, a:hover, a:active, a:visited {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
}

/* Buttons */
button, .btn, .button,
input[type="button"], input[type="submit"], input[type="reset"],
.cta-button, .primary-button, .secondary-button {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
}

/* Form Elements */
input, textarea, select, option {
    font-family: 'Inter', sans-serif !important;
    font-weight: 400 !important;
}

/* Labels */
label, legend, fieldset {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
}

/* Lists */
ul, ol, li, dl, dt, dd {
    font-family: 'Inter', sans-serif !important;
}

/* Blockquotes */
blockquote, q, cite {
    font-family: 'Inter', sans-serif !important;
    font-weight: 400 !important;
    font-style: italic;
}

/* Code elements (keep monospace for these) - EXCEPTION */
code, pre, kbd, samp, var, tt {
    font-family: 'Monaco', 'Courier New', 'Consolas', monospace !important;
}

/* Navigation - All variations */
nav, nav a, nav li, nav span, nav div,
.nav, .navbar, .menu, .navigation,
.nav-link, .nav-item, .navbar-brand {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
}

/* Cards and Sections */
.card, .section, .container, .content,
.card-title, .card-text, .card-body,
.section-title, .section-subtitle, .section-content {
    font-family: 'Inter', sans-serif !important;
}

/* Hero Sections - All variations */
.hero, .hero-section, .hero-container,
.hero-title, .hero-subtitle, .hero-description, .hero-text,
.ihd-hero, .ihd-title, .ihd-subtitle, .ihd-description,
.iih-hero, .iih-title, .iih-subtitle, .iih-description {
    font-family: 'Inter', sans-serif !important;
}

/* WEF Components - Override DM Sans */
.wef-heading, .wef-heading-1, .wef-heading-2, .wef-heading-3,
.wef-text, .wef-subtitle, .wef-description, .wef-content,
.wef-leading-voices, .wef-card, .wef-title {
    font-family: 'Inter', sans-serif !important;
}

/* Platform-specific overrides */
.ihd-hero h1, .ihd-hero h2, .ihd-hero h3, .ihd-hero p, .ihd-hero-subtitle,
.iih-hero h1, .iih-hero h2, .iih-hero h3, .iih-hero p, .iih-hero-subtitle,
.ref-hero h1, .ref-hero h2, .ref-hero h3, .ref-hero p, .ref-hero-subtitle {
    font-family: 'Inter', sans-serif !important;
}

/* IHD Specific */
.ihd-badge, .ihd-btn, .ihd-section-title, .ihd-card-title, .ihd-text,
.ihd-hero-badge, .ihd-hero-buttons, .ihd-platform-info {
    font-family: 'Inter', sans-serif !important;
}

/* IIH Specific */
.iih-card-title, .iih-card-text, .iih-pipeline-title, .iih-pipeline-desc,
.iih-service-title, .iih-service-text, .iih-cta-title, .iih-cta-text,
.iih-section-title, .iih-platform-text {
    font-family: 'Inter', sans-serif !important;
}

/* Leading Voices */
.leading-voices-title, .leading-voices-subtitle, .leading-voices-description, .leading-voices-text,
.voice-card, .voice-card-title, .voice-card-text {
    font-family: 'Inter', sans-serif !important;
}

/* Footer */
footer, footer p, footer a, footer li, footer span, footer div,
.footer, .footer-content, .footer-text, .footer-link {
    font-family: 'Inter', sans-serif !important;
}

/* Tables */
table, thead, tbody, tfoot, tr, th, td, caption {
    font-family: 'Inter', sans-serif !important;
}

/* Badges, Pills, Tags */
.badge, .pill, .tag, .label, .chip,
.badge-primary, .badge-secondary, .badge-success {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
}

/* Alerts and Messages */
.alert, .message, .notification, .toast,
.alert-success, .alert-danger, .alert-warning, .alert-info {
    font-family: 'Inter', sans-serif !important;
}

/* Modals and Popups */
.modal, .modal-title, .modal-body, .modal-footer,
.popup, .dialog, .overlay {
    font-family: 'Inter', sans-serif !important;
}

/* Breadcrumbs */
.breadcrumb, .breadcrumb-item {
    font-family: 'Inter', sans-serif !important;
}

/* Pagination */
.pagination, .page-item, .page-link {
    font-family: 'Inter', sans-serif !important;
}

/* Dropdowns */
.dropdown, .dropdown-menu, .dropdown-item, .dropdown-toggle {
    font-family: 'Inter', sans-serif !important;
}

/* Accordion */
.accordion, .accordion-header, .accordion-body, .accordion-button {
    font-family: 'Inter', sans-serif !important;
}

/* Tabs */
.tabs, .tab, .tab-content, .tab-pane, .nav-tabs, .nav-pills {
    font-family: 'Inter', sans-serif !important;
}

/* Progress Bars */
.progress, .progress-bar {
    font-family: 'Inter', sans-serif !important;
}

/* Tooltips */
.tooltip, .tooltip-inner, [data-tooltip] {
    font-family: 'Inter', sans-serif !important;
}

/* Specific Main.css Overrides - Target DM Sans specifically */
.hero-subtitle, .featured-section, .section-heading,
.card-category, .card-description, .cta-section,
.testimonial, .stats-number, .stats-label {
    font-family: 'Inter', sans-serif !important;
}

/* Perspectives Page */
.perspectives-card, .perspectives-title, .perspectives-description,
.perspective-author, .perspective-date, .perspective-content {
    font-family: 'Inter', sans-serif !important;
}

/* Brand India Platform */
.brand-india-title, .brand-india-subtitle, .brand-india-content,
.brand-card, .brand-heading {
    font-family: 'Inter', sans-serif !important;
}

/* Healthcare Platform */
.healthcare-title, .healthcare-subtitle, .healthcare-content,
.healthcare-card, .healthcare-section {
    font-family: 'Inter', sans-serif !important;
}

/* Innovation Platform */
.innovation-title, .innovation-subtitle, .innovation-content,
.innovation-card, .innovation-section {
    font-family: 'Inter', sans-serif !important;
}

/* EXIM Platform */
.exim-title, .exim-subtitle, .exim-content,
.exim-card, .exim-section {
    font-family: 'Inter', sans-serif !important;
}

/* Entrepreneurship Platform */
.entrepreneurship-title, .entrepreneurship-subtitle, .entrepreneurship-content,
.entrepreneurship-card, .entrepreneurship-section {
    font-family: 'Inter', sans-serif !important;
}

/* Rural Economic Forum */
.ref-title, .ref-subtitle, .ref-content,
.ref-card, .ref-section, .ref-speaker, .ref-agenda {
    font-family: 'Inter', sans-serif !important;
}

/* About Page */
.about-title, .about-subtitle, .about-content,
.about-card, .about-team, .about-mission {
    font-family: 'Inter', sans-serif !important;
}

/* Join/Membership Pages */
.join-title, .join-subtitle, .join-content,
.membership-tier, .membership-benefits, .join-form {
    font-family: 'Inter', sans-serif !important;
}

/* Events and Gallery */
.event-title, .event-description, .event-date,
.gallery-caption, .event-card, .event-details {
    font-family: 'Inter', sans-serif !important;
}

/* Contact and Forms */
.form-label, .form-control, .form-text, .form-check-label,
.contact-info, .contact-heading {
    font-family: 'Inter', sans-serif !important;
}

/* Global Banner */
.global-banner, .banner-content, .banner-text, .banner-link {
    font-family: 'Inter', sans-serif !important;
}

/* Insights Spotlight */
.insights-title, .insights-subtitle, .insights-content,
.insight-card, .insight-category {
    font-family: 'Inter', sans-serif !important;
}

/* React Sections */
.react-title, .react-subtitle, .react-content,
.react-card, .react-component {
    font-family: 'Inter', sans-serif !important;
}

/* Ensure font loads properly - Self-hosted fallback */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* NUCLEAR OPTION - Last resort override for stubborn elements */
[class*="wef-"] {
    font-family: 'Inter', sans-serif !important;
}

[class*="hero"] {
    font-family: 'Inter', sans-serif !important;
}

[class*="title"] {
    font-family: 'Inter', sans-serif !important;
}

[class*="heading"] {
    font-family: 'Inter', sans-serif !important;
}

[class*="subtitle"] {
    font-family: 'Inter', sans-serif !important;
}

[class*="description"] {
    font-family: 'Inter', sans-serif !important;
}

[class*="text"] {
    font-family: 'Inter', sans-serif !important;
}

[class*="content"] {
    font-family: 'Inter', sans-serif !important;
}

[class*="card"] {
    font-family: 'Inter', sans-serif !important;
}

/* Final Override - Catch anything we missed */
div, span, section, article, aside, header, main {
    font-family: 'Inter', sans-serif !important;
}

/* REF 2024 Blue Sections - White Text Override */
.ref2024-section[style*="#1e3a8a"] .ref-section-title,
.ref2024-section[style*="#1e3a8a"] h2,
.ref2024-section[style*="#1e3a8a"] h3,
.ref2024-section[style*="#1e3a8a"] .ref-section-subtitle,
.ref2024-section[style*="#1e3a8a"] p {
    color: #ffffff !important;
}

.ref2024-section[style*="#1e3a8a"] .ref-section-subtitle {
    color: rgba(255,255,255,0.85) !important;
}

/* USA Center Blue Sections - White Text */
.light-section-alt[style*="#1e3a8a"] .section-title-dark,
.light-section-alt[style*="#1e3a8a"] h2,
.light-section-alt[style*="#1e3a8a"] h3,
.light-section-alt[style*="#1e3a8a"] .section-subtitle-gray,
.light-section-alt[style*="#1e3a8a"] p {
    color: #ffffff !important;
}

.light-section-alt[style*="#1e3a8a"] .section-subtitle-gray {
    color: rgba(255,255,255,0.85) !important;
}

/* Overview Page Blue Sections - White Text */
.overview-mission-section[style*="#1e3a8a"] h2,
.overview-mission-section[style*="#1e3a8a"] h3,
.overview-mission-section[style*="#1e3a8a"] p,
.overview-mission-section[style*="#1e3a8a"] .wef-heading-2 {
    color: #ffffff !important;
}

/* SSG Blue Sections - White Text */
.agenda-section[style*="#1e3a8a"] .section-title,
.agenda-section[style*="#1e3a8a"] h2,
.agenda-section[style*="#1e3a8a"] h3,
.agenda-section[style*="#1e3a8a"] p {
    color: #ffffff !important;
}

/* IHD Blue Sections - Content Boxes should be WHITE with BLACK text */
.ihd-section[style*="#1e3a8a"] .ihd-context-content,
.ihd-section[style*="#1e3a8a"] .ihd-vision-content,
.ihd-section[style*="#1e3a8a"] .ihd-pillar-content,
.ihd-section[style*="#1e3a8a"] .ihd-framework-content {
    background: #ffffff !important;
    padding: 2rem !important;
    border-radius: 12px !important;
}

.ihd-section[style*="#1e3a8a"] .ihd-context-content h3,
.ihd-section[style*="#1e3a8a"] .ihd-context-content p,
.ihd-section[style*="#1e3a8a"] .ihd-vision-content h3,
.ihd-section[style*="#1e3a8a"] .ihd-vision-content p,
.ihd-section[style*="#1e3a8a"] .ihd-pillar-content h3,
.ihd-section[style*="#1e3a8a"] .ihd-pillar-content p,
.ihd-section[style*="#1e3a8a"] .ihd-framework-content h3,
.ihd-section[style*="#1e3a8a"] .ihd-framework-content p {
    color: #1e293b !important;
}

/* ============================================
   GLOBAL HEADING STANDARDIZATION
   Standard: Perspectives / Global Reports style
   Font: Inter | Size: 2.25rem | Weight: 700 | Align: Left
   Applies to ALL section h2 headings EXCEPT hero sections
   ============================================ */

/* All h2 inside main content — left, Inter, 2.25rem, 700 */
/* EXCLUDES: hero sections, CTA sections, footer */
#main-content h2:not([class*="hero"]):not([class*="cta"]):not([class*="footer"]) {
    text-align: left !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 2.25rem !important;
    font-weight: 700 !important;
}

/* CTA section headings & text — keep centered, keep their own size */
.cta-section h2,
.cta-section p,
[class*="cta"] h2 {
    text-align: center !important;
}

/* ============================================
   GLOBAL SUBTITLE / DESCRIPTION STANDARDIZATION
   Rule: ALL subtitles & descriptions left-aligned, Inter font
   EXCEPT: hero sections and footer
   ============================================ */

/* Universal subtitle left-align — catches ALL subtitle patterns */
#main-content section:not([class*="hero"]):not(.cta-section) [class*="subtitle"],
#main-content section:not([class*="hero"]):not(.cta-section) [class*="description"],
#main-content section:not([class*="hero"]):not(.cta-section) [class*="tagline"],
#main-content section:not([class*="hero"]):not(.cta-section) [class*="subheading"],
#main-content div:not([class*="hero"]):not(.cta-content) [class*="subtitle"],
#main-content div:not([class*="hero"]):not(.cta-content) [class*="description"],
#main-content div:not([class*="hero"]):not(.cta-content) [class*="tagline"],
#main-content div:not([class*="hero"]):not(.cta-content) [class*="subheading"] {
    text-align: left !important;
    font-family: 'Inter', sans-serif !important;
}

/* Section header containers — left align (except hero, footer, CTA) */
#main-content section:not([class*="hero"]):not(.cta-section) .section-header,
#main-content section:not([class*="hero"]):not(.cta-section) [class*="-header"]:not([class*="hero"]),
#main-content div:not([class*="hero"]):not(.cta-content) .section-header,
#main-content div:not([class*="hero"]):not(.cta-content) [class*="-header"]:not([class*="hero"]) {
    text-align: left !important;
}

/* Override flexbox centering on section headers (except hero, footer, CTA) */
#main-content section:not([class*="hero"]):not(.cta-section) [class*="header"]:not([class*="hero"]),
#main-content section:not([class*="hero"]):not(.cta-section) [class*="header"]:not([class*="hero"]) {
    justify-content: flex-start !important;
}

/* Explicit p tags under section headers — left align */
#main-content section:not([class*="hero"]):not(.cta-section) .section-header p,
#main-content section:not([class*="hero"]):not(.cta-section) [class*="header"] > p {
    text-align: left !important;
    font-family: 'Inter', sans-serif !important;
}

/* Remove auto margins that center subtitle blocks */
#main-content section:not([class*="hero"]):not(.cta-section) [class*="subtitle"],
#main-content section:not([class*="hero"]):not(.cta-section) [class*="description"] {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Page-specific heading classes — standardize to same size/weight/align */
#main-content .section-title:not([class*="hero"]),
#main-content .wef-heading-2:not([class*="hero"]),
#main-content .impact-section-title,
#main-content .strategic-title,
#main-content .strategic-title-enhanced,
#main-content .ref-section-title,
#main-content .ihd-section-title,
#main-content .iih-section-title,
#main-content .wef-section-title,
#main-content .about-section-title-dark,
#main-content .about-section-title-light,
#main-content .gallery-title,
#main-content .leading-voices-title,
#main-content .perspectives-title,
#main-content .ease-title,
#main-content .movement-title,
#main-content .newsletter-title,
#main-content .agenda-title,
#main-content .forum-title,
#main-content .summit-section-title,
#main-content .ref2025-section-title,
#main-content .partnership-opportunities-title,
#main-content .partner-section-title,
#main-content .press-release-main-title,
#main-content .overview-main-title,
#main-content .terms-section-title {
    text-align: left !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 2.25rem !important;
    font-weight: 700 !important;
}

/* ============================================
   CSS VARIABLE OVERRIDES
   Force all font CSS variables to Inter
   Prevents Geist Sans, Playfair, DM Sans, etc.
   ============================================ */
:root {
    --font-primary: 'Inter', sans-serif !important;
    --font-secondary: 'Inter', sans-serif !important;
    --font-display: 'Inter', sans-serif !important;
    --font-corporate: 'Inter', sans-serif !important;
    --font-modern: 'Inter', sans-serif !important;
    --font-heading: 'Inter', sans-serif !important;
    --font-serif: 'Inter', sans-serif !important;
    --font-mono: 'Inter', sans-serif !important;
}

/* ============================================
   FOOTER PROTECTION
   Footer layout centered, but link columns left-aligned
   ============================================ */
footer,
.footer,
.site-footer,
[class*="footer"] {
    text-align: center !important;
}

/* Footer link columns — titles and links left-aligned */
footer .footer-section h3,
footer .footer-title,
footer .footer-links,
footer .footer-links li,
footer .footer-links a,
footer .footer-contact,
footer .footer-contact p {
    text-align: left !important;
}

/* Footer bottom copyright — stays centered */
footer .footer-bottom,
footer .footer-bottom p {
    text-align: center !important;
}

/* Prevent global heading rules from affecting footer */
footer h2, .footer h2, [class*="footer"] h2 {
    text-align: center !important;
    font-size: inherit !important;
}
