#library-resources{
  --navy:#0f1e4a;
  --blue:#1f5fae;
  --orange:#d98600;
  --ink:#172033;
  --muted:#6b7280;
  --line:#e5e9f0;
  --soft:#f5f7fb;
  --white:#fff;
  --shadow:0 12px 30px rgba(15,30,74,.10);
}






.lr-section{
  padding:58px 22px 76px;
  background:
    radial-gradient(circle at top right,rgba(31,95,174,.09),transparent 30%),
    linear-gradient(180deg,#fff 0%,#f8faff 100%);
}
.lr-wrap{max-width:1280px;margin:auto}
.lr-kicker{display:inline-flex;align-items:center;gap:8px;color:var(--orange);font-weight:800;
  letter-spacing:.08em;font-size:13px;text-transform:uppercase}
.lr-kicker:before{content:"";width:32px;height:3px;border-radius:4px;background:var(--orange)}
.lr-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin:8px 0 22px}
.lr-title{margin:0;font-size:40px;line-height:1.05;color:var(--navy);font-weight:800}
.lr-sub{margin:9px 0 0;color:var(--muted);max-width:700px}
.lr-count{background:var(--navy);color:#fff;border-radius:16px;padding:15px 20px;min-width:165px;
  box-shadow:var(--shadow);text-align:center}
.lr-count strong{font-size:28px;display:block;line-height:1}
.lr-count span{font-size:12px;opacity:.8}

.subject-cloud{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px 20px;margin-bottom:20px;
 box-shadow:0 7px 22px rgba(15,30,74,.05);animation:rise .55s ease both}
.subject-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:12px}
.subject-head h3{margin:0;color:var(--navy);font-size:17px}
.subject-head span{font-size:12px;color:var(--muted)}
.subject-chips{display:flex;gap:8px;flex-wrap:wrap}
.subject-chip{border:1px solid #dfe5ee;background:#f7f9fc;color:#49566d;border-radius:999px;
 padding:7px 12px;font:700 12px "Heebo";cursor:pointer;transition:.22s ease}
