/* ============================================================
   jnl_unified.css — Journal design unified with Connect
   Overrides style5_min.css to match Connect visual language
   Updated 2026-03-31: Figma sidebar layout + Lesson Journal redesign
   ============================================================ */

:root {
    --brand-color: #00D2C2;
    --cnt-brand: #00D2C2;
    --cnt-brand-dark: #00B8AA;
    --cnt-bg: #f5f7f7;
    --cnt-card-bg: #fff;
    --cnt-radius: 12px;
    --cnt-radius-sm: 8px;
    --cnt-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --cnt-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.10);
    --cnt-border: #e0e3e2;
    --cnt-text: #3f4342;
    --cnt-text-sub: #878b8a;
    --cnt-text-light: #878b8a;
    --cnt-text-tertiary: #626262;
    --cnt-inactive: #abafae;
    --cnt-transition: 0.2s ease;
    --liked-color: #FF4081;
}

/* ── Reset old layout ── */
body {
    background-color: var(--cnt-bg);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hide old header/sidebar/footer — replaced by shared + new classes */
header:not(.shared-header) { display: none; }
.sidebar { display: none !important; }
footer:not(.shared-footer) { display: none; }

/* ── 1. Layout — Sidebar + Content ── */
.jnl-layout {
    display: flex;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 16px 0;
    flex: 1;
    gap: 0;
}

/* ── 2. Left Sidebar ── */
.jnl-sidebar {
    width: 180px;
    flex-shrink: 0;
    padding-top: 12px;
    position: sticky;
    top: 60px;
    align-self: flex-start;
    height: fit-content;
}

.jnl-sidebar-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 4px;
    border-radius: var(--cnt-radius-sm);
    font-size: 16px;
    font-weight: 400;
    color: var(--cnt-inactive);
    text-decoration: none;
    transition: all var(--cnt-transition);
    white-space: nowrap;
}

.jnl-sidebar-tab:hover {
    color: var(--cnt-text);
    background: rgba(0, 0, 0, 0.03);
}

.jnl-sidebar-tab.active {
    color: var(--brand-color);
    font-weight: 600;
}

.jnl-sidebar-tab svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.jnl-sidebar-tab.active svg {
    opacity: 1;
    color: var(--brand-color);
}

/* ── 3. Mobile Horizontal Tabs (hidden on desktop) ── */
.jnl-mode-tabs {
    display: none;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.jnl-mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cnt-text-light);
    background: var(--cnt-card-bg);
    border: 1px solid var(--cnt-border);
    text-decoration: none;
    transition: all var(--cnt-transition);
    white-space: nowrap;
}

.jnl-mode-tab:hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
}

.jnl-mode-tab.active {
    background: var(--brand-color);
    color: #fff;
    border-color: var(--brand-color);
}

/* ── 4. Main Content Area ── */
.jnl-main-content {
    flex: 1;
    min-width: 0;
    padding: 0 0 32px;
}

/* Remove old main-container sidebar layout */
.main-container {
    display: block !important;
    padding-left: 0 !important;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.main-content {
    padding: 0 !important;
}

/* ── 5. Post Cards — match Connect ── */
.feed-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
}

.post-item {
    background: var(--cnt-card-bg);
    border: none;
    border-radius: var(--cnt-radius);
    box-shadow: var(--cnt-shadow);
    margin-bottom: 12px;
    padding: 20px;
    cursor: pointer;
    transition: box-shadow var(--cnt-transition);
}

.post-item:hover {
    box-shadow: var(--cnt-shadow-lg);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.post-author-link .author-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;
}

.post-images {
    border-radius: 8px;
    overflow: hidden;
}

.post-image {
    border-radius: 8px;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-start;
    margin-top: 12px;
    padding-top: 10px;
    color: var(--cnt-text-sub);
    font-size: 13px;
}

.post-footer .icon {
    width: 18px;
    height: 18px;
    opacity: 0.5;
}

/* ── Post Meta (author name + date column) ── */
.post-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.post-meta .author-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-color);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.post-meta .author-name:hover {
    text-decoration: underline;
}

.post-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--cnt-text-sub);
}

/* ── Post Content ── */
.post-content {
    margin-bottom: 10px;
}

.post-content p {
    font-size: 18px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--cnt-text);
    margin: 0;
    word-break: break-word;
    white-space: normal;
}

