/* BidJapon - Stylesheet */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --body-font: "Karla", "Helvetica Neue", Helvetica, sans-serif;
    --headings-font: "Playfair Display", "Times New Roman", serif;
    --accent-color: #d69010;
    --body-bg: #ffffff;
    --body-color: #444444;
    --headings-color: #111111;
    --box-bg: #f5f5f5;
    --box-color: #111111;
    --header-bg: #ffffff;
    --header-color: #111111;
    --footer-bg: #f5f5f5;
    --footer-color: #555555;
    --footer-headings-color: #121212;
    --copyrights-bg: #121212;
    --copyrights-color: #eeeeee;
    --blog-bg: #ededed;
    --button-bg: #111111;
    --input-bg: #ffffff;
    --submenu-bg: #ffffff;
    --submenu-color: #111111;
}

[data-theme="dark"] {
    --accent-color: #d69010;
    --body-bg: #111111;
    --body-color: #bbbbbb;
    --headings-color: #ffffff;
    --box-bg: #222222;
    --box-color: #ffffff;
    --header-bg: #111111;
    --header-color: #ffffff;
    --footer-bg: #222222;
    --footer-color: #aaaaaa;
    --footer-headings-color: #ffffff;
    --copyrights-bg: #111111;
    --copyrights-color: #eeeeee;
    --blog-bg: #000000;
    --button-bg: #333333;
    --input-bg: #000000;
    --submenu-bg: #222222;
    --submenu-color: #ffffff;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.75;
    color: var(--body-color);
    background-color: var(--body-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--headings-color); }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--headings-font);
    font-weight: 700;
    line-height: 1.5;
    color: var(--headings-color);
    margin-bottom: 0.5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
p { margin-bottom: 1em; }

/* === Layout === */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}
.clearfix::after { content: ""; display: table; clear: both; }

/* === Header === */
#site-header {
    background: var(--header-bg);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 100;
}
#site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    padding-bottom: 15px;
}
#logo a { display: block; }
#logo img { height: 40px; width: auto; }
#logo .dark-logo { display: none; }
[data-theme="dark"] #logo .light-logo { display: none; }
[data-theme="dark"] #logo .dark-logo { display: block; }

/* Navigation */
#main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}
#main-nav a {
    color: var(--header-color);
    font-family: var(--headings-font);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}
#main-nav a:hover,
#main-nav a.active {
    border-bottom-color: var(--accent-color);
    color: var(--accent-color);
}

/* Header controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}
.theme-switch {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--header-color);
    background: none;
    border: none;
    padding: 5px;
    display: flex;
    align-items: center;
}
.theme-switch .icon-sun { display: none; }
[data-theme="dark"] .theme-switch .icon-moon { display: none; }
[data-theme="dark"] .theme-switch .icon-sun { display: inline; }

/* Mobile menu */
#menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--header-color);
}
#menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--header-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* === Blog Layout with Sidebar === */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

/* Sidebar */
#sidebar {
    position: relative;
}
.sidebar-inner {
    position: sticky;
    top: 20px;
}
.widget {
    background: var(--body-bg);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}
