/* static/css/coustory.css */


/* Global styles */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
    background-color: #f5f5f5;
}

/* Header / Subnav / Layout */
.csb-header {
    background-color: #343a40;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.csb-header a {
    color: #fff;
    text-decoration: none;
}

.csb-header a:hover {
    text-decoration: underline;
}

.csb-header a.btn,
.csb-header a.btn:hover {
    text-decoration: none;
}

.csb-subnav {
    border-bottom: 1px solid #f1f3f5;
    background-color: #fafafa;
}

.csb-subnav .nav-link.active {
    font-weight: 600;
}

.csb-container {
    max-width: 1100px;
}

footer {
    font-size: 0.8rem;
    color: #666;
}

.csb-footer {
    background-color: #f8f9fa;
}

.csb-footer .csb-footer-link {
    color: #6c757d;
    text-decoration: none;
}

.csb-footer .csb-footer-link:hover {
    text-decoration: underline;
}

/* Small UI / Badges / Meta */
.tag-pill {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 999px;
    background-color: #e9ecef;
    margin-right: 4px;
}

.csb-post-meta {
    font-size: 0.75rem;
    color: #6c757d;
}

.post-warning {
    font-size: 0.75rem;
    color: #adb5bd;
}

/* Basic IP tone (for comments/replies) */
.post-ip {
    color: #adb5bd;
    font-size: 0.78rem;
}

/* Nickname tooltip */
.nickname-tooltip {
    --bs-tooltip-bg: #4ca94dff;
    --bs-tooltip-color: #fff;

    font-size: 0.75rem;
    padding: 4px 8px;
}

.csb-list-toolbar .btn-group .btn {
    min-width: 32px;
}

