/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,400&display=swap');

:root {
    /* Premium Color Palette */
    --color-primary: #0f172a;
    /* Deep Navy */
    --color-primary-light: #1e293b;
    --color-accent: #2563eb;
    /* Vibrant Blue */
    --color-accent-hover: #1d4ed8;
    --color-danger: #ef4444;
    --color-success: #10b981;
    --color-text-main: #1f2937;
    --color-text-muted: #6b7280;
    --color-bg-light: #f8fafc;
    --color-white: #ffffff;

    /* Layout */
    --navbar-height: 70px;
    --border-radius-card: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* FIX: Override Ionic's default no-scroll behavior */
html,
body,
html.hydrated,
body.hydrated {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    position: relative !important;
    touch-action: auto !important;
    -webkit-overflow-scrolling: touch !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
}

body {
    -webkit-font-smoothing: antialiased;
    background-color: var(--color-bg-light);
    color: var(--color-text-main);
}

.hero-overlay h1 {
    color: var(--color-white);
}

.hero-overlay p {
    color: var(--color-white);
}


/* WP Admin Bar Fix */
body.admin-bar .navbar-custom {
    top: 32px !important;
    position: fixed !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar .navbar-custom {
        top: 46px !important;
        position: fixed !important;
    }

    html #wpadminbar {
        top: 0 !important;
        position: fixed !important;
    }
}

/* Ensure no other Ionic elements block scroll */
ion-app,
.ion-page {
    position: static !important;
    contain: none !important;
    overflow: auto !important;
    height: auto !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--color-primary);
}

/* Navbar Customization */
.navbar-custom {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: var(--navbar-height);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-primary) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text-main) !important;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--color-accent) !important;
}

#mobileMenu {
    z-index: 9999999999;
}

/* Hero Section */
.hero-section {
    padding: 2rem 0;
}

.hero-main-card {
    position: relative;
    border-radius: var(--border-radius-card);
    overflow: hidden;
    height: 450px;
    background-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-main-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hero-img-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.hero-main-card:hover .hero-img-bg {
    opacity: 0.9;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
    padding: 2rem;
    color: white;
    z-index: 2;
    /* Ensure overlay is above image */
    pointer-events: none;
    /* Let clicks pass through overlay container but not children */
}

/* Allow clicks on children inside overlay */
.hero-overlay>* {
    pointer-events: auto;
}

/* Hero Title Link Reset and Expansion */
.hero-overlay a {
    text-decoration: none !important;
    color: inherit !important;
}

.hero-overlay a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    cursor: pointer;
}

.badge-category {
    background-color: var(--color-accent);
    color: white;
    font-weight: 600;
    padding: 0.35em 0.8em;
    border-radius: 50rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* Standard Article Cards */
.article-card {
    background: var(--color-white);
    border: none;
    border-radius: var(--border-radius-card);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: var(--shadow-sm);
    position: relative;
    /* Allow link stretching */
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.article-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

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

/* Make the whole card clickable */
.article-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.article-title a:hover {
    color: var(--color-accent);
}

/* Single Post Specifics */
.post-header {
    margin-bottom: 2rem;
}

.post-meta-large {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-bg-light);
}

.post-featured-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-card);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

/* Fix for WordPress Caption and Images */
.article-content img,
.article-content .wp-caption {
    max-width: 100% !important;
    height: auto !important;
    width: auto;
    /* Allow sizing down */
}

.article-content figure {
    width: auto !important;
    /* Override potential inline width on figure */
    max-width: 100% !important;
    margin: 1rem 0;
}

/* Responsive wp-caption text */
.wp-caption-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

.share-buttons {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-bg-light);
}

.author-bio {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--border-radius-card);
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

/* Sidebar */
.sidebar-widget {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-card);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-bg-light);
    color: var(--color-primary);
}

.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: start;
}

.trending-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-bg-light);
    -webkit-text-stroke: 1px var(--color-text-muted);
    line-height: 1;
}

/* Footer */
.footer {
    background-color: var(--color-primary);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-title {
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: white;
}

/* Ionic Components Overrides */
ion-icon {
    font-size: 1.25em;
    vertical-align: middle;
}

/* Utilities */
.text-accent {
    color: var(--color-accent);
}

.bg-gradient-premium {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
}

.wp-caption {
	
	width: auto !important;
	
}



/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-main-card {
        height: 300px;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .author-bio {
        flex-direction: column;
        text-align: center;
    }
}