/*
Theme Name: Mira News Pro
Theme URI: https://rig24host.cloud/themes/mira-pro
Author: RIG24 Host
Author URI: https://rig24host.cloud
Description: A lightweight, app-style news theme designed for Managed Hosting clients. Features Edge-to-Edge layouts, Dynamic Footers, and Native Speed.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: news, magazine, responsive-layout, sticky-header, translation-ready
*/

/* --- 1. CSS Variables (The Control Center) --- */
:root {
    /* Colors (Default: Dark Blue Theme) */
    --mira-primary: #003366;
    --mira-accent: #d32f2f;
    --mira-text-main: #222222;
    --mira-text-light: #555555;
    --mira-bg-light: #f9f9f9;
    --mira-white: #ffffff;
    --mira-border: #e0e0e0;

    /* Typography */
    --mira-font-main: 'Noto Sans Devanagari', sans-serif;
    --mira-h-size-desk: 32px;
    --mira-h-size-mob: 24px;
    --mira-p-size: 18px; /* High Readability */
    
    /* Spacing */
    --app-padding: 18px; /* Global Container Padding */
    --mira-content-padding: 20px; /* ✅ Smart Padding for Single Post (Controlled by Customizer) */
}

/* --- 2. Global Reset --- */
* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 0;
    font-family: var(--mira-font-main);
    font-size: var(--mira-p-size);
    color: var(--mira-text-main);
    line-height: 1.6;
    background-color: var(--mira-white);
    overflow-x: hidden; /* Edge-to-edge fix */
}

/* --- 3. App-Style Layout Base --- */
img { max-width: 100%; height: auto; }

/* Links */
a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--mira-primary); }

/* --- 4. Utilities --- */
.mira-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--app-padding);
}
.text-center { text-align: center; }
.hidden-mobile { display: block; }
.hidden-desktop { display: none; }

@media (max-width: 768px) {
    .hidden-mobile { display: none; }
    .hidden-desktop { display: block; }
}

/* --- 5. Archive / Loop Styles --- */

.main-content-area {
    padding-top: 30px;
    padding-bottom: 50px;
}

/* Archive Header */
.archive-header {
    margin-bottom: 30px;
    border-left: 5px solid var(--mira-primary);
    padding-left: 15px;
}
.archive-title {
    font-size: 24px;
    margin: 0;
    color: var(--mira-primary);
}

/* --- Grid System --- */
.mira-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Desktop: 3 Columns */
    gap: 25px;
}

/* --- News Card Design --- */
.mira-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px; /* App Style Rounding */
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.mira-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* Image Fix (16:9 Aspect Ratio) */
.mira-thumb-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9; /* ✅ Magic Code */
    overflow: hidden;
    background-color: #f0f0f0;
}

.mira-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.mira-card:hover .mira-thumb {
    transform: scale(1.05); /* Zoom Effect */
}

/* Card Content */
.mira-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Category Pill */
.mira-cat-pill {
    font-size: 11px;
    font-weight: 700;
    color: var(--mira-primary);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: inline-block;
}

/* Title */
.mira-card-title {
    font-size: 18px;
    line-height: 1.4;
    margin: 0 0 10px 0;
    font-weight: 600;
}
.mira-card-title a {
    color: var(--mira-text-main);
}
.mira-card-title a:hover {
    color: var(--mira-primary);
}

/* Date */
.mira-date {
    font-size: 12px;
    color: #999;
    margin-top: auto;
}

/* --- Responsive Breakpoints --- */