/* ── Post Image Grid — match Connect ── */
.jnl-post-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.jnl-post-images.jnl-img-count-1 {
    grid-template-columns: 1fr;
}

.jnl-post-images.jnl-img-count-3 {
    grid-template-columns: 1fr 1fr;
}

.jnl-img-item {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.jnl-post-images.jnl-img-count-1 .jnl-img-item {
    padding-top: 56%;
}

.jnl-img-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jnl-img-item.jnl-img-more::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

.jnl-img-extra {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    z-index: 2;
}

/* ── 6. Like Button — pink when liked (Figma) ── */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 13px;
    color: var(--cnt-text-sub);
    transition: color 0.2s;
}

.like-btn:hover {
    color: var(--cnt-text);
}

.like-btn svg,
.comment-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Heart toggle: empty by default, filled when liked */
.like-btn .icon-heart-filled {
    display: none;
}

.like-btn .icon-heart-empty {
    display: inline;
    opacity: 0.5;
}

.like-btn.liked .icon-heart-filled {
    display: inline;
    opacity: 1;
    color: var(--liked-color);
}

.like-btn.liked .icon-heart-empty {
    display: none;
}

.like-btn.liked {
    color: var(--liked-color);
}

/* ── Comment Link ── */
.comment-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--cnt-text-sub);
}

.comment-link svg {
    opacity: 0.5;
}

/* ── 7. Lesson Journal — Figma 703/710 redesign ── */

/* Header wrap — Figma: avatar + title/desc + Edit Title btn */
.lesson-header-wrap {
    margin-bottom: 20px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* 背景画像がある場合の半透明オーバーレイ */
.lesson-header-wrap[style*="background-image"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.35) 100%);
    z-index: 1;
}

.lesson-header-wrap[style*="background-image"] .lesson-header-top {
    position: relative;
    z-index: 2;
}

.lesson-header-wrap[style*="background-image"] .lesson-header-text h2,
.lesson-header-wrap[style*="background-image"] .lesson-header-text .lesson-description {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.lesson-header-wrap[style*="background-image"] .lesson-edit-title-btn {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.lesson-header-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
}

.lesson-header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.lesson-header-text {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

.lesson-header-text h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--cnt-text);
    margin: 0 0 6px;
}

.lesson-header-text .lesson-description {
    margin-bottom: 0;
}

/* Legacy compat */
.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.lesson-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--cnt-text);
    margin: 0;
}

.lesson-edit-title-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border: 1px solid var(--cnt-border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--cnt-text);
    background: var(--cnt-card-bg);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--cnt-transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.lesson-edit-title-btn:hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
}

/* 背景画像あり時の Edit Title ボタン */
.lesson-header-wrap[style*="background-image"] .lesson-edit-title-btn {
    color: #fff;
    background: rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.6);
    text-shadow: none;
}
.lesson-header-wrap[style*="background-image"] .lesson-edit-title-btn:hover {
    background: rgba(0,0,0,0.55);
    border-color: #fff;
    color: #fff;
}

.lesson-description {
    font-size: 15px;
    color: var(--cnt-text-sub);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* スマホ: ヘッダーを縦積みにしてテキスト全文を表示 */
@media (max-width: 600px) {
    .lesson-header-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        padding: 14px 12px;
    }
    .lesson-header-avatar {
        width: 56px;
        height: 56px;
    }
    .lesson-header-text h2 {
        font-size: 18px;
    }
    .lesson-header-text .lesson-description {
        font-size: 13px;
    }
    .lesson-edit-title-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
}

/* Teal-bordered quote box — clickable to open post writer */
.lesson-quote-box {
    border: 1px solid var(--brand-color);
    border-radius: var(--cnt-radius);
    padding: 20px 24px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 210, 194, 0.03);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.lesson-quote-box:hover {
    background: rgba(0, 210, 194, 0.08);
    box-shadow: 0 2px 8px rgba(0, 210, 194, 0.15);
}

.lesson-quote-box svg {
    flex-shrink: 0;
    color: var(--brand-color);
    opacity: 0.6;
}

a.lesson-quote-box {
    text-decoration: none;
    color: inherit;
}