.csb-category-group .btn {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.csb-search input::placeholder {
    color: #adb5bd;
    opacity: 1;
}

/* Captcha / Labels / Header user */
input[name="captcha_1"] {
    border: 1px solid #ced4da;
    border-radius: 0.2rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

input[name="captcha_1"]:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.csb-label-required,
.csb-label-optional {
    font-size: 0.8rem;
}

.csb-header-user {
    font-size: 0.8rem;
    line-height: 1.2;
}

.csb-header-user-main {
    font-weight: 600;
}

.csb-header-user-meta {
    font-size: 0.7rem;
    color: #ced4da;
}

.csb-header .btn-sm,
.csb-header .btn-sm:focus {
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    box-shadow: none;
}

/* Password group */
.csb-password-group {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    overflow: hidden;
}

.csb-password-group .form-control,
.csb-password-group .csb-password-toggle {
    border: 0;
    box-shadow: none;
}

.csb-password-group:focus-within {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Toggle button is defined only once */
.csb-password-group .csb-password-toggle {
    padding: 0.15rem 0.4rem;
    background-color: #fff;
}

.csb-password-group .csb-password-toggle:hover,
.csb-password-group .csb-password-toggle:focus {
    background-color: #fff;
    color: inherit;
}

/* Post list table / title area */
.csb-post-table {
    table-layout: fixed;
    width: 100%;
}

/* Title link (left: title/comment count, right: center/job) */
.csb-post-title-link {
    display: flex;
    align-items: center;
    max-width: 100%;
    font-size: 0.85rem;
    color: #333333;
    text-decoration: none;
}

.csb-post-title-link:visited {
    color: #770088;
}

.csb-post-title-link:hover {
    text-decoration: none;
}

.csb-post-title-link:hover .csb-post-title-text {
    text-decoration: underline;
}

.csb-post-title-main {
    flex: 1 1 auto;
    min-width: 0; /* ellipsis 위해 필수 */
    display: flex;
    align-items: baseline;
}

/* List meta-right (center/job) */
.csb-post-meta-right {
    margin-left: auto;
    display: flex;
    align-items: baseline;
}

/* Title text (ellipsis applied) */
.csb-post-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csb-post-comment-count {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #979797;
}

.csb-post-center,
.csb-post-job {
    flex: 0 0 auto;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.csb-post-job {
    margin-left: 0.35rem;
}

.csb-post-writer {
    max-width: 140px;
    font-size: 0.75rem;
    text-align: center;
}

.csb-writer-wrap {
    display: inline-flex;
    align-items: baseline;
    max-width: 100%;
}

.csb-writer-name {
    flex: 1 1 auto;
    min-width: 0;
}

.csb-text-ellipsis {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* List writer IP is slightly darker */
.csb-writer-ip {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

/* Comment write box */
.csb-comment-write-box {
    background-color: #fafafa;
    border-color: #becbd9;
    border-width: 1px;
    border-style: solid;
}

.csb-comment-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    color: #6c757d;
}

.csb-nickname-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 999px;
    background-color: #f1f3f5;
    border: 1px solid #dee2e6;
}

textarea.form-control.csb-comment-textarea {
    min-height: 110px;
    resize: vertical;
    font-size: 0.9rem;
}

.csb-comment-textarea::placeholder {
    color: #979797;
    opacity: 1;
    font-size: 0.85rem;
}

/* Comment / Reply list (1-depth) */
.csb-comment-row {
    padding: 4px 4px;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
}

/* Common: one-line layout */
.csb-comment-line {
    display: flex;
    align-items: flex-start; /* 기본은 top 정렬 */
    gap: 4px;
    font-size: 0.8rem;
    padding: 4px 0px;
}

/* Nickname */
.csb-col-nick {
    width: 140px;
    min-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

/* Content */
.csb-col-content {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.4;
}

/* Date */
.csb-col-date {
    width: 120px;
    text-align: right;
    font-size: 0.78rem;
    color: #868e96;
}

/* Action area */
.csb-col-actions {
    width: 140px;
    text-align: right;
    font-size: 0.78rem;
    color: #868e96;
}

.csb-col-actions a {
    color: #868e96;
    text-decoration: none;
}

.csb-col-actions a:hover {
    text-decoration: underline;
}

.csb-comment-vote-group .btn {
    font-size: 0.7rem;
    padding-top: 0;
    padding-bottom: 0;
}

/* hover */
.csb-comment-row:hover .csb-comment-line {
    background-color: #f1f3f5;
}

/* Reply block */
.csb-reply-block-li {
    border-bottom: none;
    padding: 0px 4px 6px;
}

.csb-reply-block {
    margin-left: 0px;
    margin-right: 0px;
    background-color: #f1f3f5;
    padding: 0;
    border: 0.5px solid #d8dfe6;
}

/* Reply row (both new and legacy classes supported) */
.csb-comment-reply-row,
.csb-comment-reply {
    border-bottom: 1px solid #d8dfe6;
    padding: 4px 4px;
}

/* Reply row: prevent duplicate padding in .csb-comment-line */
.csb-comment-reply-row .csb-comment-line,
.csb-comment-reply .csb-comment-line {
    padding: 0;
}

.csb-comment-reply-row:last-child,
.csb-comment-reply:last-child {
    border-bottom: none;
}

.csb-reply-arrow {
    display: inline-block;
    margin-right: 4px;
    color: #868e96;
}

/* reply block hover */
.csb-reply-block:hover {
    background-color: #eef2f7;
}

/* Comment delete popover */
.csb-delete-popover {
    position: absolute;
    z-index: 2000;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.20);
    font-size: 0.8rem;
    max-width: 260px;
    width: 260px;
}

.csb-delete-popover-header {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.csb-delete-popover p {
    margin-bottom: 6px;
    font-size: 0.78rem;
}

.csb-delete-popover-arrow {
    position: absolute;
    top: -6px;
    right: 6px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-top: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    transform-origin: center;
    transform: rotate(45deg);
}

.csb-comment-deleting {
    background-color: #fff3cd !important;
}

.csb-comment-deleting .csb-comment-line {
    background-color: #fff3cd !important;
}

/* Overlay delete error */
.csb-delete-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

.csb-delete-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: auto;
}

.csb-delete-error-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 260px;
    max-width: 360px;
    background: #222;
    color: #fff;
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    text-align: center;
}

/* Icon buttons / toolbar links */
.csb-icon-btn {
    border: none !important;
    background: transparent !important;
    padding: 0;
    line-height: 1;
}

.csb-icon-btn:focus,
.csb-icon-btn:active {
    outline: none;
    box-shadow: none;
}

.csb-icon-link {
    text-decoration: none;
}

.csb-icon-link:hover {
    text-decoration: none;
}

.csb-comment-toolbar .csb-comment-link,
.csb-comment-toolbar .csb-comment-link:link,
.csb-comment-toolbar .csb-comment-link:visited,
.csb-comment-toolbar .csb-comment-link:hover,
.csb-comment-toolbar .csb-comment-link:focus,
.csb-comment-toolbar .csb-comment-link:active {
    font-weight: bold;
    text-decoration: none !important;
    color: #000 !important;
}

.csb-reply-to-name {
    color: #7799DD;
    font-weight: 400;
    margin-right: 4px;
    white-space: nowrap;
}

/* Editor drop active */
#id_content.csb-editor-drop-active {
    outline: 2px dashed #0d6efd;
    outline-offset: 2px;
    background-color: rgba(13, 110, 253, 0.03);
}

/* Post detail - scoped */
.csb-post-head {
    padding-bottom: 8px;
    padding-left: 8px;
    padding-right: 8px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.10);
}

.csb-post-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.csb-post-title {
    font-weight: 700;
    line-height: 1.3;
}

.csb-post-stats {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    color: #6c757d;
    white-space: nowrap;
}

.csb-post-stats strong {
    color: #212529;
    font-weight: 700;
}

.csb-post-meta-row {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6c757d;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.csb-post-meta-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* 상세 전용 meta-right */
.csb-post-meta-row .csb-post-meta-right {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 0;
}

.csb-post-meta-row .csb-post-meta-right .csb-stat + .csb-stat::before {
    content: "|";
    color: #adb5bd;
    margin: 0 10px;
}

.csb-stat strong {
    color: #212529;
    font-weight: 700;
}

.csb-meta-dot {
    color: #adb5bd;
}

.csb-writer strong {
    color: #212529;
}

/* Post detail meta IP color - slightly darker */
.csb-post-meta-row .post-ip {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Action bar */
.csb-post-actionbar {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.csb-action-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Button set */
.csb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #fff;
    color: #212529;
    padding: 4px 10px;
    font-size: 0.85rem;
    border-radius: 4px;
    text-decoration: none;
    line-height: 1.2;
}

.csb-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.csb-btn-blue {
    border-color: rgba(13, 110, 253, 0.35);
    color: #0d6efd;
}

.csb-btn-red {
    border-color: rgba(220, 53, 69, 0.35);
    color: #dc3545;
}

.csb-btn-gray {
    border-color: rgba(108, 117, 125, 0.35);
    color: #6c757d;
}

.csb-btn-outline {
    border-color: rgba(0, 0, 0, 0.15);
    color: #212529;
}

.csb-btn-outline-red {
    border-color: rgba(220, 53, 69, 0.35);
    color: #dc3545;
}

.csb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* bottom nav */
.csb-detail-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 2px solid rgba(0, 0, 0, 0.10);
}

.csb-detail-bottom-left,
.csb-detail-bottom-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 429 message/general error area: reserve minimum height */
#csbPostEditLockMsg,
#csbPostEditError,
#csbPostDeleteLockMsg,
#csbPostDeleteError {
    min-height: 1.25rem;
}

@media (max-width: 576px) {
    .csb-detail-bottom-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .csb-detail-bottom-left,
    .csb-detail-bottom-right {
        justify-content: flex-start;
    }
}

.bi-x-square-fill {
    color: #adb5bd;
}

/* Regardless of sorting/filtering, "read posts" are displayed the same */
.csb-post-title-link.csb-read,
.csb-post-title-link.csb-read:visited {
    color: #770088;
}

/* Brand: CouStory (Story letters colored) */
.csb-brand {
  text-decoration: none;
}

.csb-brand-story {
  letter-spacing: 0.2px;
}

.csb-brand-story .csb-s1 { color: #e98281; } /* S */
.csb-brand-story .csb-s2 { color: #D8382E; } /* t */
.csb-brand-story .csb-s3 { color: #EA9C2A; } /* o */
.csb-brand-story .csb-s4 { color: #95BC44; } /* r */
.csb-brand-story .csb-s5 { color: #55A6DA; } /* y */

/* Slightly more prominent (optional) */
.csb-brand-story span {
  text-shadow: 0 0 0.01px rgba(0,0,0,0.01); /* Cleaner rendering */
}

.csb-brand-story span { opacity: 0.95; }

/*  Brand Story hover animation (CouStory) */

/* If motion reduction is preferred, disable animations */
@media (prefers-reduced-motion: reduce) {
  .csb-brand-story,
  .csb-brand-story span {
    transition: none !important;
    animation: none !important;
  }
}

/* Basic: Smooth transition only on Story letters */
.csb-brand-story span {
  display: inline-block;
  transition: transform 180ms ease, filter 180ms ease;
  transform-origin: 50% 70%;
}

/* hover 시: CouStory 전체가 살짝 떠오르고 */
.csb-brand:hover .csb-brand-story {
  display: inline-block;
  transform: translateY(-1px);
  transition: transform 180ms ease;
}

/* hover 시: Story 글자들이 반짝반짝 애니메이션 */
.csb-brand:hover .csb-brand-story span {
  animation: csb-story-sparkle 900ms ease-in-out infinite;
  /* filter: drop-shadow(0 0 6px rgba(255,255,255,0.15)); */
}

/* Brand link underline off (only CouStory logo) */
.csb-brand,
.csb-brand:hover,
.csb-brand:focus,
.csb-brand:active {
  text-decoration: none !important;
}

.csb-brand:hover .csb-s1 { animation-delay: 0ms; }
.csb-brand:hover .csb-s2 { animation-delay: 70ms; }
.csb-brand:hover .csb-s3 { animation-delay: 140ms; }
.csb-brand:hover .csb-s4 { animation-delay: 210ms; }
.csb-brand:hover .csb-s5 { animation-delay: 280ms; }

/* Core animation: very subtle scale + rotate */
@keyframes csb-story-sparkle {
  0%   { transform: translateY(0) scale(1); }
  50%  { transform: translateY(-2px) scale(1.1) rotate(-2deg); }
  100% { transform: translateY(0) scale(1); }
}

/* Share icons: icon + label set */
.csb-share-item{
  background: transparent;
  border: 0;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.csb-share-item:hover{
  filter: brightness(0.98);
}

.csb-share-label{
  font-size: 12px;
  line-height: 1;
  color: #6c757d; /* Bootstrap text-muted */
}

/* Circular button */
.csb-share-circle{
  width:56px;height:56px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  border:0;
  transition: transform 120ms ease, filter 120ms ease;
}

.csb-share-item:hover .csb-share-circle{
  transform: translateY(-4px);
}

/* Kakao image */
.csb-share-kakao{
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.csb-share-icon-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* X / Facebook */
.csb-share-x{ background:#111; color:#fff; font-weight:800; }
.csb-share-facebook{ background:#1877F2; color:#fff; font-size:32px; font-weight:900; }

/* Vote button border thickness */
.csb-vote-btn{
  border-width: 2px;
  width:72px;
  height:72px;
}

/* (optional) Keep the same on hover/active */
.csb-vote-btn:hover,
.csb-vote-btn:active,
.csb-vote-btn:focus{
  border-width: 2px;
}

/* Disabled state (remove after development) */
.csb-share-item:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== post_detail 본문 이미지 잘림 방지 ===== */
.csb-post-content img,
.toastui-editor-contents img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0.5rem auto;
}

/* (선택) 아주 긴 표/코드도 모바일에서 잘림 방지 */
.csb-post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.csb-post-content pre {
  overflow: auto;
}

.csb-license-text{
  text-align: justify;
  text-align-last: left;      /* 마지막 줄 과도한 벌어짐 방지 */
  hyphens: auto;              /* 영문 줄바꿈 자연스럽게 */
  overflow-wrap: anywhere;    /* URL/긴 토큰 안전 */
  line-height: 1.65;
  word-break: normal;
}

.csb-license-text ol {
  margin-top: 0.25rem;
}

.csb-license-text li {
  overflow-wrap: anywhere;
}

.csb-comment-pager .page-link {
  color: var(--bs-green);
  border-color: var(--bs-green);
}

.csb-comment-pager .page-item.active .page-link {
  background-color: var(--bs-green);
  border-color: var(--bs-green);
  color: #fff;
}

/* 개인정보처리방침 표 가독성 */
.csb-privacy-table th,
.csb-privacy-table td {
  vertical-align: top;
}

.csb-privacy-table td {
  line-height: 1.35;
}

/* 법적 문서용 테이블(약관/운영/개인정보 공통) */
.csb-legal-table th,
.csb-legal-table td {
  vertical-align: top;
}

.csb-legal-col-a { width: 22%; }
.csb-legal-col-b { width: 22%; }

/* =============================
   글 작성/수정: 이미지 업로드 진행상황 UI
   ============================= */
.csb-img-progress {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1085;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.75rem;
  padding: 0.6rem 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  min-width: 220px;
  max-width: 340px;
  display: none;
}

.csb-img-progress.show {
  display: block;
}

.csb-img-progress-bar {
  height: 0.35rem;
}

.csb-img-progress-bar::-webkit-progress-bar {
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
}

.csb-img-progress-bar::-webkit-progress-value {
  background-color: var(--bs-primary);
  border-radius: 999px;
}

.csb-img-progress-bar::-moz-progress-bar {
  background-color: var(--bs-primary);
  border-radius: 999px;
}