/* =========================================================
   GNIPST CENTRAL LIBRARY PORTAL STYLES
   ========================================================= */

/* --- Library Secondary Portal Bar --- */
.lib-subnav-bar {
  background: var(--green-900);
  border-bottom: 2px solid var(--gold-500);
  position: sticky;
  top: 72px; /* right below main sticky header */
  z-index: 90;
  box-shadow: 0 4px 18px rgba(10, 61, 38, 0.18);
}
.lib-subnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
}
.lib-subnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.lib-subnav-brand svg {
  color: var(--gold-500);
  flex-shrink: 0;
}
.lib-subnav-brand .lib-tag {
  background: rgba(240, 168, 0, 0.2);
  color: var(--gold-500);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Nav Links --- */
.lib-nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.lib-nav-item {
  position: relative;
}
.lib-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.lib-nav-link:hover,
.lib-nav-item:hover > .lib-nav-link,
.lib-nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.lib-nav-link svg.caret {
  transition: transform 0.25s ease;
}
.lib-nav-item:hover > .lib-nav-link svg.caret {
  transform: rotate(180deg);
}

/* --- Dropdown Menus --- */
.lib-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(10, 61, 38, 0.2);
  border: 1px solid var(--line);
  padding: 8px 0;
  margin-top: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  list-style: none;
}
.lib-nav-item:hover > .lib-dropdown,
.lib-dropdown-item:hover > .lib-sub-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lib-dropdown-item {
  position: relative;
}
.lib-dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.lib-dropdown-link:hover,
.lib-dropdown-link.is-active {
  background: var(--green-100);
  color: var(--green-900);
  font-weight: 600;
  padding-left: 22px;
}
.lib-dropdown-link svg.ext-icon {
  width: 13px;
  height: 13px;
  color: #8fa096;
  flex-shrink: 0;
}
.lib-dropdown-link:hover svg.ext-icon {
  color: var(--green-700);
}

/* Sub-level dropdown */
.lib-sub-dropdown {
  position: absolute;
  top: -6px;
  left: 100%;
  min-width: 220px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(10, 61, 38, 0.2);
  border: 1px solid var(--line);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 101;
  list-style: none;
}

/* Quick OPAC CTA in Subnav */
.lib-opac-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--gold-500), #e59b00);
  color: #112117;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(240, 168, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.lib-opac-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(240, 168, 0, 0.45);
}

/* Mobile Trigger Button */
.lib-mobile-btn {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  align-items: center;
  gap: 6px;
}

/* --- Mobile Drawer / Collapse --- */
.lib-mobile-menu {
  display: none;
  background: #08291a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 20px 24px;
  max-height: 80vh;
  overflow-y: auto;
}
.lib-mobile-menu.is-open {
  display: block;
}
.lib-m-section-title {
  color: var(--gold-500);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lib-m-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
}
.lib-m-link:hover, .lib-m-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-500);
}

/* --- Hero Banner Specifics --- */
.lib-hero {
  background: linear-gradient(135deg, var(--green-900) 0%, #0d462a 50%, #115333 100%);
  color: #fff;
  padding: 56px 0 44px;
  position: relative;
  overflow: hidden;
}
.lib-hero::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: radial-gradient(circle at 85% 30%, rgba(240, 168, 0, 0.14) 0%, transparent 60%);
  pointer-events: none;
}
.lib-hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}
.lib-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.lib-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}
.lib-hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  color: #ffffff;
}
.lib-hero p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 24px;
  max-width: 720px;
}
.lib-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* --- Stats Strip --- */
.lib-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: -30px;
  position: relative;
  z-index: 10;
  margin-bottom: 48px;
}
.lib-stat-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 22px 20px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(10, 61, 38, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lib-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(10, 61, 38, 0.12);
}
.lib-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--green-100);
  color: var(--green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lib-stat-num {
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green-900);
  line-height: 1;
}
.lib-stat-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 4px;
  font-weight: 500;
}

/* --- Cards & Grid Layouts --- */
.lib-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.lib-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.lib-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 28px 24px;
  box-shadow: 0 8px 24px rgba(10, 61, 38, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.lib-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--green-700);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lib-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(10, 61, 38, 0.12);
  border-color: #cbdad1;
}
.lib-card:hover::before {
  opacity: 1;
}
.lib-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--green-100);
  color: var(--green-800);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.lib-card-icon.gold {
  background: #fdf5e0;
  color: var(--gold-600);
}
.lib-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-900);
  margin-bottom: 10px;
  line-height: 1.3;
}
.lib-card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}
.lib-card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f0eee6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lib-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green-700);
  transition: gap 0.2s ease, color 0.2s ease;
}
.lib-card-link:hover {
  gap: 9px;
  color: var(--gold-600);
}

/* --- Modern Table Design --- */
.lib-table-wrap {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(10, 61, 38, 0.05);
  overflow: hidden;
  margin-bottom: 36px;
}
.lib-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.lib-table th {
  background: var(--green-900);
  color: #fff;
  font-weight: 600;
  padding: 14px 18px;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.02em;
  border: none;
}
.lib-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #eef0ee;
  color: var(--ink);
  vertical-align: middle;
}
.lib-table tr:last-child td {
  border-bottom: none;
}
.lib-table tr:nth-child(even) td {
  background: #fbfbf9;
}
.lib-table tr:hover td {
  background: #f2f7f4;
}

/* --- Search & Filter Bar --- */
.lib-search-container {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: var(--cream);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.lib-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.lib-search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #839188;
}
.lib-search-input {
  width: 100%;
  padding: 11px 16px 11px 44px;
  border-radius: 8px;
  border: 1px solid #d4ded8;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.lib-search-input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(23, 122, 73, 0.15);
}

/* --- Badges --- */
.lib-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lib-badge-oa {
  background: #dcfce7;
  color: #15803d;
}
.lib-badge-sub {
  background: #fef3c7;
  color: #b45309;
}
.lib-badge-gov {
  background: #e0e7ff;
  color: #3730a3;
}

/* --- Section Heads Inside Library --- */
.lib-section-head {
  margin-bottom: 36px;
}
.lib-section-kicker {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-600);
  margin-bottom: 6px;
}
.lib-section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--green-900);
  margin-bottom: 12px;
}
.lib-section-desc {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 680px;
  line-height: 1.6;
}

/* --- Accordions & Rules --- */
.lib-rule-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lib-rule-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(10, 61, 38, 0.06);
  border-color: #cbdad1;
}
.lib-rule-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
}
.lib-rule-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-900);
  margin-bottom: 6px;
}
.lib-rule-content p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* --- Library Dedicated Footer Grid --- */
.lib-footer {
  background: var(--green-900);
  color: #cfe4d7;
  padding: 56px 0 0;
}
.lib-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.1fr 1.3fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.lib-hours-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.86rem;
  color: #a9c8b4;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lib-hours-list li {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lib-hours-list li strong {
  color: #ffffff;
}
.lib-hours-list li span.val {
  color: var(--gold-500);
  font-weight: 600;
  text-align: right;
}
.lib-hours-list li.closed span.val {
  color: #f87171;
}
@media (max-width: 980px) {
  .lib-footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
  }
}
@media (max-width: 600px) {
  .lib-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* --- Responsive Breakpoints --- */
@media (max-width: 991px) {
  .lib-nav-list,
  .lib-opac-btn {
    display: none;
  }
  .lib-mobile-btn {
    display: inline-flex;
  }
}