.lesson-quote-box p {
    font-size: 14px;
    color: var(--cnt-text-sub);
    line-height: 1.6;
    margin: 0;
}

/* ── Write Post Modal (iframe) ── */
.write-post-modal {
    max-width: 480px;
    margin: 0 auto;
    padding: 28px 28px 24px;
}

.write-post-modal h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-color);
    text-align: center;
    margin-bottom: 20px;
}

.write-post-modal .form-group {
    margin-bottom: 14px;
}

.write-post-modal input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 15px;
    font-weight: 600;
    color: var(--cnt-text);
    font-family: inherit;
    box-sizing: border-box;
    background: #fafafa;
    transition: border-color var(--cnt-transition);
}

.write-post-modal input[type="text"]:focus {
    outline: none;
    border-color: var(--brand-color);
    background: #fff;
}

.write-post-modal input[type="text"]::placeholder {
    color: var(--cnt-inactive);
    font-weight: 400;
}

.write-post-modal textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 14px;
    color: var(--cnt-text);
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    background: #fafafa;
    transition: border-color var(--cnt-transition);
}

.write-post-modal textarea:focus {
    outline: none;
    border-color: var(--brand-color);
    background: #fff;
}

.write-post-modal textarea::placeholder {
    color: var(--cnt-inactive);
}

.write-post-photo-group {
    margin-top: 4px;
    margin-bottom: 8px;
}

.write-post-photo-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.write-post-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.write-preview-item {
    position: relative;
    width: 56px;
    height: 56px;
}

.write-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--cnt-border);
}

.write-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.write-post-modal .publish-status-box {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.write-post-modal .publish-status-box div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.write-post-modal .publish-status-box input[type="radio"] {
    accent-color: var(--brand-color);
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.write-post-modal .publish-status-box label {
    font-size: 14px;
    color: var(--cnt-text);
    cursor: pointer;
}

.write-post-modal .form-actions {
    text-align: center;
    margin-top: 20px;
}

.write-post-modal .btn-post {
    display: inline-block;
    width: 100%;
    padding: 14px 0;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--cnt-transition);
}

.write-post-modal .btn-post:not(:disabled) {
    background: var(--brand-color);
    color: #fff;
}

.write-post-modal .btn-post:not(:disabled):hover {
    background: var(--cnt-brand-dark);
}

.write-post-modal .btn-post:disabled {
    background: #e0e0e0;
    color: var(--cnt-text-sub);
    cursor: not-allowed;
}

/* ── Feed Card — For You / Following (Figma) ── */
.feed-card.post-item {
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius);
    padding: 20px 24px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.feed-card.post-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.feed-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.feed-card-author-link img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.feed-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-color);
    text-decoration: none;
}

.feed-card-name:hover {
    text-decoration: underline;
}

.feed-card-body {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.feed-card-body .lesson-text-col p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--cnt-text);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-card-body .post-footer {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}

/* Lesson Journal entry — Figma: card style */
.lesson-entry.post-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius);
    box-shadow: none;
    cursor: pointer;
    transition: box-shadow 0.2s;
    margin-bottom: 12px;
    background: #fff;
}

.lesson-entry:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Figma: date number ~48px bold teal, month ~14px teal uppercase */
.lesson-date-col {
    text-align: center;
    flex-shrink: 0;
    width: 64px;
    padding-top: 2px;
}

.lesson-date-num {
    font-size: 48px;
    font-weight: 700;
    color: var(--brand-color);
    line-height: 1;
}

.lesson-date-month {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-color);
    text-transform: uppercase;
    margin-top: 4px;
}

.lesson-text-col {
    flex: 1;
    min-width: 0;
}

/* Figma: 14px/400 dark text, 4-line clamp */
.lesson-text-col p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--cnt-text);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lesson-text-col .post-footer {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
    font-size: 14px;
}

/* Figma: thumbnail ~120x90, 8px radius */
.lesson-thumb-col {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: var(--cnt-radius-sm);
    overflow: hidden;
}

.lesson-thumb-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Only me badge on lesson entry */
.lesson-entry .onlyme-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--cnt-text-sub);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* Draft entry styling */
.lesson-entry.lesson-draft {
    opacity: 0.6;
}

.lesson-entry.lesson-draft .lesson-date-num,
.lesson-entry.lesson-draft .lesson-date-month {
    color: var(--cnt-text-sub);
}

