/**
 * Marga Enterprises - Main Stylesheet
 * Professional, clean, business-focused design
 */

/* CRITICAL: Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    img, video, iframe, embed, object {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Override inline width attributes */
    img[width], img[style*="width"] {
        width: auto !important;
        max-width: 100% !important;
    }
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal overflow */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #003d7a;
    --accent-color: #ff6b00;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --white: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo img {
    height: 50px;
    width: auto;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero .lead {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #e55d00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

/* Main Content */
.main-content {
    padding: 60px 20px;
}

.main-content h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin: 40px 0 20px;
}

.main-content h3 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin: 30px 0 15px;
}

.main-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.main-content ul,
.main-content ol {
    margin: 20px 0 20px 30px;
}

.main-content li {
    margin-bottom: 10px;
}

.main-content img {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
}

/* Prevent any element from causing horizontal overflow */
.main-content img,
.main-content iframe,
.main-content video,
.main-content table,
.main-content pre,
.main-content code {
    max-width: 100%;
    overflow-x: auto;
}

.main-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.main-content a:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 40px 20px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.footer-col p {
    margin-bottom: 8px;
    opacity: 0.9;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    .main-nav ul {
        gap: 0;
        flex-direction: column;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .lead {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        text-align: center;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }


/* ============================================
   NAVIGATION ENHANCEMENTS
   ============================================ */

.nav-menu {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 0;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.cta-link {
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 5px;
}

.nav-link.cta-link:hover {
    background: var(--secondary-color);
    color: var(--white);
}

/* Dropdown Menu */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 100;
    list-style: none;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-menu li a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        display: none;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 20px;
    }
    
    .nav-link {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 20px;
    }
}


/* ============================================
   PAGE HEADER & BREADCRUMBS
   ============================================ */

.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 40px 20px;
}

.page-header h1 {
    font-size: 2.25rem;
    margin-top: 15px;
}

.breadcrumb {
    margin-bottom: 10px;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.9;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 10px;
}

.breadcrumb a {
    color: var(--white);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ============================================
   PAGE CONTENT
   ============================================ */

.page-content {
    padding: 60px 0;
}

.page-content .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.content-wrapper {
    max-width: 900px;
}

.content-wrapper h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.content-wrapper h3 {
    color: var(--secondary-color);
    font-size: 1.35rem;
    margin: 30px 0 15px;
}

.content-wrapper h4 {
    font-size: 1.15rem;
    margin: 25px 0 12px;
}

.content-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
}

.content-wrapper th,
.content-wrapper td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.content-wrapper th {
    background: var(--bg-light);
    font-weight: 600;
}

.content-wrapper tr:nth-child(even) {
    background: var(--bg-light);
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta-section {
    background: var(--bg-light);
    padding: 60px 20px;
    text-align: center;
}

.cta-section h2 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.cta-section p {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}


/* ============================================
   BLOG STYLES
   ============================================ */

.blog-post .post-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 40px 20px;
}

.post-meta {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.post-content-wrapper {
    padding: 60px 0;
}

.post-content-wrapper .container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 50px;
}

.post-content {
    max-width: 100%;
}

.post-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

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

.related-posts li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.related-posts li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-posts a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
}

.related-posts a:hover {
    color: var(--primary-color);
}

.cta-widget {
    background: var(--primary-color);
    color: var(--white);
}

.cta-widget h3 {
    color: var(--white);
}

.cta-widget .btn {
    display: block;
    text-align: center;
    margin-top: 15px;
}

/* Post Navigation */
.post-navigation {
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
}

.post-navigation .container {
    display: flex;
    justify-content: space-between;
}

.nav-prev,
.nav-next {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    max-width: 45%;
}

.nav-next {
    text-align: right;
    margin-left: auto;
}

.nav-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.nav-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 5px;
}

/* Blog Listing */
.blog-listing {
    padding: 60px 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    transition: box-shadow 0.3s;
}

.blog-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.blog-card h2 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.blog-card h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.blog-card h2 a:hover {
    color: var(--primary-color);
}

.blog-card time {
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-card p {
    margin: 15px 0;
    color: var(--text-light);
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .post-content-wrapper .container {
        grid-template-columns: 1fr;
    }
    
    .post-sidebar {
        position: static;
    }
}


/* ============================================
   ENHANCED FOOTER
   ============================================ */

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.footer-logo img {
    height: 40px;
    margin-bottom: 15px;
}

.footer-tagline {
    opacity: 0.9;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    color: var(--white);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.social-links a:hover {
    opacity: 1;
}

.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--white);
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--white);
}

.contact-info p {
    margin-bottom: 5px;
    opacity: 0.9;
}

.contact-info a {
    color: var(--white);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.footer-bottom {
    padding-top: 25px;
    text-align: center;
}

.seo-tagline {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .site-header,
    .site-footer,
    .cta-section,
    .post-sidebar,
    .post-navigation {
        display: none;
    }
    
    .page-header,
    .post-header {
        background: none !important;
        color: #000 !important;
        padding: 20px 0;
    }
    
    .content-wrapper,
    .post-content {
        max-width: 100%;
    }
}


/* ============================================
   MOBILE FIXES - January 2026
   ============================================ */

/* Ensure all sections have same horizontal alignment */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Fix header container on mobile */
@media (max-width: 768px) {
    /* Header row layout */
    .site-header {
        width: 100%;
    }
    
    .site-header .container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        position: relative;
        gap: 0 !important;
        max-width: 100%;
        padding: 15px 20px;
    }
    
    /* Hamburger button styles */
    .mobile-menu-toggle {
        display: block !important;
        z-index: 1001;
    }
    
    /* Hamburger animation when active */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Navigation hidden by default, shown when active */
    .main-nav {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .main-nav.active {
        display: block !important;
    }
    
    .main-nav .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 10px 20px 20px;
    }
    
    .main-nav .nav-link {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Unified container widths across all sections */
    .container {
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box;
    }
    
    /* Full width sections */
    .site-header,
    .hero,
    .page-header,
    .page-content,
    .main-content,
    .cta-section,
    .site-footer {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    /* Content wrapper full width on mobile */
    .content-wrapper {
        max-width: 100% !important;
        padding: 0 !important;
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Force all images to fit within container - override HTML width attributes */
    .content-wrapper img,
    .page-content img,
    .main-content img,
    img[width] {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    /* Prevent srcset from causing overflow */
    img {
        max-width: 100% !important;
    }
    
    /* Article content overflow prevention */
    article,
    .page-content,
    .post-content {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Footer grid single column */
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 30px;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Logo styling */
.logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

/* Text fallback for logo */
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
}
