/* =========================================================
   Library portal theme - ink blue, parchment & antique gold
   (loaded after assets/css/style.css; only applies to /library)
   ========================================================= */
body.lib-portal {
  --primary: #1f3a5f;
  --primary-2: #2d5a8a;
  --primary-dark: #14263f;
  --accent: #b9852a;
  --accent-2: #e0b45a;
  --red: #a63d2f;
  --ink: #1b2433;
  --text: #3d4555;
  --muted: #7a7466;
  --line: #e7dcc6;
  --soft: #f6efe0;
  --grad: linear-gradient(135deg, #14263f 0%, #1f3a5f 55%, #2d5a8a 100%);
  --grad-accent: linear-gradient(135deg, #b9852a, #e0b45a);
  --shadow: 0 10px 28px rgba(20, 38, 63, .09);
  --shadow-lg: 0 20px 48px rgba(20, 38, 63, .18);
  --side-w: 272px;
  --top-h: 68px;
  background: #fbf7ee radial-gradient(circle at 100% 0%, rgba(185, 133, 42, .07), transparent 40%) fixed;
  padding: 0;
}
.lib-portal ::selection { background: var(--accent-2); color: var(--primary-dark); }

/* ---------- top bar ---------- */
.lp-top { position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 1200; display: flex; align-items: center; gap: 18px; padding: 0 22px; background: var(--grad); color: #fff; box-shadow: 0 4px 22px rgba(20, 38, 63, .25); }
.lp-top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent), var(--accent-2), transparent); }
.lp-toggle { display: none; background: rgba(255, 255, 255, .12); border: 0; color: #fff; width: 42px; height: 42px; border-radius: 11px; font-size: 18px; }
.lp-brand { display: flex; align-items: center; gap: 12px; color: #fff; min-width: 0; }
.lp-brand:hover { color: #fff; }
.lp-logo { width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 21px; color: var(--primary-dark); background: var(--grad-accent); box-shadow: 0 0 0 3px rgba(224, 180, 90, .25); animation: lpGlow 3s ease-in-out infinite; }
@keyframes lpGlow { 50% { box-shadow: 0 0 0 6px rgba(224, 180, 90, .12), 0 0 18px rgba(224, 180, 90, .5); } }
.lp-brand-text strong { display: block; font-family: var(--font-head); font-size: 19px; line-height: 1.15; letter-spacing: .2px; }
.lp-brand-text small { display: block; font-size: 12px; opacity: .8; }
.lp-search { flex: 1; max-width: 520px; margin-left: auto; display: flex; align-items: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 40px; padding-left: 16px; transition: background .25s, border-color .25s; }
.lp-search:focus-within { background: #fff; border-color: #fff; }
.lp-search i { color: var(--accent-2); }
.lp-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; padding: 11px 12px; font: inherit; font-size: 14px; }
.lp-search:focus-within input { color: var(--ink); }
.lp-search input::placeholder { color: rgba(255, 255, 255, .7); }
.lp-search:focus-within input::placeholder { color: var(--muted); }
.lp-search button { border: 0; margin: 4px; padding: 7px 16px; border-radius: 30px; background: var(--grad-accent); color: var(--primary-dark); font-weight: 700; font-size: 13px; }
.lp-college { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 500; padding: 6px 12px 6px 6px; border-radius: 30px; background: rgba(255, 255, 255, .1); white-space: nowrap; }
.lp-college img { width: 34px; height: 34px; border-radius: 50%; background: #fff; }
.lp-college:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- left sidebar (always visible on desktop) ---------- */
.lp-side { position: fixed; top: var(--top-h); left: 0; bottom: 0; width: var(--side-w); z-index: 1100; display: flex; flex-direction: column; background: #fffdf8; border-right: 1px solid var(--line); box-shadow: 4px 0 24px rgba(20, 38, 63, .05); }
.lp-side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.lp-open { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 30px; background: var(--soft); color: var(--muted); }
.lp-open i { font-size: 8px; }
.lp-open.is-open { background: #e6f5ea; color: #1d7a3e; }
.lp-open.is-open i { color: #22a24d; animation: blink 1.6s infinite; }
.lp-open.is-closed { background: #fbeceb; color: #a63d2f; }
.lp-close { display: none; border: 0; background: var(--soft); color: var(--primary); width: 36px; height: 36px; border-radius: 50%; }
.lp-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; }
.lp-group { margin-top: 12px; }
.lp-group-title { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); padding: 4px 12px 6px; }
.lp-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px; border-radius: 11px; color: var(--text); font-size: 14.5px; font-weight: 500; position: relative; transition: background .2s, color .2s, padding .25s; }
.lp-nav a i { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--soft); color: var(--primary); font-size: 14px; transition: all .25s; }
.lp-nav a:hover { background: var(--soft); color: var(--primary); padding-left: 16px; }
.lp-nav a:hover i { background: var(--primary); color: var(--accent-2); }
.lp-nav a.on { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(20, 38, 63, .22); }
.lp-nav a.on i { background: rgba(255, 255, 255, .14); color: var(--accent-2); }
.lp-nav a.on::after { content: ''; position: absolute; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.lp-side-foot { padding: 14px 18px 18px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.lp-side-foot p { margin: 0 0 10px; }
.lp-side-foot p i { color: var(--accent); }
.lp-social { display: flex; gap: 8px; margin-bottom: 12px; }
.lp-social a { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--primary); transition: all .25s; }
.lp-social a:hover { background: var(--grad); color: var(--accent-2); transform: translateY(-3px); }
.lp-back { font-size: 13px; font-weight: 600; color: var(--primary); }
.lp-backdrop { display: none; }

/* ---------- main area ---------- */
.lp-main { margin-left: var(--side-w); padding: calc(var(--top-h) + 26px) 32px 0; min-height: 100vh; display: flex; flex-direction: column; }
.lp-head { margin-bottom: 20px; }
.lp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.lp-crumbs a { color: var(--muted); }
.lp-crumbs a:hover { color: var(--primary); }
.lp-crumbs i { font-size: 10px; }
.lp-crumbs span { color: var(--accent); font-weight: 600; }
.lp-head h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(24px, 2.8vw, 34px); color: var(--primary-dark); margin: 0; }
.lp-head-icon { width: 54px; height: 54px; flex: none; border-radius: 15px; display: grid; place-items: center; background: var(--grad); color: var(--accent-2); font-size: 22px; box-shadow: var(--shadow); }
.lp-content { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); max-width: 1180px; width: 100%; }
.lib-dash .lp-content { background: transparent; border: 0; box-shadow: none; padding: 0; max-width: 1240px; }
.lp-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 22px 2px 26px; margin-top: 26px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); max-width: 1240px; }
.lp-hidden { display: none !important; }
.lp-noresult { padding: 14px 18px; border-radius: 12px; background: var(--soft); color: var(--muted); }

/* entry tweaks for the library theme */
.lib-portal .entry h2, .lib-portal .entry h3 { color: var(--primary-dark); }
.lib-portal .fancy-title { color: var(--primary); }
.lib-portal .entry table thead th, .lib-portal .entry tr:first-child td { background: var(--soft); }
.lib-portal .btn-primary { background: var(--grad); }
.lib-portal .btn-primary:hover { box-shadow: 0 10px 22px rgba(20, 38, 63, .25); }
.lib-portal .btn-outline { color: var(--primary); border-color: var(--primary); }
.lib-portal .cta-card { border-left-color: var(--accent); }
.lib-portal .lib-h { border-left-color: var(--accent); color: var(--primary-dark); }
.lib-portal .to-top { bottom: 24px; }

/* ---------- dashboard ---------- */
.ld-welcome { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: center; padding: 32px; border-radius: 22px; background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); }
.ld-welcome::before { content: ''; position: absolute; inset: 0; background: url('../images/hero.webp') center/cover; opacity: .14; mix-blend-mode: luminosity; }
.ld-welcome::after { content: '\f02d'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; right: -20px; bottom: -40px; font-size: 220px; color: rgba(255, 255, 255, .05); transform: rotate(-12deg); }
.ld-welcome > * { position: relative; z-index: 1; }
.ld-greet { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-2); margin-bottom: 6px; }
.ld-welcome h1 { color: #fff; font-size: clamp(24px, 3vw, 36px); margin: 0 0 10px; }
.ld-welcome p { opacity: .9; margin-bottom: 18px; max-width: 560px; }
.ld-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ld-actions .btn { margin: 0; }
.ld-actions .btn-gold { background: var(--grad-accent); color: var(--primary-dark); font-weight: 700; }
.ld-actions .btn-glass { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .45); color: #fff; }
.ld-actions .btn-glass:hover { background: #fff; color: var(--primary); }
.ld-hours { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: 18px; padding: 20px; backdrop-filter: blur(6px); }
.ld-hours h3 { color: #fff; font-size: 17px; margin-bottom: 12px; }
.ld-hours .lp-open { margin-bottom: 14px; }
.ld-hours ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.ld-hours li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, .2); }
.ld-hours li:last-child { border: 0; }
.ld-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.ld-kpi { display: flex; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); transition: transform .3s; }
.ld-kpi:hover { transform: translateY(-4px); }
.ld-kpi i { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--soft); color: var(--primary); }
.ld-kpi:nth-child(2) i { color: var(--accent); }
.ld-kpi:nth-child(3) i { color: #2f7a5f; }
.ld-kpi:nth-child(4) i { color: var(--red); }
.ld-kpi strong { display: block; font-family: var(--font-head); font-size: 26px; color: var(--primary-dark); line-height: 1.1; }
.ld-kpi span { font-size: 13px; color: var(--muted); }
.ld-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.ld-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ld-panel-head h2 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 10px; color: var(--primary-dark); }
.ld-panel-head h2 i { color: var(--accent); }
.ld-panel-head a { font-size: 13px; font-weight: 600; }
.ld-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; align-items: start; }
.ld-panel .lib-cards { margin: 0; }
.ld-eres { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ld-eres a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px; background: var(--soft); color: var(--ink); font-size: 13px; font-weight: 600; text-align: center; transition: all .25s; }
.ld-eres a i { font-size: 20px; color: var(--primary); }
.ld-eres a:hover { background: var(--grad); color: #fff; transform: translateY(-3px); }
.ld-eres a:hover i { color: var(--accent-2); }
.ld-list { list-style: none; margin: 0; padding: 0; }
.ld-list a { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px dashed var(--line); color: var(--ink); font-size: 14px; }
.ld-list li:last-child a { border: 0; }
.ld-list a i { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--soft); color: var(--accent); }
.ld-list a:hover { color: var(--primary); }
.ld-list small { display: block; color: var(--muted); font-size: 12px; }
.ld-librarian { display: flex; gap: 16px; align-items: center; }
.ld-librarian .lib-avatar { width: 72px; height: 72px; font-size: 24px; border-color: var(--soft); background: var(--grad); color: var(--accent-2); }
.ld-librarian h3 { font-size: 16px; margin: 0 0 2px; }
.ld-librarian p { font-size: 13px; color: var(--muted); margin: 0 0 4px; }