/* ── 8. Journal Title Edit Modal — Figma 710 ── */
.title-edit-modal {
    max-width: 420px;
    margin: 0 auto;
    padding: 28px 28px 24px;
}

.title-edit-modal h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--brand-color);
    text-align: center;
    margin-bottom: 20px;
}

/* Avatar upload in title edit modal */
.title-edit-avatar-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.title-edit-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    display: block;
}

.title-edit-avatar-placeholder {
    background: #f5f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-edit-avatar-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-color);
    color: #fff;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.title-edit-avatar-btn:hover {
    background: var(--cnt-brand-dark);
}

/* Photo attachment row in title edit modal */
.title-edit-photo-group {
    margin-top: 4px;
    margin-bottom: 8px;
}

.title-edit-photo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.title-edit-photo-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--cnt-border);
}

.title-edit-photo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px dashed var(--cnt-border);
    border-radius: 8px;
    background: none;
    color: var(--cnt-text-sub);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--cnt-transition);
}

.title-edit-photo-btn:hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
}

.title-edit-modal .form-group {
    margin-bottom: 14px;
}

.title-edit-modal input[type="text"],
.title-edit-modal textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius-sm);
    font-size: 14px;
    color: var(--cnt-text);
    font-family: inherit;
    transition: border-color var(--cnt-transition);
    box-sizing: border-box;
    background: #fafafa;
}

.title-edit-modal input[type="text"]::placeholder,
.title-edit-modal textarea::placeholder {
    color: var(--cnt-inactive);
}

.title-edit-modal input[type="text"]:focus,
.title-edit-modal textarea:focus {
    outline: none;
    border-color: var(--brand-color);
    background: #fff;
}

.title-edit-modal textarea {
    min-height: 100px;
    resize: vertical;
}

.title-edit-modal .form-actions {
    text-align: center;
    margin-top: 20px;
}

.title-edit-modal .btn-post {
    display: inline-block;
    width: 100%;
    padding: 14px 0;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--cnt-transition);
}

.title-edit-modal .btn-post:disabled,
.title-edit-modal .btn-post.disabled {
    background: #e0e0e0;
    color: var(--cnt-text-sub);
    cursor: not-allowed;
}

.title-edit-modal .btn-post:not(:disabled) {
    background: var(--brand-color);
    color: #fff;
}

.title-edit-modal .btn-post:not(:disabled):hover {
    background: var(--cnt-brand-dark);
}

/* ── 9. Post Write Modal — Figma post editor ── */

/* Post write modal card */
.form-container {
    max-width: 480px;
    margin: 0 auto;
}

/* Textarea — Figma: clean white, large */
.form-container textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 1px solid var(--cnt-border);
    border-radius: var(--cnt-radius);
    font-size: 15px;
    line-height: 1.7;
    color: var(--cnt-text);
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.form-container textarea:focus {
    outline: none;
    border-color: var(--brand-color);
}

/* Section labels — Figma: teal, 14px, 600 */
.form-container .form-group > div:first-child,
.form-container .attachment-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Attachment progress bar — Figma: teal bar */
.progress-bar-container {
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--brand-color);
    border-radius: 2px;
    transition: width 0.3s;
}

/* Attachment size text */
.attachment-size-text {
    font-size: 12px;
    color: var(--cnt-text-sub);
    margin-left: auto;
}

/* Attachment thumbnails — Figma: 72x72, rounded, grid */
.attachment-preview-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.attachment-preview-item {
    width: 72px;
    height: 72px;
    border-radius: var(--cnt-radius-sm);
    overflow: hidden;
    position: relative;
}

.attachment-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-add-btn {
    width: 72px;
    height: 72px;
    border-radius: var(--cnt-radius-sm);
    border: 1px dashed var(--cnt-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: var(--cnt-inactive);
    transition: all var(--cnt-transition);
}

.attachment-add-btn:hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
}

