/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #333;
    line-height: 1.7;
    background: #fff;
    font-size: 16px;
}
a { color: #2ea3f2; text-decoration: none; }
a:hover { color: #1a7abf; }
img { max-width: 100%; height: auto; }

/* ---- Layout ---- */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header ---- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-logo {
    font-family: 'Concert One', 'Open Sans', sans-serif;
    font-size: 1.6em;
    color: #333;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.site-logo:hover { color: #2ea3f2; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5em; cursor: pointer; }
.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.nav-menu li a {
    display: block;
    padding: 8px 12px;
    color: #555;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.nav-menu li a:hover { color: #2ea3f2; }

/* ---- Homepage ---- */
.page-title {
    font-size: 1.8em;
    margin: 40px 0 30px;
    color: #333;
}
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}
.post-card {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.post-card-content { padding: 15px 20px 20px; }
.post-card-content h2 { font-size: 1.1em; line-height: 1.4; margin-bottom: 8px; }
.post-card-content h2 a { color: #333; }
.post-card-content h2 a:hover { color: #2ea3f2; }
.post-card-content time { font-size: 0.8em; color: #999; }
.post-card-content .post-cats { font-size: 0.8em; color: #999; margin-left: 10px; }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px 0 50px;
}
.pagination a {
    display: inline-block;
    padding: 10px 20px;
    background: #2ea3f2;
    color: #fff;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.9em;
}
.pagination a:hover { background: #1a7abf; color: #fff; }
.page-info { color: #999; font-size: 0.9em; }

/* ---- Single Post ---- */
.single-post { padding: 40px 0 60px; }
.post-header { margin-bottom: 30px; }
.post-header h1 {
    font-size: 2em;
    line-height: 1.3;
    color: #333;
    margin-bottom: 10px;
}
.post-meta { font-size: 0.85em; color: #999; }
.post-meta a { color: #2ea3f2; }

/* ---- Post Content (general) ---- */
.post-content {
    font-size: 1em;
    line-height: 1.8;
}
.post-content p { margin-bottom: 1.2em; }
.post-content h2 {
    font-size: 1.5em;
    margin: 1.8em 0 0.8em;
    color: #333;
}
.post-content h3 {
    font-size: 1.25em;
    margin: 1.5em 0 0.6em;
    color: #333;
}
.post-content ul, .post-content ol {
    margin: 0 0 1.2em 1.5em;
}
.post-content li { margin-bottom: 0.4em; }
.post-content img {
    display: block;
    margin: 1em auto;
    border-radius: 3px;
}
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
}
.post-content table th, .post-content table td {
    padding: 10px 14px;
    border: 1px solid #ddd;
    text-align: left;
}
.post-content table th {
    background: #f7f7f7;
    font-weight: 600;
}
.post-content blockquote {
    border-left: 4px solid #2ea3f2;
    padding: 10px 20px;
    margin: 1.2em 0;
    background: #f9f9f9;
    font-style: italic;
}

/* ---- Divi Layout Compatibility ---- */
/* These styles make the scraped Divi HTML render properly */

.entry-content { /* wrapper from WP */ }

.et_pb_section { margin-bottom: 0; }
.et_pb_row {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}
.et_pb_column { width: 100%; }
.et_pb_column_4_4 { width: 100%; }

.et_pb_text {
    margin-bottom: 1em;
}
.et_pb_text_inner {
    line-height: 1.8;
}
.et_pb_text_inner p { margin-bottom: 1em; }

/* Divi Images */
.et_pb_image {
    margin: 1.5em auto;
    text-align: center;
}
.et_pb_image_wrap {
    display: inline-block;
    max-width: 100%;
}
.et_pb_image_wrap img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}
.et_pb_image_sticky { }

/* Divi Dividers */
.et_pb_space,
.et_pb_divider,
.et_pb_divider_hidden {
    height: 20px;
}
.et_pb_divider_internal {
    border-top: 1px solid #eee;
    margin: 10px 0;
}

/* Divi Buttons (Amazon CTA) */
.et_pb_button_module_wrapper {
    text-align: center;
    margin: 1.5em 0;
}
.et_pb_button {
    display: inline-block;
    padding: 12px 28px;
    background: #e8930a;
    color: #fff !important;
    font-size: 1em;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}
.et_pb_button:hover {
    background: #c97d08;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Divi Post Title (used on builder pages) */
.et_pb_post_title { margin-bottom: 20px; }
.et_pb_post_title .entry-title,
.et_pb_title_container h1 {
    font-size: 2em;
    line-height: 1.3;
    color: #0c71c3;
}
.et_pb_title_meta_container { font-size: 0.85em; color: #999; }

/* Divi Video */
.et_pb_video_box { margin: 1.5em 0; }
.et_pb_video_box iframe { max-width: 100%; }

/* Lazy load youtube */
.container-youtube,
.container-lazyload {
    position: relative;
    max-width: 100%;
    margin: 1.5em 0;
}
.container-youtube iframe {
    width: 100%;
    aspect-ratio: 16/9;
}

/* Author box (molongui) */
.m-a-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    margin: 2em 0;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}
.m-a-box-avatar-url img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}
.m-a-box-name { font-weight: 700; margin-bottom: 5px; }
.m-a-box-bio { font-size: 0.9em; color: #666; }

/* ---- Footer ---- */
.site-footer {
    background: #f7f7f7;
    border-top: 1px solid #eee;
    padding: 30px 0;
    text-align: center;
    margin-top: 40px;
}
.footer-links { margin-bottom: 10px; }
.footer-links a {
    color: #666;
    margin: 0 12px;
    font-size: 0.85em;
}
.footer-links a:hover { color: #2ea3f2; }
.footer-copy { font-size: 0.8em; color: #999; }

/* ---- Error Page ---- */
.error-page {
    text-align: center;
    padding: 80px 0;
}
.error-page h1 { font-size: 2em; margin-bottom: 15px; }
.error-page p { color: #666; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #eee;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        padding: 10px 0;
    }
    .nav-menu.open { display: flex; }
    .nav-menu li a { padding: 10px 20px; }
    .post-grid { grid-template-columns: 1fr; }
    .post-header h1 { font-size: 1.5em; }
    .et_pb_title_container h1 { font-size: 1.5em; }
}
