/*
Theme Name: Asim Demirci
Theme URI: https://asimdemirci.com.tr
Author: Asim Demirci Team
Description: A premium, high-performance tech blog theme
Version: 1.0.0
*/

:root {
    /* Color Palette - Light Mode (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f4f4f4;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent-color: #e02401;
    /* Webtekno style orange/red accent */
    --accent-hover: #b81e01;
    --border-color: #e5e5e5;

    /* Layout */
    --container-width: 1200px;
    --header-height: 70px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    /* Color Palette - Dark Mode */
    --bg-primary: #121212;
    --bg-secondary: #1a1a1a;
    --bg-card: #242424;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.site-logo a {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: -1px;
}

.main-navigation {
    flex: 1;
    margin: 0 20px;
    overflow-x: auto;
    /* Enable horizontal scrolling */
    /* Enable horizontal scrolling */
    white-space: nowrap;
    /* Prevent wrapping */
    scrollbar-width: thin;
    /* Show thin scrollbar for UX */
}

/* Hide scrollbar for Chrome/Safari if preferred, but user asked for "scrolling thing" so keeping thin or hidden? 
   Let's keep it clean but functional. If user wants a "scrolling thing", they might mean visible controls, but start with standard touch/drag scroll working. */
.main-navigation::-webkit-scrollbar {
    height: 4px;
    /* Thin scrollbar */
}

.main-navigation::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari/Webkit */
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 20px;
    padding: 0;
    margin: 0;
}

.main-navigation ul li a {
    font-weight: 700;
    font-size: 14px;
    padding: 8px 0;
    position: relative;
    display: inline-block;
}

.main-navigation ul li {
    flex-shrink: 0;
    /* Important: Prevent items from shrinking */
}

.main-navigation ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-fast);
}

.main-navigation ul li a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Search & Theme Toggle */
.search-toggle,
.theme-toggle,
.mobile-menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 20px;
    padding: 8px;
    border-radius: 50%;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle:hover,
.theme-toggle:hover,
.mobile-menu-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--accent-color);
}

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

/* Search Overlay */
.search-overlay {
    position: fixed;
    /* Fixed to viewport to avoid layout interference */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    /* Solid/Opaque cover */
    display: none !important;
    /* Force hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* Highest z-index */
    backdrop-filter: blur(5px);
}

.search-overlay.active {
    display: flex !important;
    /* Show when active */
    animation: fadeInOverlay 0.2s ease forwards;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body.dark-mode .search-overlay {
    background: rgba(18, 18, 18, 0.98);
    /* Dark background for dark mode */
}

.search-form {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

.search-field {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 10px 50px 10px 0;
}

.search-field:focus {
    outline: none;
}

.search-submit {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--accent-color);
    cursor: pointer;
    position: absolute;
    right: 60px;
}

.search-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    position: absolute;
    right: 20px;
}


/* Footer */
.site-footer {
    background-color: var(--bg-secondary);
    padding: 60px 0 30px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

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

.footer-widget h4 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-widget ul {
    list-style: none;
}

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

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s var(--transition-smooth) forwards;
}

/* Post Grid - Index */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    border: 1px solid var(--border-color);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

.post-cat {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .main-navigation {
        display: none;
        /* Todo: Implement Mobile Menu */
    }

    .mobile-menu-toggle {
        display: flex;
        /* Show on mobile */
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Comments Section Styles */
.comments-area {
    max-width: 800px;
    margin: 60px auto;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.comments-title {
    font-size: 22px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.comment-list {
    list-style: none;
    margin-bottom: 40px;
}

.comment-item {
    margin-bottom: 20px;
}

.comment-list .children {
    list-style: none;
    margin-left: 20px;
    /* Indent replies */
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
}

.comment-body {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.comment-author-avatar img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
}

.comment-content-wrapper {
    flex: 1;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: center;
}

.comment-author b {
    font-size: 16px;
    color: var(--text-primary);
}

.comment-metadata {
    font-size: 12px;
    color: var(--text-secondary);
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.comment-actions a {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-color);
}

/* Comment Form */
.comment-form p {
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.submit-btn:hover {
    background: var(--accent-hover);
}

/* Dark Mode Adjustments */
body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea {
    background-color: #333;
    border-color: #444;
    color: white;
}


/* Hero Slider Container */
.hero-slider-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hero-slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.hero-slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.hero-content {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    z-index: 2;
    color: white;
}

.hero-cat {
    display: inline-block;
    background: var(--accent-color);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-meta {
    font-size: 14px;
    opacity: 0.8;
}

.hero-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

/* Controls - Always Visible & Elegant */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    /* Dark semi-transparent */
    backdrop-filter: blur(5px);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Removed opacity: 0 to make them visible */
}

.slider-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev {
    left: 30px;
}

.slider-btn.next {
    right: 30px;
}

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 25px;
    right: 30px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.slider-dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
    border-color: var(--accent-color);
}

/* Load More Button */
#load-more-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 14px 50px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    /* Less rounded for tech feel */
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

#load-more-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#load-more-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Content Layout (Sidebar) */
.site-content-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

.content-area {
    width: 100%;
}

.sidebar-area {
    position: sticky;
    top: 90px;
    /* Header height + gap */
}

/* Sidebar Widgets */
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.widget-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

/* Trending List */
.trending-list {
    list-style: none;
    counter-reset: trend-counter;
}

.trending-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.trending-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.trend-number {
    font-size: 32px;
    font-weight: 900;
    color: var(--accent-color);
    /* Changed to accent color for premium feel, or could use text-secondary */
    opacity: 0.8;
    /* Visible but not overwhelming */
    line-height: 1;
    min-width: 30px;
    font-style: italic;
}

.trending-list li a {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
}

/* Most Read Mini Cards */
.mini-post-card {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.mini-post-thumb {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.mini-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-post-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
}

.mini-post-info .mini-views {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Recent Comments - Fix Bullet Points */
.recent-comments-list {
    list-style: none !important;
    /* Force remove bullets */
    padding: 0;
    margin: 0;
}

.recent-comments-list li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    /* Contain absolute children */
}

.recent-comments-list li span {
    word-break: break-word;
    /* Fix long text overflow */
    overflow-wrap: anywhere;
}

.recent-comments-list li:last-child {
    border: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.recent-comments-list i {
    color: var(--accent-color);
    margin-top: 5px;
    font-size: 14px;
}

/* Hero Content Enhancements */
.hero-title {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-cat {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Single Post with Sidebar */
/* We can reuse site-content-layout in single.php too */

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

    .sidebar-area {
        position: static;
        margin-top: 40px;
    }
}

border-bottom: 1px solid var(--border-color);
position: relative;
/* Contain absolute children */
}

.recent-comments-list li:last-child {
    border: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.recent-comments-list i {
    color: var(--accent-color);
    margin-top: 5px;
    font-size: 14px;
}

/* Single Post with Sidebar */
/* We can reuse site-content-layout in single.php too, but need to implement it first */

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

    .sidebar-area {
        position: static;
        margin-top: 40px;
    }
}