/* Publish status — Figma: radio buttons vertical */
/* Form modal container */
.modal-content-container {
    background: #fff;
    border-radius: 16px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

.publish-status-box {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin: 16px 0;
}

.publish-status-box div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.publish-status-box input[type="radio"] {
    accent-color: var(--brand-color);
    width: 18px;
    height: 18px;
}

.publish-status-box label {
    font-size: 15px;
    font-weight: 500;
    color: var(--cnt-text);
    cursor: pointer;
}

/* Post button — Figma: full-width, teal, pill shape */
.form-actions .button,
.form-container button[type="submit"] {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 16px auto 0;
    padding: 14px 0;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--brand-color);
    cursor: pointer;
    transition: background var(--cnt-transition);
}

.form-actions .button:hover,
.form-container button[type="submit"]:hover {
    background: var(--cnt-brand-dark);
}

/* Success toast — Figma: centered card with check icon */
.post-success-toast {
    text-align: center;
    padding: 32px 24px;
}

.post-success-toast .success-icon {
    font-size: 48px;
    color: var(--brand-color);
    margin-bottom: 12px;
}

.post-success-toast p {
    font-size: 16px;
    font-weight: 600;
    color: var(--cnt-text);
    margin: 0 0 20px;
}

.post-success-toast .btn-done {
    display: inline-block;
    padding: 12px 48px;
    border: none;
    border-radius: 24px;
    background: var(--brand-color);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--cnt-transition);
}

.post-success-toast .btn-done:hover {
    background: var(--cnt-brand-dark);
}

/* ── 10. Post Detail Modal — Figma: single-column card ── */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
}

.modal[style*="display: block"],
.modal[style*="display:block"] {
    display: flex !important;
}

.modal-content {
    position: relative;
    flex-direction: column !important;
    max-width: 520px !important;
    width: 92% !important;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    background: #fff;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Single column: post view full-width, no side border */
.modal-post-view {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--cnt-border);
    padding: 24px;
    padding-right: 48px;
    overflow-y: visible;
    min-height: auto !important;
    box-sizing: border-box;
}

.modal-comments-view {
    width: 100% !important;
    padding: 16px 24px 24px;
    overflow-y: visible;
    max-height: none;
    box-sizing: border-box;
}

/* Modal header — Figma: avatar + name(teal) + date + category */
.modal-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.modal-post-header {
    display: flex;
    align-items: center;
}

.modal-post-header .post-author-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.modal-post-header .post-author-link .author-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.modal-post-header .post-author-link .author-name {
    display: flex;
    flex-direction: column;
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-color);
    line-height: 1.3;
}

.modal-post-header .post-createDt {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--cnt-text-sub);
}

.modal-edit-link {
    font-size: 13px;
    color: var(--brand-color);
    text-decoration: underline;
    flex-shrink: 0;
    margin-left: auto;
}

/* Modal post body — Figma: 15px weight 400 */
.modal-post-view .post-content p,
.modal-post-view .post-text {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--cnt-text);
}

/* Modal images — carousel */
.modal-post-view .post-images,
.modal-post-view .jnl-post-images {
    margin: 12px 0;
}

.modal-post-view .post-image-carousel-track {
    gap: 0;
}

.modal-post-view .post-image-carousel-track img {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 8px;
}

.post-image-carousel {
    position: relative;
    overflow: hidden;
}

.post-image-carousel-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.post-image-carousel-track::-webkit-scrollbar {
    display: none;
}

.post-image-carousel-track img {
    flex: 0 0 calc(50% - 4px);
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .post-image-carousel-track img {
        flex: 0 0 100%;
    }
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    border: 1px solid #ddd;
    font-size: 16px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    color: #333;
    user-select: none;
}

.carousel-arrow:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.carousel-arrow-left {
    left: 4px;
}

.carousel-arrow-right {
    right: 4px;
}

/* Modal engagement row — Figma: heart + comment icons with counts */
.modal-post-view .post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 0;
    border-top: none;
    font-size: 14px;
}

.modal-post-view .like-btn,
.modal-post-view .comment-link {
    font-size: 14px;
    font-weight: 400;
    color: var(--cnt-text-sub);
}

/* Modal comments */
.modal-comments-view .comment-item,
.modal-comments-view .comment-box {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cnt-text);
}

.modal-comments-view .comment-item:last-child {
    border-bottom: none;
}

.modal-comments-view .comment-header {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.modal-comments-view .comment-body {
    font-size: 14px;
    margin-bottom: 6px;
}

.modal-comments-view .comment-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}

.modal-comments-view .comment-actions .action-link {
    color: #888;
    text-decoration: none;
    font-size: 13px;
}