/* library cards re-coloured */
.lib-portal .lib-card i { background: var(--soft); color: var(--primary); }
.lib-portal .lib-card:hover { border-color: var(--accent); }
.lib-portal .lib-librarian { background: var(--grad); }

/* ---------- mobile bottom bar ---------- */
.lp-bottom { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .ld-kpis { grid-template-columns: repeat(2, 1fr); }
  .ld-grid { grid-template-columns: 1fr; }
  .lp-college span { display: none; }
  .lp-college { padding: 6px; }
}
@media (max-width: 991px) {
  body.lib-portal { --top-h: 62px; padding-bottom: 70px; }
  .lp-toggle { display: grid; place-items: center; }
  .lp-top { padding: 0 12px; gap: 10px; }
  .lp-brand-text strong { font-size: 15px; }
  .lp-brand-text small { display: none; }
  .lp-logo { width: 40px; height: 40px; font-size: 18px; }
  .lp-search { display: none; }
  .lp-side { transform: translateX(-105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); top: 0; z-index: 1400; width: min(86vw, 320px); }
  body.lp-side-open .lp-side { transform: none; box-shadow: 20px 0 50px rgba(0, 0, 0, .25); }
  .lp-close { display: grid; place-items: center; }
  .lp-backdrop { display: block; position: fixed; inset: 0; z-index: 1300; background: rgba(10, 20, 35, .5); opacity: 0; visibility: hidden; transition: all .3s; }
  body.lp-side-open .lp-backdrop { opacity: 1; visibility: visible; }
  body.lp-side-open { overflow: hidden; }
  .lp-main { margin-left: 0; padding: calc(var(--top-h) + 18px) 16px 0; }
  .lp-content { padding: 22px 18px; }
  .ld-welcome { grid-template-columns: 1fr; padding: 24px 20px; }
  .lp-bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1250; background: rgba(255, 253, 248, .97); backdrop-filter: blur(12px); box-shadow: 0 -6px 24px rgba(20, 38, 63, .14); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
  .lp-bottom a, .lp-bottom button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; color: var(--muted); font-size: 10.5px; font-weight: 500; padding: 4px 0; }
  .lp-bottom i { font-size: 19px; }
  .lp-bottom .on, .lp-bottom a:hover { color: var(--primary); }
  .lp-bottom .lp-toggle { display: flex; width: auto; height: auto; color: var(--muted); }
  .lib-portal .to-top { bottom: 86px; }
}
@media (max-width: 560px) {
  .ld-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ld-kpi { flex-direction: column; text-align: center; padding: 14px 8px; }
  .lp-head h1 { font-size: 22px; }
  .lp-head-icon { width: 44px; height: 44px; font-size: 18px; }
  .lp-college { display: none; }
}

