/*
Theme Name: DigiBinary
Theme URI: https://digibinary.xyz
Author: xaman
Author URI: https://digibinary.xyz
Description: A fully customizable WordPress theme with modern design, customizer options, and comprehensive functionality. Built for flexibility and ease of customization.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: digibinary
Tags: customizable, responsive, modern, flexible, blog, business, portfolio, custom-colors, custom-header, custom-menu, featured-images, threaded-comments, translation-ready

This theme is fully customizable through the WordPress Customizer.
*/

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: #0073aa;
    transition: color 0.3s ease;
}

a:hover {
    color: #005177;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    padding: 2rem 0;
}

.content-area {
    width: 100%;
}

.sidebar {
    width: 100%;
    margin-top: 2rem;
}

/* Two-column layout for desktop */
@media (min-width: 768px) {
    .site-content {
        display: flex;
        gap: 2rem;
    }
    
    /* Sidebar on right (default) */
    .content-area {
        flex: 2;
        order: 1;
    }
    
    .sidebar {
        flex: 1;
        margin-top: 0;
        order: 2;
    }
    
    /* Sidebar on left */
    body.sidebar-left .content-area {
        order: 2;
    }
    
    body.sidebar-left .sidebar {
        order: 1;
    }
    
    /* No sidebar */
    body.no-sidebar .content-area {
        max-width: 900px;
        margin: 0 auto;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

body.sticky-header .site-header {
    position: sticky;
    top: 0;
}

body:not(.sticky-header) .site-header {
    position: relative;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo img {
    max-height: 60px;
    width: auto;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: #1a1a1a;
}

.site-description {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}

/* Navigation */
.main-navigation {
    display: none;
}

.main-navigation.active {
    display: block;
}

.menu-toggle {
    background: none;
    border: 2px solid #333;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
    
    .main-navigation {
        display: block;
    }
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-direction: column;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .main-navigation ul {
        flex-direction: row;
        margin-top: 0;
    }
}

.main-navigation a {
    color: #333;
    font-weight: 500;
    padding: 0.5rem 0;
    display: block;
}

.main-navigation a:hover {
    color: #0073aa;
}

.main-navigation .current-menu-item > a {
    color: #0073aa;
}

/* ==========================================================================
   Posts & Pages
   ========================================================================== */
.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.entry-title a {
    color: #1a1a1a;
}

.entry-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.entry-meta span {
    margin-right: 1rem;
}

.post-thumbnail {
    margin-bottom: 1.5rem;
}

.post-thumbnail img {
    border-radius: 8px;
}

.entry-content {
    margin-bottom: 1.5rem;
}

.entry-content img {
    margin: 1.5rem 0;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background-color: #0073aa;
    color: #fff;
    border-radius: 4px;
    font-weight: 500;
}

.read-more:hover {
    background-color: #005177;
    color: #fff;
}

.entry-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
    color: #666;
}

.tag-links {
    margin-top: 1rem;
}

.tag-links a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 4px;
    font-size: 0.875rem;
}

.tag-links a:hover {
    background-color: var(--accent-color, #0073aa);
    color: #fff;
}

/* Post Navigation */
.post-navigation {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.post-navigation .nav-title {
    font-weight: 600;
    color: #1a1a1a;
}

.post-navigation a {
    color: #1a1a1a;
}

.post-navigation a:hover .nav-title {
    color: var(--accent-color, #0073aa);
}

/* Pagination */
.pagination,
.posts-navigation {
    margin: 2rem 0;
    text-align: center;
}

.pagination .nav-links,
.posts-navigation .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination .page-numbers,
.posts-navigation .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.posts-navigation .page-numbers:hover,
.pagination .page-numbers.current,
.posts-navigation .page-numbers.current {
    background-color: var(--accent-color, #0073aa);
    color: #fff;
}

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */
.widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0073aa;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.widget a {
    color: #333;
}

.widget a:hover {
    color: var(--accent-color, #0073aa);
}

.widget ul ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.widget select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.widget_search .search-form {
    flex-direction: column;
}

.widget_search .search-field {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: var(--footer-bg, #1a1a1a);
    color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-menu {
    margin: 1.5rem 0;
}

.footer-menu ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-menu a {
    color: #ccc;
    font-size: 0.875rem;
}

.footer-menu a:hover {
    color: #fff;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content.footer-columns-1 {
        grid-template-columns: 1fr;
    }
    
    .footer-content.footer-columns-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content.footer-columns-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content.footer-columns-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-widget {
    margin-bottom: 1.5rem;
}

.footer-widget h3 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer-widget a {
    color: #ccc;
}

.footer-widget a:hover {
    color: #fff;
}

.site-info {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    margin-top: 2rem;
    color: #999;
}

.site-info a {
    color: #ccc;
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.comment-list {
    list-style: none;
    margin-bottom: 2rem;
}

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.comment-author .avatar {
    float: left;
    margin-right: 1rem;
    border-radius: 50%;
}

.comment-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.comment-content {
    margin-top: 1rem;
    line-height: 1.6;
}

.comment-reply-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 1rem;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 4px;
    font-size: 0.875rem;
}

.comment-reply-link:hover {
    background-color: var(--accent-color, #0073aa);
    color: #fff;
}

/* Comment Form */
.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color, #0073aa);
}

.comment-form .form-submit input {
    padding: 0.75rem 2rem;
    background-color: var(--accent-color, #0073aa);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.comment-form .form-submit input:hover {
    background-color: var(--accent-hover, #005177);
}

/* Nested Comments */
.children {
    list-style: none;
    margin-top: 1rem;
    padding-left: 2rem;
}

/* ==========================================================================
   Search & Archives
   ========================================================================== */
.page-header {
    margin-bottom: 2rem;
    padding: 2rem;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.page-title {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   404 Page
   ========================================================================== */
.error-404 {
    text-align: center;
    padding: 3rem 1rem;
}

.error-404 h1 {
    font-size: 6rem;
    color: #0073aa;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Search Form
   ========================================================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-field:focus {
    outline: none;
    border-color: var(--accent-color, #0073aa);
}

.search-submit {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color, #0073aa);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.search-submit:hover {
    background-color: var(--accent-hover, #005177);
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Screen Reader Text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ==========================================================================
   Customizer Colors (Dynamic)
   ========================================================================== */
.site-title a,
.entry-title a {
    color: var(--primary-color, #1a1a1a);
}

a,
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--accent-color, #0073aa);
}

a:hover {
    color: var(--accent-hover, #005177);
}

.read-more {
    background-color: var(--accent-color, #0073aa);
}

.read-more:hover {
    background-color: var(--accent-hover, #005177);
}

.widget-title {
    border-bottom-color: var(--accent-color, #0073aa);
}

.site-footer {
    background-color: var(--footer-bg, #1a1a1a);
}

