.kdrama-community {
    max-width: 860px;
    margin: 0 auto;
}

.kdrama-community__header h1 {
    margin-bottom: 0.5rem;
}

.kdrama-community__banner {
    width: 100%;
    max-height: 3cm;
    height: 2.9cm;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(13, 110, 253, 0.18);
    background: #0b1220;
}

.kdrama-community__banner-track {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 2px;
}

.kdrama-community__banner-item {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: block;
    overflow: hidden;
    position: relative;
}

.kdrama-community__banner-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 45%;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    transition: transform 0.35s ease, filter 0.35s ease;
}

.kdrama-community__banner-item:hover img,
.kdrama-community__banner-item:focus-visible img {
    transform: translateZ(0) scale(1.05);
    filter: brightness(0.88);
}

.kdrama-community__banner-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 0.2rem 0.3rem;
    background: rgba(8, 12, 20, 0.82);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.kdrama-community__banner-item:hover .kdrama-community__banner-caption,
.kdrama-community__banner-item:focus-visible .kdrama-community__banner-caption {
    opacity: 1;
    transform: translateY(0);
}

/* 3ª e 6ª slide: soggetto spesso più in basso nel poster */
.kdrama-community__banner-item:nth-child(3) img,
.kdrama-community__banner-item:nth-child(6) img {
    object-position: center 85%;
}

.kdrama-rules {
    position: relative;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border: 1px solid rgba(13, 110, 253, 0.25);
    border-radius: 8px;
    background: #f0f7ff;
}

.kdrama-rules__pin {
    position: absolute;
    left: 0.85rem;
    top: 0.85rem;
    font-size: 1.1rem;
    line-height: 1;
}

.kdrama-rules__title {
    color: #0d47a1;
    font-weight: 700;
}

.kdrama-rules__list {
    padding-left: 1.15rem;
    font-size: 0.875rem;
    color: #333;
    line-height: 1.45;
}

.kdrama-rules__list li + li {
    margin-top: 0.25rem;
}

.kdrama-spoiler {
    display: block;
    margin: 0.35rem 0;
}

.kdrama-spoiler__toggle {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    line-height: 1.2;
}

.kdrama-spoiler__content {
    display: block;
    margin-top: 0.35rem;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    background: #fff8e6;
    border: 1px dashed rgba(0, 0, 0, 0.15);
}

.kdrama-spoiler__content[hidden] {
    display: none !important;
}

.kdrama-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.kdrama-category-filter__link {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #333;
    text-decoration: none;
    background: #fff;
}

.kdrama-category-filter__link:hover,
.kdrama-category-filter__link.is-active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    text-decoration: none;
}

.kdrama-category-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2em 0.45em;
    background: #6c757d;
}