/* ---------- library banner (above page title, every library page) ---------- */
.lp-banner { position: relative; overflow: hidden; height: 170px; border-radius: 18px; margin-bottom: 16px; max-width: 1240px; background: linear-gradient(110deg, rgba(10, 22, 40, .92), rgba(31, 58, 95, .78) 55%, rgba(185, 133, 42, .45)), url('../images/hero.webp') center 40%/cover; box-shadow: var(--shadow); display: flex; align-items: center; padding: 0 34px; }
.lp-banner.has-img { background-size: cover; background-position: center; height: auto; aspect-ratio: 1456 / 300; max-height: 260px; padding: 0; }
.lp-banner::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); }
.lp-banner-text { position: relative; z-index: 1; color: #fff; }
.lp-banner-text strong { display: block; font-family: 'Noto Sans Devanagari', var(--font-head); font-size: clamp(22px, 3vw, 38px); font-weight: 600; color: var(--accent-2); text-shadow: 0 3px 14px rgba(0, 0, 0, .35); line-height: 1.25; }
.lp-banner-text span { display: block; font-size: clamp(14px, 1.5vw, 19px); opacity: .95; margin-top: 4px; }
.lp-banner-icon { position: absolute; right: 30px; top: 50%; transform: translateY(-50%) rotate(-8deg); font-size: 120px; color: rgba(255, 255, 255, .1); }
/* compact page title for library pages */
.lp-head { margin-bottom: 14px; }
.lp-head h1 { font-size: clamp(20px, 2vw, 26px); gap: 10px; }
.lp-head-icon { width: 40px; height: 40px; border-radius: 11px; font-size: 17px; }
.lp-crumbs { margin-bottom: 6px; font-size: 12.5px; }
@media (max-width: 991px) {
  .lp-banner { height: 120px; padding: 0 18px; border-radius: 14px; }
  .lp-banner-icon { font-size: 80px; right: 12px; }
}

/* collapsible sidebar groups */
.lp-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.lp-group > summary::-webkit-details-marker { display: none; }
.lp-group > summary i { font-size: 10px; color: var(--muted); transition: transform .25s; }
.lp-group:not([open]) > summary i { transform: rotate(-90deg); }
.lp-group > summary:hover { color: var(--primary); }
