/**
 * Home Money Theme - Main Stylesheet
 * Version: 1.0.0
 */

/* ==========================================================================
   1. Reset & Base
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

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

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #004499;
}

/* ==========================================================================
   2. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #111;
}

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: 1.5rem;
}

/* ==========================================================================
   3. Layout
   ========================================================================== */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.has-sidebar .content-container {
    grid-template-columns: 1fr 300px;
}

@media (max-width: 768px) {
    .has-sidebar .content-container {
        grid-template-columns: 1fr;
    }
}

.content-area {
    min-width: 0;
}

/* ==========================================================================
   4. Header
   ========================================================================== */

.site-header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

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

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

.site-title a {
    color: #111;
}

.site-title a:hover {
    color: #0066cc;
}

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

.custom-logo-link {
    display: block;
    max-width: 200px;
}

/* Navigation */
.main-navigation {
    display: block;
}

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

.main-navigation li {
    position: relative;
}

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

.main-navigation a:hover {
    color: #0066cc;
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
    color: #0066cc;
    font-weight: 600;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    position: relative;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: #333;
    left: 0;
}

.menu-toggle-icon::before {
    top: -8px;
}

.menu-toggle-icon::after {
    bottom: -8px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        border-top: 1px solid #e0e0e0;
        padding: 1rem;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-navigation li {
        border-bottom: 1px solid #e0e0e0;
    }
    
    .main-navigation a {
        padding: 1rem 0;
    }
}

/* ==========================================================================
   5. Posts & Pages
   ========================================================================== */

.entry-header {
    margin-bottom: 2rem;
}

.entry-title {
    margin-bottom: 0.5rem;
}

.entry-meta {
    font-size: 0.875rem;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.post-thumbnail img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

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

.entry-content {
    margin-bottom: 2rem;
}

.entry-content > * {
    margin-bottom: 1.5rem;
}

.entry-content img {
    border-radius: 8px;
}

.read-more {
    display: inline-block;
    color: #0066cc;
    font-weight: 600;
    margin-top: 1rem;
}

.read-more:hover {
    color: #004499;
}

.entry-footer {
    border-top: 1px solid #e0e0e0;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.tags-links {
    font-size: 0.875rem;
}

/* Archive & Blog */
article {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e0e0e0;
}

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

.page-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #0066cc;
}

.page-title {
    margin-bottom: 0.5rem;
}

.archive-description {
    color: #666;
    font-size: 1.125rem;
}

/* ==========================================================================
   6. Sidebar
   ========================================================================== */

.widget-area {
    font-size: 0.9375rem;
}

.widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #111;
}

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

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.widget a {
    color: #333;
}

.widget a:hover {
    color: #0066cc;
}

/* ==========================================================================
   7. Comments
   ========================================================================== */

.comments-area {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid #e0e0e0;
}

.comments-title {
    margin-bottom: 2rem;
}

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

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.comment-content {
    margin-bottom: 1rem;
}

.reply {
    font-size: 0.875rem;
}

.comment-form {
    margin-top: 2rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* ==========================================================================
   8. Footer
   ========================================================================== */

.site-footer {
    background-color: #111;
    color: #fff;
    margin-top: auto;
}

.footer-widgets {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 3rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
    }
}

.footer-widget-area .widget {
    background-color: transparent;
    padding: 0;
}

.footer-widget-area .widget-title {
    color: #fff;
    font-size: 1.125rem;
}

.footer-widget-area .widget a {
    color: rgba(255,255,255,0.8);
}

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

.site-info {
    padding: 2rem 0;
}

.site-info .footer-container {
    grid-template-columns: 1fr;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
}

.copyright a {
    color: #fff;
}

.footer-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.footer-navigation a {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

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

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   9. Buttons
   ========================================================================== */

.button,
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.wp-block-button__link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #0066cc;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
.wp-block-button__link:hover {
    background-color: #004499;
    color: #fff;
}

/* ==========================================================================
   10. Pagination
   ========================================================================== */

.pagination,
.navigation {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.page-numbers:hover,
.page-numbers.current {
    background-color: #0066cc;
    color: #fff;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0;
    gap: 2rem;
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-subtitle {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.nav-title {
    font-weight: 600;
}

/* ==========================================================================
   11. 404 Page
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 3rem 0;
}

.error-404 .page-header {
    border-bottom: none;
}

.error-404-search,
.error-404-widgets,
.error-404-categories {
    margin: 2rem 0;
}

.error-404-back {
    margin-top: 3rem;
}

/* ==========================================================================
   12. Accessibility
   ========================================================================== */

.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;
}

.skip-link:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   13. Utilities
   ========================================================================== */

.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

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

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

.alignfull {
    max-width: 100%;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

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