/* CMTY.ONE */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background: #fff;
    color: #000;
}

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

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

/* Logo */
.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: inline-block;
    text-decoration: none;
}

.logo img {
    height: 32px;
    width: auto;
    vertical-align: middle;
}

/* Desktop/Mobile logo control - these take precedence */
.logo-desktop {
    display: block !important;
}

.logo-mobile {
    display: none !important;
}

/* Light/Dark mode control for desktop logos */
.logo-desktop.logo-light {
    display: block !important;
}

.logo-desktop.logo-dark {
    display: none !important;
}

body.dark-mode .logo-desktop.logo-light {
    display: none !important;
}

body.dark-mode .logo-desktop.logo-dark {
    display: block !important;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
    height: 32px;
}

.main-nav a {
    text-decoration: none;
    color: #000;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 1px;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    line-height: 1;
    vertical-align: middle;
}

.main-nav a:hover,
.main-nav a.active {
    color: #666;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle svg {
    color: #000;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: #fff;
    padding: 20px;
    transition: right 0.3s ease;
    overflow-y: auto;
}

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

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-close svg {
    color: #000;
}

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

.mobile-nav li {
    margin-bottom: 5px;
}

.mobile-nav a {
    display: block;
    padding: 15px 0;
    text-decoration: none;
    color: #000;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
    transition: color 0.2s;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: #666;
}



.social-icon {
    color: #000;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.2s;
}

.social-icon:hover {
    color: #666;
}

.theme-toggle,
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.theme-toggle:hover,
.search-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.theme-toggle svg,
.search-toggle svg {
    color: #000;
    transition: color 0.2s ease;
}

/* Header Search */
.header-search {
    background: #f8f9fa;
    padding: 15px 20px;
    display: none;
    border-top: 1px solid #eee;
}

.header-search.active {
    display: block;
}

.search-form {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
}

.search-submit {
    padding: 10px 20px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.search-submit:hover {
    background: #333;
}

/* General Layout */
.home-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 40px;
}

/* Top Grid */
.top-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Featured Article */
.featured-article {
    position: relative;
}

.featured-article .article-image {
    height: 550px;
    overflow: hidden;
    border-radius: 0;
}

.featured-article .article-content {
    padding: 20px 0;
}

.featured-article h1 {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 500;
    margin-bottom: 10px;
}

.featured-article h1 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.featured-article h1 a:hover {
    opacity: 0.7;
}

.featured-article p {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
}

/* Side Articles */
.side-articles {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 40px;
}

.side-article .article-image {
    height: 250px;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 0;
}

.side-article h2 {
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 500;
}

.side-article h2 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.side-article h2 a:hover {
    opacity: 0.7;
}

.side-article .article-content {
    /* Content wrapper for side articles */
}

.side-article .article-content p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 8px;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.grid-article {
    transition: transform 0.2s;
}

.grid-article:hover {
    transform: none;
}

.grid-article .article-image {
    height: 200px;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 0;
}

.grid-article h2 {
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 500;
    margin-bottom: 8px;
}

.grid-article h2 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.grid-article h2 a:hover {
    opacity: 0.7;
}

.grid-article p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Article Images */
.article-image {
    width: 100%;
    overflow: hidden;
    transition: transform 0.3s ease;
    background: #f5f5f5;
}

.article-image:hover {
    transform: none;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Latest Posts Section */
.latest-posts-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: #000;
}

.article-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item .article-image {
    height: 200px;
    border-radius: 0;
}

.article-item .article-content h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.3;
}

.article-item .article-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.article-item .article-content h3 a:hover {
    opacity: 0.7;
}

.article-item .article-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-radius: 0;
    transition: background 0.2s;
}

.read-more:hover {
    background: #333;
}

/* Sidebar styles removed - full width Latest Posts section */

/* Skeleton Styles */
.skeleton {
    position: relative;
    overflow: hidden;
}

.skeleton-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    width: 100%;
    border-radius: 0;
}

.skeleton-text {
    background: none;
    height: auto;
    margin-bottom: 10px;
    border-radius: 0;
}

.skeleton-ad {
    background: #f0f0f0;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 18px;
    border-radius: 0;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a1a1a;
    color: #fff;
}

body.dark-mode .site-header {
    background: #2d2d2d;
    border-bottom: 1px solid #444;
}

body.dark-mode .logo a,
body.dark-mode .main-nav a,
body.dark-mode .social-icon {
    color: #fff;
}

body.dark-mode .theme-toggle svg,
body.dark-mode .search-toggle svg {
    color: #fff;
}

body.dark-mode .theme-toggle:hover,
body.dark-mode .search-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Dark mode mobile menu */
body.dark-mode .mobile-menu-toggle svg {
    color: #fff;
}

body.dark-mode .mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mobile-menu {
    background: #2d2d2d;
}

body.dark-mode .mobile-menu-close svg {
    color: #fff;
}

body.dark-mode .mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mobile-nav a {
    color: #fff;
    border-bottom-color: #444;
}

