/**
 * K-Drama Dark Pro – single post page (6.2)
 * Banner with title, details panel, post text, download card, related grid.
 */

.kd-single {
    padding-bottom: 10px;
}

/* breathing room between the menu / top ad and the banner + sidebar */
.kd-single .kd-layout--sb,
.kd-single .kd-layout:not(.kd-layout--sb) {
    margin-top: 20px;
}

@media (min-width: 1100px) {
    .kd-single .kd-layout--sb {
        margin-top: 28px;
    }
}

/* ------------------------------------------------------------------ banner */
.kd-post-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    min-height: clamp(310px, 36vw, 430px);
    margin: 0 0 18px;
    padding: 16px 20px 20px;
    overflow: hidden;
    border: 1px solid var(--kd-line);
    border-radius: calc(var(--kd-radius) + 4px);
    background: linear-gradient(135deg, #2b1216 0%, #141414 70%);
    isolation: isolate;
}

.kd-post-hero__img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.kd-post-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(0deg, rgba(10, 10, 10, .96) 0%, rgba(10, 10, 10, .78) 34%, rgba(10, 10, 10, 0) 70%),
        linear-gradient(180deg, rgba(10, 10, 10, .55) 0%, rgba(10, 10, 10, 0) 26%);
}

/* breadcrumb */
.kd-crumbs {
    align-self: flex-start;
    max-width: 100%;
}

.kd-crumbs ol {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    background: rgba(12, 12, 12, .62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    list-style: none;
    font-size: 12px;
    line-height: 1.4;
}

.kd-crumbs li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    color: #d8d8d8;
}

.kd-crumbs li + li::before {
    content: "›";
    padding: 0 8px;
    color: rgba(255, 255, 255, .45);
    font-size: 14px;
}

.kd-crumbs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #f1f1f1;
}

.kd-crumbs a:hover {
    color: var(--kd-accent);
}

.kd-crumbs .kd-ico {
    width: 14px;
    height: 14px;
}

.kd-crumbs li:not([aria-current]) {
    flex: 0 0 auto;
}

.kd-crumbs li[aria-current] {
    flex: 1 1 auto;
}

.kd-crumbs li[aria-current] span {
    display: block;
    max-width: 38ch;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* title + meta */
.kd-post-hero .single-seo-title {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(22px, 3.1vw, 36px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.01em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
    overflow-wrap: anywhere;
}

.kd-post-hero__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
}

.kd-post-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #e6e6e6;
    font-size: 13px;
}

.kd-post-hero__meta li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.kd-post-hero__meta li + li {
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, .22);
}

.kd-post-hero__meta .kd-ico {
    width: 16px;
    height: 16px;
    color: #cfcfcf;
}

.kd-post-hero__meta .is-rating {
    color: var(--kd-gold);
}

.kd-post-hero__meta .is-rating .kd-ico {
    color: var(--kd-gold);
}

.kd-post-hero__meta .is-rating strong {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.kd-post-hero__meta .is-rating small {
    color: #bdbdbd;
    font-size: 12px;
}

.kd-post-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kd-post-hero__chips li {
    margin: 0;
}

.kd-post-hero__chips a {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #f4f4f4;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background .2s ease, border-color .2s ease;
}

.kd-post-hero__chips a:hover {
    border-color: var(--kd-accent);
    background: rgba(var(--kd-accent-rgb), .3);
    color: #fff;
}

/* ----------------------------------------------------------- details panel */
.kd-single .kd-details {
    columns: 300px 2;
    column-gap: 44px;
    margin: 0 0 22px;
    padding: 8px 20px;
    border: 1px solid var(--kd-line);
    border-radius: calc(var(--kd-radius) + 2px);
    background: var(--kd-surface);
    list-style: none;
}

.kd-single .kd-details li {
    display: grid;
    grid-template-columns: minmax(118px, 36%) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 13px 0;
    border-bottom: 1px solid var(--kd-line);
    font-size: 14px;
    line-height: 1.45;
    break-inside: avoid;
}

.kd-single .kd-details li:last-child {
    border-bottom: 0;
}

.kd-details__label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.kd-details__label strong {
    color: var(--kd-accent);
    font-size: 13px;
    font-weight: 700;
}

.kd-details__label .kd-ico {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    color: var(--kd-accent);
}

.kd-details__value {
    min-width: 0;
    color: #ececec;
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------------- post text */
.kd-single .entry-content {
    margin: 4px 0 6px;
    color: #d3d3d3;
    font-size: 15px;
    line-height: 1.75;
}

.kd-single .entry-content > :first-child {
    margin-top: 0;
}

.kd-single .entry-content h1,
.kd-single .entry-content h2,
.kd-single .entry-content h3,
.kd-single .entry-content h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 12px;
    color: #fff;
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 700;
    line-height: 1.25;
}

.kd-single .entry-content h1::before,
.kd-single .entry-content h2::before,
.kd-single .entry-content h3::before,
.kd-single .entry-content h4::before {
    content: "";
    flex: 0 0 4px;
    align-self: stretch;
    min-height: 1.1em;
    border-radius: 3px;
    background: var(--kd-accent);
}

.kd-single .entry-content p {
    margin: 0 0 12px;
}

.kd-single .entry-content a {
    color: var(--kd-accent);
}

.kd-single .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--kd-radius);
}