.widget h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-color);
}
.widget ul {
    list-style: none;
    padding: 0;
}
.widget ul li {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.widget ul li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.widget ul li a {
    color: var(--body-color);
    font-size: 0.9rem;
    line-height: 1.4;
}
.widget ul li a:hover {
    color: var(--accent-color);
}

/* === Blog Grid === */
#blog-content {
    background: var(--blog-bg);
    padding: 40px 0;
    min-height: 60vh;
}
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}
.post-card {
    background: var(--body-bg);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.post-card.featured {
    grid-column: 1 / -1;
}
.post-card .post-image {
    position: relative;
    overflow: hidden;
}
.post-card .post-image img {
    width: 100%;
    height: auto;
    transition: transform 0.3s;
}
.post-card:hover .post-image img {
    transform: scale(1.03);
}
.post-card .post-body {
    padding: 20px 25px 25px;
}
.post-card .post-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    margin-bottom: 8px;
}
.post-card .post-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
    line-height: 1.4;
}
.post-card .post-title a {
    color: var(--headings-color);
}
.post-card .post-title a:hover {
    color: var(--accent-color);
}
.post-card.featured .post-title {
    font-size: 1.6rem;
}
.post-card .post-date {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 10px;
}
.post-card .post-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--body-color);
}
.post-card .read-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* === Single Article === */
.single-header {
    text-align: center;
    padding: 40px 0 20px;
    max-width: 800px;
    margin: 0 auto;
}
.single-header .post-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    margin-bottom: 10px;
}
.single-header .post-category a { color: var(--accent-color); }
.single-header h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 10px;
}
.single-header .post-date {
    font-size: 0.85rem;
    color: #999;
}
.single-image {
    max-width: 1000px;
    margin: 20px auto;
}
.single-image img {
    width: 100%;
    border-radius: 4px;
}
.single-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px 50px;
}
.single-content h1,
.single-content h2,
.single-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.single-content p {
    margin-bottom: 1.2em;
    line-height: 1.8;
}
.single-content ul, .single-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}
.single-content li {
    margin-bottom: 0.5em;
    line-height: 1.7;
}

/* Table of Contents */
.toc-container {
    background: var(--box-bg);
    border-radius: 4px;
    padding: 20px 25px;
    margin: 20px 0 30px;
}
.toc-container .toc-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--box-color);
    cursor: pointer;
}
.toc-container nav ul {
    list-style: none;
    padding-left: 0;
    counter-reset: toc-item;
}
.toc-container nav ul li {
    counter-increment: toc-item;
    margin-bottom: 5px;
}
.toc-container nav ul li a::before {
    content: counters(toc-item, '.') '. ';
    color: #999;
}
.toc-container nav ul li a {
    color: var(--body-color);
    font-size: 0.9rem;
}
.toc-container nav ul li a:hover {
    color: var(--accent-color);
}

/* Prev/Next Navigation */
.post-navigation {
    display: flex;
    gap: 30px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.1);
}
.post-navigation .nav-item {
    flex: 1;
    display: flex;
    gap: 15px;
    align-items: center;
}
.post-navigation .nav-item.next {
    text-align: right;
    flex-direction: row-reverse;
}
.post-navigation .nav-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.post-navigation .nav-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.post-navigation .nav-title {
    font-family: var(--headings-font);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--headings-color);
    line-height: 1.3;
}
.post-navigation .nav-title a {
    color: var(--headings-color);
}
.post-navigation .nav-title a:hover {
    color: var(--accent-color);
}

/* === Category Page === */
.category-header {
    text-align: center;
    padding: 40px 0 10px;
}
.category-header h1 {
    font-size: 2rem;
}

/* === Footer === */
#site-footer {
    background: var(--footer-bg);
    color: var(--footer-color);
    padding: 30px 0 0;
}
#copyrights {
    background: var(--copyrights-bg);
    color: var(--copyrights-color);
    text-align: center;
    padding: 15px 0;
    font-size: 0.85rem;
}
#copyrights a {
    color: var(--copyrights-color);
}

/* === Responsive === */
@media (max-width: 960px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    #sidebar {
        order: 2;
    }
}

@media (max-width: 768px) {
    #main-nav { display: none; }
    #main-nav.open {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--submenu-bg);
        border-top: 1px solid rgba(0,0,0,0.1);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        z-index: 99;
    }
    #main-nav.open ul {
        flex-direction: column;
        gap: 0;
        padding: 10px 20px;
    }
    #main-nav.open a {
        display: block;
        padding: 10px 0;
        color: var(--submenu-color);
    }
    #menu-toggle { display: block; }

    .posts-grid {
        grid-template-columns: 1fr;
    }
    .single-header h1 { font-size: 1.6rem; }
    .post-navigation { flex-direction: column; gap: 20px; }
    .post-navigation .nav-item.next { flex-direction: row; text-align: left; }
}

@media (max-width: 480px) {
    .post-card .post-body { padding: 15px; }
    .post-card .post-title { font-size: 1.1rem; }
    .post-card.featured .post-title { font-size: 1.3rem; }
}
