/* GKPV Thánh Ca 1.2.16 – YouTube / PDF viewer (#gk-vw, created by viewer.js on Thánh Ca pages only). */
html.gk-vw-lock, html.gk-vw-lock body { overflow: hidden !important; }
#gk-vw[hidden] { display: none !important; }
#gk-vw {
  --vw-bg: #170f23; --vw-bg2: #231b2e; --vw-card: #2a2139; --vw-line: rgba(255,255,255,.1);
  --vw-text: #fff; --vw-muted: rgba(255,255,255,.62); --vw-accent: #9b4de0; --vw-accent2: #c273ed; --vw-yt: #ff3b3b;
  position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
  font-family: Inter, "Be Vietnam Pro", Roboto, "Segoe UI", system-ui, sans-serif; color: var(--vw-text);
  line-height: 1.4; -webkit-font-smoothing: antialiased;
}
#gk-vw *, #gk-vw *::before, #gk-vw *::after { box-sizing: border-box; }
#gk-vw .gk-vw__backdrop { position: absolute; inset: 0; background: rgba(10,6,16,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: gkVwFade .18s ease-out; }
#gk-vw .gk-vw__panel {
  position: relative; display: flex; flex-direction: column; width: min(1000px, calc(100vw - 48px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  background: var(--vw-bg); border: 1px solid var(--vw-line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(155,77,224,.18); animation: gkVwIn .22s cubic-bezier(.2,.8,.2,1);
}
#gk-vw.gk-vw--yt.has-side .gk-vw__panel { width: min(1240px, calc(100vw - 48px)); }
#gk-vw.gk-vw--pdf .gk-vw__panel { width: min(1040px, calc(100vw - 48px)); height: calc(100vh - 48px); height: calc(100dvh - 48px); }
@keyframes gkVwFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gkVwIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #gk-vw .gk-vw__panel, #gk-vw .gk-vw__backdrop { animation: none; } }

/* top bar */
#gk-vw .gk-vw__bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--vw-line); background: linear-gradient(180deg, #221833, var(--vw-bg)); flex: 0 0 auto; min-height: 56px; flex-wrap: nowrap; }
#gk-vw .gk-vw__kind { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 7px; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 12px; letter-spacing: .02em; flex: 0 0 auto; }
#gk-vw .gk-vw__kind b { font-weight: 700; }
#gk-vw .gk-vw__title { margin: 0; font-size: 16px; font-weight: 700; color: #fff; min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; line-height: 1.3; text-transform: none; }
#gk-vw .gk-vw__sub { margin: 0; font-size: 13px; color: var(--vw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32%; flex: 0 1 auto; }
#gk-vw .gk-vw__tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
#gk-vw .gk-vw__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; min-width: 38px; padding: 0 12px; margin: 0;
  border: 1px solid var(--vw-line); border-radius: 999px; background: rgba(255,255,255,.06); color: #fff; font: 600 13px/1 inherit; font-family: inherit;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; box-shadow: none; text-transform: none; letter-spacing: 0;
}
#gk-vw .gk-vw__btn:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.22); color: #fff; }
#gk-vw .gk-vw__btn:active { transform: scale(.96); }
#gk-vw .gk-vw__btn:focus-visible, #gk-vw .gk-vw__relbtn:focus-visible { outline: 2px solid var(--vw-accent2); outline-offset: 2px; }
#gk-vw .gk-vw__btn[disabled] { opacity: .35; cursor: default; transform: none; }
#gk-vw .gk-vw__btn svg { flex: 0 0 auto; }
#gk-vw .gk-vw__x, #gk-vw .gk-vw__back { padding: 0; width: 40px; border-color: transparent; background: transparent; }
#gk-vw .gk-vw__x:hover { background: rgba(255,255,255,.1); }
#gk-vw .gk-vw__back { display: none; }
#gk-vw .gk-vw__dl { background: var(--vw-accent); border-color: var(--vw-accent); }
#gk-vw .gk-vw__dl:hover { background: #8a3fd0; border-color: #8a3fd0; }

/* ---- YouTube ---- */
#gk-vw .gk-vw__body { display: flex; min-height: 0; flex: 1 1 auto; }
#gk-vw.gk-vw--yt .gk-vw__body { overflow: auto; }
#gk-vw .gk-vw__main { flex: 1 1 auto; min-width: 0; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
#gk-vw .gk-vw__stage { width: 100%; max-width: calc((100vh - 330px) * 16 / 9); max-width: calc((100dvh - 330px) * 16 / 9); min-width: min(100%, 480px); margin: 0 auto; }
#gk-vw .gk-vw__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06); }
@supports not (aspect-ratio: 1) { #gk-vw .gk-vw__frame { height: 0; padding-top: 56.25%; } }
#gk-vw .gk-vw__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .25s; }
#gk-vw .gk-vw__frame.is-ready iframe { opacity: 1; }
#gk-vw .gk-vw__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.7); }
#gk-vw .gk-vw__spin { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: gkVwSpin .8s linear infinite; }
#gk-vw .gk-vw__frame.is-ready .gk-vw__spin { display: none; }
@keyframes gkVwSpin { to { transform: rotate(360deg); } }
#gk-vw .gk-vw__hero { position: relative; display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 14px; overflow: hidden; background: var(--vw-bg2); isolation: isolate; }
#gk-vw .gk-vw__hero-bg { position: absolute; inset: -30px; z-index: -1; background-size: cover; background-position: center; filter: blur(28px) saturate(1.3) brightness(.45); transform: scale(1.1); }
#gk-vw .gk-vw__hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(23,15,35,.55), rgba(42,20,64,.35) 60%, rgba(155,77,224,.25)); }
#gk-vw .gk-vw__cover { width: 96px; height: 96px; flex: 0 0 96px; border-radius: 12px; object-fit: cover; object-position: center top; box-shadow: 0 8px 20px rgba(0,0,0,.45); background: #2a2139; }
#gk-vw .gk-vw__info { min-width: 0; flex: 1 1 auto; }
#gk-vw .gk-vw__kicker { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--vw-accent2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gk-vw .gk-vw__name { margin: 0 0 6px; font-size: 22px; font-weight: 800; line-height: 1.2; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; letter-spacing: 0; text-transform: none; }
#gk-vw .gk-vw__who { margin: 0; font-size: 14px; color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gk-vw .gk-vw__who span { display: inline-block; min-width: 58px; font-size: 12px; color: var(--vw-muted); }
#gk-vw .gk-vw__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#gk-vw .gk-vw__pill { background: var(--vw-accent); border-color: var(--vw-accent); height: 36px; }
#gk-vw .gk-vw__pill:hover { background: #8a3fd0; border-color: #8a3fd0; }
#gk-vw .gk-vw__pill--ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
#gk-vw .gk-vw__pill--ghost:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.26); }
#gk-vw .gk-vw__side { flex: 0 0 330px; width: 330px; border-left: 1px solid var(--vw-line); display: flex; flex-direction: column; min-height: 0; background: rgba(255,255,255,.02); }
#gk-vw .gk-vw__side-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 16px 8px; }
#gk-vw .gk-vw__side-head h4 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; text-transform: none; letter-spacing: 0; }
#gk-vw .gk-vw__side-head span { font-size: 12px; color: var(--vw-muted); white-space: nowrap; }
#gk-vw .gk-vw__rel { list-style: none; margin: 0; padding: 0 8px 12px; overflow: auto; flex: 1 1 auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
#gk-vw .gk-vw__rel li { margin: 0; padding: 0; list-style: none; }
#gk-vw .gk-vw__relbtn { display: flex; gap: 10px; align-items: center; width: 100%; padding: 6px; margin: 0; border: 0; border-radius: 10px; background: transparent; color: #fff; text-align: left; cursor: pointer; font: inherit; text-transform: none; letter-spacing: 0; min-height: 0; height: auto; box-shadow: none; }
#gk-vw .gk-vw__relbtn:hover { background: rgba(255,255,255,.07); }
#gk-vw .gk-vw__rel li.is-on .gk-vw__relbtn { background: rgba(155,77,224,.2); }
#gk-vw .gk-vw__relthumb { position: relative; flex: 0 0 120px; width: 120px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #000; }
#gk-vw .gk-vw__relthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#gk-vw .gk-vw__relthumb i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(23,15,35,.66); font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff; }
#gk-vw .gk-vw__reltxt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#gk-vw .gk-vw__reltxt b { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#gk-vw .gk-vw__reltxt small { font-size: 12px; color: var(--vw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- PDF ---- */
#gk-vw.gk-vw--pdf .gk-vw__body { background: #0f0a16; }
#gk-vw .gk-vw__pages { flex: 1 1 auto; overflow: auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; outline: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: radial-gradient(1200px 400px at 50% -100px, rgba(155,77,224,.14), transparent 70%), #0f0a16; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
#gk-vw .gk-vw__page { position: relative; flex: 0 0 auto; background: #fff; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); overflow: hidden; }
#gk-vw .gk-vw__page:not(.is-ready) { background: linear-gradient(100deg, #f2f0f5 40%, #fff 50%, #f2f0f5 60%) 0 0 / 200% 100%; animation: gkVwShine 1.2s linear infinite; }
@keyframes gkVwShine { to { background-position: -200% 0; } }
#gk-vw .gk-vw__page canvas { display: block; width: 100%; height: 100%; }
#gk-vw .gk-vw__pageno { position: absolute; right: 8px; bottom: 8px; z-index: 1; min-width: 24px; padding: 2px 7px; border-radius: 999px; background: rgba(23,15,35,.65); color: #fff; font-size: 11px; text-align: center; }
#gk-vw .gk-vw__loading { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--vw-muted); font-size: 14px; }
#gk-vw .gk-vw__loading .gk-vw__spin { position: static; margin: 0; }
#gk-vw .gk-vw__foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--vw-line); background: var(--vw-bg); }
#gk-vw .gk-vw__foot.is-off { display: none; }
#gk-vw .gk-vw__group { display: flex; align-items: center; gap: 6px; }
#gk-vw .gk-vw__group .gk-vw__btn { padding: 0; width: 38px; }
#gk-vw .gk-vw__count { min-width: 74px; text-align: center; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; }
#gk-vw .gk-vw__zoom .gk-vw__count { min-width: 48px; }
#gk-vw .gk-vw__sheets:empty { visibility: hidden; }
#gk-vw .gk-vw__fallback { margin: auto; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; color: var(--vw-muted); }
#gk-vw .gk-vw__fallback iframe { width: 100%; height: 100%; min-height: 60vh; border: 0; border-radius: 6px; background: #fff; }

/* ---- phone: full screen sheet ---- */
@media (max-width: 767px) {
  #gk-vw { align-items: stretch; }
  #gk-vw .gk-vw__panel, #gk-vw.gk-vw--yt.has-side .gk-vw__panel, #gk-vw.gk-vw--pdf .gk-vw__panel {
    width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: 0; animation-name: gkVwUp;
  }
  @keyframes gkVwUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  #gk-vw .gk-vw__bar { padding: 6px 6px 6px 4px; gap: 6px; min-height: 52px; padding-top: max(6px, env(safe-area-inset-top)); }
  #gk-vw .gk-vw__back { display: inline-flex; }
  #gk-vw .gk-vw__x { display: none; }
  #gk-vw .gk-vw__kind b { display: none; }
  #gk-vw .gk-vw__kind { padding: 5px; background: transparent; }
  #gk-vw .gk-vw__title { font-size: 15px; }
  #gk-vw .gk-vw__sub { display: none; }
  #gk-vw .gk-vw__tools .gk-vw__btn span { display: none; }
  #gk-vw .gk-vw__tools .gk-vw__btn { width: 38px; padding: 0; }
  #gk-vw.gk-vw--yt .gk-vw__body { flex-direction: column; overflow: auto; }
  #gk-vw .gk-vw__main { padding: 0; gap: 0; flex: 0 0 auto; }
  #gk-vw .gk-vw__stage { max-width: none; min-width: 0; position: sticky; top: 0; z-index: 2; }
  #gk-vw .gk-vw__frame { border-radius: 0; box-shadow: none; }
  #gk-vw .gk-vw__hero { border-radius: 0; padding: 14px 14px 16px; align-items: flex-start; gap: 12px; }
  #gk-vw .gk-vw__cover { width: 64px; height: 64px; flex-basis: 64px; border-radius: 10px; }
  #gk-vw .gk-vw__name { font-size: 18px; }
  #gk-vw .gk-vw__who { font-size: 13px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  #gk-vw .gk-vw__who span { min-width: 0; margin-right: 4px; }
  #gk-vw .gk-vw__acts { margin-top: 10px; }
  #gk-vw .gk-vw__acts .gk-vw__pill { height: 34px; padding: 0 12px; font-size: 12.5px; }
  #gk-vw .gk-vw__side { flex: 0 0 auto; width: auto; border-left: 0; border-top: 1px solid var(--vw-line); background: transparent; }
  #gk-vw .gk-vw__rel { overflow: visible; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  #gk-vw .gk-vw__relthumb { flex-basis: 132px; width: 132px; }
  #gk-vw .gk-vw__pages { padding: 10px 8px 16px; gap: 10px; }
  #gk-vw .gk-vw__foot { padding: 8px 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); gap: 4px; }
  #gk-vw .gk-vw__group { gap: 2px; }
  #gk-vw .gk-vw__group .gk-vw__btn { width: 36px; height: 36px; min-width: 36px; }
  #gk-vw .gk-vw__count { min-width: 0; font-size: 12px; padding: 0 2px; }
  #gk-vw .gk-vw__zoom .gk-vw__zfit, #gk-vw .gk-vw__zoom .gk-vw__count { display: none; }
}
@media (max-width: 767px) and (orientation: landscape) and (max-height: 500px) {
  #gk-vw.gk-vw--yt .gk-vw__stage { max-width: calc(100dvh * 16 / 9 - 90px); margin: 0 auto; position: static; }
}
@media (min-width: 768px) {
  /* the related list scrolls inside the height of the player column instead of stretching the dialog */
  #gk-vw .gk-vw__side { position: relative; }
  #gk-vw .gk-vw__side .gk-vw__rel { position: absolute; top: 46px; left: 0; right: 0; bottom: 0; }
}