/* screenshots */
.kd-single .entry-content .kd-shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin: 0 0 12px;
    line-height: 0;
}

.kd-single .entry-content .kd-shots br {
    display: none;
}

.kd-single .entry-content .kd-shots a {
    display: block;
}

.kd-single .entry-content .kd-shots img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid var(--kd-line);
    transition: transform .25s ease, border-color .25s ease;
}

.kd-single .entry-content .kd-shots img:hover {
    transform: scale(1.02);
    border-color: rgba(var(--kd-accent-rgb), .6);
}

.kd-single .entry-content .wp-block-gallery,
.kd-single .entry-content .gallery {
    gap: 10px;
}

/* ------------------------------------------------------------ download card */
.kd-single .kd-dl {
    margin: 24px 0 8px;
    padding: 18px 20px;
    border: 1px solid rgba(var(--kd-accent-rgb), .35);
    border-radius: calc(var(--kd-radius) + 2px);
    background:
        radial-gradient(90% 160% at 0% 0%, rgba(var(--kd-accent-rgb), .22) 0%, rgba(var(--kd-accent-rgb), 0) 60%),
        #1a1214;
    text-align: left;
}

.kd-dl__main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kd-dl__icon {
    display: grid;
    flex: 0 0 52px;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(var(--kd-accent-rgb), .45);
    border-radius: 14px;
    background: rgba(var(--kd-accent-rgb), .14);
    color: var(--kd-accent);
}

.kd-dl__icon .kd-ico {
    width: 28px;
    height: 28px;
}

.kd-dl__text {
    flex: 1 1 auto;
    min-width: 0;
}

.kd-single .kd-dl h3 {
    margin: 0 0 3px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
}

.kd-single .kd-dl .watch-disclaimer,
.kd-single .kd-dl .watch-note {
    margin: 0;
    color: #bdbdbd;
    font-size: 12.5px;
    line-height: 1.55;
}

.kd-single .kd-dl .watch-note {
    margin-top: 4px;
    color: #e0e0e0;
}

.kd-single .kd-dl .kdrama-download-page-btn {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: auto;
    max-width: none;
    min-height: 46px;
    margin: 0;
    padding: 12px 22px;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(var(--kd-accent-rgb), .35);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform .2s ease, background .2s ease;
}

.kd-single .kd-dl .kdrama-download-page-btn:hover {
    transform: translateY(-1px);
}

.kd-single .kd-dl .kdrama-download-page-btn .kd-ico {
    width: 18px;
    height: 18px;
}

.kd-single .kd-dl .kd-smartlink {
    margin-top: 14px;
}

/* ------------------------------------------------------------ related grid */
.kd-single .kd-sec--related {
    margin: 36px 0 8px;
}

.kd-grid--related {
    --kd-min: 180px;
    grid-template-columns: repeat(auto-fill, minmax(var(--kd-min), 1fr));
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 760px) {
    .kd-post-hero {
        gap: 30px;
        min-height: 300px;
        padding: 12px 14px 16px;
    }

    .kd-crumbs li[aria-current] span {
        max-width: 16ch;
    }

    .kd-post-hero__meta {
        gap: 6px 14px;
    }

    .kd-post-hero__meta li + li {
        padding-left: 0;
        border-left: 0;
    }

    .kd-single .kd-details {
        padding: 4px 14px;
        columns: 1;
    }

    .kd-single .kd-details li {
        grid-template-columns: minmax(110px, 40%) minmax(0, 1fr);
        padding: 11px 0;
        font-size: 13px;
    }
}

@media (max-width: 599px) {
    .kd-grid--related {
        --kd-min: 140px;
    }

    .kd-single .kd-dl {
        padding: 16px 14px;
    }

    .kd-dl__main {
        flex-wrap: wrap;
    }

    .kd-dl__text {
        flex: 1 1 calc(100% - 70px);
    }

    .kd-single .kd-dl .kdrama-download-page-btn {
        width: 100%;
        min-height: 48px;
    }

    .kd-single .entry-content .kd-shots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .kd-single .entry-content .kd-shots img,
    .kd-post-hero__chips a,
    .kd-single .kd-dl .kdrama-download-page-btn { transition: none !important; }
}
