/*
Theme Name: Sg
Theme URI: https://example.com
Description: Clean custom WordPress theme for PHP 8.1
Author: Albert
Version: 1.0
Text Domain: mytheme
*/

/* =============================================
   BASE RESET
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* =============================================
   LAYOUT
   ============================================= */
#wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    flex: 1;
}

#content {
    flex: 1;
    min-width: 290px;
    padding: 20px;
}

#sidebar-primary {
    width: 300px;
    padding: 20px;
}

/* =============================================
   HEADER
   ============================================= */
#header {
    width: 100%;
}

/* =============================================
   FOOTER
   ============================================= */
#footer {
    width: 100%;
}

/* =============================================
   NAVIGATION
   ============================================= */
.nav-primary ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.nav-primary ul li {
    position: relative;
}

.nav-primary ul li a {
    display: block;
    padding: 10px 16px;
    transition: color 0.2s;
}

/* Dropdown */
.nav-primary ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 100;
    flex-direction: column;
}

.nav-primary ul li:hover > ul {
    display: flex;
}

/* =============================================
   POSTS / ARTICLES
   ============================================= */
.post {
    margin-bottom: 40px;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.post-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 12px;
}

.post-thumbnail {
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.post-excerpt {
    margin-bottom: 16px;
    line-height: 1.7;
}

.read-more {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.read-more:hover {
    opacity: 0.8;
}

/* =============================================
   SINGLE POST / PAGE
   ============================================= */
.single-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.single-content p { margin-bottom: 1rem; }
.single-content h2 { font-size: 1.75rem; margin: 2rem 0 1rem; }
.single-content h3 { font-size: 1.4rem; margin: 1.5rem 0 0.75rem; }
.single-content ul, .single-content ol { padding-left: 2rem; margin-bottom: 1rem; }
.single-content li { margin-bottom: 0.5rem; list-style: disc; }
.single-content img { margin: 1.5rem 0; border-radius: 8px; }
.single-content blockquote {
    border-left: 4px solid #ccc;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #555;
    background: #f9f9f9;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid #ddd;
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: #333;
}

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

/* =============================================
   SIDEBAR
   ============================================= */
.widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.widget ul li a:hover {
    text-decoration: underline;
}

/* =============================================
   404
   ============================================= */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 h1 {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 20px;
}

/* =============================================
   SEARCH
   ============================================= */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 500px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-form button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.search-form button:hover {
    opacity: 0.85;
}

/* =============================================
   COMMENTS
   ============================================= */
.comments-area {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

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

.comment {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-author {
    font-weight: 700;
    margin-bottom: 6px;
}

.comment-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 10px;
}

/* =============================================
   ALIGNMENTS (WordPress defaults)
   ============================================= */
.alignleft {
    float: left;
    margin: 0 20px 10px 0;
}

.alignright {
    float: right;
    margin: 0 0 10px 20px;
}

.aligncenter {
    display: block;
    margin: 0 auto;
}

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

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    #main {
        flex-direction: column;
        padding: 10px;
    }

    #sidebar-primary {
        width: 100%;
        padding: 20px 0;
    }

    .nav-primary ul {
        flex-direction: column;
    }

    .nav-primary ul li ul {
        position: static;
        box-shadow: none;
    }
}
