/*
Theme Name: CodeCrafty
Theme URI: https://codecrafty.com
Author: CodeCrafty Team
Author URI: https://codecrafty.com
Description: A modern, lightweight WordPress theme fully compatible with Elementor page builder. Features clean design, fast loading, and complete Elementor integration for easy customization.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: codecrafty
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, elementor, page-builder, responsive-layout

This theme is built to work seamlessly with Elementor page builder.
*/

/* ============================================
   BASE STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 20px 0;
    font-weight: 600;
    line-height: 1.3;
    color: #222;
}

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: 0 0 15px 0;
}

a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #005177;
    text-decoration: underline;
}

/* ============================================
   LAYOUT
   ============================================ */

.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-content {
    padding: 40px 0;
    min-height: 500px;
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    max-height: 50px;
    width: auto;
}

.site-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

.site-title a {
    color: #222;
    text-decoration: none;
}

.site-title a:hover {
    color: #0073aa;
}

.site-description {
    font-size: 0.875rem;
    color: #666;
    margin: 5px 0 0 0;
}

/* ============================================
   NAVIGATION
   ============================================ */

.main-navigation {
    display: flex;
    align-items: center;
}

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

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: #333;
    font-weight: 500;
    padding: 10px 0;
    display: block;
}

.main-navigation a:hover {
    color: #0073aa;
    text-decoration: none;
}

/* Dropdown Menu */
.main-navigation .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 10px 0;
    border-radius: 4px;
}

.main-navigation li:hover > .sub-menu {
    display: flex;
}

.main-navigation .sub-menu a {
    padding: 10px 20px;
}

.main-navigation .sub-menu a:hover {
    background-color: #f5f5f5;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
}

/* ============================================
   CONTENT
   ============================================ */

.entry-header {
    margin-bottom: 30px;
}

.entry-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.entry-meta {
    color: #666;
    font-size: 0.875rem;
}

.entry-meta a {
    color: #666;
}

.entry-meta a:hover {
    color: #0073aa;
}

.entry-content {
    max-width: 100%;
}

.entry-content img {
    max-width: 100%;
    height: auto;
}

.entry-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ============================================
   POSTS & PAGES
   ============================================ */

.post,
.page {
    margin-bottom: 60px;
}

.post-thumbnail {
    margin-bottom: 30px;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ============================================
   SIDEBAR
   ============================================ */

.widget-area {
    padding-left: 30px;
}

.widget {
    margin-bottom: 40px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

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

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.widget li:last-child {
    border-bottom: none;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background-color: #222;
    color: #aaa;
    padding: 60px 0 30px;
}

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

.footer-widget .widget-title {
    color: #fff;
    border-bottom-color: #0073aa;
}

.footer-widget a {
    color: #aaa;
}

.footer-widget a:hover {
    color: #fff;
}

.site-info {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #444;
    font-size: 0.875rem;
}

.site-info a {
    color: #aaa;
}

.site-info a:hover {
    color: #fff;
}

/* ============================================
   ELEMENTOR COMPATIBILITY
   ============================================ */

/* Full Width Template for Elementor */
.elementor-page .site-content,
.elementor-page .content-area,
.elementor-page .site-main {
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.elementor-page .entry-header,
.elementor-page .entry-footer,
.elementor-page .post-navigation,
.elementor-page .comments-area {
    display: none;
}

.elementor-page .entry-content {
    margin: 0;
    padding: 0;
}

/* Elementor Canvas Template */
.elementor-template-canvas .site-header,
.elementor-template-canvas .site-footer {
    display: none;
}

.elementor-template-canvas .site-content {
    padding: 0;
}

/* Elementor Header/Footer Support */
.elementor-location-header {
    position: relative;
    z-index: 1000;
}

.elementor-location-footer {
    position: relative;
    z-index: 1;
}

/* Ensure Elementor sections are full width */
.elementor-section-wrap {
    width: 100%;
}

/* ============================================
   WORDPRESS DEFAULTS
   ============================================ */

/* Alignment */
.alignleft {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
}

.alignright {
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Captions */
.wp-caption {
    max-width: 100%;
    margin-bottom: 20px;
}

.wp-caption img {
    display: block;
    margin: 0;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

/* Galleries */
.gallery {
    display: grid;
    grid-gap: 20px;
    margin-bottom: 30px;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.gallery-columns-7 { grid-template-columns: repeat(7, 1fr); }
.gallery-columns-8 { grid-template-columns: repeat(8, 1fr); }
.gallery-columns-9 { grid-template-columns: repeat(9, 1fr); }

.gallery-item {
    margin: 0;
}

.gallery-caption {
    font-size: 0.875rem;
    color: #666;
    margin-top: 10px;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #0073aa;
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: #555;
}

blockquote cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-weight: 600;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0073aa;
}

button,
input[type="submit"],
input[type="button"] {
    background-color: #0073aa;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background-color: #005177;
}

/* ============================================
   COMMENTS
   ============================================ */

.comments-area {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    margin-bottom: 30px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-metadata {
    font-size: 0.875rem;
    color: #666;
}

.comment-content {
    margin-left: 55px;
}

.comment-reply-link {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination,
.post-navigation {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a,
.pagination .current {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
    text-decoration: none;
}

.pagination .current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #eee;
    clip: auto !important;
    clip-path: none;
    color: #444;
    display: block;
    font-size: 1em;
    height: auto;
    left: 5px;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .site-container {
        padding: 0 15px;
    }
    
    .widget-area {
        padding-left: 0;
        margin-top: 40px;
    }
    
    .content-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .entry-title {
        font-size: 2rem;
    }
    
    .site-content {
        padding: 30px 0;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .site-header,
    .site-footer,
    .comments-area,
    .post-navigation,
    .pagination {
        display: none;
    }
    
    .site-content {
        padding: 0;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.875rem;
        color: #666;
    }
}
