/*
Theme Name: MaxGate
Theme URI: https://maxgate.io
Description: A custom theme to match the MaxGate application design.
Version: 1.3
Author: MaxGate Team
Author URI: https://maxgate.io
*/

:root {
    /* Light Theme Defaults */
    --bg-primary: #f9fafb;
    /* gray-50 */
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    /* gray-900 */
    --text-secondary: #4b5563;
    /* gray-600 */
    --accent-color: #2563eb;
    /* blue-600 */
    --border-color: #e5e7eb;
    /* gray-200 */
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #000000;
        /* black */
        --bg-secondary: #0A0A0A;
        /* dark panel */
        --text-primary: #f3f4f6;
        /* gray-100 */
        --text-secondary: #9ca3af;
        /* gray-400 */
        --accent-color: #3b82f6;
        /* blue-500 */
        --border-color: #ffffff0d;
        /* white/5 */
    }
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Utility-like classes */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    /* xl */
    padding: 1.5rem;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    /* Ensure font family is inherited for buttons too */
}

.btn-primary {
    background: linear-gradient(to right, #2563eb, #06b6d4);
    /* blue-500 to cyan-400 equivalent */
    color: white;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
    border-color: var(--text-secondary);
}

/* Header & Nav */
.site-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    max-width: 1280px;
    margin: 0 auto;
}

.site-logo {
    font-size: 1.5rem;
    /* Larger logo */
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

/* Desktop Menu */
.desktop-menu {
    display: none;
}

@media (min-width: 1024px) {
    .desktop-menu {
        display: block;
    }

    .desktop-menu ul {
        display: flex;
        gap: 2rem;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .desktop-menu li {
        margin: 0;
    }

    .desktop-menu a {
        font-weight: 500;
        font-size: 1rem;
        transition: color 0.2s;
        text-decoration: none;
    }

    .desktop-menu a:hover {
        color: var(--accent-color);
    }

    /* Hide mobile toggle on desktop */
    .mobile-menu-toggle {
        display: none;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.5rem;
}

.mobile-nav-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-list li {
    margin-bottom: 0.75rem;
}

.mobile-nav-list a {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    font-weight: 700;
    color: var(--text-primary);
}

.text-sm {
    font-size: 0.875rem;
}

.text-gray-500 {
    color: var(--text-secondary);
}

/* Pagination Styles */
.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s;
}

.pagination .page-numbers.current {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.pagination .page-numbers:not(.current):hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* Article Content Styles */
.entry-content a {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

.entry-content a:hover {
    text-decoration-thickness: 2px;
}

/* Share Dropdown */
.share-dropdown-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.5rem;
    min-width: 200px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 20;
}

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

.share-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s;
    text-decoration: none;
    /* For A tags */
    box-sizing: border-box;
    /* Ensure padding doesn't break layout */
    line-height: normal;
}

.share-item:hover {
    background-color: var(--bg-primary);
}

.share-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: white;
    flex-shrink: 0;
}

.share-icon-wrapper img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    display: block;
}

.share-copy-icon {
    background-color: var(--text-secondary);
}

.share-tg-icon {
    background-color: #24A1DE;
}

.share-vk-icon {
    background-color: #0077FF;
}

.share-ok-icon {
    background-color: #EE8208;
}

.share-wa-icon {
    background-color: #25D366;
}

.share-toggle-btn {
    padding-right: 0.75rem;
    gap: 0.5rem;
}

.share-btn-icon {
    display: block;
    transition: filter 0.3s;
}

@media (prefers-color-scheme: dark) {
    .share-btn-icon {
        filter: invert(1);
    }
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        align-items: center;
    }
}