body.dark-mode .mobile-nav a:hover,
body.dark-mode .mobile-nav a.active {
    color: #ccc;
}

body.dark-mode .main-nav a:hover,
body.dark-mode .main-nav a.active {
    color: #ccc;
}

body.dark-mode .header-search {
    background: #333;
    border-top-color: #555;
}

body.dark-mode .search-input {
    background: #444;
    border-color: #555;
    color: #fff;
}

body.dark-mode .search-submit {
    background: #fff;
    color: #000;
}

body.dark-mode .featured-article p,
body.dark-mode .side-article .article-content p,
body.dark-mode .grid-article p,
body.dark-mode .article-item .article-content p {
    color: #fff;
}

body.dark-mode .section-title {
    color: #fff;
}

body.dark-mode .latest-posts-section {
    border-top-color: #333;
}

body.dark-mode .article-item {
    border-bottom-color: #333;
}

body.dark-mode .read-more {
    background: #fff;
    color: #000;
}

body.dark-mode .read-more:hover {
    background: #ddd;
}

/* Dark mode sidebar styles removed */

/* Footer */
.site-footer {
    background: #f8f9fa;
    padding: 40px 20px;
    margin-top: 80px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
}

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

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

body.dark-mode .site-footer {
    background: #2d2d2d;
    border-top-color: #444;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .home-container {
        padding: 20px 30px;
    }
    
    .top-grid {
        gap: 30px;
    }
    
    .articles-grid {
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .top-grid {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .latest-posts-section {
        margin-top: 40px;
        padding-top: 30px;
    }
    
    .article-item {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        height: 60px;
        padding: 0 15px;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Force mobile logos - override desktop rules */
    .logo-desktop.logo-light,
    .logo-desktop.logo-dark {
        display: none !important;
    }
    
    .logo-mobile.logo-light {
        display: block !important;
    }
    
    .logo-mobile.logo-dark {
        display: none !important;
    }
    
    /* Mobile dark mode switching */
    body.dark-mode .logo-mobile.logo-light {
        display: none !important;
    }
    
    body.dark-mode .logo-mobile.logo-dark {
        display: block !important;
    }
    
    body.dark-mode .logo-desktop.logo-light,
    body.dark-mode .logo-desktop.logo-dark {
        display: none !important;
    }
    
    .logo img {
        height: 24px;
    }
    
    .home-container {
        padding: 20px;
        max-width: 100%;
    }
    
    .top-grid {
        gap: 0;
        margin-bottom: 0;
    }
    
    /* Add separator after featured article on mobile */
    .featured-article {
        margin-bottom: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .side-articles {
        gap: 0;
    }
    
    /* Style side articles on mobile with consistent spacing */
    .side-article {
        margin-bottom: 30px;
        padding-bottom: 30px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .side-article:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    /* Style side article content on mobile */
    .side-article .article-content {
        /* Remove extra padding that creates inconsistent spacing */
    }
    
    .side-article .article-content h2 {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .side-article .article-content p {
        color: #666;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Make all article titles smaller on mobile */
    .featured-article h1 {
        font-size: 1.3rem;
    }
    
    .grid-article h2 {
        font-size: 0.95rem;
    }
    
    .article-item .article-content h3 {
        font-size: 1.1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 30px;
        border-top: 1px solid #f0f0f0;
        padding-top: 30px;
    }
    
    /* Add separators between grid articles on mobile */
    .grid-article {
        margin-bottom: 30px;
        padding-bottom: 30px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .grid-article:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    .latest-posts-section {
        margin-top: 30px;
        padding-top: 30px;
    }
    
    .latest-posts-section .section-title {
        display: none;
    }
    
    .article-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .article-item .article-image {
        height: 180px;
    }
    
    .featured-article .article-image {
        height: 220px;
    }
    
    .side-article .article-image {
        height: 200px;
    }
    
    .footer-icons {
        gap: 20px;
    }
    
    .site-footer {
        padding: 30px 15px;
        margin-top: 40px;
    }
}

/* Infinite Scroll Loading Indicator */
.infinite-loading {
    text-align: center;
    padding: 40px 20px;
    margin: 30px 0;
}

.loading-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.loading-text::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #666;
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes loading-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Scroll sentinel (invisible trigger element) */
.scroll-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
}

/* Dark mode infinite scroll */
body.dark-mode .loading-text {
    color: #aaa;
}

body.dark-mode .loading-text::after {
    border-top-color: #aaa;
}

/* Dark mode mobile separators */
@media (max-width: 768px) {
    body.dark-mode .featured-article {
        border-bottom-color: #333;
    }
    
    body.dark-mode .side-article {
        border-bottom-color: #333;
    }
    
    body.dark-mode .side-article .article-content p {
        color: #aaa !important;
    }
    
    body.dark-mode .articles-grid {
        border-top-color: #333;
    }
    
    body.dark-mode .grid-article {
        border-bottom-color: #333;
    }
}