/*
Theme Name: Idara Tehqeeqaat Theme
Theme URI: https://imamahmadraza.com
Description: WordPress theme for Idara-e-Tahqeeqat-e-Imam Ahmed Raza
Version: 1.0
Author: Idara Tehqeeqaat
Author URI: https://imamahmadraza.com
Text Domain: idara-theme
*/

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-background: hsl(42, 47%, 95%);
    --color-foreground: hsl(155, 40%, 15%);
    --color-card: hsl(0, 0%, 100%);
    --color-primary: hsl(155, 55%, 35%);
    --color-primary-foreground: hsl(0, 0%, 100%);
    --color-secondary: hsl(43, 100%, 94%);
    --color-muted: hsl(42, 30%, 90%);
    --color-muted-foreground: hsl(155, 20%, 45%);
    --color-accent: hsl(43, 74%, 66%);
    --color-border: hsl(155, 20%, 85%);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
    --spacing-section: 4rem;
}

@media (max-width: 768px) {
    :root {
        --spacing-section: 2.5rem;
    }
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-background);
    color: var(--color-foreground);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    word-wrap: break-word;
}

h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled .nav-content {
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-foreground);
    height: 80px; 
    flex-grow: 0; 
}

/* FIX: HIDE GHOST LOGO - Targets the logo container and image to completely hide it. */
.logo-img, 
.logo > img {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    visibility: hidden !important;
}
/* END FIX: HIDE GHOST LOGO */

.logo:hover {
    transform: scale(1.05);
}

.logo-text {
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled .logo-text {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .logo-text {
        display: none;
    }
}

/* * FIX: Force Menu Alignment and Horizontal Display * */
.nav-links {
    /* Ensures the link container is a flex box and aligns items vertically */
    display: flex !important;
    align-items: center !important; 
    gap: 0.25rem;
}

/* Target the WordPress UL element inside the nav-links */
.nav-links ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Forces the list items horizontal */
    display: flex !important; 
    align-items: center !important;
    gap: 0.25rem;
}

/* Target the list items */
.nav-links ul li {
    /* Ensure no unwanted margins/paddings break the horizontal layout */
    margin: 0 !important;
    padding: 0 !important;
}
/* END FIX: Force Menu Alignment */


@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

.nav-link {
    /* Apply important to link padding to ensure consistent spacing */
    padding: 0.5rem 1rem !important;
    text-decoration: none;
    color: var(--color-foreground);
    border-radius: 0.375rem;
    transition: var(--transition-smooth);
}

.nav-link:hover {
    background: var(--color-muted);
}

.nav-link.active,
.current-menu-item a {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
}

/* Desktop Only Elements */
.desktop-only {
    display: inline-block;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
}

.hamburger {
    width: 24px;
    height: 2px;
    background: var(--color-foreground);
    transition: var(--transition-smooth);
    margin: 2px 0;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.mobile-menu.active {
    display: flex;
    max-height: 500px;
    opacity: 1;
}

@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    touch-action: manipulation;
}

.btn-primary:hover {
    background: hsl(155, 55%, 30%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--color-foreground);
    border: 2px solid var(--color-border);
}

.btn-outline:hover {
    background: var(--color-muted);
}

/* Hero Section */
.hero-section {
    padding-top: 80px;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Page Hero */
.page-hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, hsl(155, 55%, 35%) 0%, hsl(155, 45%, 45%) 100%);
    color: white;
    text-align: center;
    margin-top: 80px;
}

@media (max-width: 768px) {
    .page-hero {
        padding: 6rem 1rem 3rem;
        margin-top: 64px;
    }
}

@media (max-width: 640px) {
    .page-hero {
        padding: 5rem 1rem 2.5rem;
    }
}

/* Sections */
.section {
    padding: var(--spacing-section) 0;
}

.bg-light {
    background: var(--color-card);
}

.section-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 2rem;
    color: var(--color-foreground);
}

.text-center {
    text-align: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 2rem 0;
    }
}

.stat-card {
    padding: 2rem 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    text-align: center;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
    .stat-card {
        padding: 1.5rem 1rem;
    }
}

/* Objectives Grid */
.objectives-grid {
    /* Base for Mobile/Tablet: Auto-fit is good for general responsiveness */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

/* AGGRESSIVE FIX: TARGETING DESKTOP ALIGNMENT */
@media (min-width: 1024px) {
    .section .objectives-grid {
        /* 1. Switch to Flexbox at the section level to reliably center rows */
        display: flex;
        flex-wrap: wrap;
        justify-content: center; /* FIX: Centers the items in the last row */
        gap: 1.5rem;
    }
    
    .section .objectives-grid .objective-card {
        /* 2. Fix the width to ensure 4 cards fit with gaps */
        /* Calculation: (1200px container - 3 gaps*1.5rem)/4 = 288.75px */
        width: calc( (var(--max-width) - 4.5rem) / 4);
        /* Ensure max size is respected to prevent abnormal stretching if the outer container is wider */
        max-width: 280px; 
    }
}

@media (max-width: 640px) {
    .objectives-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }
}

.objective-card {
    padding: 2rem 1.5rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    text-align: center;
    transition: var(--transition-smooth);
}

.objective-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {
    .objective-card {
        padding: 1.5rem 1rem;
    }
}

