/*
Theme Name: Nakama Adsensei
Theme URI: https://nakama-adsensei.com
Author: MR. Nakamura
Author URI: https://nakama-adsensei.com
Description: Theme WordPress premium yang dioptimalkan penuh untuk SEO dan Google AdSense. Dirancang untuk memaksimalkan CTR, RPM, dan pendapatan iklan dengan layout yang bersih, cepat, dan mobile-first.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nakama-adsensei
Tags: blog, news, seo, adsense, responsive, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #1a1a1a;
    background: #f8f9fa;
}
a { color: #0066cc; text-decoration: none; transition: color 0.2s; }
a:hover { color: #004499; text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; }

/* === LAYOUT === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }
.content-area { display: grid; grid-template-columns: 1fr 300px; gap: 30px; padding: 30px 0; }
@media (max-width: 992px) { .content-area { grid-template-columns: 1fr; } }

/* === HEADER === */
.site-header {
    background: #fff;
    border-bottom: 3px solid #0066cc;
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.header-inner {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 12px 16px; max-width: 1200px; margin: 0 auto;
}
.site-branding .site-title a { font-size: 1.6rem; font-weight: 800; color: #0066cc; }
.site-branding .site-description { font-size: 0.8rem; color: #666; }
.custom-logo { max-height: 60px; width: auto; }

/* === NAVIGATION === */
.main-navigation ul { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; }
.main-navigation ul li a {
    display: block; padding: 8px 14px;
    font-size: 0.9rem; font-weight: 600; color: #1a1a1a;
    border-radius: 4px; transition: background 0.2s, color 0.2s;
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a { background: #0066cc; color: #fff; text-decoration: none; }
.main-navigation ul ul {
    display: none; position: absolute;
    background: #fff; border: 1px solid #e0e0e0;
    border-radius: 4px; min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 999;
}
.main-navigation ul li:hover > ul { display: block; }
.main-navigation ul ul li a { padding: 8px 16px; font-weight: 400; }
.menu-toggle { display: none; background: none; border: 2px solid #0066cc; color: #0066cc; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 1.2rem; }
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-navigation { display: none; width: 100%; }
    .main-navigation.toggled { display: block; }
    .main-navigation ul { flex-direction: column; }
    .main-navigation ul ul { position: static; box-shadow: none; border: none; padding-left: 1rem; }
}

/* === AD HEADER BANNER === */
.header-ad-zone { background: #f0f4ff; padding: 10px 0; text-align: center; border-bottom: 1px solid #dce4f5; }
.header-ad-zone .ad-label { font-size: 0.7rem; color: #999; text-transform: uppercase; margin-bottom: 4px; }

/* === BREADCRUMB === */
.breadcrumb-wrap { background: #fff; border-bottom: 1px solid #eee; padding: 8px 0; font-size: 0.82rem; }
.breadcrumb-wrap a { color: #0066cc; }
.breadcrumb-wrap span.sep { margin: 0 6px; color: #bbb; }
.breadcrumb-wrap span.current { color: #666; }

/* === POST CARDS (INDEX/ARCHIVE) === */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.post-card {
    background: #fff; border-radius: 8px;
    overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.post-card-thumb { position: relative; overflow: hidden; aspect-ratio: 16/9; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.post-card:hover .post-card-thumb img { transform: scale(1.05); }
.post-card-body { padding: 16px; }
.post-card-category { display: inline-block; background: #0066cc; color: #fff; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 3px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.post-card-title { font-size: 1rem; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.post-card-title a { color: #1a1a1a; }
.post-card-title a:hover { color: #0066cc; text-decoration: none; }
.post-card-excerpt { font-size: 0.87rem; color: #555; line-height: 1.6; margin-bottom: 12px; }
.post-card-meta { font-size: 0.78rem; color: #888; display: flex; gap: 12px; flex-wrap: wrap; }
.post-card-meta span { display: flex; align-items: center; gap: 4px; }

/* === SINGLE POST === */
.single-post-header { margin-bottom: 24px; }
.single-post-header .post-category { display: inline-block; background: #0066cc; color: #fff; font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 3px; margin-bottom: 10px; }
.single-post-header h1 { font-size: 2rem; font-weight: 800; line-height: 1.3; color: #111; margin-bottom: 12px; }
@media (max-width: 768px) { .single-post-header h1 { font-size: 1.5rem; } }
.post-meta-bar { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.83rem; color: #777; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #eee; }
.post-meta-bar a { color: #0066cc; }
.post-featured-image { border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.post-featured-image img { width: 100%; height: auto; }

/* === ARTICLE CONTENT === */
.entry-content { font-size: 1.05rem; line-height: 1.8; color: #222; }
.entry-content h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; color: #111; border-left: 4px solid #0066cc; padding-left: 12px; }
.entry-content h3 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.75rem; color: #222; }
.entry-content h4 { font-size: 1.1rem; font-weight: 600; margin: 1.2rem 0 0.6rem; }
.entry-content p { margin-bottom: 1.2rem; }
.entry-content ul, .entry-content ol { margin-bottom: 1.2rem; }
.entry-content li { margin-bottom: 0.4rem; }
.entry-content blockquote {
    border-left: 4px solid #0066cc; margin: 1.5rem 0;
    padding: 1rem 1.5rem; background: #f0f4ff;
    border-radius: 0 8px 8px 0; font-style: italic; color: #444;
}
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.entry-content th, .entry-content td { padding: 10px 14px; border: 1px solid #ddd; text-align: left; }
.entry-content th { background: #0066cc; color: #fff; font-weight: 600; }
.entry-content tr:nth-child(even) td { background: #f5f8ff; }
.entry-content code { background: #f1f3f5; padding: 2px 6px; border-radius: 3px; font-family: monospace; font-size: 0.9em; }
.entry-content pre { background: #1a1a2e; color: #e0e0e0; padding: 1.2rem; border-radius: 8px; overflow-x: auto; margin-bottom: 1.5rem; font-size: 0.9rem; }
.entry-content img { border-radius: 6px; margin: 1rem auto; }

/* === IN-CONTENT ADS === */
.ad-in-content { text-align: center; margin: 2rem 0; padding: 10px; background: #fafafa; border: 1px dashed #ddd; border-radius: 6px; }
.ad-before-content, .ad-after-content { text-align: center; margin: 20px 0; }
.ad-label-small { font-size: 0.68rem; color: #aaa; text-transform: uppercase; display: block; margin-bottom: 4px; }

/* === SIDEBAR === */
.sidebar { min-width: 0; }
.widget { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.widget-title { font-size: 1rem; font-weight: 700; color: #111; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #0066cc; text-transform: uppercase; letter-spacing: 0.5px; }
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: #333; }
.widget ul li a:hover { color: #0066cc; }
.sidebar-ad-widget { text-align: center; }

/* === RELATED POSTS === */
.related-posts { margin: 2.5rem 0; padding: 1.5rem; background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.related-posts h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: #111; border-left: 4px solid #0066cc; padding-left: 10px; }
.related-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 600px) { .related-posts-grid { grid-template-columns: 1fr; } }
.related-post-card { border-radius: 6px; overflow: hidden; border: 1px solid #eee; }
.related-post-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.related-post-card-body { padding: 10px; }
.related-post-card-body a { font-size: 0.87rem; font-weight: 600; color: #1a1a1a; line-height: 1.4; }
.related-post-card-body a:hover { color: #0066cc; }

/* === POST NAVIGATION === */
.post-navigation { display: flex; justify-content: space-between; gap: 16px; margin: 2rem 0; }
.post-navigation a { display: flex; flex-direction: column; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 14px 18px; flex: 1; transition: border-color 0.2s; }
.post-navigation a:hover { border-color: #0066cc; text-decoration: none; }
.post-navigation .nav-label { font-size: 0.75rem; color: #888; margin-bottom: 4px; text-transform: uppercase; }
.post-navigation .nav-title { font-size: 0.9rem; font-weight: 600; color: #1a1a1a; line-height: 1.4; }
.nav-next { text-align: right; }

/* === COMMENTS === */
.comments-section { margin-top: 2rem; padding: 1.5rem; background: #fff; border-radius: 8px; }
.comments-section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; }
.comment-list { list-style: none; padding: 0; }
.comment { padding: 1rem 0; border-bottom: 1px solid #f0f0f0; }
.comment-author { font-weight: 600; font-size: 0.9rem; }
.comment-meta { font-size: 0.78rem; color: #888; margin-bottom: 8px; }
.comment-body { font-size: 0.93rem; }
.comment-reply-link { font-size: 0.8rem; color: #0066cc; }
.comment-form input, .comment-form textarea {
    width: 100%; border: 1px solid #ddd; border-radius: 4px;
    padding: 10px 12px; font-size: 0.9rem; font-family: inherit;
    margin-bottom: 12px; transition: border-color 0.2s;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: #0066cc; }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form .submit { background: #0066cc; color: #fff; border: none; padding: 10px 24px; border-radius: 4px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.comment-form .submit:hover { background: #004499; }

/* === PAGINATION === */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 2rem 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 4px;
    font-size: 0.9rem; font-weight: 500; border: 1px solid #ddd;
    background: #fff; color: #333; transition: all 0.2s;
}
.pagination a:hover, .pagination span.current { background: #0066cc; color: #fff; border-color: #0066cc; text-decoration: none; }

/* === FOOTER === */
.site-footer { background: #1a1a2e; color: #ccc; padding: 40px 0 0; margin-top: 40px; }
.footer-widgets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding-bottom: 30px; }
@media (max-width: 768px) { .footer-widgets { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .footer-widgets { grid-template-columns: 1fr; } }
.footer-widget-area .widget-title { color: #fff; border-bottom-color: #0066cc; }
.footer-widget-area p, .footer-widget-area li, .footer-widget-area a { color: #aaa; font-size: 0.88rem; }
.footer-widget-area a:hover { color: #fff; }
.footer-bottom { background: #111; padding: 14px 0; text-align: center; font-size: 0.82rem; color: #666; }
.footer-bottom a { color: #888; }
.footer-ad-zone { text-align: center; padding: 16px 0; border-top: 1px solid #2a2a3e; }

/* === 404 PAGE === */
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 h1 { font-size: 6rem; font-weight: 900; color: #0066cc; line-height: 1; }
.error-404 h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.error-404 p { color: #666; margin-bottom: 1.5rem; }
.btn-home { display: inline-block; background: #0066cc; color: #fff; padding: 12px 28px; border-radius: 6px; font-weight: 600; transition: background 0.2s; }
.btn-home:hover { background: #004499; color: #fff; text-decoration: none; }

/* === SEARCH === */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] { flex: 1; border: 1px solid #ddd; border-radius: 4px; padding: 10px 14px; font-size: 0.9rem; }
.search-form button { background: #0066cc; color: #fff; border: none; padding: 10px 18px; border-radius: 4px; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: background 0.2s; }
.search-form button:hover { background: #004499; }
.search-results-header { margin-bottom: 1.5rem; }
.search-results-header h1 { font-size: 1.4rem; }

/* === TAG CLOUD === */
.tag-cloud-link { display: inline-block; background: #f0f4ff; color: #0066cc; padding: 4px 10px; border-radius: 20px; font-size: 0.82rem !important; margin: 3px; border: 1px solid #dce4f5; transition: all 0.2s; }
.tag-cloud-link:hover { background: #0066cc; color: #fff; text-decoration: none; }

/* === READING PROGRESS BAR === */
#reading-progress { position: fixed; top: 0; left: 0; width: 0%; height: 3px; background: linear-gradient(to right, #0066cc, #00aaff); z-index: 9999; transition: width 0.1s linear; }

/* === BACK TO TOP === */
#back-to-top { position: fixed; bottom: 24px; right: 24px; width: 42px; height: 42px; background: #0066cc; color: #fff; border: none; border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: none; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,102,204,0.4); transition: all 0.2s; z-index: 9998; }
#back-to-top:hover { background: #004499; transform: translateY(-2px); }
#back-to-top.show { display: flex; }

/* === STICKY AD === */
.sticky-ad-bottom { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(255,255,255,0.97); padding: 8px; text-align: center; border-top: 1px solid #ddd; z-index: 9000; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); }
.sticky-ad-close { position: absolute; top: 4px; right: 12px; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #666; }
@media (min-width: 769px) { .sticky-ad-bottom { display: none; } }

/* === TABLE OF CONTENTS === */
.toc-box { background: #f0f4ff; border: 1px solid #dce4f5; border-radius: 8px; padding: 16px 20px; margin: 1.5rem 0; }
.toc-box .toc-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; color: #111; }
.toc-box ol { margin: 0; padding-left: 1.2rem; }
.toc-box li { font-size: 0.88rem; margin-bottom: 5px; }
.toc-box a { color: #0066cc; }

/* === UTILITY === */
.text-center { text-align: center; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.clearfix::after { content: ''; display: table; clear: both; }
.skip-link { position: absolute; top: -40px; left: 0; background: #0066cc; color: #fff; padding: 8px 16px; z-index: 10000; transition: top 0.2s; }
.skip-link:focus { top: 0; }
