@charset "UTF-8";

/* =========================================================================
   Imports & Base Font Sizing
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;900&display=swap&subset=japanese');
@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@200;500;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css');

html {
    scroll-behavior: smooth;
    font-size: 62.5%;
    /* 1rem = 10px */
}

/* =========================================================================
   Base Layout & Typography
   ========================================================================= */
body {
    background-color: #dad6cd !important;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(255, 255, 255, 0.2) 3px, rgba(255, 255, 255, 0.2) 4px);
    background-attachment: fixed;
    color: #333;
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    margin: 0;
    line-height: 1.8;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    font-size: 1.4rem;
}

/* --- Emoji Fix --- */
img.emoji {
    height: 1.25em !important;
    width: 1.25em !important;
    margin: 0 .05em 0 .1em !important;
    vertical-align: -0.15em !important;
}

/* --- Links --- */
a {
    color: #333;
    text-decoration: none;
    font-weight: 700;
}

a:hover {
    color: #8c8c88;
    transition: all 0.2s ease;
}

/* --- Header --- */
.pageheader {
    padding: 3rem 1rem 1rem;
    text-align: center;
    background: transparent;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 3rem;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

header h2 {
    margin: 1rem 0 0;
    text-decoration: underline wavy #8c8c88;
    font-size: 1.2rem;
    color: #666;
    font-weight: normal;
}

/* --- Desktop Layout Grid --- */
.container {
    display: grid !important;
    grid-template-columns: 200px 1fr 240px !important;
    grid-template-areas: "sidebar1 main sidebar2" !important;
    gap: 3.5rem !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 3rem 2rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.box1 {
    grid-area: sidebar1 !important;
}

.main {
    grid-area: main !important;
    min-width: 0 !important;
}

.box2 {
    grid-area: sidebar2 !important;
}

/* --- Articles (Card Design) --- */
article,
.tegalog_body {
    background: #eceae3;
    padding: 2.5rem;
    margin-bottom: 4rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: none !important;
}

.post_title,
.tegalog_date,
.onelog_date {
    font-size: 1.6rem;
    font-weight: bold;
    background: #8c8c88;
    color: #fff;
    padding: 12px 25px;
    margin: -2.5rem -2.5rem 2.5rem -2.5rem;
    width: calc(100% + 5rem);
    box-sizing: border-box;
    border-radius: 4px 4px 0 0;
    line-height: 1.4;
    border: none !important;
}

.content,
.tegalog_text,
.comment-body {
    line-height: 1.8;
    color: #333;
    font-size: 1.35rem;
    /* Readable font size */
}

/* Hide internal tags from text body */
.content .taglink,
.tegalog_text .taglink,
.comment-body .taglink {
    display: none !important;
}

/* --- "Read More" & "View Body" Buttons --- */
article .comment a.readmorebutton,
article .comment a.readmore,
.passkeysubmit {
    display: inline-block !important;
    background: #555 !important;
    color: #fff !important;
    padding: 0 20px !important;
    /* Height is set by height/line-height */
    height: 38px !important;
    line-height: 38px !important;
    border-radius: 6px !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer;
    vertical-align: middle !important;
    transition: background 0.2s !important;
}

article .comment a.readmorebutton,
article .comment a.readmore {
    margin-top: 1.5rem !important;
}

article .comment a.readmorebutton:hover,
article .comment a.readmore:hover,
.passkeysubmit:hover {
    background: #333 !important;
}

/* Password Form Clean-up & Alignment */
.passkeyform {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 2rem !important;
}

.passkeybox {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

.passkeyinput {
    border: 1px solid #ccc !important;
    padding: 0 12px !important;
    border-radius: 4px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    height: 38px !important;
    /* Exactly matching button height */
    font-size: 1.2rem !important;
}



/* --- Tag Styles (Softer shade) --- */
.footer_left a,
.footer_left ul li a,
.taglink,
.tag-list-wrapper a {
    display: inline-block;
    background: #b0aeaa !important;
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1.1rem;
    text-decoration: none !important;
    font-weight: bold;
    transition: all 0.2s ease;
}

.footer_left a:hover,
.footer_left ul li a:hover,
.taglink:hover,
.tag-list-wrapper a:hover {
    background: #8c8c88 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* --- Article Footer --- */
div.onelogfooter,
footer.onelogfooter {
    display: block;
    background-color: #e0ded6;
    padding: 10px 25px;
    margin: 2.5rem -2.5rem -2.5rem -2.5rem;
    width: calc(100% + 5rem);
    box-sizing: border-box;
}

.footer_line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer_left ul {
    display: inline;
    padding: 0;
    margin: 0;
    list-style: none;
}

.footer_left li {
    display: inline-block;
    margin-right: 8px;
}

/* New! Badge Fix: Hide if empty to prevent "weird black line" */
.newsign:empty {
    display: none !important;
}

.newsign {
    display: inline-block;
    background-color: #555 !important;
    color: #fff !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    margin-right: 1.5rem !important;
}

.footer_right {
    text-align: right;
    color: #555;
    font-size: 1.1rem;
}

/* =========================================================================
   Sidebar Styles
   ========================================================================= */
aside h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    border-bottom: 2px solid #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
}

.box1 .category-list-wrapper {
    margin-bottom: 4rem !important;
}

.box1 .category-list-wrapper a,
.box1 ul.cattree li a {
    font-size: 1.3rem;
    color: #333;
    font-weight: 600 !important;
    /* Bold font */
    padding: 4px 0;
    display: inline-block;
    /* Required for transform */
    transition: all 0.2s ease;
    text-decoration: none;
}

.box1 ul.cattree li {
    display: block !important;
    margin: 0;
    padding: 0;
}

.box1 .category-list-wrapper a:hover,
.box1 ul.cattree li a:hover {
    color: #8c8c88;
    transform: translateX(2px);
    /* Subtle indentation */
}


/* Sidebar Item Spacing */
.sidebar-item {
    display: block !important;
    margin-bottom: 2rem !important;
    /* Slightly reduced overall */
}

/* Specific Compact Spacing (for TOP/HOME) */
.compact-item {
    margin-bottom: 0.4rem !important;
}



/* Right Sidebar Fixes */
.box2 .side section,
.box2 .side nav,
.box2 .side form {
    margin-bottom: 2rem;
}

/* Archives Radio Buttons (Restore Visibility) */
.box2 input[type="radio"] {
    display: inline-block !important;
    appearance: auto !important;
    /* Force browser default radio look */
    -webkit-appearance: radio !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
    width: auto !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
}

.box2 form label {
    display: block !important;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    font-weight: 400 !important;
    cursor: pointer;
}

.box2 .search-container {
    background: #fff;
    border: 1px solid #333;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    height: 34px;
    margin-bottom: 1.5rem;
}

.search-input {
    border: none;
    padding: 0 12px;
    flex: 1;
    outline: none;
    font-size: 1.2rem;
    width: 60%;
}

.search-btn {
    background: #dcdcdc;
    border: none;
    padding: 0 14px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Floating/Round Link Button (Restored Design) */
.newpost {
    margin-top: 3rem;
    text-align: left;
}

.newpost a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: #000 !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    text-decoration: none !important;
}

.newpost a i {
    font-size: 20px !important;
}

/* --- Word Count --- */
.word-count-info {
    display: block;
    width: fit-content;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 1.25rem;
    font-weight: 400 !important;
    margin-top: 1.2rem;
    margin-bottom: 2.5rem;
}

/* --- Site Footer --- */
body>footer {
    background-color: #000;
    color: #fff;
    padding: 0.6rem 1rem;
    text-align: center;
    font-size: 1.1rem;
    margin-top: auto;
    width: 100%;
}

body>footer p {
    display: inline;
    margin: 0;
    padding: 0;
    color: #fff !important;
}

body>footer a {
    display: inline-block;
    color: #fff !important;
    margin-left: 10px;
    vertical-align: middle;
}

/* Global Hiding */
.searchtarget,
.limitedsearch,
.dateseparator,
.num {
    display: none !important;
}

/* =========================================================================
   Mobile Optimization
   ========================================================================= */
@media screen and (max-width: 960px) {
    .container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-areas: "main main" "sidebar1 sidebar2" !important;
        gap: 1.5rem !important;
        padding: 1.5rem !important;
        width: 100% !important;
    }

    .main {
        grid-area: main !important;
        margin-bottom: 2rem !important;
        width: 100% !important;
    }

    .box1,
    .box2 {
        display: block !important;
        width: 100% !important;
        padding: 1.5rem 0 !important;
        border-top: 1px solid #ccc !important;
    }

    .box1 {
        grid-area: sidebar1 !important;
    }

    .box2 {
        grid-area: sidebar2 !important;
    }

    article,
    .tegalog_body {
        display: flow-root !important;
        background: #eceae3 !important;
        padding: 0 !important;
        margin-bottom: 3.5rem !important;
        border: none !important;
        border-radius: 4px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
        overflow: visible !important;
    }



    .content,
    .tegalog_text,
    .comment-body {
        font-size: 1.05rem !important;
        padding: 0 2rem 2rem !important;
    }

    div.onelogfooter,
    footer.onelogfooter {
        margin: 0 !important;
        width: 100% !important;
        padding: 8px 15px !important;
        background: #e0ded6 !important;
        font-size: 0.8rem !important;
        border-radius: 0 0 4px 4px !important;
    }

    .post_title,
    .tegalog_date,
    .onelog_date {
        margin: 0 !important;
        width: 100% !important;
        padding: 1.2rem 1.5rem !important;
        font-size: 1.2rem !important;
        border-radius: 4px 4px 0 0 !important;
        box-sizing: border-box !important;
        /* Ensure padding doesn't cause overflow */
    }
}