.board-layout {
    --board-accent: var(--tripbora-primary);
    --board-accent-dark: var(--tripbora-primary-hover);
    --board-accent-soft: var(--tripbora-soft);
    --board-border: #e2e8f0;
    --board-text: #172033;
    --board-muted: #64748b;
    display: flex;
    align-items: flex-start;
    gap: 28px;
    width: min(1240px, 100%);
    min-height: 680px;
    margin: 42px auto 64px;
    padding: 0 20px;
    box-sizing: border-box;
}

.board-sidebar {
    position: sticky;
    top: 20px;
    flex: 0 0 220px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--board-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

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

.board-sidebar li + li {
    margin-top: 4px;
}

.board-sidebar a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    box-sizing: border-box;
    border-radius: 11px;
    color: var(--board-muted);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.board-sidebar a:hover {
    background: #f8fafc;
    color: var(--board-text);
}

.board-sidebar a:focus-visible {
    outline: 3px solid rgba(118, 87, 200, 0.24);
    outline-offset: 2px;
}

.board-sidebar a.active {
    background: var(--board-accent-soft);
    color: var(--board-accent-dark);
    font-weight: 750;
}

.board-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 34px 36px 30px;
    border: 1px solid var(--board-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
}

.board-mobile-write-action { display: none; }

.board-list-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 26px;
}

.board-heading {
    min-width: 0;
}

.board-heading-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--board-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.board-heading h1 {
    margin: 0;
    color: var(--board-text);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.2;
}

.board-heading p {
    margin: 10px 0 0;
    color: var(--board-muted);
    font-size: 14px;
    line-height: 1.55;
}

.board-write-btn {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: var(--board-accent);
    box-shadow: 0 4px 10px rgba(118, 87, 200, 0.16);
    color: #fff !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.board-list-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.board-write-btn::before {
    content: "+";
    margin-right: 7px;
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
}

.board-write-btn:hover {
    background: var(--board-accent-dark);
    box-shadow: 0 5px 12px rgba(118, 87, 200, 0.2);
}

.board-write-btn:focus-visible {
    outline: 3px solid rgba(118, 87, 200, 0.28);
    outline-offset: 3px;
}

/* 글쓰기 종류 선택 모달 스타일은 작성폼과 공유하므로 board-write-modal.css 에 둔다. */

.board-sort-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--board-border);
}

.board-sort-button {
    position: relative;
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--board-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.board-sort-button:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: var(--board-text);
}

.board-sort-button:focus-visible {
    outline: 3px solid rgba(118, 87, 200, 0.24);
    outline-offset: 2px;
}

.board-sort-button.active,
.board-sort-button[aria-pressed="true"] {
    border-color: transparent;
    background: #f8fafc;
    color: var(--board-accent-dark);
    font-weight: 750;
}

.board-sort-button.active::after,
.board-sort-button[aria-pressed="true"]::after {
    position: absolute;
    right: 9px;
    bottom: 2px;
    left: 9px;
    height: 2px;
    border-radius: 2px;
    background: var(--board-accent);
    content: "";
}

.board-profile-link {
    color: inherit;
    text-decoration: none;
}

.board-profile-link:hover {
    color: var(--board-accent-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.board-profile-link:focus-visible {
    outline: 2px solid rgba(118, 87, 200, 0.28);
    outline-offset: 2px;
}

.board-list {
    width: 100%;
}

.board-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    min-width: 0;
    padding: 20px 6px;
    border-bottom: 1px solid #edf1f5;
    transition: background-color 150ms ease;
}

.board-list-row:hover {
    background: #fbfdfd;
}

.board-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.board-type {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 28px;
    padding: 4px 9px;
    box-sizing: border-box;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}

.board-type--question {
    background: #eff6ff;
    color: #2563eb;
}

.board-type--tip {
    background: #fff7ed;
    color: #c2410c;
}

.board-title {
    min-width: 0;
    margin: 0;
    color: var(--board-text);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.45;
}

.board-title a {
    display: block;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-title a:hover {
    color: var(--board-accent-dark);
}

.board-title a:focus-visible {
    border-radius: 3px;
    outline: 3px solid rgba(118, 87, 200, 0.22);
    outline-offset: 3px;
}

.board-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-width: 0;
    color: var(--board-muted);
}

.board-meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    font-size: 12px;
    white-space: nowrap;
}

.board-meta-item + .board-meta-item::before {
    content: "·";
    margin-right: 2px;
    color: #cbd5e1;
    font-weight: 700;
}

