/*
 * Medium Style Theme - Main Stylesheet
 * Version: 1.0.0
 * Author: SGIX Team
 */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --text-primary: #242424;
    --text-secondary: #6b6b6b;
    --text-muted: #8b8b8b;
    --accent: #1a8917;
    --accent-hover: #156d13;
    --border: #e6e6e6;
    --border-dark: #d4d4d4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-container {
    max-width: 1192px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    font-family: 'Lora', Georgia, serif;
    letter-spacing: -0.03em;
}

.logo-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.logo-thumb-fallback {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.desktop-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.desktop-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: color 0.2s;
}

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

/* Social Links */
.social-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.social-links a:hover {
    color: var(--text-primary);
}

.social-links svg {
    width: 100%;
    height: 100%;
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: inherit;
}
.dropdown-toggle:hover { color: var(--text-primary); }
.dropdown-toggle svg { width: 12px; height: 12px; transition: transform 0.2s; }
.dropdown:hover .dropdown-toggle svg { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a { display: block; padding: 10px 16px; color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; transition: all 0.2s; }
.dropdown-menu a:hover { background: var(--bg-secondary); color: var(--text-primary); }

/* Main Content Area */
.main-wrapper {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Container */
.container {
    max-width: 728px;
    margin: 0 auto;
    padding: 0 48px;
    width: 100%;
}

/* Footer */
footer {
    padding: 32px 48px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    margin-top: auto;
}

.footer-content {
    max-width: 728px;
    margin: 0 auto;
}

footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }
}

@media (max-width: 768px) {
    .desktop-nav,
    .desktop-social {
        display: none;
    }
    
    .container {
        padding: 0 24px;
    }
}

@media (max-width: 640px) {
    .header-container {
        height: 56px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 20px;
    }
}

/* Hamburger Button */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 64px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 64px);
    background: var(--bg-primary);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav {
    padding: 24px 0;
}

.mobile-nav > a {
    display: block;
    padding: 14px 24px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.mobile-nav > a:hover {
    background: var(--bg-secondary);
}

/* Mobile Dropdown */
.mobile-dropdown {
    border-bottom: 1px solid var(--border);
}

.mobile-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.mobile-dropdown-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

.mobile-dropdown-toggle.active svg {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-secondary);
}

.mobile-dropdown-menu a {
    display: block;
    padding: 12px 24px 12px 40px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.mobile-dropdown-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Mobile Social Links */
.mobile-social-links {
    display: flex;
    gap: 20px;
    padding: 24px;
    justify-content: center;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.mobile-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.mobile-social-links a:hover {
    color: var(--text-primary);
}

.mobile-social-links svg {
    width: 100%;
    height: 100%;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .mobile-menu {
        top: 56px;
        height: calc(100vh - 56px);
    }
}

/* Desktop only for larger screens */
@media (min-width: 769px) {
    .mobile-menu,
    .hamburger {
        display: none !important;
    }
}
