/*
 * Yotsuba Theme Stylesheet
 * Authentic 4chan Yotsuba Color Palette & Typography
 */

html {
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body.yotsuba {
    background-color: #FFFFEE;
    color: #000000;
    font-family: arial, helvetica, sans-serif;
    font-size: 10pt;
    margin: 0;
    padding: 8px 12px;
}

/* Links */
a {
    color: #34345C;
    text-decoration: none;
}

a:hover {
    color: #DD0000;
    text-decoration: underline;
}

/* Navigation Bar */
.board-nav {
    font-size: 9pt;
    text-align: center;
    padding: 3px 0 8px 0;
    color: #89A;
}

.board-nav a {
    color: #34345C;
    margin: 0 1px;
}

/* Header */
.header {
    text-align: center;
    margin: 10px 0 15px 0;
}

.board-title {
    color: #AF0A0F;
    font-family: Tahoma, sans-serif;
    font-size: 24pt;
    font-weight: bold;
    margin: 0;
    letter-spacing: -1px;
}

.board-title a {
    color: #AF0A0F;
}

.board-subtitle {
    color: #000000;
    font-size: 9pt;
    margin-top: 4px;
}

.header-divider, .section-divider, .thread-divider {
    border: 0;
    height: 1px;
    background-color: #D9BFB7;
    margin: 15px 0;
}

/* Layout Wrapper (Content Area + Right Sidebar) */
.layout-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.content-area {
    flex: 1;
    min-width: 0; /* Prevents flex children from overflowing */
}

/* Threads & Posts */
.thread-container {
    margin-bottom: 25px;
    clear: both;
}

.return-link {
    margin-bottom: 12px;
    font-size: 10pt;
}

.post {
    margin-bottom: 8px;
    word-break: break-word;
}

.op-post {
    display: block;
    clear: both;
}

.post-header {
    margin-bottom: 4px;
    line-height: 1.4;
}

.post-board {
    font-weight: bold;
    color: #34345C;
}

.post-title {
    color: #0F0C5D;
    font-weight: bold;
    margin-right: 6px;
}

.post-title a.post-board-link {
    color: #0F0C5D;
    font-weight: bold;
}

.post-name {
    color: #117743;
    font-weight: bold;
    margin-right: 6px;
    white-space: nowrap;
}

.post-date {
    color: #000;
    font-size: 9pt;
    margin-right: 6px;
    white-space: nowrap;
}

.post-num {
    white-space: nowrap;
}

.post-num a {
    color: #000;
}

.post-num a:hover {
    color: #DD0000;
}

.post-view-thread {
    margin-left: 6px;
    font-size: 9pt;
}

.file-info {
    font-size: 9pt;
    margin-bottom: 4px;
    color: #444;
}

.file-info a {
    color: #34345C;
    font-weight: bold;
}

.file-container {
    float: left;
    margin: 2px 16px 8px 0;
}

.post-thumb {
    max-width: 250px;
    max-height: 250px;
    border: none;
    cursor: pointer;
    vertical-align: top;
}

.reply-post .post-thumb {
    max-width: 125px;
    max-height: 125px;
}

.post-thumb.expanded {
    max-width: 100%;
    max-height: none;
}

.post-media-player {
    max-width: 400px;
    max-height: 300px;
    display: block;
    margin-top: 4px;
}

.post-audio-player {
    display: block;
    margin-top: 4px;
    width: 300px;
}

.file-badge {
    background: #F0E0D6;
    border: 1px solid #D9BFB7;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 9pt;
}

.file-icon {
    font-size: 16pt;
}

.post-body {
    line-height: 1.35;
    margin: 6px 0 10px 0;
}

.comment-reply-btn-box {
    margin-top: 6px;
    font-size: 9pt;
}

.clear-post {
    clear: both;
    height: 0;
    overflow: hidden;
}

.btn-reply, .btn-reply-link {
    background: transparent;
    border: none;
    color: #34345C;
    font-size: 9pt;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-weight: bold;
}

.btn-reply:hover, .btn-reply-link:hover {
    color: #DD0000;
    text-decoration: underline;
}

/* Omitted Posts */
.omitted-notice {
    color: #707070;
    font-size: 9pt;
    margin: 8px 0 10px 15px;
}

.omitted-notice a {
    color: #707070;
    font-weight: bold;
}

/* Replies (Level 2 & Level 3) */
.replies-wrapper {
    margin-top: 10px;
    clear: both;
}

.comment-tree {
    margin-bottom: 12px;
}

.reply-container {
    display: table;
    margin: 4px 0;
    clear: both;
}

.reply-arrow {
    float: left;
    color: #D9BFB7;
    margin-right: 4px;
    font-family: monospace;
    padding-top: 2px;
}

.reply-post {
    display: table;
    background-color: #F0E0D6;
    border: 1px solid #D9BFB7;
    padding: 5px 10px;
    margin-left: 18px;
    min-width: 420px;
    max-width: 95%;
}

/* Level 3: Nested Reply-to-Reply */
.reply-nested {
    margin-left: 36px;
    border-left: 2px solid #D9BFB7;
    padding-left: 4px;
}

.tree-reply-bar {
    margin: 4px 0 10px 36px;
    font-size: 8.5pt;
}

/* Markdown & Formatting */
.greentext {
    color: #789922;
}

.quote-link {
    color: #D00;
}

.quote-link:hover {
    color: #800000;
}

code {
    background: #E8D4C8;
    color: #333;
    padding: 1px 4px;
    font-family: monospace;
    font-size: 9pt;
    border-radius: 2px;
}

/* Target post highlight */
:target {
    background-color: #F8E8DE !important;
    outline: 2px solid #800000;
}

/* Post Form (Below Threads) */
.post-form-box {
    background: #F0E0D6;
    border: 1px solid #D9BFB7;
    padding: 12px 18px;
    margin: 20px auto;
    max-width: 600px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.05);
}

.post-form-title {
    color: #800000;
    font-weight: bold;
    font-size: 11pt;
    margin-bottom: 10px;
    border-bottom: 1px solid #D9BFB7;
    padding-bottom: 4px;
}

.post-table {
    border-collapse: collapse;
    width: 100%;
}

.post-table td {
    padding: 4px 6px;
    vertical-align: top;
}

.field-label {
    background: #EA8;
    color: #800000;
    font-weight: bold;
    border: 1px solid #800000;
    padding: 3px 8px !important;
    width: 80px;
    text-align: right;
    font-size: 9pt;
}

.input-text, .input-file {
    font-family: inherit;
    font-size: 9pt;
    padding: 3px 6px;
    border: 1px solid #AAA;
    background: #FFF;
    width: 280px;
}

.textarea-box {
    font-family: inherit;
    font-size: 10pt;
    padding: 4px;
    border: 1px solid #AAA;
    background: #FFF;
    width: 100%;
    max-width: 450px;
    resize: vertical;
}

.required-badge {
    color: #800000;
    font-size: 8.5pt;
    font-weight: bold;
    margin-left: 4px;
}

.file-hint {
    font-size: 8pt;
    color: #555;
    margin-top: 3px;
}

.btn-submit {
    background: #EA8;
    border: 1px solid #800000;
    color: #800000;
    font-weight: bold;
    font-size: 9.5pt;
    padding: 4px 14px;
    cursor: pointer;
}

.btn-submit:hover {
    background: #f0c090;
}

.btn-reset-reply {
    background: transparent;
    border: 1px solid #AAA;
    color: #555;
    font-size: 8.5pt;
    padding: 3px 8px;
    margin-left: 8px;
    cursor: pointer;
}

/* Right Sidebar */
.sidebar-right {
    width: 260px;
    flex-shrink: 0;
    align-self: flex-start;
}

.sidebar-section {
    background: #F0E0D6;
    border: 1px solid #D9BFB7;
    margin-bottom: 15px;
    padding: 8px 10px;
    font-size: 9pt;
}

.sidebar-header {
    background: #EA8;
    color: #800000;
    font-weight: bold;
    padding: 3px 6px;
    border: 1px solid #800000;
    margin: -8px -10px 8px -10px;
    font-size: 9pt;
}

.sidebar-subtext {
    font-size: 8pt;
    color: #555;
    margin-bottom: 6px;
}

.sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-links li {
    margin-bottom: 4px;
}

.sidebar-links a {
    font-weight: bold;
    color: #34345C;
}

.sidebar-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-post-list li {
    padding: 3px 0;
    border-bottom: 1px dashed #D9BFB7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-anchor-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-post-title {
    color: #000;
}

.sidebar-anchor-link:hover .sidebar-post-title {
    color: #DD0000;
}

.sidebar-board-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-board-list li {
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted #D9BFB7;
}

.sidebar-board-count {
    color: #555;
    font-size: 8pt;
}

.sidebar-empty {
    color: #777;
    font-style: italic;
    font-size: 8.5pt;
}

/* Pagination */
.pagination {
    text-align: center;
    margin: 20px 0;
    font-size: 10pt;
}

.page-link, .page-current {
    margin: 0 4px;
    padding: 2px 6px;
}

.page-current {
    font-weight: bold;
    color: #800000;
}

/* Bottom Full Board List (4 Columns) */
.full-board-list-box {
    margin: 20px auto;
    max-width: 950px;
    background: #F0E0D6;
    border: 1px solid #D9BFB7;
    padding: 12px 18px;
}

.board-list-title {
    color: #800000;
    font-size: 12pt;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #D9BFB7;
    padding-bottom: 4px;
}

.board-columns-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.board-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.board-column li {
    padding: 3px 0;
    border-bottom: 1px dotted #D9BFB7;
    font-size: 9pt;
}

.board-desc {
    color: #555;
    font-size: 8.5pt;
}

/* Bottom New Board Form */
.new-board-box {
    margin: 20px auto;
    max-width: 600px;
    background: #F0E0D6;
    border: 1px solid #D9BFB7;
    padding: 12px 18px;
}

.new-board-title {
    color: #800000;
    font-size: 12pt;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #D9BFB7;
    padding-bottom: 4px;
}

.new-board-table {
    border-collapse: collapse;
    width: 100%;
}

.new-board-table td {
    padding: 4px 6px;
    vertical-align: top;
}

.field-hint {
    font-size: 8pt;
    color: #555;
    margin-left: 6px;
}

.footer-bottom {
    text-align: center;
    font-size: 8.5pt;
    color: #777;
    margin: 20px 0 10px 0;
}

/* Notice box */
.notice-box {
    background: #F0E0D6;
    border: 1px dashed #800000;
    padding: 15px;
    text-align: center;
    margin: 20px 0;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 850px) {
    .layout-wrapper {
        flex-direction: column-reverse;
    }
    .sidebar-right {
        width: 100%;
        position: static;
    }
    .board-columns-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
