/*
 * KissKH — page component styles (FRONTEND-PAGES).
 * Ported from the live kisskh.co Angular bundle component `styles:[...]` arrays:
 *   main.js  → app-home, mat-carousel, mat-carousel-slide, app-drama-card, app-main-card
 *   502.js   → app-drama, app-watch        780.js → app-explore
 *   535.js   → app-faq                     856.js → app-drama-list      791.js → app-page404
 * `[_ngcontent-%COMP%]` removed, selectors scoped with the host class (e.g. `.app-home`).
 * Angular Material structural CSS lives in app.css (shell) and colors in the prebuilt theme.
 * Our own additions use the `kkh-` prefix.
 */

/* ------------------------------------------------------------------ *
 * Shared
 * ------------------------------------------------------------------ */
.kkh-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
a.mat-card, a.mat-card:hover, a.mat-chip, a.mat-chip:hover, a.mat-button, a.mat-button:hover,
a.mat-raised-button, a.mat-raised-button:hover, a.mat-stroked-button, a.mat-stroked-button:hover,
a.mat-flat-button, a.mat-flat-button:hover, a.mat-icon-button, a.mat-icon-button:hover { text-decoration: none; }
a.mat-card { display: block; color: inherit; }
.mat-icon.mat-icon-inline { font-size: inherit; height: inherit; line-height: inherit; width: inherit; }
@media (max-width: 1279.98px) { .kkh-hide-lt-lg { display: none !important; } }
.kkh-ad { text-align: center; overflow: hidden; }
.kkh-ad > * { max-width: 100%; }

/* spinner (indeterminate) — self contained so it works without the shell keyframe injector */
.kkh-pspinner { position: relative; display: block; }
.kkh-pspinner svg { position: absolute; top: 0; left: 0; overflow: visible; animation: kkh-spin-rotate 1.4s linear infinite; transform-origin: center; }
.kkh-pspinner circle { fill: transparent; stroke-width: 10%; stroke-linecap: butt; stroke-dasharray: 282.743px; stroke-dashoffset: 0; animation: kkh-spin-dash 1.4s ease-in-out infinite; transform-origin: center; }
@keyframes kkh-spin-rotate { 0% { transform: rotate(-90deg); } 100% { transform: rotate(270deg); } }
@keyframes kkh-spin-dash { 0% { stroke-dashoffset: 268.6px; } 50% { stroke-dashoffset: 70.7px; transform: rotate(45deg); } 100% { stroke-dashoffset: 268.6px; transform: rotate(360deg); } }

/* expansion panel open / close (Angular animation values) */
.mat-expansion-panel-header { height: 48px; }
.mat-expansion-panel.mat-expanded > .mat-expansion-panel-header { height: 64px; }
.mat-expansion-panel-content { overflow: hidden; transition: height 225ms cubic-bezier(0.4, 0, 0.2, 1), visibility 225ms cubic-bezier(0.4, 0, 0.2, 1); }
.mat-expansion-indicator { transition: transform 225ms cubic-bezier(0.4, 0, 0.2, 1); transform: rotate(0deg); }
.mat-expansion-panel.mat-expanded > .mat-expansion-panel-header .mat-expansion-indicator { transform: rotate(180deg); }
.mat-accordion > .mat-expansion-panel.mat-expanded { margin: 16px 0; }
.mat-accordion > .mat-expansion-panel.mat-expanded:first-child { margin-top: 0; }
.mat-accordion > .mat-expansion-panel.mat-expanded:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ *
 * app-home (main.js)
 * ------------------------------------------------------------------ */
.app-home { display: block; }
.app-home .loading { padding: 70px; background-color: var(--loading); }
.app-home .loading-show .loading { padding: 100px; }
.app-home .btn { font-size: inherit; }
@media only screen and (max-width: 768px) {
  .app-home .loading { padding: 50px; }
  .app-home .loading-show { padding: 80px; }
  .app-home .btn { font-size: 16px; line-height: 18px; }
}
.app-home .mat-card-title > .btn { padding: 0 16px; }
.app-home .kkh-signin-hint { cursor: pointer; }