.board-meta-label {
    color: #94a3b8;
    font-size: 11px;
}

.board-meta-value {
    color: #526078;
    font-weight: 650;
}

.board-nickname {
    max-width: 110px;
}

.board-nickname .board-meta-value {
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-comments .board-meta-value,
.board-bookmarks .board-meta-value {
    color: var(--board-accent-dark);
}

.board-list-empty {
    padding: 72px 20px;
    border-bottom: 1px solid var(--board-border);
    color: var(--board-muted);
    font-size: 14px;
    text-align: center;
}

.board-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 28px;
}

.board-page-button {
    min-width: 76px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.board-page-button:hover:not(:disabled) {
    border-color: var(--board-accent);
    background: var(--board-accent-soft);
    color: var(--board-accent-dark);
}

.board-page-button:focus-visible {
    outline: 3px solid rgba(118, 87, 200, 0.24);
    outline-offset: 2px;
}

.board-page-button:disabled {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
}

.board-page-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 74px;
    color: #94a3b8;
    font-size: 13px;
}

.board-page-status strong {
    color: var(--board-accent-dark);
    font-size: 15px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1100px) {
    .board-list-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .board-meta {
        justify-content: flex-start;
        padding-left: 84px;
    }
}

@media (max-width: 1024px) {
    .board-layout {
        flex-direction: column;
        gap: 18px;
        margin-top: 30px;
    }

    .board-sidebar {
        position: static;
        width: 100%;
        box-sizing: border-box;
    }

    .board-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .board-sidebar li + li {
        margin-top: 0;
    }

    .board-sidebar a {
        padding-right: 16px;
        padding-left: 16px;
    }

    .board-main {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .board-layout {
        padding: 0 16px;
    }

    .board-main {
        padding: 26px 22px;
        border-radius: 18px;
    }

    .board-list-header {
        margin-bottom: 22px;
    }

    .board-heading p {
        max-width: 460px;
    }

    .board-sort-bar {
        justify-content: flex-start;
    }

    .board-list-row {
        padding-right: 2px;
        padding-left: 2px;
    }

    .board-meta {
        flex-wrap: wrap;
        gap: 7px 14px;
        padding-left: 84px;
    }
}

@media (max-width: 480px) {
    .board-layout {
        gap: 12px;
        margin: 20px auto 42px;
        padding: 0 12px;
    }

    .board-sidebar {
        padding: 8px;
        border-radius: 14px;
        overflow: hidden;
    }

    .board-sidebar ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .board-sidebar li {
        flex: 0 0 auto;
    }

    .board-sidebar a {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .board-main {
        padding: 22px 16px;
        border-radius: 16px;
    }

    .board-list-header {
        margin-bottom: 18px;
    }

    .board-heading-kicker {
        font-size: 10px;
    }

    .board-heading h1 {
        font-size: 26px;
    }

    .board-heading p {
        display: none;
    }

    .board-write-btn {
        min-height: 42px;
        padding: 0 14px;
        font-size: 13px;
    }

    .board-list-actions {
        margin-top: 16px;
    }

    .board-sort-bar {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
    }

    .board-sort-button {
        min-width: 0;
        min-height: 42px;
        padding: 0 5px;
        font-size: 12px;
    }

    .board-row-main {
        align-items: flex-start;
        gap: 9px;
    }

    .board-type {
        min-width: 62px;
        min-height: 26px;
        padding-right: 7px;
        padding-left: 7px;
        font-size: 11px;
    }

    .board-title {
        padding-top: 1px;
        font-size: 14px;
    }

    .board-meta {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 7px;
        padding-left: 71px;
    }

    .board-meta-item {
        gap: 3px;
        font-size: 11px;
    }

    .board-meta-label {
        font-size: 10px;
    }

    .board-nickname {
        grid-column: span 3;
        max-width: none;
    }

    .board-date {
        grid-column: span 3;
        min-width: 0;
        overflow: hidden;
    }

    .board-date .board-meta-value {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .board-views,
    .board-comments,
    .board-bookmarks {
        grid-column: span 2;
    }

    .board-pagination {
        gap: 8px;
        padding-top: 22px;
    }

    .board-page-button {
        min-width: 68px;
        min-height: 44px;
    }

    .board-page-status {
        min-width: 58px;
    }
}

/* Smartphone feed; tablet and desktop retain the existing board layout. */
@media (max-width: 600px) {
    .board-layout {
        min-height: 0;
        gap: 20px;
        margin: 12px auto 36px;
        padding: 0 16px;
        background: #fff;
    }

    .board-sidebar {
        flex: 0 0 auto;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .board-sidebar ul {
        flex-wrap: nowrap;
        gap: 18px;
        overflow-x: auto;
        scrollbar-width: none;
        border-bottom: 1px solid #edf1f5;
    }

    .board-sidebar ul::-webkit-scrollbar,
    .board-sort-bar::-webkit-scrollbar { display: none; }

    .board-sidebar li { flex: 0 0 auto; }

    .board-sidebar a,
    .board-sidebar a:hover,
    .board-sidebar a.active {
        min-height: 42px;
        padding: 0;
        border-radius: 0;
        border-bottom: 2px solid transparent;
        background: transparent;
        font-size: 12px;
        white-space: nowrap;
    }

    .board-sidebar a.active { border-bottom-color: var(--board-accent); }

    .board-main {
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .board-list-header { margin-bottom: 16px; position: relative; }
    .board-main:has(.board-mobile-write-action) .board-heading { padding-right: 88px; }
    .board-mobile-write-action { display: block; position: absolute; top: 0; right: 0; }
    .board-mobile-write-action .board-write-btn {
        min-height: 40px;
        padding: 0 10px;
        border: 0;
        border-radius: 4px;
        background: linear-gradient(#f5f1fc, #f5f1fc) center / 100% 32px no-repeat;
        box-shadow: none;
        color: var(--tripbora-primary) !important;
        font-size: 12px;
        gap: 4px;
    }
    .board-mobile-write-action .board-write-btn::before { font-size: 15px; }
    .board-list-actions { display: none; }
    .board-heading-kicker { display: none; }
    .board-heading h1 { font-size: 24px; }
    .board-heading p { display: none; }

    .board-sort-bar {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 20px;
        padding: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .board-sort-button,
    .board-sort-button:hover,
    .board-sort-button.active,
    .board-sort-button[aria-pressed="true"] {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        font-size: 11px;
    }

    .board-sort-button.active::after,
    .board-sort-button[aria-pressed="true"]::after { right: 0; left: 0; bottom: 0; height: 1px; }

    .board-list-row,
    .board-list-row:hover {
        position: relative;
        display: block;
        padding: 15px 0;
        background: transparent;
        transition: none;
    }

    .board-row-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    .board-type {
        min-width: 0;
        min-height: 0;
        padding: 0;
        border-radius: 0;
        background: transparent;
        color: var(--board-muted);
        font-size: 11px;
        font-weight: 400;
        line-height: 20px;
    }

    .board-title {
        width: 100%;
        padding: 0;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.5;
    }
    .board-title a {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .board-title a::after { position: absolute; inset: 0; content: ""; }
    .board-profile-link { position: relative; z-index: 1; }

    .board-meta {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0 8px;
        margin-top: 8px;
        padding: 0;
    }
    /* An empty flex line keeps reaction counts together beneath writer/date. */
    .board-meta::before { content: ""; order: 1; flex-basis: 100%; height: 0; }
    .board-meta-item { grid-column: auto; gap: 3px; font-size: 11px; line-height: 1.5; }
    .board-meta-item::before { display: none; }
    .board-nickname { max-width: min(170px, calc(100% - 112px)); }
    .board-nickname .board-meta-label { display: none; }
    .board-date { overflow: visible; }
    .board-date .board-meta-value { font-size: 0; }
    .board-date .board-meta-value::after { content: attr(data-mobile-date); font-size: 11px; }
    .board-date::before { display: inline !important; content: "·"; }
    .board-meta-label { font-size: 11px; color: var(--board-muted); }
    .board-meta-value,
    .board-comments .board-meta-value,
    .board-bookmarks .board-meta-value { color: var(--board-muted); font-weight: 400; }

    .board-views,
    .board-comments,
    .board-bookmarks {
        order: 2;
        margin-top: 4px;
        font-size: 10px;
    }
    .board-views .board-meta-label,
    .board-comments .board-meta-label,
    .board-bookmarks .board-meta-label { font-size: 10px; }
    .board-comments::before,
    .board-bookmarks::before { display: inline; font-weight: 400; }

    .board-list-empty { padding: 32px 0; font-size: 13px; }
    .board-pagination { gap: 10px; padding-top: 22px; }
    .board-page-button { min-width: 62px; min-height: 37px; border-radius: 6px; font-size: 12px; }
    .board-page-button:disabled { border-color: #f1f5f9; background: transparent; }
    .board-page-status { min-width: 58px; font-size: 12px; }
    .board-page-status strong { font-size: 13px; }
}