.icon-circle {
    width: 80px;
    height: 80px;
    background: var(--color-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

@media (max-width: 640px) {
    .icon-circle {
        width: 64px;
        height: 64px;
        font-size: 1.75rem;
    }
}

/* Card Component */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: rgba(155, 55, 35, 0.05);
}

@media (max-width: 640px) {
    .card-header {
        padding: 1.25rem;
    }
}

.card-body {
    padding: 1.5rem;
}

@media (max-width: 640px) {
    .card-body {
        padding: 1.25rem;
    }
}

/* Footer */
.footer {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    padding: 3rem 0 1rem;
    margin-top: var(--spacing-section);
}

@media (max-width: 768px) {
    .footer {
        padding: 2rem 0 1rem;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.footer a {
    color: var(--color-primary-foreground);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .footer-bottom {
        padding-top: 1.5rem;
        font-size: 0.8125rem;
    }
}

/* WordPress Specific */
.wp-block-image img {
    max-width: 100%;
    height: auto;
}

.alignwide {
    max-width: 1200px;
}

.alignfull {
    max-width: 100%;
}

/* WordPress Menu Items */
.nav-links ul,
.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    /* This rule will be overridden by the specific FIX above */
    display: flex;
    gap: 0.25rem;
}

.mobile-menu ul {
    flex-direction: column;
}

.nav-links li,
.mobile-menu li {
    margin: 0;
}

.nav-links a,
.mobile-menu a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--color-foreground);
    border-radius: 0.375rem;
    transition: var(--transition-smooth);
    display: block;
}

.nav-links a:hover,
.mobile-menu a:hover {
    background: var(--color-muted);
}

.nav-links .current-menu-item > a,
.mobile-menu .current-menu-item > a {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
}

/* Logo Image Adjustments */
.custom-logo {
    height: 56px;
    width: 56px;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled .custom-logo {
    height: 44px;
    width: 44px;
}

/* Elementor Compatibility */
.elementor-page {
    overflow-x: hidden;
}

.elementor-page-content {
    width: 100%;
}

/* Full width for Elementor sections */
.elementor-section.elementor-section-boxed > .elementor-container {
    max-width: var(--max-width);
}

.elementor-section.elementor-section-stretched {
    width: 100%;
}

/* Remove default padding for Elementor full width */
body.elementor-page .hero-section {
    padding-top: 0;
}

body.elementor-page.admin-bar .elementor-edit-area {
    padding-top: 32px;
}

/* Elementor widget compatibility */
.elementor-widget-container {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure buttons work well with Elementor */
.elementor-button-wrapper .btn {
    margin: 0;
}

/* Responsive Elementor columns */
@media (max-width: 768px) {
    .elementor-column {
        width: 100% !important;
    }
}

/* ========================================
    CUSTOM ELEMENTOR WIDGET STYLES
    ======================================== */

/* Event Card Widget */
.event-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: var(--color-primary);
}

.event-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--color-secondary);
}

.event-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-primary), hsl(155, 45%, 45%));
    color: var(--color-primary-foreground);
}

.event-card-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.event-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.event-card-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.95;
}

.event-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-card-description {
    color: var(--color-muted-foreground);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.event-card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.event-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
}

.event-card-footer {
    padding: 0 1.5rem 1.5rem;
}

.event-card-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.event-card-btn:hover {
    background: hsl(155, 55%, 30%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.event-card-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-card-status.upcoming {
    background: hsl(155, 70%, 90%);
    color: hsl(155, 60%, 30%);
}

.event-card-status.ongoing {
    background: hsl(43, 90%, 85%);
    color: hsl(43, 80%, 30%);
}

.event-card-status.completed {
    background: hsl(0, 0%, 90%);
    color: hsl(0, 0%, 40%);
}

/* Team Member Profile Widget */
.team-profile {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
    height: 100%;
}

.team-profile:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.team-profile-header {
    padding: 2rem 1.5rem 1rem;
    background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-card) 100%);
}

.team-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--color-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0 auto 1rem;
    object-fit: cover;
    background: var(--color-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.team-profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: 0.25rem;
}

.team-profile-role {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.team-profile-designation {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    margin-bottom: 1rem;
}

.team-profile-body {
    padding: 1.5rem;
}

.team-profile-bio {
    color: var(--color-muted-foreground);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: left;
}

.team-profile-details {
    text-align: left;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.team-profile-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
}

.team-profile-detail-icon {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.team-profile-social {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--color-border);
}

.team-profile-social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-muted);
    border-radius: 50%;
    color: var(--color-foreground);
    transition: var(--transition-smooth);
    text-decoration: none;
}

.team-profile-social-link:hover {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    transform: translateY(-2px);
}

/* Publication Display Widget */
.publication-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.publication-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
}

.publication-card-header {
    padding: 1.5rem;
    background: var(--color-secondary);
    border-bottom: 3px solid var(--color-accent);
}

.publication-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-accent);
    color: var(--color-foreground);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.publication-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-foreground);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.publication-card-subtitle {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    font-style: italic;
}

.publication-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.publication-card-authors {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--color-muted-foreground);
    font-size: 0.875rem;
}

.publication-card-abstract {
    color: var(--color-muted-foreground);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.publication-card-meta-item {
    display: