/*
 * Online Lectures - professional polish layer (LinkedIn-style). Loaded after the page's own styles; changes only the
 * look and motion, never layout logic. Animations use transform / opacity only (GPU-composited) and are switched off
 * for prefers-reduced-motion and in data-saver mode (html[data-lowbw], static/net/net.js).
 */
:root {
  --li-bg: #f4f2ee;
  --li-line: #e8e6e1;
  --li-ink: #191919;
  --li-muted: #5e5e5e;
  --lp-radius: 12px;
  --lp-shadow: 0 0 0 1px rgba(0, 0, 0, .07), 0 2px 3px rgba(0, 0, 0, .04);
  --lp-shadow-hover: 0 0 0 1px rgba(0, 0, 0, .06), 0 10px 28px -10px rgba(15, 23, 42, .22);
  --lp-ease: cubic-bezier(.2, .8, .2, 1);
}
html { scroll-behavior: smooth; }
body { background: var(--li-bg); letter-spacing: -.005em; }

/* ---------------------------------------------------------------- header: frosted, sharpens on scroll */
.li-header {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: transparent;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  transition: box-shadow .25s var(--lp-ease), background-color .25s var(--lp-ease);
}
.li-header.is-scrolled { background: rgba(255, 255, 255, .96); box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 8px 24px -16px rgba(15, 23, 42, .35); }
.li-search input { background: #eef3f8; transition: background-color .2s, box-shadow .2s, border-color .2s; }
.li-nav a { border-bottom: 0; transition: color .2s var(--lp-ease); }
.li-nav a i { transition: transform .25s var(--lp-ease); }
.li-nav a:hover i { transform: translateY(-2px); }
.li-nav a::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--li-ink); transform: scaleX(0); transition: transform .3s var(--lp-ease);
}
.li-nav a.active::after { transform: scaleX(1); }
.li-nav a:hover::after { transform: scaleX(.5); background: var(--li-muted); }
.li-nav a.active:hover::after { transform: scaleX(1); background: var(--li-ink); }
.li-portal { box-shadow: 0 6px 16px -8px var(--site-primary); transition: transform .2s var(--lp-ease), box-shadow .2s, background-color .2s; }
.li-portal:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px var(--site-primary); }

/* ---------------------------------------------------------------- cards */
.li-card, .li-post {
  border: 0;
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow);
}
.li-post { margin-bottom: .75rem; transition: box-shadow .3s var(--lp-ease), transform .3s var(--lp-ease); }
@media (hover: hover) and (pointer: fine) {
  .li-post:hover { box-shadow: var(--lp-shadow-hover); transform: translateY(-2px); }
}
.li-card-title { letter-spacing: -.01em; }