.kdrama-category-badge--generale { background: #6c757d; }
.kdrama-category-badge--drama { background: #0d6efd; }
.kdrama-category-badge--spoiler { background: #fd7e14; }
.kdrama-category-badge--fanart { background: #6f42c1; }
.kdrama-category-badge--casting { background: #20c997; }

.kdrama-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.kdrama-tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
}

.kdrama-tag:hover {
    background: #dee2e6;
    text-decoration: none;
}

.kdrama-thread--pinned .kdrama-thread__row {
    background: #fffbeb;
}

.kdrama-thread__pin {
    flex: 0 0 auto;
    font-size: 0.75rem;
    line-height: 1;
}

.kdrama-thread__category {
    flex: 0 0 auto;
    font-size: 0.65rem;
}

.kdrama-active-filter {
    color: #6c757d;
}

.kdrama-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.kdrama-list-toolbar--top {
    justify-content: space-between;
}

.kdrama-list-toolbar__actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.75rem;
    flex-shrink: 0;
}

.kdrama-new-post-link {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.8125rem;
    padding: 0.25rem 0.65rem;
    line-height: 1.25;
}

.kdrama-list-toolbar--bottom {
    margin-top: 0.65rem;
    margin-bottom: 0;
}

.kdrama-search {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.kdrama-search__group {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}

.kdrama-search__input {
    width: 11rem;
    max-width: 42vw;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

.kdrama-search__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.45rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.kdrama-pagination {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 0.25rem;
}

.kdrama-search__icon {
    display: block;
}

.kdrama-search__clear {
    padding: 0.15rem 0.35rem;
    font-size: 0.8125rem;
    text-decoration: none;
}

.kdrama-pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.4rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    font-size: 0.8125rem;
    line-height: 1;
    color: #0d6efd;
    text-decoration: none;
    background: #fff;
}

.kdrama-pagination__link:hover {
    background: #f0f7ff;
    text-decoration: none;
}

.kdrama-pagination__link.is-active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: 600;
}

.kdrama-thread-list {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.kdrama-thread {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.kdrama-thread:last-child {
    border-bottom: 0;
}

.kdrama-thread__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.65rem;
    min-height: 0;
    line-height: 1.25;
    font-size: 0.875rem;
}

.kdrama-thread__row:hover {
    background: #f8f9fa;
}

.kdrama-thread.is-open .kdrama-thread__row {
    background: #f0f7ff;
}

.kdrama-thread__author {
    flex: 0 0 6.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kdrama-thread__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
    font-size: 0.8125rem;
}

.kdrama-thread__activity {
    flex: 0 0 auto;
    font-size: 0.7rem;
    color: #6c757d;
    white-space: nowrap;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kdrama-thread__count {
    flex: 0 0 auto;
    font-size: 0.65rem;
    padding: 0.15em 0.45em;
    line-height: 1.2;
}

.kdrama-thread__toggle {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    line-height: 1.2;
}

.kdrama-thread__body {
    padding: 0.5rem 0.65rem;
    background: #fafafa;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.kdrama-thread__body[hidden] {
    display: none !important;
}

@media (max-width: 576px) {
    .kdrama-thread__row {
        flex-wrap: wrap;
        gap: 0.25rem 0.4rem;
        padding: 0.35rem 0.55rem;
    }

    .kdrama-thread__author {
        flex: 1 1 40%;
    }

    .kdrama-thread__title {
        flex: 1 1 100%;
        order: 3;
    }

    .kdrama-thread__activity {
        order: 4;
        flex: 1 1 auto;
        max-width: none;
    }

    .kdrama-thread__count {
        order: 2;
    }

    .kdrama-thread__toggle {
        margin-left: auto;
    }
}

.kdrama-post__comment,
.kdrama-reply__comment {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.875rem;
    line-height: 1.4;
}

.kdrama-post__thumb-btn {
    position: relative;
    display: inline-block;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 0;
    cursor: zoom-in;
}

.kdrama-post__thumb {
    display: block;
    max-width: 48px;
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kdrama-post__thumb-btn:hover .kdrama-post__thumb,
.kdrama-post__thumb-btn:focus .kdrama-post__thumb {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: #0d6efd;
}

.kdrama-post__thumb-zoom {
    position: absolute;
    right: 2px;
    bottom: 2px;
    font-size: 9px;
    line-height: 1;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 4px;
    padding: 2px 4px;
    pointer-events: none;
}

.kdrama-replies {
    border-left: 2px solid #0d6efd;
    padding-left: 0.65rem;
}

.kdrama-community .kdrama-replies {
    margin-top: 0.45rem !important;
}

.kdrama-reply--depth-2 {
    margin-left: 0.45rem;
}

.kdrama-reply--depth-3,
.kdrama-reply--depth-4,
.kdrama-reply--depth-5 {
    margin-left: 0.75rem;
}

.kdrama-post__comment--deleted {
    font-style: italic;
}

.kdrama-reply {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.4rem;
}

.kdrama-reply:last-child {
    margin-bottom: 0;
}

.kdrama-post__title {
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1.25;
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.kdrama-reply__thread-title {
    margin-top: -0.25rem;
}

.kdrama-reply-banner__thread {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: rgba(0, 0, 0, 0.75);
}

.kdrama-reply-banner__title {
    font-weight: 600;
}

.kdrama-reply-banner__excerpt {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.65);
    font-style: italic;
    line-height: 1.4;
}

.kdrama-compose-actions {
    margin-top: 0.25rem;
}

.kdrama-reply-banner .kdrama-reply-cancel {
    display: none !important;
}

#kdrama-compose-cancel[hidden] {
    display: none !important;
}

#kdrama-new-post-form.kdrama-form--reply #kdrama-compose-cancel,
#kdrama-new-post-form.kdrama-form--edit #kdrama-compose-cancel {
    display: inline-block !important;
}

#kdrama-new-post-form.kdrama-form--reply #kdrama-compose-cancel[hidden],
#kdrama-new-post-form.kdrama-form--edit #kdrama-compose-cancel[hidden] {
    display: none !important;
}

.kdrama-edit-banner .kdrama-edit-cancel {
    display: none !important;
}

.kdrama-compose-actions .btn-primary + .btn-primary {
    margin-left: 0;
}

.kdrama-reply-banner {
    margin-bottom: 0;
}

.kdrama-reply-banner .btn-link,
.kdrama-reply-banner .btn-outline-secondary {
    white-space: nowrap;
}

.kdrama-reply-form {
    background: #f0f7ff;
    border-radius: 8px;
    padding: 1rem;
}

.kdrama-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100050;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.kdrama-lightbox[hidden] {
    display: none !important;
}

.kdrama-lightbox__img {
    max-width: min(92vw, 900px);
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.kdrama-lightbox__close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100051;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.kdrama-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.kdrama-report-modal {
    position: fixed;
    inset: 0;
    z-index: 100060;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.kdrama-report-modal[hidden] {
    display: none !important;
}

.kdrama-report-modal__panel {
    width: min(100%, 520px);
    max-height: 90vh;
    overflow: auto;
}

body.kdrama-report-open {
    overflow: hidden;
}

.kdrama-sort-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.kdrama-sort-filter__link {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: inherit;
    background: rgba(255, 255, 255, 0.6);
}

.kdrama-sort-filter__link.is-active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* Layout compatto: post, meta e azioni */
.kdrama-community .kdrama-post.card {
    margin-bottom: 0.5rem !important;
}

.kdrama-community .kdrama-post.card > .card-body {
    padding: 0.6rem 0.75rem;
}

.kdrama-community .kdrama-post__meta,
.kdrama-community .kdrama-reply__meta {
    margin-bottom: 0.35rem;
    gap: 0.35rem;
}

.kdrama-community .kdrama-post__meta-tags {
    margin-bottom: 0.35rem;
    gap: 0.35rem;
}

.kdrama-community .kdrama-reply__thread-title {
    margin-bottom: 0.35rem;
}

.kdrama-community .kdrama-post__image {
    margin-top: 0.45rem;
}

.kdrama-community .kdrama-replies--orphan {
    margin-bottom: 0.5rem;
}

.kdrama-community .kdrama-post__meta .btn-sm,
.kdrama-community .kdrama-reply__meta .btn-sm {
    padding: 0.12rem 0.38rem;
    font-size: 0.72rem;
    line-height: 1.2;
}

.kdrama-post__actions {
    gap: 0.25rem;
    max-width: 100%;
}

.kdrama-post__actions .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

.kdrama-post__actions .kdrama-action-icon {
    font-size: 0.85em;
    line-height: 1;
}

.kdrama-post__actions--compact .btn-sm {
    padding: 0.1rem 0.32rem;
    font-size: 0.68rem;
}

.kdrama-post__actions--compact .kdrama-action-label {
    display: none;
}

.kdrama-post__actions--compact .btn-sm .kdrama-like-btn__count {
    font-size: 0.68rem;
}

.kdrama-report-btn--self {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

@media (min-width: 768px) {
    .kdrama-post__actions--compact .kdrama-action-label {
        display: inline;
    }
}

.kdrama-community .kdrama-like-btn {
    padding: 0.12rem 0.4rem;
}

.kdrama-like-btn {
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #fff;
    color: #333;
    line-height: 1.2;
    padding: 0.2rem 0.55rem;
}

.kdrama-like-btn.is-active {
    background: #fff8e1;
    border-color: #ffc107;
    color: #856404;
}

.kdrama-like-btn__count {
    font-size: 0.8rem;
    margin-left: 0.15rem;
}

.kdrama-quote {
    margin: 0.15rem 0 0.25rem;
    padding: 0.3rem 0.45rem 0.35rem;
    border-left: 3px solid #6c757d;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 0 4px 4px 0;
}

.kdrama-quote__author {
    display: block;
    font-style: normal;
    font-weight: 600;
    font-size: 0.78rem;
    margin: 0 0 0.1rem;
    padding: 0;
    line-height: 1.2;
    color: #495057;
}

.kdrama-quote__text {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.kdrama-post__comment > .kdrama-quote:first-child,
.kdrama-reply__comment > .kdrama-quote:first-child {
    margin-top: 0;
}

.kdrama-post__comment > .kdrama-quote:last-child,
.kdrama-reply__comment > .kdrama-quote:last-child {
    margin-bottom: 0.15rem;
}