.subject-chip:hover{transform:translateY(-2px);background:#fff7e8;border-color:#efc574;color:#8d5600}
.subject-chip.active{background:var(--orange);border-color:var(--orange);color:#fff}

.lr-tools{display:flex;gap:12px;margin-bottom:15px}
.lr-search{position:relative;flex:1}
.lr-search svg{position:absolute;left:17px;top:50%;transform:translateY(-50%);opacity:.45}
.lr-search input{width:100%;height:52px;border:1px solid var(--line);border-radius:14px;padding:0 16px 0 48px;
 font:500 15px "Heebo";outline:none;background:#fff;box-shadow:0 4px 14px rgba(15,30,74,.04)}
.lr-search input:focus{border-color:#9db7db;box-shadow:0 0 0 4px rgba(31,95,174,.08)}
.clear-filter{height:52px;border:1px solid var(--line);background:#fff;border-radius:14px;padding:0 18px;
 color:var(--navy);font:800 13px "Heebo";cursor:pointer}

.lr-shell{display:grid;grid-template-columns:300px 1fr;gap:20px;align-items:stretch}
.lr-resource-panel{height:640px}
.lr-sidebar{background:#fff;border:1px solid var(--line);border-radius:20px;padding:16px;
 box-shadow:0 8px 24px rgba(15,30,74,.06);animation:rise .55s .08s ease both}
.lr-side-title{font-size:12px;color:#8a93a3;text-transform:uppercase;letter-spacing:.08em;font-weight:800;
 margin:3px 8px 12px}
.lr-cat{width:100%;border:0;background:transparent;display:flex;align-items:center;justify-content:space-between;
 gap:12px;padding:10px 11px;border-radius:13px;color:#263248;font:700 14px "Heebo";cursor:pointer;
 transition:.22s ease;margin:4px 0}
.lr-cat:hover{background:#f3f6fb;color:var(--navy);transform:translateX(4px)}
.lr-cat.active{background:linear-gradient(135deg,var(--navy),#183b7a);color:#fff;box-shadow:0 8px 18px rgba(15,30,74,.18)}
.cat-left{display:flex;align-items:center;gap:10px}
.cat-icon{width:32px;height:32px;border-radius:10px;background:#eef3fa;display:grid;place-items:center;
 color:var(--blue);font-size:11px;font-weight:900;transition:.22s ease}
.lr-cat.active .cat-icon{background:rgba(255,255,255,.14);color:#fff}
.num{min-width:29px;height:24px;padding:0 8px;border-radius:20px;display:grid;place-items:center;
 background:#edf1f7;color:#536079;font-size:11px}
.lr-cat.active .num{background:rgba(255,255,255,.16);color:#fff}

.lr-resource-panel{overflow:auto;padding:2px 8px 10px 2px;scrollbar-width:thin;scrollbar-color:#c8d2e1 transparent}
.lr-resource-panel::-webkit-scrollbar{width:8px}
.lr-resource-panel::-webkit-scrollbar-thumb{background:#c8d2e1;border-radius:10px}
.lr-resource-panel::-webkit-scrollbar-track{background:transparent}
.lr-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.lr-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:17px;min-height:178px;
 display:flex;flex-direction:column;box-shadow:0 4px 16px rgba(15,30,74,.035);
 transition:transform .23s ease,box-shadow .23s ease,border-color .23s ease;animation:cardIn .45s ease both}
.lr-card:hover{transform:translateY(-5px) scale(1.012);border-color:#c9d3e1;box-shadow:0 16px 30px rgba(15,30,74,.12)}
.lr-card:hover .item-icon{transform:rotate(-6deg) scale(1.08);background:var(--navy);color:#fff}
.lr-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.item-icon{width:43px;height:43px;border-radius:13px;background:#eff4fb;color:var(--blue);
 display:grid;place-items:center;font-size:12px;font-weight:900;transition:.25s ease}
.tag{background:#fff7e8;color:#9a5a00;border-radius:20px;padding:5px 9px;font-size:10px;font-weight:800;
 text-transform:uppercase;letter-spacing:.04em;max-width:140px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lr-card h4{font-size:16px;color:var(--navy);margin:14px 0 4px}
.lr-card p{font-size:12.5px;color:var(--muted);line-height:1.45;margin:0 0 13px;
 display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.lr-actions{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:10px}
.lr-open{text-decoration:none;color:var(--blue);font-weight:800;font-size:12.5px}
.lr-info{border:0;background:#f3f5f8;color:#48556b;border-radius:9px;padding:7px 10px;
 font:700 11px "Heebo";cursor:pointer;transition:.2s}
.lr-info:hover{background:var(--orange);color:#fff}
.lr-empty{display:none;background:#fff;border:1px dashed #ccd4e1;border-radius:18px;padding:36px;text-align:center;color:var(--muted)}

.lr-modal{position:fixed;inset:0;background:rgba(8,18,44,.55);display:none;align-items:center;justify-content:center;
 padding:20px;z-index:9999}
.lr-modal.show{display:flex}
.lr-dialog{width:min(620px,100%);background:#fff;border-radius:20px;box-shadow:0 30px 90px rgba(0,0,0,.28);overflow:hidden;
 animation:pop .22s ease}
.lr-dialog-head{background:var(--navy);color:#fff;padding:21px 24px;display:flex;justify-content:space-between;gap:20px}
.lr-dialog-head h3{margin:0;font-size:21px}
.lr-close{border:0;background:rgba(255,255,255,.12);color:#fff;width:34px;height:34px;border-radius:9px;font-size:20px;cursor:pointer}
.lr-dialog- .lr-dialog-body p{color:#566174;line-height:1.65;margin-top:0}
.lr-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}
.lr-meta div{background:#f6f8fb;border-radius:12px;padding:12px}
.lr-meta b{display:block;color:var(--navy);font-size:12px;margin-bottom:3px}
.lr-meta span{font-size:13px;color:#687386}
.lr-dialog-foot{padding:0 24px 24px}
.lr-dialog-foot a{display:inline-block;background:var(--orange);color:#fff;text-decoration:none;border-radius:11px;padding:10px 15px;font-weight:800}


.cat-icon i{font-size:14px}
.item-icon i{font-size:18px}
.lr-card:nth-child(4n+1) .item-icon{background:#eef4ff}
.lr-card:nth-child(4n+2) .item-icon{background:#fff6e8;color:#a76100}
.lr-card:nth-child(4n+3) .item-icon{background:#eef9f5;color:#25785d}
.lr-card:nth-child(4n+4) .item-icon{background:#f6f0ff;color:#6b4ba5}


.resource-desc{
  font-size:12.5px;color:var(--muted);line-height:1.5;margin:0 0 13px;
  display:block;overflow:visible;
}
.inline-details{
  border:0;background:transparent;color:var(--blue);padding:0 0 0 5px;
  font:800 12px "Heebo";cursor:pointer;text-decoration:underline;
}
.inline-details:hover{color:var(--orange)}
.details-page{
  position:fixed;inset:0;background:#f7f9fc;z-index:10000;display:none;overflow:auto;
}
.details-page.show{display:block;animation:fadePage .2s ease}
.details-page-inner{max-width:900px;margin:0 auto;padding:42px 20px 70px}
.details-back{
  border:0;background:#fff;color:var(--navy);border:1px solid var(--line);border-radius:12px;
  padding:10px 15px;font:800 13px "Heebo";cursor:pointer;margin-bottom:20px;
}
.details-sheet{
  background:#fff;border:1px solid var(--line);border-radius:22px;padding:30px;
  box-shadow:0 18px 45px rgba(15,30,74,.09);
}
.details-sheet h2{margin:0 0 8px;color:var(--navy);font-size:30px}
.details-sheet .details-badge{
  display:inline-block;background:#fff7e8;color:#9a5a00;border-radius:999px;
  padding:6px 10px;font-size:11px;font-weight:800;text-transform:uppercase;margin-bottom:18px;
}
.details-sheet p{font-size:16px;line-height:1.8;color:#4e5a70;margin:0}
.details-meta-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:24px}
.details-meta-grid div{background:#f6f8fb;border-radius:14px;padding:14px}
.details-meta-grid b{display:block;color:var(--navy);font-size:12px;margin-bottom:4px}
.details-meta-grid span{color:#657087;font-size:13px}
@keyframes fadePage{from{opacity:0}to{opacity:1}}
@media(max-width:560px){.details-meta-grid{grid-template-columns:1fr}.details-sheet{padding:22px}}


.lr-sidebar{
  height:max-content !important;
  align-self:start;
  padding-bottom:12px;
}
.lr-cat:last-child{margin-bottom:0}


.title-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  flex:1;
}
.title-wrap h4{
  margin:0;
  font-size:16px;
  line-height:1.25;
  color:var(--navy);
}
.lr-card-top{align-items:center}
.lr-actions{justify-content:flex-start}

/* Desktop hover popup */
.lr-card{
  position:relative;
  overflow:visible;
}
.resource-hover-popup{
  position:absolute;
  left:22px;
  right:22px;
  bottom:calc(100% - 10px);
  z-index:200;
  background:#fff;
  border:1px solid #dfe5ee;
  border-radius:16px;
  box-shadow:0 20px 50px rgba(15,30,74,.20);
  opacity:0;
  visibility:hidden;
  transform:translateY(10px) scale(.985);
  transition:opacity .18s ease,transform .18s ease,visibility .18s ease;
  pointer-events:none;
}
.lr-card:hover .resource-hover-popup,
.lr-card.popup-open .resource-hover-popup{
  opacity:1;
  visibility:visible;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
.popup-caret{
  position:absolute;
  bottom:-8px;
  left:34px;
  width:16px;
  height:16px;
  background:#fff;
  transform:rotate(45deg);
  border-right:1px solid #dfe5ee;
  border-bottom:1px solid #dfe5ee;
}
.popup-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  padding:15px 16px 12px;
  background:linear-gradient(135deg,var(--navy),#183b7a);
  border-radius:16px 16px 0 0;
  color:#fff;
}
.popup-label{
  display:inline-block;
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:#ffd28a;
  margin-bottom:3px;
}
.popup-head h5{
  margin:0;
  font-size:15px;
  line-height:1.3;
  color:#fff;
}
.popup-close{
  display:none;
  border:0;
  background:rgba(255,255,255,.14);
  color:#fff;
  width:30px;
  height:30px;
  border-radius:8px;
  font-size:20px;
  line-height:1;
  cursor:pointer;
}
.popup-
.popup-body p{
  margin:0 0 10px;
  font-size:12.5px;
  line-height:1.58;
  color:#596477;
}
.popup-meta{
  border-top:1px solid #edf0f4;
  padding-top:9px;
  font-size:11.5px;
  color:#738097;
}
.popup-meta strong{color:var(--navy)}

/* Keep popup from being clipped by the resource scroller */
.lr-resource-panel{
  overflow-y:auto;
  overflow-x:visible;
  padding-top:150px;
  margin-top:-150px;
}

/* Mobile/tablet: tap card opens centered/bottom popup instead of hover */
@media (max-width:780px), (hover:none){
  .resource-hover-popup{
    position:fixed;
    left:14px;
    right:14px;
    bottom:14px;
    top:auto;
    z-index:10001;
    max-height:72vh;
    overflow:auto;
    border-radius:18px;
    transform:translateY(24px);
    opacity:0;
    visibility:hidden;
    box-shadow:0 24px 70px rgba(0,0,0,.28);
  }
  .lr-card:hover .resource-hover-popup{
    opacity:0;
    visibility:hidden;
    transform:translateY(24px);
  }
  .lr-card.popup-open .resource-hover-popup{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
  }
  .popup-caret{display:none}
  .popup-close{display:block}
  .popup-head{position:sticky;top:0;z-index:2}
  .lr-card.popup-open:after{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(8,18,44,.52);
    z-index:10000;
  }
  .lr-card.popup-open .resource-hover-popup{z-index:10002}
}

@keyframes rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes cardIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes pop{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}

@media(max-width:1020px){
 .lr-shell{grid-template-columns:260px 1fr}
 .lr-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:780px){
 .lr-head{display:block} .lr-count{display:none}
 .lr-shell{grid-template-columns:1fr}
 .lr-sidebar{height:auto;display:flex;overflow-x:auto;gap:6px;border-radius:15px}
 .lr-side-title{display:none} .lr-cat{width:auto;white-space:nowrap;margin:0}
 .lr-resource-panel{height:620px}
}
@media(max-width:560px){
 .lr-section{padding:42px 13px 60px} .lr-title{font-size:31px}
 .lr-grid{grid-template-columns:1fr} .clear-filter{display:none}
 .subject-head{display:block} .subject-head span{display:block;margin-top:4px}
 .lr-resource-panel{height:650px}
}

/* ===== v8 clean layout overrides ===== */

/* Prevent the resource scroller from overlapping the subject/search section */
.lr-shell{
  align-items:start;
}
.lr-resource-panel{
  position:relative;
  height:640px;
  margin:0 !important;
  padding:0 8px 12px 0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  scrollbar-width:thin;
  scrollbar-color:#c8d2e1 #f3f6fa;
}
.lr-resource-panel::-webkit-scrollbar{width:8px}
.lr-resource-panel::-webkit-scrollbar-track{
  background:#f3f6fa;
  border-radius:12px;
}
.lr-resource-panel::-webkit-scrollbar-thumb{
  background:#c8d2e1;
  border-radius:12px;
}
.lr-resource-panel::-webkit-scrollbar-thumb:hover{background:#aebcd0}

.lr-sidebar{
  height:max-content !important;
  align-self:start;
  position:relative;
  top:0;
  margin:0;
}

/* Two-column cards */
.lr-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:15px;
}

/* Title stays next to the icon */
.title-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  flex:1;
}
.title-wrap h4{
  margin:0 !important;
  color:var(--navy);
  font-size:16px;
  line-height:1.25;
}
.lr-card-top{align-items:center}

/* Description + More details */
.resource-desc{
  margin:12px 0 10px !important;
  color:var(--muted);
  font-size:12.8px;
  line-height:1.52;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.more-details-link{
  display:inline-flex;
  align-items:center;
  gap:5px;
  color:var(--blue);
  text-decoration:none;
  font-size:12.5px;
  font-weight:800;
  margin:0 0 11px;
  cursor:pointer;
}
.more-details-link:hover{
  color:var(--orange);
  text-decoration:underline;
}
.lr-actions{
  margin-top:auto;
  justify-content:flex-start;
}

/* Details modal */
.resource-details-modal{
  position:fixed;
  inset:0;
  z-index:10000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(8,18,44,.58);
}
.resource-details-modal.show{display:flex}
.resource-details-dialog{
  width:min(680px,100%);
  max-height:86vh;
  overflow:auto;
  background:#fff;
  border-radius:20px;
  box-shadow:0 30px 90px rgba(0,0,0,.28);
  animation:detailsPop .2s ease;
}
.resource-details-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  padding:20px 22px;
  background:linear-gradient(135deg,var(--navy),#183b7a);
  color:#fff;
  border-radius:20px 20px 0 0;
}
.resource-details-head h3{
  margin:0;
  font-size:21px;
  line-height:1.3;
}
.resource-details-close{
  flex:0 0 auto;
  border:0;
  width:34px;
  height:34px;
  border-radius:9px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:20px;
  cursor:pointer;
}
.resource-details-
.resource-details-body p{
  margin:0;
  color:#566174;
  font-size:14.5px;
  line-height:1.75;
}
.resource-details-meta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:18px;
}
.resource-details-meta div{
  background:#f6f8fb;
  border-radius:12px;
  padding:12px;
}
.resource-details-meta b{
  display:block;
  color:var(--navy);
  font-size:11.5px;
  margin-bottom:3px;
}
.resource-details-meta span{
  color:#6a7588;
  font-size:12.5px;
}
@keyframes detailsPop{
  from{opacity:0;transform:translateY(10px) scale(.98)}
  to{opacity:1;transform:none}
}

/* Ensure no hover popup appears */
.resource-hover-popup,
.hover-popup{
  display:none !important;
}

/* Responsive */
@media(max-width:900px){
  .lr-shell{grid-template-columns:240px 1fr}
}
@media(max-width:780px){
  .lr-shell{grid-template-columns:1fr}
  .lr-sidebar{
    display:flex;
    overflow-x:auto;
    gap:6px;
    border-radius:15px;
    padding:10px;
  }
  .lr-side-title{display:none}
  .lr-cat{
    width:auto;
    min-width:max-content;
    margin:0;
  }
  .lr-resource-panel{
    height:620px;
    padding-right:5px !important;
  }
}
@media(max-width:620px){
  .lr-grid{grid-template-columns:1fr !important}
  .lr-resource-panel{height:650px}
  .resource-details-meta{grid-template-columns:1fr}
  .resource-details-modal{padding:10px}
  .resource-details-dialog{max-height:90vh}
}


/* v9: "More details" appears directly after the description text */
.more-details-link{display:none !important}

.resource-desc{
  display:block !important;
  -webkit-line-clamp:unset !important;
  overflow:visible !important;
  margin:12px 0 10px !important;
  color:var(--muted);
  font-size:12.8px;
  line-height:1.52;
}

.more-details-inline{
  display:inline;
  margin-left:4px;
  color:var(--blue);
  text-decoration:none;
  font-size:12.5px;
  font-weight:800;
  white-space:nowrap;
  cursor:pointer;
}
.more-details-inline:hover{
  color:var(--orange);
  text-decoration:underline;
}

/* Keep card text compact: visually show preview text, then inline More details */
.resource-desc{
  position:relative;
}


/* v10 compact two-sentence preview */
.resource-desc{
  margin:12px 0 10px !important;
  font-size:12.8px;
  line-height:1.55;
  color:var(--muted);
}
.more-details-inline{
  display:inline;
  margin-left:4px;
  font-weight:800;
  color:var(--blue);
  text-decoration:none;
  white-space:nowrap;
}
.more-details-inline:hover{
  color:var(--orange);
  text-decoration:underline;
}


/* ===== v11 alignment + popup fixes ===== */

/* Both sides begin and end on the same visual line */
.lr-shell{
  display:grid;
  grid-template-columns:300px minmax(0,1fr);
  gap:20px;
  align-items:start;
}

.lr-sidebar{
  align-self:start;
  height:auto !important;
  margin:0 !important;
}

.lr-resource-panel{
  position:relative;
  margin:0 !important;
  padding:0 8px 0 0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  min-height:0;
  height:auto; /* JS synchronizes this with the sidebar */
}

/* Make the first and last card align neatly inside the scroll area */
.lr-grid{
  margin:0 !important;
  padding:0 0 1px 0 !important;
}
.lr-card:first-child,
.lr-card:nth-child(2){
  margin-top:0 !important;
}

/* Keep the two-column desktop layout */
.lr-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}

/* More details stays directly after the two-sentence preview */
.resource-desc{
  margin:12px 0 10px !important;
  font-size:12.8px;
  line-height:1.52;
  color:var(--muted);
}
.more-details-inline{
  display:inline !important;
  margin-left:4px;
  color:var(--blue);
  text-decoration:none;
  font-size:12.5px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.more-details-inline:hover{
  color:var(--orange);
  text-decoration:underline;
}

/* Reliable modal */
.resource-details-modal{
  position:fixed !important;
  inset:0 !important;
  z-index:999999 !important;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(8,18,44,.60);
}
.resource-details-modal.show{
  display:flex !important;
}
.resource-details-dialog{
  width:min(700px,100%);
  max-height:86vh;
  overflow:auto;
  background:#fff;
  border-radius:20px;
  box-shadow:0 30px 90px rgba(0,0,0,.30);
}
.resource-details-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:20px 22px;
  color:#fff;
  background:linear-gradient(135deg,var(--navy),#183b7a);
}
.resource-details-head h3{
  margin:0;
  font-size:21px;
  line-height:1.3;
}
.resource-details-close{
  border:0;
  width:34px;
  height:34px;
  border-radius:9px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:20px;
  cursor:pointer;
}
.resource-details-
.resource-details-body p{
  margin:0;
  color:#566174;
  font-size:14.5px;
  line-height:1.75;
}
.resource-details-meta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:18px;
}
.resource-details-meta div{
  background:#f6f8fb;
  border-radius:12px;
  padding:12px;
}
.resource-details-meta b{
  display:block;
  color:var(--navy);
  font-size:11.5px;
  margin-bottom:3px;
}
.resource-details-meta span{
  color:#6a7588;
  font-size:12.5px;
}

/* Mobile */
@media(max-width:900px){
  .lr-shell{grid-template-columns:240px minmax(0,1fr)}
}
@media(max-width:780px){
  .lr-shell{grid-template-columns:1fr}
  .lr-sidebar{
    display:flex;
    overflow-x:auto;
    gap:6px;
    width:100%;
  }
  .lr-resource-panel{
    height:auto !important;
    max-height:650px;
  }
}
@media(max-width:620px){
  .lr-grid{grid-template-columns:1fr !important}
  .resource-details-meta{grid-template-columns:1fr}
  .resource-details-modal{padding:10px}
}


.more-details-inline:hover{
    color:var(--orange);
    text-decoration:underline;
  }
}


/* ===== v13: whole resource card opens popup ===== */
.more-details-inline,
.more-details-link{
  display:none !important;
}

.lr-card{
  cursor:default;
}

@media (hover:hover) and (pointer:fine){
  .lr-card{
    cursor:pointer;
  }
  .lr-card:hover{
    border-color:#b9c8db;
    box-shadow:0 14px 28px rgba(15,30,74,.12);
  }
}

/* Touch devices get a visible interaction cue */
@media (hover:none), (pointer:coarse){
  .lr-card{
    cursor:pointer;
  }
  .lr-card:active{
    transform:scale(.995);
  }
}


/* ===== v14: Access left, More details right ===== */
.lr-card{cursor:default !important}

.lr-actions{
  margin-top:auto;
  display:flex !important;
  align-items:center;
  justify-content:space-between !important;
  gap:14px;
  width:100%;
}

.lr-open{
  flex:0 0 auto;
}

.card-more-details{
  margin-left:auto;
  color:var(--blue);
  text-decoration:none;
  font-size:12.5px;
  font-weight:800;
  white-space:nowrap;
  cursor:pointer;
  position:relative;
}

.card-more-details:hover{
  color:var(--orange);
  text-decoration:underline;
}

/* Small old-page-style hover information popup */
.link-hover-popup{
  position:absolute;
  right:0;
  bottom:calc(100% + 11px);
  z-index:500;
  width:390px;
  max-width:min(390px,calc(100vw - 40px));
  background:#fff;
  border:1px solid #dce3ed;
  border-radius:14px;
  box-shadow:0 18px 45px rgba(15,30,74,.20);
  opacity:0;
  visibility:hidden;
  transform:translateY(7px);
  transition:opacity .16s ease,transform .16s ease,visibility .16s ease;
  pointer-events:none;
  white-space:normal;
  text-decoration:none !important;
}

.card-more-details:hover .link-hover-popup,
.card-more-details:focus .link-hover-popup{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

.link-hover-popup:after{
  content:"";
  position:absolute;
  right:28px;
  bottom:-7px;
  width:14px;
  height:14px;
  background:#fff;
  border-right:1px solid #dce3ed;
  border-bottom:1px solid #dce3ed;
  transform:rotate(45deg);
}

.link-popup-head{
  padding:12px 14px;
  background:linear-gradient(135deg,var(--navy),#183b7a);
  color:#fff;
  border-radius:14px 14px 0 0;
  font-size:14px;
  font-weight:800;
}

.link-popup-

.link-popup-body p{
  margin:0 0 9px;
  color:#596477;
  font-size:12px;
  line-height:1.55;
  font-weight:500;
}

.link-popup-meta{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  padding-top:8px;
  border-top:1px solid #edf0f4;
  color:#748096;
  font-size:11px;
  font-weight:500;
}
.link-popup-meta b{color:var(--navy)}

/* On touch/mobile don't show CSS hover box; tap opens full modal */
@media (hover:none), (pointer:coarse), (max-width:780px){
  .link-hover-popup{display:none !important}
  .lr-actions{gap:10px}
  .card-more-details{font-size:12px}
}


/* Full description on More details mouse hover */
.link-hover-popup{
  width:460px !important;
  max-width:min(460px,calc(100vw - 40px)) !important;
  max-height:360px;
  overflow-y:auto;
  z-index:9999 !important;
}

.link-popup-body p{
  display:block !important;
  -webkit-line-clamp:unset !important;
  overflow:visible !important;
  white-space:normal !important;
  text-overflow:clip !important;
  max-height:none !important;
  margin:0 0 12px !important;
  line-height:1.6 !important;
}

/* Keep hover popup available while pointer moves over it */
.card-more-details .link-hover-popup{
  pointer-events:auto !important;
}

@media (hover:hover) and (pointer:fine){
  .card-more-details:hover .link-hover-popup,
  .card-more-details:focus-visible .link-hover-popup,
  .link-hover-popup:hover{
    opacity:1 !important;
    visibility:visible !important;
    transform:translateY(0) !important;
    display:block !important;
  }
}

/* Mobile continues to use click/tap details modal */
@media (hover:none), (pointer:coarse), (max-width:780px){
  .link-hover-popup{
    display:none !important;
  }
}


/* ===== v16: Professional floating hover details ===== */

/* Hide the older popup nested inside the link */
.card-more-details .link-hover-popup{
  display:none !important;
}

.resource-hover-flyout{
  position:fixed;
  z-index:999999;
  width:440px;
  max-width:calc(100vw - 28px);
  background:#ffffff;
  border:1px solid #dfe6ef;
  border-radius:16px;
  box-shadow:0 18px 50px rgba(15,30,74,.20);
  opacity:0;
  visibility:hidden;
  transform:translateY(6px);
  transition:opacity .16s ease, transform .16s ease, visibility .16s ease;
  pointer-events:none;
  overflow:hidden;
}

.resource-hover-flyout.show{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  pointer-events:auto;
}

.hover-flyout-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  background:#0f1e4a;
  color:#fff;
}

.hover-flyout-title{
  min-width:0;
  font-size:15px;
  line-height:1.3;
  font-weight:800;
}

.hover-flyout-badge{
  flex:0 0 auto;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:10px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.hover-flyout-

.hover-flyout-desc{
  margin:0;
  color:#536174;
  font-size:12.7px;
  line-height:1.65;
}

.hover-flyout-meta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid #edf1f5;
}

.hover-flyout-meta-item{
  min-width:0;
  padding:9px 10px;
  background:#f7f9fc;
  border:1px solid #e7ebf1;
  border-radius:10px;
}

.hover-flyout-meta-item b{
  display:block;
  margin-bottom:3px;
  color:#0f1e4a;
  font-size:10.5px;
  letter-spacing:.02em;
}

.hover-flyout-meta-item span{
  display:block;
  color:#6a7688;
  font-size:11.5px;
  line-height:1.35;
}

@media(max-width:620px){
  .resource-hover-flyout{display:none !important}
}
