:root{
  --green:#16834B;
  --green-dark:#0D6338;
  --green-soft:rgba(22,131,75,.07);
  --text:#101411;
  --muted:#5F6862;
  --surface:#F7FAF8;
  --white:#fff;
  --border:rgba(16,20,17,.08);
  --shadow:0 16px 42px rgba(16,20,17,.08);
  --shadow-soft:0 8px 24px rgba(16,20,17,.06);
  --radius:22px;
  --radius-sm:16px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  color:var(--text);
  background:linear-gradient(180deg,#fff 0%,var(--surface) 48%,#fff 100%);
  font-family:"Tajawal","Cairo","Noto Sans Arabic",system-ui,-apple-system,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button,a{font:inherit}
a{color:inherit;text-decoration:none}
button{border:0}
.container{width:min(1200px,calc(100% - 36px));margin-inline:auto}

.site-header{
  position:sticky;top:0;z-index:50;
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(18px);
  border-bottom:1px solid var(--border)
}
.header-inner{height:78px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand{display:flex;align-items:center;gap:12px;min-width:0}
.brand-mark{
  width:46px;height:46px;border-radius:15px;display:grid;place-items:center;
  background:var(--green);color:#fff;box-shadow:0 9px 18px rgba(22,131,75,.18)
}
.brand-mark svg{width:32px;height:32px}
.brand-copy{display:grid;gap:2px;min-width:0}
.brand-copy strong{font-size:15px;white-space:nowrap}
.brand-copy span{font-size:11px;color:var(--muted);white-space:nowrap}
.header-actions{display:flex;align-items:center;gap:8px}
.header-link{padding:10px 12px;border-radius:12px;color:var(--muted);font-size:13px}
.header-link:hover{background:var(--green-soft);color:var(--green-dark)}
.icon-btn{width:42px;height:42px;border-radius:13px;background:var(--surface);color:var(--text);display:grid;place-items:center;cursor:pointer;border:1px solid var(--border)}
.icon{display:block;width:19px;height:19px;position:relative}
.icon-menu:before,.icon-menu:after,.icon-menu{border-top:2px solid currentColor}
.icon-menu:before,.icon-menu:after{content:"";position:absolute;left:0;right:0}
.icon-menu:before{top:5px}.icon-menu:after{top:11px}
.icon-close:before,.icon-close:after{content:"";position:absolute;left:8px;top:1px;height:17px;width:2px;background:currentColor;border-radius:3px}.icon-close:before{transform:rotate(45deg)}.icon-close:after{transform:rotate(-45deg)}
.mobile-subjects-btn,.mobile-close-btn{display:none}

.hero-section{padding:64px 0 34px}
.hero-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(320px,.7fr);gap:44px;align-items:center}
.eyebrow,.section-kicker{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:800;color:var(--green-dark);letter-spacing:.03em}
.eyebrow:before,.section-kicker:before{content:"";width:7px;height:7px;border-radius:50%;background:var(--green)}
.hero-copy h1{font-size:clamp(38px,6vw,70px);line-height:1.04;margin:12px 0 18px;letter-spacing:-.045em}
.hero-lead{max-width:730px;margin:0;color:var(--muted);font-size:17px;line-height:1.95}
.stats-row{margin-top:28px;display:flex;gap:12px;flex-wrap:wrap}
.stat-card{min-width:120px;padding:15px 17px;border:1px solid var(--border);background:rgba(255,255,255,.82);border-radius:17px;box-shadow:var(--shadow-soft);display:grid;gap:3px}
.stat-card b{font-size:22px;color:var(--green-dark)}.stat-card span{font-size:12px;color:var(--muted)}
.hero-illustration{min-height:300px;border-radius:34px;background:linear-gradient(145deg,#eff8f2 0%,#e2f1e7 100%);position:relative;overflow:hidden;display:grid;place-items:center;border:1px solid rgba(22,131,75,.10);box-shadow:var(--shadow)}
.hero-book{width:210px;height:210px;display:grid;place-items:center;position:relative;z-index:2;filter:drop-shadow(0 22px 28px rgba(13,99,56,.16));animation:float 5s ease-in-out infinite}
.hero-book svg{width:100%;height:100%}
.hero-orbit{position:absolute;border:1px solid rgba(22,131,75,.16);border-radius:50%;animation:orbit 12s linear infinite}
.hero-orbit-a{width:300px;height:190px;transform:rotate(24deg)}
.hero-orbit-b{width:245px;height:320px;transform:rotate(-35deg);animation-direction:reverse}
@keyframes float{50%{transform:translateY(-7px)}}
@keyframes orbit{to{transform:rotate(384deg)}}

.content-section{padding:24px 0 70px}
.section-heading{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:24px}
.section-heading h2,.lectures-heading h2{margin:8px 0 0;font-size:clamp(23px,3vw,32px);letter-spacing:-.025em}
.section-heading p{margin:0;color:var(--muted);font-size:13px}
.subject-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:24px;align-items:start}
.subjects-panel,.lectures-panel{border:1px solid var(--border);background:rgba(255,255,255,.88);border-radius:var(--radius);box-shadow:var(--shadow-soft)}
.subjects-panel{padding:14px;position:sticky;top:94px}
.panel-heading{display:flex;align-items:center;justify-content:space-between;padding:4px 6px 10px;font-weight:800}
.subjects-list{display:grid;gap:8px}
.subject-item{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 14px;border-radius:16px;background:transparent;color:var(--text);cursor:pointer;text-align:right;transition:.2s ease}
.subject-item:hover{background:var(--green-soft)}
.subject-item.active{background:linear-gradient(135deg,rgba(22,131,75,.12),rgba(22,131,75,.05));color:var(--green-dark);box-shadow:inset 0 0 0 1px rgba(22,131,75,.09)}
.subject-main{min-width:0}.subject-name{font-weight:800;font-size:13px;line-height:1.65}.subject-meta{font-size:11px;color:var(--muted);margin-top:2px}
.subject-count{min-width:34px;height:30px;padding-inline:8px;border-radius:10px;background:#fff;border:1px solid var(--border);display:grid;place-items:center;font-size:11px;color:var(--muted)}
.subject-item.active .subject-count{color:var(--green-dark);border-color:rgba(22,131,75,.16);background:#fafffc}

.lectures-panel{padding:22px}
.lectures-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.lecture-count-pill{padding:9px 11px;border-radius:12px;background:var(--green-soft);color:var(--green-dark);font-size:12px;white-space:nowrap}
.lectures-list{display:grid;gap:16px}

.lecture-card{border:1px solid var(--border);background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 9px 27px rgba(16,20,17,.05)}
.lecture-head{padding:20px 20px 16px;display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.lecture-index{min-width:48px;height:48px;border-radius:15px;background:var(--green-soft);color:var(--green-dark);display:grid;place-items:center;font-size:14px;font-weight:900}
.lecture-title-wrap{display:flex;gap:13px;min-width:0;flex:1}
.lecture-title{margin:1px 0 6px;font-size:19px;line-height:1.6;letter-spacing:-.02em}
.lecture-meta{display:flex;flex-wrap:wrap;gap:7px;color:var(--muted);font-size:11px}
.meta-tag{padding:5px 8px;border-radius:9px;background:var(--surface);border:1px solid var(--border)}

.audio-shell{margin:0 20px 20px;border-radius:18px;background:linear-gradient(180deg,#0f2418,#0c1b12);padding:15px 16px;color:#fff}
.audio-row{display:flex;align-items:center;gap:14px}
.audio-play{width:50px;height:50px;border-radius:50%;display:grid;place-items:center;cursor:pointer;background:#fff;color:var(--green-dark);flex:0 0 auto;box-shadow:0 10px 20px rgba(0,0,0,.16)}
.audio-play svg{width:21px;height:21px}
.audio-main{min-width:0;flex:1}
.audio-topline{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px;color:rgba(255,255,255,.72)}
.audio-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.time-text{direction:ltr;white-space:nowrap;font-variant-numeric:tabular-nums}
.progress-wrap{margin-top:9px}
.progress{appearance:none;width:100%;height:5px;border-radius:99px;background:rgba(255,255,255,.18);cursor:pointer;outline:none}
.progress::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border-radius:50%;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.24)}
.progress::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#fff;border:none;box-shadow:0 2px 8px rgba(0,0,0,.24)}
.audio-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}
.volume-wrap{display:flex;align-items:center;gap:8px;min-width:150px}.volume{appearance:none;width:90px;height:4px;border-radius:99px;background:rgba(255,255,255,.18)}
.volume::-webkit-slider-thumb{appearance:none;width:12px;height:12px;border-radius:50%;background:#fff}.volume::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:#fff;border:0}
.speed-btn,.audio-download{padding:7px 9px;border-radius:9px;background:rgba(255,255,255,.08);color:#fff;border:1px solid rgba(255,255,255,.08);cursor:pointer;font-size:11px}
.speed-btn:hover,.audio-download:hover{background:rgba(255,255,255,.14)}
.audio-icon{width:18px;height:18px;display:block}

.attachment-section{padding:0 20px 22px}
.attachment-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.attachment-title{font-size:13px;font-weight:800}.attachment-count{font-size:11px;color:var(--muted)}
.gallery{border:1px solid var(--border);border-radius:18px;overflow:hidden;background:#0f1210}
.gallery-stage{position:relative;min-height:280px;display:grid;place-items:center;background:linear-gradient(140deg,#101713,#161c18)}
.gallery-slide{position:absolute;inset:0;padding:12px;opacity:0;transform:translateX(16px) scale(.985);transition:opacity .38s ease,transform .38s ease;display:grid;place-items:center;pointer-events:none}
.gallery-slide.active{opacity:1;transform:translateX(0) scale(1);pointer-events:auto}
.gallery-slide img{max-width:100%;max-height:390px;width:auto;height:auto;object-fit:contain;border-radius:12px;box-shadow:0 15px 28px rgba(0,0,0,.18)}
.gallery-slide iframe{width:100%;height:390px;border:0;background:#fff;border-radius:12px}
.file-preview{width:min(88%,540px);padding:28px;border-radius:18px;background:#fff;text-align:center;color:var(--text)}
.file-preview .file-symbol{width:58px;height:58px;margin:0 auto 12px;border-radius:17px;background:var(--green-soft);display:grid;place-items:center;color:var(--green-dark)}
.file-preview strong{display:block;font-size:14px}.file-preview span{display:block;margin-top:6px;font-size:11px;color:var(--muted)}
.gallery-nav{display:flex;align-items:center;justify-content:space-between;padding:10px 10px 11px;background:#0c110e;border-top:1px solid rgba(255,255,255,.08)}
.gallery-arrow{width:38px;height:38px;border-radius:11px;background:rgba(255,255,255,.08);color:#fff;cursor:pointer;display:grid;place-items:center}
.gallery-arrow:hover{background:rgba(255,255,255,.14)}
.gallery-dots{display:flex;align-items:center;justify-content:center;gap:6px;flex:1}
.gallery-dot{width:7px;height:7px;border-radius:50%;background:rgba(255,255,255,.27);cursor:pointer;transition:.2s}
.gallery-dot.active{width:19px;border-radius:99px;background:#fff}
.thumbs{display:flex;gap:7px;overflow:auto;padding-top:10px;scrollbar-width:thin}
.thumb{width:64px;height:52px;flex:0 0 auto;border-radius:10px;overflow:hidden;border:1px solid var(--border);background:var(--surface);cursor:pointer;position:relative}
.thumb.active{border-color:rgba(22,131,75,.38);box-shadow:0 0 0 2px rgba(22,131,75,.08)}
.thumb img{width:100%;height:100%;object-fit:cover}.thumb.pdf-thumb{display:grid;place-items:center;color:#a33}.thumb.pdf-thumb:after{content:"PDF";font-size:9px;font-weight:900}

.state-card{padding:36px;border:1px dashed var(--border);border-radius:18px;background:var(--surface);color:var(--muted);text-align:center;font-size:13px}
.loading-card{display:flex;align-items:center;justify-content:center;gap:9px}
.spinner{width:17px;height:17px;border-radius:50%;border:2px solid rgba(22,131,75,.15);border-top-color:var(--green);animation:spin .75s linear infinite;display:inline-block}
@keyframes spin{to{transform:rotate(360deg)}}

.site-footer{padding:26px 0 34px;border-top:1px solid var(--border);background:rgba(255,255,255,.72)}
.footer-inner{display:flex;justify-content:space-between;align-items:center;gap:18px}
.footer-brand{display:flex;align-items:center;gap:10px;color:var(--muted)}
.footer-brand strong{display:block;color:var(--text);font-size:12px}.footer-brand span{display:block;font-size:10px;margin-top:2px}.footer-mark{width:40px;height:40px}.footer-mark svg{width:28px;height:28px}
.footer-note{font-size:11px;letter-spacing:.12em;color:var(--muted)}

.mobile-overlay{display:none}
.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%) translateY(20px);background:#101411;color:#fff;padding:11px 15px;border-radius:12px;font-size:12px;opacity:0;pointer-events:none;transition:.25s;z-index:100;box-shadow:0 15px 32px rgba(16,20,17,.18)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media (max-width: 980px){
  .hero-grid{grid-template-columns:1fr}.hero-illustration{min-height:250px}.subject-layout{grid-template-columns:1fr}.subjects-panel{position:fixed;inset:0 auto 0 0;width:min(340px,88vw);z-index:80;border-radius:0 24px 24px 0;padding:18px;transform:translateX(-105%);transition:.28s ease;overflow:auto;box-shadow:24px 0 60px rgba(0,0,0,.14)}
  .subjects-panel.open{transform:translateX(0)}.mobile-subjects-btn,.mobile-close-btn{display:grid}.mobile-overlay.show{display:block;position:fixed;inset:0;z-index:70;background:rgba(16,20,17,.36);backdrop-filter:blur(2px)}
  .header-link{display:none}
}

@media (max-width: 640px){
  .container{width:min(100% - 24px,1200px)}.header-inner{height:70px}.brand-mark{width:42px;height:42px}.brand-copy strong{font-size:14px}.brand-copy span{font-size:10px}
  .hero-section{padding:38px 0 25px}.hero-copy h1{font-size:40px}.hero-lead{font-size:14px;line-height:1.85}.hero-illustration{min-height:220px}.hero-book{width:165px;height:165px}
  .section-heading,.lectures-heading{align-items:flex-start;flex-direction:column}.section-heading{gap:10px}.section-heading p{font-size:12px}
  .lectures-panel{padding:14px;border-radius:18px}.lecture-head{padding:15px 14px}.lecture-title{font-size:16px}.lecture-index{width:42px;height:42px;min-width:42px;border-radius:12px}
  .audio-shell{margin:0 14px 16px;padding:12px}.audio-controls{align-items:flex-start;flex-wrap:wrap}.volume-wrap{min-width:0;flex:1}.volume{width:82px}
  .attachment-section{padding:0 14px 16px}.gallery-stage{min-height:235px}.gallery-slide img{max-height:280px}.gallery-slide iframe{height:300px}.thumb{width:58px;height:47px}
  .stats-row{gap:8px}.stat-card{min-width:96px;padding:13px}.stat-card b{font-size:20px}.footer-inner{align-items:flex-start;flex-direction:column}
}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}

/* ============================================================================
 * V2 UX ENHANCEMENTS
 * - mobile subject dropdown
 * - compact lecture list + lecture modal
 * - image lightbox + download actions
 * ========================================================================== */

body.modal-open{overflow:hidden}

.mobile-subject-picker{display:none;position:relative;margin:-4px 0 18px;z-index:20}
.mobile-subject-trigger{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:13px 14px;border:1px solid var(--border);border-radius:17px;
  background:rgba(255,255,255,.92);box-shadow:var(--shadow-soft);cursor:pointer;text-align:right;
  transition:.22s ease;
}
.mobile-subject-trigger:hover,.mobile-subject-picker.open .mobile-subject-trigger{
  border-color:rgba(22,131,75,.18);box-shadow:0 12px 34px rgba(16,20,17,.09)
}
.mobile-subject-trigger-main{display:grid;gap:3px;min-width:0}
.mobile-subject-trigger-label{font-size:10px;color:var(--muted)}
.mobile-subject-trigger-main strong{font-size:14px;line-height:1.55;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mobile-subject-chevron{width:10px;height:10px;border-inline-end:2px solid var(--green-dark);border-bottom:2px solid var(--green-dark);transform:rotate(45deg) translateY(-2px);transition:.22s ease;flex:0 0 auto}
.mobile-subject-picker.open .mobile-subject-chevron{transform:rotate(225deg) translateY(-2px)}
.mobile-subject-menu{
  position:absolute;inset-inline:0;top:calc(100% + 8px);padding:8px;
  border:1px solid var(--border);border-radius:18px;background:#fff;
  box-shadow:0 24px 60px rgba(16,20,17,.13);opacity:0;transform:translateY(-7px) scale(.985);
  visibility:hidden;pointer-events:none;transition:opacity .18s ease,transform .18s ease,visibility .18s ease;
  max-height:min(420px,60vh);overflow:auto;
}
.mobile-subject-menu.open{opacity:1;transform:translateY(0) scale(1);visibility:visible;pointer-events:auto}
.mobile-subject-option{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 12px;border-radius:13px;background:transparent;color:var(--text);cursor:pointer;text-align:right;
  transition:background .18s ease,color .18s ease;outline:none;
}
.mobile-subject-option:hover,.mobile-subject-option:focus-visible{background:var(--green-soft)}
.mobile-subject-option.active{background:rgba(22,131,75,.09);color:var(--green-dark)}
.mobile-subject-option-copy{display:grid;gap:3px;min-width:0}
.mobile-subject-option-copy strong{font-size:13px;line-height:1.55;overflow:hidden;text-overflow:ellipsis}
.mobile-subject-option-copy small{font-size:10px;color:var(--muted)}
.mobile-subject-option-check{width:20px;height:20px;display:grid;place-items:center;color:var(--green);opacity:0;flex:0 0 auto}
.mobile-subject-option-check svg{width:18px;height:18px}
.mobile-subject-option.active .mobile-subject-option-check{opacity:1}

/* Compact lecture list */
.lectures-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.lecture-card{
  appearance:none;width:100%;border:1px solid var(--border);background:#fff;border-radius:18px;
  padding:15px;display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:12px;
  text-align:right;color:var(--text);cursor:pointer;box-shadow:0 7px 22px rgba(16,20,17,.045);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease;
}
.lecture-card:hover{transform:translateY(-2px);border-color:rgba(22,131,75,.16);box-shadow:0 14px 32px rgba(16,20,17,.08);background:#fcfffd}
.lecture-card:focus-visible{outline:3px solid rgba(22,131,75,.16);outline-offset:2px}
.lecture-card-number{width:48px;height:48px;border-radius:14px;background:var(--green-soft);color:var(--green-dark);display:grid;place-items:center;font-size:14px;font-weight:900;direction:ltr;font-variant-numeric:tabular-nums}
.lecture-card-main{min-width:0;display:grid;gap:6px}
.lecture-card-title{font-size:15px;font-weight:800;line-height:1.65;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.lecture-card-meta{display:flex;flex-wrap:wrap;gap:6px;color:var(--muted);font-size:10px}
.lecture-card-meta span{padding:4px 7px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}
.lecture-card-action{display:flex;align-items:center;gap:4px;color:var(--green-dark);font-size:11px;white-space:nowrap}
.lecture-card-action svg{width:16px;height:16px}

/* Lecture modal */
.lecture-modal-backdrop,.image-lightbox-backdrop{
  position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;
  padding:24px;background:rgba(7,11,8,.58);backdrop-filter:blur(10px);
  opacity:0;visibility:hidden;pointer-events:none;transition:opacity .22s ease,visibility .22s ease;
}
.lecture-modal-backdrop.open,.image-lightbox-backdrop.open{opacity:1;visibility:visible;pointer-events:auto}
.lecture-modal{
  width:min(980px,100%);max-height:min(900px,calc(100vh - 48px));overflow:auto;
  border:1px solid rgba(255,255,255,.18);border-radius:26px;background:#fff;box-shadow:0 30px 90px rgba(0,0,0,.24);
  transform:translateY(16px) scale(.985);transition:transform .24s ease;
}
.lecture-modal-backdrop.open .lecture-modal{transform:translateY(0) scale(1)}
.lecture-modal-header{position:sticky;top:0;z-index:5;display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:20px 22px;border-bottom:1px solid var(--border);background:rgba(255,255,255,.94);backdrop-filter:blur(14px)}
.lecture-modal-heading{min-width:0}.lecture-modal-kicker,.lightbox-kicker{display:block;font-size:10px;font-weight:800;color:var(--green-dark);margin-bottom:5px}
.lecture-modal-heading h2{margin:0;font-size:clamp(20px,3vw,28px);line-height:1.5}
.modal-close{width:42px;height:42px;border-radius:13px;border:1px solid var(--border);background:var(--surface);color:var(--text);display:grid;place-items:center;cursor:pointer;font-size:28px;line-height:1}
.modal-close:hover{background:var(--green-soft);color:var(--green-dark)}
.lecture-modal-body{padding:20px 22px 28px}
.lecture-modal-meta{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:14px}
.modal-meta-pill{padding:7px 9px;border-radius:9px;background:var(--surface);border:1px solid var(--border);font-size:11px;color:var(--muted)}
.modal-attachments{margin-top:20px}.modal-section-heading{display:flex;align-items:end;justify-content:space-between;gap:15px;margin-bottom:12px}
.modal-section-heading h3{margin:5px 0 0;font-size:18px}.modal-empty{margin-top:18px}

/* Audio inside modal */
.audio-main{min-width:0;flex:1}.audio-tools{display:flex;align-items:center;gap:7px}.audio-download{display:inline-flex;align-items:center;gap:5px}.audio-download svg{width:15px;height:15px}

/* Gallery enhancements */
.gallery{position:relative}
.gallery-slide img{cursor:zoom-in}
.gallery-slide-toolbar{position:absolute;inset:auto 20px 20px auto;display:flex;gap:7px;opacity:0;transform:translateY(5px);transition:.2s ease;z-index:3}
.gallery-slide.active:hover .gallery-slide-toolbar,.gallery-slide.active:focus-within .gallery-slide-toolbar{opacity:1;transform:translateY(0)}
.gallery-slide-download,.file-open{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:8px 10px;border-radius:10px;
  background:rgba(0,0,0,.72);border:1px solid rgba(255,255,255,.14);color:#fff;font-size:10px;cursor:pointer;backdrop-filter:blur(8px)
}
.gallery-slide-download:hover{background:rgba(0,0,0,.84)}
.gallery-slide-download svg,.gallery-all-download svg{width:15px;height:15px}
.gallery-slide-download-pdf{position:absolute;inset:auto 20px 20px auto;z-index:3}
.gallery-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 10px 12px;background:#0c110e;border-top:1px solid rgba(255,255,255,.08)}
.gallery-all-download,.lightbox-all-download{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:8px 10px;border-radius:10px;
  background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.1);color:#fff;cursor:pointer;font-size:10px
}
.gallery-all-download:hover,.lightbox-all-download:hover{background:rgba(255,255,255,.16)}
.gallery-hint{font-size:10px;color:rgba(255,255,255,.62)}
.file-open{margin-top:14px;background:var(--green);border-color:transparent}
.file-open:hover{background:var(--green-dark)}

/* Image lightbox */
.image-lightbox-backdrop{z-index:230;padding:12px}
.image-lightbox{
  width:min(1240px,100%);height:min(94vh,900px);display:grid;grid-template-rows:auto minmax(0,1fr) auto;
  border-radius:24px;overflow:hidden;background:#0b100d;border:1px solid rgba(255,255,255,.12);box-shadow:0 35px 100px rgba(0,0,0,.36);
  transform:translateY(14px) scale(.985);transition:transform .24s ease;
}
.image-lightbox-backdrop.open .image-lightbox{transform:translateY(0) scale(1)}
.lightbox-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 16px;background:#0d140f;border-bottom:1px solid rgba(255,255,255,.08);color:#fff}
.lightbox-title-wrap{min-width:0}.lightbox-title-wrap strong{display:block;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lightbox-kicker{color:rgba(255,255,255,.58)}
.lightbox-actions{display:flex;align-items:center;gap:7px}.lightbox-download{display:inline-flex;align-items:center;padding:8px 10px;border-radius:10px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.08);color:#fff;font-size:10px;white-space:nowrap}
.lightbox-download:hover{background:rgba(255,255,255,.14)}
.lightbox-stage{position:relative;min-height:0;display:grid;place-items:center;padding:24px 68px;background:radial-gradient(circle at center,#1a241e 0%,#0a0e0b 72%);overflow:hidden}
.lightbox-stage img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:12px;box-shadow:0 26px 55px rgba(0,0,0,.35)}
.lightbox-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:3;width:46px;height:46px;border-radius:14px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.12);color:#fff;font-size:31px;display:grid;place-items:center;cursor:pointer}
.lightbox-arrow:hover{background:rgba(255,255,255,.17)}
.lightbox-prev{right:16px}.lightbox-next{left:16px}
.lightbox-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px;background:#0d140f;border-top:1px solid rgba(255,255,255,.08);color:rgba(255,255,255,.7);font-size:10px}
.lightbox-all-download{background:rgba(255,255,255,.1)}

@media (min-width:761px){
  .gallery-slide-toolbar{opacity:1;transform:none}
}

@media (max-width:980px){
  .mobile-subject-picker{display:block}
  .subjects-panel{display:none}
  .subject-layout{grid-template-columns:1fr}
  .lectures-list{grid-template-columns:1fr;gap:10px}
  .lecture-card{grid-template-columns:44px minmax(0,1fr) auto;padding:12px;border-radius:16px}
  .lecture-card-number{width:44px;height:44px;border-radius:12px}
  .lecture-card-title{font-size:14px;-webkit-line-clamp:2}
  .lecture-card-action{font-size:10px}.lecture-card-action svg{width:14px;height:14px}

  .lecture-modal-backdrop{padding:0;align-items:flex-end}
  .lecture-modal{width:100%;max-height:94vh;border-radius:24px 24px 0 0;border-bottom:0}
  .lecture-modal-header{padding:15px 15px 12px}
  .lecture-modal-body{padding:15px 15px 24px}

  .gallery-stage{min-height:230px}
  .gallery-slide img{max-height:300px}
  .gallery-slide-toolbar{opacity:1;transform:none;inset:auto 16px 16px auto}
  .gallery-actions{padding:9px}
  .gallery-hint{font-size:9px}
  .lightbox-topbar{padding:12px}.lightbox-actions{gap:5px}.lightbox-download{font-size:9px;padding:7px 8px}.modal-close{width:38px;height:38px}
  .image-lightbox{height:100%;border-radius:18px}.lightbox-stage{padding:18px 48px}.lightbox-stage img{max-height:calc(100vh - 180px)}
  .lightbox-prev{right:8px}.lightbox-next{left:8px}.lightbox-arrow{width:38px;height:38px;border-radius:11px}
}

@media (hover:none){
  .gallery-slide-toolbar{opacity:1;transform:none}
}

@media (max-width:640px){
  .hero-copy h1{font-size:clamp(36px,11vw,49px)}
  .hero-lead{font-size:14px}
  .section-heading{margin-bottom:18px}
  .lectures-panel{padding:14px}
  .lectures-heading{margin-bottom:14px}
  .lecture-modal-heading h2{font-size:18px}
}
