/* ========================================
   Home Money - Main Stylesheet
   ======================================== */

/* --- Variables --- */
:root {
    --color-primary: #1a73e8;
    --color-primary-dark: #1557b0;
    --color-secondary: #ff6b35;
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-text: #1f2937;
    --color-text-light: #6b7280;
    --color-border: #e5e7eb;
    --color-accent: #10b981;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1200px;
    --header-height: 72px;
}

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

/* --- Header --- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.site-branding .site-title-link {
    text-decoration: none;
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* --- Navigation --- */
.main-navigation ul {
    display: flex;
    gap: 8px;
}

.main-navigation a {
    display: block;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    background: var(--color-primary);
    color: #fff;
}

/* --- Mobile Menu Toggle --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

/* --- Page Header --- */
.page-header {
    text-align: center;
    padding: 48px 0 32px;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.page-description {
    color: var(--color-text-light);
    font-size: 1.1rem;
}

/* --- Posts Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    padding-bottom: 60px;
}

/* --- Post Card --- */
.post-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card-thumbnail img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.post-card-content {
    padding: 20px 24px 24px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--color-text-light);
    margin-bottom: 10px;
}

.post-card-category {
    color: var(--color-primary);
    font-weight: 500;
}

.post-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-card-title a {
    color: var(--color-text);
}

.post-card-title a:hover {
    color: var(--color-primary);
}

.post-card-excerpt {
    color: var(--color-text-light);
    font-size: 0.92rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.post-card-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: color 0.2s;
}

.post-card-link:hover {
    color: var(--color-primary-dark);
}

/* --- Single Post / Page --- */
.single-container {
    max-width: 760px;
    padding-top: 32px;
    padding-bottom: 60px;
}

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

.entry-thumbnail-full {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.entry-thumbnail-full img {
    width: 100%;
    height: auto;
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
}

.entry-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    line-height: 1.25;
    color: var(--color-text);
}

.entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text);
}

.entry-content p {
    margin-bottom: 1.4em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 1.8em;
    margin-bottom: 0.6em;
}

.entry-content img {
    border-radius: var(--radius-sm);
    margin: 1.5em 0;
}

.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 16px 24px;
    margin: 1.5em 0;
    background: #f0f4ff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--color-text-light);
}

/* --- Tags --- */
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.tag-badge {
    display: inline-block;
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-primary);
    background: #e8f0fe;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.tag-badge:hover {
    background: var(--color-primary);
    color: #fff;
}

/* --- Post Navigation --- */
.post-navigation {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.post-navigation .nav-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.post-navigation .nav-title {
    display: block;
    font-weight: 600;
    color: var(--color-text);
}

/* --- Comments --- */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.comments-title {
    font-size: 1.4rem;
    margin-bottom: 24px;
}

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

.comment-list .comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}

.comment-list .comment-body {
    display: flex;
    gap: 16px;
}

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

.comment-form {
    margin-top: 32px;
}

.comment-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.comment-form .form-submit .submit {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .form-submit .submit:hover {
    background: var(--color-primary-dark);
}

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

.error-title {
    font-family: 'Playfair Display', serif;
    font-size: 8rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 16px;
}

.error-404 h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.error-404 p {
    color: var(--color-text-light);
    margin-bottom: 24px;
}

.error-actions {
    margin-bottom: 40px;
}

.error-search {
    max-width: 400px;
    margin: 0 auto;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

/* --- Search Form --- */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form .search-field {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
}

.search-form .search-field:focus {
    outline: none;
    border-color: var(--color-primary);
}

.search-form .search-submit {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form .search-submit:hover {
    background: var(--color-primary-dark);
}

/* --- Pagination --- */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 32px 0;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: all 0.2s;
}

.nav-links .page-numbers.current,
.nav-links .page-numbers:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.nav-links .prev,
.nav-links .next {
    width: auto;
    padding: 0 16px;
}

/* --- Footer --- */
.site-footer {
    background: #1a1a2e;
    color: #c9c9d6;
    margin-top: 60px;
    padding: 48px 0 24px;
}

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

.footer-column .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.footer-column a {
    color: #a0a0b8;
    transition: color 0.2s;
}

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

.footer-navigation ul {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-navigation a {
    color: #a0a0b8;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #7a7a94;
}

/* --- Widgets --- */
.widget {
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* --- No Results --- */
.no-results {
    text-align: center;
    padding: 60px 0;
    grid-column: 1 / -1;
}

.no-results h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.no-results p {
    color: var(--color-text-light);
    margin-bottom: 24px;
}

.no-results .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        padding: 16px 24px;
    }

    .main-navigation.is-open {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 4px;
    }

    .main-navigation a {
        padding: 12px 16px;
    }

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

    .page-title {
        font-size: 1.6rem;
    }

    .entry-title {
        font-size: 1.8rem;
    }

    .error-title {
        font-size: 5rem;
    }

    .post-navigation .nav-links {
        flex-direction: column;
    }

    .footer-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* --- WP Admin Bar Fix --- */
.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}