.modal-comments-view .comment-actions .action-link:hover {
    color: var(--brand-color);
}

.modal-comments-view .reply-list {
    margin-left: 20px;
    margin-top: 4px;
}

.modal-comments-view .reply-item {
    padding: 8px 0;
    border-bottom: 1px solid #f8f8f8;
    font-size: 13px;
}

.modal-comments-view .reply-item:last-child {
    border-bottom: none;
}

.modal-comments-view .reply-form-container {
    margin-left: 20px;
    margin-top: 8px;
}

.modal-comments-view .reply-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-comments-view .reply-form textarea {
    flex: 1;
    border: 1px solid var(--cnt-border, #e0e3e2);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    resize: none;
    min-height: 36px;
    max-height: 80px;
    font-family: inherit;
}

.modal-comments-view .reply-form button[type="submit"] {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--brand-color, #00D2C2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.modal-comments-view .comment-author-link,
.modal-comments-view .reply-author-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.modal-comments-view .comment-author-link .author-img,
.modal-comments-view .reply-author-link .author-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.modal-comments-view .comment-author-link .author-name,
.modal-comments-view .reply-author-link .author-name {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-color);
    line-height: 1.3;
}

.modal-comments-view .comment_or_reply_dt {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--cnt-text-sub);
}

.modal-comments-view .comment-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-color);
}

.modal-comments-view .comment-date {
    font-size: 12px;
    color: var(--cnt-text-sub);
}

.modal-comments-view .no-comments,
.modal-comments-view > p {
    font-size: 15px;
    color: var(--cnt-text-sub);
    padding: 16px 0;
}

/* Comment input — Figma: pill input + teal send button */
.comment-form-container {
    border-top: 1px solid var(--cnt-border);
    padding: 12px 0 0;
    margin-top: 8px;
}

/* Comment form update — teal send button */
.comment-form-container form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    /* border-top: 1px solid var(--cnt-border); */
}

.comment-form-container form > div {
    width: 100%;
}

.comment-form-container textarea {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--cnt-border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    resize: none;
    min-height: 36px;
    max-height: 80px;
    font-family: inherit;
    color: var(--cnt-text);
    box-sizing: border-box;
}

.comment-form-container textarea:focus {
    outline: none;
    border-color: var(--brand-color);
}

.comment-form-container button[type="submit"] {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--brand-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.comment-form-container button[type="submit"]:hover {
    background: var(--cnt-brand-dark);
}

/* ── 11. Responsive ── */
@media (min-width: 744px) {
    /* Desktop: show sidebar, hide mobile tabs */
    .jnl-sidebar {
        display: block;
    }
    .jnl-mode-tabs {
        display: none !important;
    }
}

@media (max-width: 743px) {
    /* Mobile: hide sidebar, show horizontal tabs */
    .jnl-layout {
        flex-direction: column;
        padding: 12px 10px 0;
    }

    .jnl-sidebar {
        display: none;
    }

    .jnl-mode-tabs {
        display: flex !important;
        gap: 6px;
        margin-bottom: 12px;
        padding: 0 4px;
    }

    .jnl-main-content {
        padding: 0 0 24px;
    }

    /* Old sidebar override for mobile */
    .main-container {
        flex-direction: column !important;
        padding-left: 0 !important;
    }

    /* Lesson Journal responsive */
    .lesson-header h2 {
        font-size: 20px;
    }

    .feed-card {
        padding: 16px 18px;
    }

    .feed-card-body {
        gap: 14px;
    }

    .lesson-entry {
        gap: 14px;
        padding: 16px 18px;
    }

    .lesson-date-col {
        width: 52px;
    }

    .lesson-date-num {
        font-size: 36px;
    }

    .lesson-date-month {
        font-size: 12px;
    }

    .lesson-thumb-col {
        width: 100px;
        height: 75px;
    }
}

@media (max-width: 480px) {

    .publish-status-box { gap:10px; }

    .jnl-mode-tab {
        padding: 6px 12px;
        font-size: 12px;
    }

    .post-item {
        padding: 16px;
        border-radius: 8px;
    }

    .lesson-thumb-col {
        width: 80px;
        height: 60px;
    }

    .lesson-date-num {
        font-size: 30px;
    }
}