/* Tablet (2 Columns) */
@media (max-width: 900px) {
    .mira-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (1 Column - Big App Card) */
@media (max-width: 600px) {
    .mira-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mira-card {
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .mira-card-title {
        font-size: 19px;
    }
}

/* --- 6. Header Styles --- */

/* Top Bar */
.mira-top-bar {
    background-color: #f5f5f5;
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    color: #666;
}
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; }

/* Main Header */
.mira-main-header {
    padding: 15px 0;
    background: #fff;
}
.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo Sizing */
.site-branding img {
    max-height: 70px; /* Desktop Logo Size */
    width: auto;
}

/* Navigation (Sticky) */
.mira-main-nav {
    background-color: var(--mira-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.mira-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
.mira-menu li a {
    display: block;
    color: #fff;
    padding: 12px 18px;
    font-weight: 500;
    font-size: 16px;
}
.mira-menu li a:hover {
    background-color: rgba(0,0,0,0.2);
}

/* --- Mobile Specific Header --- */
@media (max-width: 768px) {
    .site-branding img { max-height: 45px; } /* Smaller Mobile Logo */
    .mira-main-nav { display: none; } 
    
    .menu-toggle {
        background: none; border: none; cursor: pointer; padding: 0;
        display: flex; flex-direction: column; gap: 5px;
    }
    .menu-toggle .bar {
        width: 25px; height: 3px; background-color: var(--mira-primary); border-radius: 2px;
    }
    
    .header-grid {
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        align-items: center;
    }
    .site-branding { text-align: center; }
    .header-right { text-align: right; }
}

/* --- Mobile Drawer (Slide-in) --- */
.mobile-menu-drawer {
    position: fixed; top: 0; left: -280px; width: 280px; height: 100%;
    background: #fff; z-index: 2000; transition: 0.3s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 20px;
}
.mobile-menu-drawer.active { left: 0; }
.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1999;
    display: none;
}
.mobile-menu-overlay.active { display: block; }
.close-menu {
    background: none; border: none; font-size: 30px; float: right; cursor: pointer;
}

/* --- 7. Footer Styles --- */
.site-footer {
    background-color: #1a1a1a;
    color: #b0b0b0;
    font-size: 15px;
    margin-top: 50px;
}
.mira-footer-inner {
    padding: 60px 0;
    display: grid;
    gap: 40px;
    align-items: center;
}
.site-footer a { color: #fff; }
.site-footer h2.widget-title {
    color: #fff;
    font-size: 18px;
    border-bottom: 2px solid var(--mira-primary);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

/* Grid Layouts */
.mira-grid-2 { grid-template-columns: 1.5fr 1fr; }
.mira-grid-3 { grid-template-columns: 2fr 1fr 1fr; }
.mira-grid-1 { grid-template-columns: 1fr; }

/* Bottom Bar */
.site-info {
    background-color: #000;
    padding: 15px 0;
    font-size: 14px;
    border-top: 1px solid #333;
}
.info-flex {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}
.powered-by a {
    color: var(--mira-primary);
    font-weight: 700;
}

/* Mobile Footer */
@media (max-width: 900px) {
    .mira-footer-inner {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 50px;
    }
    .widget {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .info-flex {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    /* Footer Widget Separators */
    .footer-widget-area {
        border-bottom: 1px dashed #333;
        padding-bottom: 30px;
        margin-bottom: 30px;
    }
    .footer-widget-area:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}

/* --- 8. Widgets Styles --- */

/* Profile Widget */
.mira-profile-card {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mira-img-wrap { margin-bottom: 15px; display: inline-block; }
.mira-img-wrap img {
    object-fit: cover;
    border: 3px solid var(--mira-primary);
    display: block;
}
.mira-img-wrap.small img { width: 80px; height: 80px; }
.mira-img-wrap.medium img { width: 125px; height: 125px; }
.mira-img-wrap.large img { width: 150px; height: 150px; }
.mira-profile-img.circle { border-radius: 50%; }
.mira-profile-img.rounded { border-radius: 16px; }

.mira-profile-name { color: #fff; font-size: 18px; font-weight: 700; margin: 5px 0; }
.mira-profile-role {
    color: #aaa; font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 15px; display: inline-block;
    background: rgba(255,255,255,0.05); padding: 2px 10px; border-radius: 4px;
}
.mira-profile-social { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.soc-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: #333; color: #fff; border-radius: 50%;
    transition: 0.3s;
}
.soc-icon svg { width: 18px; height: 18px; fill: currentColor; }
.soc-icon:hover { background: var(--mira-primary); transform: translateY(-2px); }

/* About Widget */
.mira-about-logo { margin-bottom: 20px; }
.mira-about-logo img { max-height: 60px; width: auto; }
.mira-about-logo .site-title { color: #fff; font-size: 24px; margin: 0; }
.mira-about-desc { color: #b0b0b0; margin-bottom: 25px; line-height: 1.7; font-size: 15px; }
.mira-contact-list { display: flex; flex-direction: column; gap: 15px; }
.contact-item { display: flex; align-items: flex-start; gap: 12px; color: #ccc; font-size: 14px; }
.contact-item a { color: #ccc; transition: 0.2s; }
.contact-item a:hover { color: var(--mira-primary); text-decoration: underline; }
.c-icon {
    display: flex; align-items: center; justify-content: center;
    width: 20px; min-width: 20px; color: var(--mira-primary); margin-top: 2px;
}
.c-icon svg { width: 18px; height: 18px; }

/* Mobile Card Fix */
@media (max-width: 768px) {
    .mira-profile-card { width: 100%; max-width: 100%; box-sizing: border-box; }
}

/* --- 9. Sidebar Styles (Smart Mode) --- */

.mira-sidebar {
    width: 30%;
    padding-left: 20px;
    margin-top: 30px;
}

/* Feature: Sticky Sidebar */
.mira-sidebar.is-sticky .sidebar-inner {
    position: sticky;
    top: 90px;
    height: fit-content;
    overflow-y: auto;
    max-height: 90vh;
}

/* Feature: Mobile Hide */
@media (max-width: 900px) {
    .mira-sidebar {
        width: 100%;
        padding-left: 0;
        margin-top: 40px;
    }
    .mira-sidebar.hide-on-mobile { display: none; }
}

/* --- 10. Single Page Layout (Smart Padding System) --- */

.main-wrapper {
    margin-top: 30px;
    margin-bottom: 50px;
}

.mira-row {
    display: flex;
    gap: 40px; 
    align-items: flex-start;
}

.mira-content-col {
    flex: 1; 
    width: 100%; 
    min-width: 0;
}

/* --- HEADLINE & META --- */
.entry-title {
    font-size: 32px;
    font-weight: 500; /* Updated: Not too bold */
    line-height: 1.35;
    color: #111;
    margin-bottom: 20px;
}

.mira-app-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
    margin-top: 10px; /* Gap from image */
}
.meta-left { display: flex; gap: 12px; align-items: center; }
.meta-avatar img { width: 42px; height: 42px; border-radius: 50%; }
.meta-info { display: flex; flex-direction: column; line-height: 1.2; }
.meta-author-name { font-weight: 700; font-size: 14px; color: #222; }
.meta-date { font-size: 12px; color: #888; }

/* Category Badge */
.mira-cat-badge {
    background: var(--mira-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 50px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: 0.3s;
}
.mira-cat-badge:hover { background: #000; color: #fff; }

/* Breadcrumb */
.mira-breadcrumb {
    font-size: 14px; /* Updated Size */
    color: #777; /* Lighter color */
    margin-bottom: 15px;
}
.mira-breadcrumb a { font-weight: 500; }

/* --- THE SMART PADDING LOGIC --- */

/* 1. Only constrain text elements (Text gets padding & max-width) */
.mira-single-article .mira-breadcrumb,
.mira-single-article .entry-header,
.mira-single-article .mira-app-meta,
.mira-single-article .entry-content > *:not(figure):not(.wp-block-image):not(iframe):not(video),
.mira-single-article .entry-footer {
    padding-left: var(--mira-content-padding);
    padding-right: var(--mira-content-padding);
    margin-left: auto;
    margin-right: auto;
    max-width: 850px; /* Desktop readability width */
}

/* 2. Release Images & Videos (Edge-to-Edge) */
.mira-single-article .mira-featured-edge,
.mira-single-article .entry-content figure,
.mira-single-article .entry-content .wp-block-image,
.mira-single-article .entry-content iframe,
.mira-single-article .entry-content video {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    display: block;
}

/* 3. Featured Image Styling */
.mira-featured-edge {
    margin-bottom: 20px;
    position: relative;
    width: 100%;
}
.mira-featured-edge img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px; /* Desktop Rounding */
}
.mira-caption, .entry-content figcaption {
    font-size: 13px; color: #777; margin-top: 8px; font-style: italic;
    /* Caption needs padding too */
    padding-left: var(--mira-content-padding);
    padding-right: var(--mira-content-padding);
    text-align: center;
}

/* Content Typography */
.entry-content {
    font-size: 19px;
    line-height: 1.75;
    color: #2a2a2a;
}
.entry-content p { margin-bottom: 22px; }
.entry-content h2 { font-size: 26px; margin-top: 35px; font-weight: 700; }

/* Tags */
.tags-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
}
.tag-label { font-weight: bold; margin-right: 5px; color: #333; }
.tags-links a { color: var(--mira-primary); margin-right: 5px; }

/* --- MOBILE SPECIFIC OVERRIDES --- */
@media (max-width: 900px) {
    
    .mira-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* Remove wrapper padding to allow true Edge-to-Edge */
    .mira-container.main-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .entry-title { font-size: 24px; line-height: 1.4; }

    /* Remove Border Radius on Mobile */
    .mira-featured-edge img {
        border-radius: 0;
    }
    
    /* Content Font Size Mobile */
    .entry-content { font-size: 18px; }
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 900px) {
    
    /* 1. Meta Box को एकदम चिपका दें */
    .mira-app-meta {
        margin-top: 5px !important;       /* इमेज से सिर्फ 5px नीचे */
        margin-bottom: 10px !important;   /* कंटेंट से थोड़ा गैप (ताकि सांस ले सके) */
        padding-bottom: 8px !important;   /* बॉर्डर और टेक्स्ट के बीच थोड़ी जगह */
        align-items: center;
        border-bottom: 1px solid #eee;    /* हल्की लाइन */
    }

    /* 2. अगर आपको नीचे 0px ही चाहिए (Extremely Tight) तो यह लाइन अन-कमेंट करें: */
    /* .mira-app-meta {
        margin-bottom: 0px !important;
        padding-bottom: 5px !important;
    }
    */

    /* 3. अवतार और टेक्स्ट को छोटा करें (Balance के लिए) */
    .meta-avatar img {
        width: 32px;  /* और छोटा किया */
        height: 32px;
    }
    .meta-author-name { font-size: 13px; margin-bottom: 0; }
    .meta-date { font-size: 11px; margin-top: 0; }
    
    /* 4. Category Badge को स्लिम करें */
    .mira-cat-badge {
        font-size: 10px;
        padding: 2px 8px; /* बटन छोटा */
        line-height: 1;
    }
}