/* Institution card: slow-moving cover gradient */
.li-cover {
  height: 64px;
  background: linear-gradient(120deg, #0b2058, var(--site-primary, #0E2D6D) 40%, #1C4DA1 70%, var(--site-secondary, #008C6A));
  background-size: 220% 220%;
  animation: lpCover 14s ease-in-out infinite alternate;
}
@keyframes lpCover { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.li-profile-av { box-shadow: 0 6px 18px -6px rgba(15, 23, 42, .35); transition: transform .35s var(--lp-ease); }
.li-card:hover .li-profile-av { transform: translateY(-2px) scale(1.02); }
.li-profile-name { font-family: var(--site-heading-font); letter-spacing: -.01em; }
.li-stat { transition: background-color .2s; border-radius: 6px; margin: 0 .35rem; padding-left: .65rem; padding-right: .65rem; }
.li-stat:hover { background: #f5f5f3; }
.li-stat b { font-variant-numeric: tabular-nums; }

/* Filters, chips, segmented controls */
.li-filter, .li-chip, .li-seg button, .li-select, .li-more, .li-follow, .li-mob-filter {
  transition: background-color .2s var(--lp-ease), color .2s var(--lp-ease), border-color .2s var(--lp-ease), box-shadow .2s, transform .15s var(--lp-ease);
}
.li-filter:hover { background: #f1f0ec; }
.li-chip:hover { transform: translateY(-1px); }
.li-chip.active { box-shadow: 0 6px 14px -8px var(--site-secondary); }
.li-composer-input { transition: border-color .2s, box-shadow .2s; }
.li-composer-input:hover { border-color: #7c7c7c; }

/* ---------------------------------------------------------------- feed post */
.li-post-name { font-size: .9rem; letter-spacing: -.005em; }
.li-av-sm { box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(15, 23, 42, .18); }
.li-post-title { font-family: var(--site-heading-font); font-size: .98rem; letter-spacing: -.01em; }
.li-media { border-radius: 0; isolation: isolate; }
.li-media::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .35));
  opacity: .6; transition: opacity .35s var(--lp-ease);
}
.li-media:hover::before { opacity: 1; }
.li-media > img { transition: transform .6s var(--lp-ease); }
.li-media:hover > img { transform: scale(1.05); }
.li-media .li-play, .li-media .li-dur, .li-media .li-code, .li-media .li-resume, .li-media .li-prog { z-index: 2; }
.li-media .li-play { transition: transform .3s var(--lp-ease), box-shadow .3s; }
.li-media .li-play::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7);
  animation: lpRing 2.4s var(--lp-ease) infinite;
}
@keyframes lpRing { 0% { transform: scale(.85); opacity: .9; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
.li-media:hover .li-play { transform: scale(1.1); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
.li-media .li-prog > span { transition: width .6s var(--lp-ease); }
.li-social { border-bottom-color: #ecebe7; }
.li-action { position: relative; overflow: hidden; transition: background-color .2s, color .2s; }
.li-action i { transition: transform .25s var(--lp-ease); }
.li-action:hover:not(:disabled) i { transform: scale(1.12) rotate(-4deg); }
.li-action.saved i { animation: lpPop .45s var(--lp-ease); }
@keyframes lpPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.li-see-more { transition: color .2s; }

/* Ripple on tap (static/lectures_pro.js) */
.lp-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); opacity: .35;
  background: currentColor; animation: lpRipple .55s var(--lp-ease) forwards;
}
@keyframes lpRipple { to { transform: scale(2.6); opacity: 0; } }

/* ---------------------------------------------------------------- right rail */
.li-rail-item { border-radius: 8px; padding-left: .35rem; padding-right: .35rem; margin: 0 -.35rem; width: calc(100% + .7rem); transition: background-color .2s; }
.li-rail-item:hover { background: #f5f5f3; }
.li-rail-item img, .li-rail-item .ph { border-radius: 8px; transition: transform .3s var(--lp-ease); }
.li-rail-item:hover img, .li-rail-item:hover .ph { transform: scale(1.06); }
.li-live { transition: background-color .2s; border-radius: 8px; }
.li-live:hover { background: #f8f7f4; }
.li-live-date { transition: transform .25s var(--lp-ease); }
.li-live:hover .li-live-date { transform: translateY(-2px); }

/* ---------------------------------------------------------------- loading */
.li-skeleton .sk, .sk {
  background: linear-gradient(100deg, #ebe9e4 30%, #f7f6f3 50%, #ebe9e4 70%);
  background-size: 220% 100%;
  animation: liShine 1.3s ease-in-out infinite;
}

/* ---------------------------------------------------------------- reveal on scroll (only once JS is running) */
html.lp-anim .li-post:not(.lp-in), html.lp-anim .li-left .li-card:not(.lp-in), html.lp-anim .li-right .li-card:not(.lp-in) {
  opacity: 0; transform: translateY(14px);
}
html.lp-anim .li-post.lp-in, html.lp-anim .li-left .li-card.lp-in, html.lp-anim .li-right .li-card.lp-in {
  opacity: 1; transform: none;
  transition: opacity .55s var(--lp-ease) var(--lp-delay, 0ms), transform .55s var(--lp-ease) var(--lp-delay, 0ms), box-shadow .3s var(--lp-ease);
}

/* ---------------------------------------------------------------- accessibility */
.li-header a:focus-visible, .li-header button:focus-visible, .li-filter:focus-visible, .li-chip:focus-visible,
.li-action:focus-visible, .li-seg button:focus-visible, .li-follow:focus-visible, .li-rail-item:focus-visible, .li-media:focus-visible {
  outline: 2px solid var(--site-primary); outline-offset: 2px; border-radius: 8px;
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 767.98px) {
  .li-post, .li-card { border-radius: 0; box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 -1px 0 rgba(0, 0, 0, .03); }
  .li-post { margin-bottom: .5rem; }
}

/* ---------------------------------------------------------------- no motion: reduced-motion or data saver */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.lp-anim .li-post:not(.lp-in), html.lp-anim .li-card:not(.lp-in) { opacity: 1 !important; transform: none !important; }
}
html[data-lowbw] .li-cover, html[data-lowbw] .li-media .li-play::after { animation: none !important; }
html[data-lowbw] .li-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
html[data-lowbw].lp-anim .li-post:not(.lp-in), html[data-lowbw].lp-anim .li-card:not(.lp-in) { opacity: 1 !important; transform: none !important; }