/* mat-carousel (main.js) */
.kkh-carousel { display: block; }
.kkh-carousel .carousel { width: 100%; position: relative; overflow: hidden; outline: none; max-width: auto; }
.kkh-carousel .carousel > button { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); }
.kkh-carousel .carousel > button:first-of-type { left: 30px; }
.kkh-carousel .carousel > button[data-kkh-carousel-next] { left: auto; right: 30px; }
.kkh-carousel .carousel-list { width: 100%; margin: 0; padding: 0; list-style: none; display: flex; position: relative; will-change: transform; }
.kkh-carousel .carousel-list.kkh-animate { transition: transform 250ms ease-in; }
.kkh-carousel li.carousel-slide { width: 100%; height: 0; display: flex; flex-shrink: 0; position: relative; padding-bottom: 50%; }
.kkh-carousel li.carousel-slide:hover { cursor: -webkit-grab; cursor: grab; }
.kkh-carousel.kkh-dragging li.carousel-slide { cursor: grabbing; }
.kkh-carousel .carousel-indicators { display: flex; position: absolute; bottom: 15px; z-index: 1; left: 50%; transform: translate(-50%); outline: none; }
.kkh-carousel .carousel-indicators > button { width: 10px; height: 10px; margin: 7.5px; min-height: 0; padding: 0; line-height: 10px; }
/* mat-carousel-slide */
.kkh-carousel div.carousel-slide { width: 100%; height: 100%; position: absolute; z-index: auto; background-size: cover; background-repeat: no-repeat; background-position: center; }
.kkh-carousel .carousel-slide-overlay { width: 100%; height: 100%; position: absolute; z-index: auto; }
.kkh-carousel .carousel-slide-content { width: 100%; height: 100%; position: absolute; z-index: 1; }
.kkh-carousel .carousel-slide-content > a { color: inherit; text-decoration: none; -webkit-user-drag: none; }
.kkh-carousel .carousel-slide-content .mat-card-header { display: flex; flex-direction: row; }
.kkh-carousel .carousel-slide-content .mat-card-title { font-size: 20px; line-height: 1.2; }
/* layoutDetectorService.isDesktop (Medium+ ≥ 960px): proportion 30 + arrows, else 50 + no arrows */
.kkh-carousel [data-kkh-carousel-prev], .kkh-carousel [data-kkh-carousel-next] { display: none; }
@media (min-width: 960px) {
  .kkh-carousel li.carousel-slide { padding-bottom: 30%; }
  .kkh-carousel [data-kkh-carousel-prev], .kkh-carousel [data-kkh-carousel-next] { display: inline-block; }
}

/* ------------------------------------------------------------------ *
 * app-drama-card (main.js) — row scroller (shared rules also in app.css)
 * ------------------------------------------------------------------ */
.app-drama-card { display: block; }
.app-drama-card .menu { position: absolute; width: 100%; bottom: 5%; text-align: end; }
.app-drama-card .landscape { flex-flow: nowrap; overflow-x: auto; align-items: center; }
.app-drama-card .landscape-title { -webkit-line-clamp: 2; width: 100%; }
.app-drama-card .visible { display: hidden; opacity: 0; transition: ease; pointer-events: none; }
@media (max-width: 768px) { .col-d-5 { flex: 0 0 45.666667%; max-width: 51.666667%; } }
@media (min-width: 768px) { .col-md-d-4 { flex: 0 0 30.333333%; max-width: 30.333333%; } .app-drama-card .menu { bottom: 6%; } }
@media (min-width: 1024px) { .app-drama-card .menu { bottom: 5%; } }
@media (min-width: 1200px) { .col-xl-d-3 { flex: 0 0 23%; max-width: 23%; } }
.scrollbar-hidden { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hidden::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------ *
 * app-main-card (main.js) — card (contract: SCRATCH/reports/card-markup.html)
 * ------------------------------------------------------------------ */
.app-main-card { display: flex; }
.app-main-card .mat-card { padding: 0; overflow: hidden; }
.app-main-card .drama-title { text-overflow: ellipsis; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; width: 100%; }
.app-main-card .duration { position: absolute; width: 100%; text-align: end; bottom: 6px; color: #fff; }
.app-main-card .duration-span { margin: 6px; padding: .2rem; background-color: #0009; font-weight: 500; border-radius: .2rem; }
.app-main-card .title { line-height: 1rem !important; margin-top: .2rem !important; margin-bottom: 0; }
.app-main-card .title-sm { line-height: 1.5rem !important; font-size: 16px !important; }
.app-main-card .title-xs { font-size: 12px !important; }
.app-main-card .title-md { line-height: 1.7rem !important; font-size: 17px !important; }
.app-main-card .aspect-ratio-box { position: relative; }
.app-main-card .aspect-ratio-box:after { display: block; content: ""; padding-bottom: 56.25%; }
.app-main-card .aspect-ratio-box img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.app-main-card .bt { background-color: transparent; }
.app-main-card .ep { bottom: 0 !important; background: linear-gradient(0deg, rgba(45, 45, 45, .6), rgba(45, 45, 45, 0)); }
@media (max-width: 768px) { .app-main-card .duration-span { font-size: x-small; margin: 0 2px; line-height: 1.5; } .app-main-card .duration { bottom: 1px; } }
@media (min-width: 768px) { .app-main-card .duration-span { font-size: small; margin: 0 3px; } .app-main-card .duration { bottom: 3px; } }
@media (max-width: 599.98px) { .app-main-card .kkh-title { line-height: 1rem !important; margin-top: .2rem !important; margin-bottom: 0; font-size: 12px !important; } }
@media (min-width: 600px) and (max-width: 959.98px) { .app-main-card .kkh-title { line-height: 1.5rem !important; margin-top: .2rem !important; margin-bottom: 0; font-size: 16px !important; } }
@media (min-width: 960px) and (max-width: 1279.98px) { .app-main-card .kkh-title { line-height: 1.7rem !important; margin-top: .2rem !important; margin-bottom: 0; font-size: 17px !important; } }
/* history card menu (live mat-menu Remove / Cancel) */
.app-main-card .menu { position: absolute; width: 100%; bottom: 5%; text-align: end; pointer-events: none; }
.app-main-card .menu > * { pointer-events: auto; }
.app-main-card .menu .mat-icon-button { color: #fff; }
.kkh-menu-panel { position: absolute; right: 8px; bottom: 44px; z-index: 5; min-width: 112px; max-width: 280px; text-align: start; border-radius: 4px; overflow: hidden; }
.kkh-menu-panel .mat-menu-content { padding: 8px 0; }
.kkh-menu-panel .mat-menu-item { display: flex; align-items: center; width: 100%; }
.kkh-menu-panel .mat-menu-item .mat-icon { margin-right: 16px; vertical-align: middle; }
.app-main-card.kkh-removing { opacity: .4; pointer-events: none; transition: opacity .2s; }

/* ------------------------------------------------------------------ *
 * app-drama / app-watch (502.js)
 * ------------------------------------------------------------------ */
.app-drama { display: block; }
.app-drama .portrait { position: fixed; z-index: 2; height: auto; }
.app-drama .text-center { text-align: center; }
.app-drama .action-btn { width: 60px; height: 60px; line-height: 1.6; }
.app-drama .cc { height: 14px; width: 14px; font-size: smaller; position: absolute; right: 2px; top: 2px; }
.app-drama .action-loading { position: absolute; bottom: 6px; }
.app-drama .list { font-size: small; padding: 0; height: 16px; width: auto; }
.app-drama .list a.kkh-meta-link { color: inherit; text-decoration: none; }
.app-drama .list a.kkh-meta-link:hover { text-decoration: underline; }
.app-drama .kkh-drama-row { min-height: calc(100vh - 64px); }
.app-drama .kkh-info-card h1.mat-card-title { font-size: 20px; font-weight: 500; line-height: 20px; margin: 0 0 12px; letter-spacing: normal; }
.app-drama .kkh-info-card .mat-card-actions { margin-left: 16px; margin-right: 16px; }
.app-drama .kkh-info-card .mat-card-actions .action-btn { margin: 0; }
.app-drama .kkh-info-card .mat-card-actions .action-btn .mat-button-wrapper { display: block; }
.app-drama .kkh-description p:last-child { margin-bottom: 0; }
.app-drama .kkh-other-names, .app-drama .kkh-genres { margin: 8px 0 0; }
.app-drama .kkh-genres a { color: inherit; }
.app-drama .mat-card-footer .mat-card-header { display: flex; } /* live: nowrap + stretch; the paginator shrinks and wraps internally on phones */
.app-drama .mat-card-footer { margin: 0 -16px; }
/* Items-per-page: native select dressed as the live legacy mat-select (value, 5px arrow, underline). */
.app-drama .kkh-page-size { padding: 10px 0 15px; }
.app-drama .kkh-page-size .kkh-native-select { -webkit-appearance: none; -moz-appearance: none; appearance: none; display: block; width: 56px; margin: 0; padding: 5px 14px 5px 0; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; font: inherit; font-size: 12px; line-height: 13.5px; color: inherit; cursor: pointer; outline: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%275%27%3E%3Cpath d=%27M0 0h10L5 5z%27 fill=%27%23999%27/%3E%3C/svg%3E") no-repeat right 2px center; }
.app-drama .kkh-page-size .kkh-native-select option { background: #424242; color: #fff; }
.app-drama .kkh-page-size .kkh-native-select:focus { border-bottom-width: 2px; padding-bottom: 4px; }
.app-drama .mat-card-footer .mat-paginator { background: transparent; }
.app-drama [data-kkh-episodes] .mat-raised-button { min-width: 64px; }
.app-drama [data-kkh-episodes] .mat-raised-button .mat-button-wrapper { white-space: nowrap; }
@media (min-width: 960px) {
  .app-drama .kkh-info-col { max-height: calc(100vh - 64px); overflow: auto; }
}
@media (max-width: 599.98px) {
  .app-drama .kkh-drama-row { min-height: calc(100vh - 56px); }
}

/* player column */
.app-drama .kkh-player-col { display: flex; flex-direction: column; }
.app-drama .kkh-player-col > .app-watch, .app-drama .kkh-player-col > .kkh-trailer { display: flex; flex-direction: column; flex: 1 1 auto; }
.kkh-player { display: flex; flex-direction: column; flex: 1 1 auto; }
.kkh-video-box { position: relative; width: 100%; background: #000; color: #fff; overflow: hidden; }
.kkh-video-box:before { content: ""; display: block; padding-top: 56.25%; }
.kkh-video-box > * { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.kkh-video-box .kkh-video-header { height: auto; z-index: 2; padding: 12px 16px; background: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); pointer-events: none; }
.kkh-video-box .kkh-video-title { text-align: center; font-size: 14px; font-weight: 500; }
.kkh-video-box .kkh-video-poster, .kkh-video-cover .kkh-video-poster { width: 100%; height: 100%; object-fit: contain; display: block; }
.kkh-video-box .kkh-video-play, .kkh-video-cover .kkh-video-play { position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; line-height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; z-index: 3; }
.kkh-video-box .kkh-video-play .mat-icon, .kkh-video-cover .kkh-video-play .mat-icon { font-size: 48px; width: 48px; height: 48px; line-height: 48px; }
.kkh-video-box .kkh-video-play:hover, .kkh-video-cover .kkh-video-play:hover { background: rgba(0, 0, 0, .7); }
.kkh-video-box iframe.kkh-trailer-frame { border: 0; z-index: 4; }
.kkh-video-cover { position: absolute; background: #000; }
.kkh-video-unavailable { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; padding: 8px 16px; background: rgba(0, 0, 0, .6); font-size: 14px; }
/* live app-watch embed (thirdParty iframe) */
.kkh-video-box-episode > .h-100 { position: absolute; }
.app-watch .embed-responsive { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; align-self: center; }
.app-watch .embed-responsive:before { display: block; content: ""; }
.app-watch .embed-responsive .embed-responsive-item, .app-watch .embed-responsive iframe, .app-watch .embed-responsive embed, .app-watch .embed-responsive object, .app-watch .embed-responsive video { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; }
.app-watch .embed-responsive-21by9:before { padding-top: 56.25%; }
.app-watch .kkh-embed-html iframe, .app-watch .kkh-embed-html video { width: 100% !important; height: 100% !important; border: 0; }
/* desktop (≥1200px, player beside the info card): the player fills the column height like live mat-video */
@media (min-width: 1200px) {
  .kkh-video-box { flex: 1 1 auto; }
  .kkh-video-box:before { padding-top: 0; min-height: 100%; }
  .kkh-player-trailer .kkh-video-box, .kkh-player-episode .kkh-video-box { min-height: 320px; }
  /* the embed iframe fills the whole player box instead of a 16:9 strip inside it */
  .app-watch .kkh-video-box-episode .embed-responsive { height: 100%; }
  .app-watch .kkh-video-box-episode .embed-responsive-21by9:before { padding-top: 0; }
}
/* phones, portrait (CDK HandsetPortrait): live pins the player under the toolbar (".portrait": position fixed)
   and pads the rest by the player height; the sidenav container has overflow hidden so sticky is not an option. */
@media (max-width: 599.98px) and (orientation: portrait) {
  .app-drama .kkh-player { padding-top: 56.25vw; }
  .app-drama .kkh-video-box { position: fixed; top: 56px; left: 0; right: 0; width: 100%; z-index: 2; }
}

/* compact server switcher + prev / next (our addition under the player; only rendered for 2+ servers) */
.kkh-server-bar.mat-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 4px 8px; border-radius: 0; box-shadow: none !important; gap: 4px 12px; }
.kkh-server-nav { display: flex; align-items: center; flex: 0 0 auto; }
.kkh-server-ep { font-size: 14px; font-weight: 500; padding: 0 4px; white-space: nowrap; }
.kkh-server-list { display: flex; align-items: center; flex-wrap: nowrap; overflow-x: auto; flex: 1 1 auto; justify-content: flex-end; gap: 8px; padding: 4px 0; }
.kkh-server-list .kkh-server-btn { flex: 0 0 auto; line-height: 30px; min-width: 0; padding: 0 12px; font-size: 13px; }
@media (max-width: 599.98px) { .kkh-server-list { justify-content: flex-start; width: 100%; } }

/* download dialog */
.kkh-download-list { list-style: none; margin: 0; padding: 0; min-width: 260px; }
.kkh-download-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.kkh-download-list li + li { border-top: 1px solid rgba(128, 128, 128, .25); }
.kkh-download-list .kkh-dl-name { font-size: 14px; }
.kkh-download-list .kkh-dl-quality { font-size: 12px; opacity: .7; margin-left: 6px; }
.kkh-pages-overlay .cdk-global-overlay-wrapper { justify-content: center; align-items: center; }
.kkh-pages-overlay .cdk-overlay-pane { max-width: 80vw; }
@media (max-width: 599.98px) { .kkh-pages-overlay .cdk-overlay-pane { max-width: calc(100vw - 32px); } }
.kkh-pages-overlay .mat-dialog-title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 20px; }

/* ------------------------------------------------------------------ *
 * app-explore (780.js)
 * ------------------------------------------------------------------ */
.app-explore { display: block; }
.app-explore .mscroll { overflow-y: hidden; }
.app-explore .no-wrap { white-space: nowrap; }
.app-explore .mat-chip { cursor: pointer; }
.app-explore .history-title { font-size: 30px; display: inline-block; width: 100%; text-align: center; }
@media screen and (max-width: 767px) { .app-explore .history-title { font-size: 20px; } }
.kkh-to-top .mat-icon-button { color: #fff; }
.kkh-infinite-sentinel { height: 1px; }
.kkh-pager .mat-paginator-container { justify-content: center; }
.kkh-pager { background: transparent !important; }
.kkh-post-card { width: 100%; }
.kkh-post-card .mat-card-title a { color: inherit; text-decoration: none; }
.kkh-post-card .aspect-ratio-box img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.kkh-post-card .aspect-ratio-box { position: relative; margin: -16px -16px 16px; }
.kkh-post-card .aspect-ratio-box:after { display: block; content: ""; padding-bottom: 56.25%; }

/* ------------------------------------------------------------------ *
 * app-faq (535.js — styles:[""]) + WordPress pages
 * ------------------------------------------------------------------ */
.app-faq { display: block; }
.app-faq .mat-accordion { display: block; }
/* Live's FAQ column shrink-wraps its content, which there always resolves to an 863px column (847px accordion)
   capped by max-width:100%. Pin that width so admin-edited answers can't widen or shrink the panels. */
.app-faq > .d-flex > .px-2 { width: 863px; box-sizing: border-box; }
.app-faq iframe { max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.app-faq .mat-expansion-panel-body img { max-width: 100%; height: auto; }
.app-faq .mat-expansion-panel-body .mat-icon-button { vertical-align: middle; }
.app-faq .kkh-fb-icon { vertical-align: middle; margin-right: 4px; }
.kkh-page-card { width: 960px; max-width: calc(100% - 16px); }
.kkh-entry img { max-width: 100%; height: auto; }
.kkh-entry a { color: inherit; text-decoration: underline; }
.kkh-page-thumb img { width: 100%; height: auto; display: block; }

/* ------------------------------------------------------------------ *
 * app-drama-list (856.js)
 * ------------------------------------------------------------------ */
.app-drama-list { display: block; }
.app-drama-list .history-title { font-size: 30px; display: inline-block; width: 100%; text-align: center; }
@media screen and (max-width: 767px) { .app-drama-list .history-title { font-size: 20px; } }
.app-drama-list .text-center { text-align: center; }
.app-drama-list .kkh-check-overlay { position: absolute; top: 0; left: 0; z-index: 3; cursor: pointer; }
.app-drama-list #checkBox .mat-checkbox-inner-container-no-side-margin, .app-drama-list .kkh-check .mat-checkbox-inner-container-no-side-margin { height: 30px; width: 30px; margin: 0; }
.app-drama-list .kkh-check .mat-checkbox-layout { pointer-events: none; }
.app-drama-list .kkh-editing .app-main-card .menu { display: none; }

/* ------------------------------------------------------------------ *
 * app-page404 (791.js)
 * ------------------------------------------------------------------ */
.app-page404 { display: block; }
.app-page404 .text-center { text-align: center; }
.app-page404 h1 { font-size: 24px; font-weight: 400; line-height: 32px; margin: 0 0 16px; } /* live: mat-typography h1 */
.app-page404 .mat-stroked-button .mat-icon { vertical-align: middle; }

/* below md the live .row keeps its -15px gutters (col-12 p-0 player spans them): keep our bar content on screen */
@media (max-width: 767.98px) {
  .app-drama .kkh-server-bar.mat-card { padding-left: 23px; padding-right: 23px; }
  .app-drama .kkh-player .kkh-ad { padding-left: 15px; padding-right: 15px; }
}
