/* ========================================
   Brooklyn College Library - Custom Styles
   ======================================== */

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */

:root {
  /* Brand Colors */
  --bc-maroon: #7b2240;
  --bc-gold: #ffd600;
  --bc-white: #ffffff;
  --bc-black: #000000;
  --bc-gray-light: #eeeeee;
  --bc-gray-medium: #666666;
  --bc-gray-dark: #222222;

  /* Spacing Scale (rem-based for accessibility) */
  --spacing-xs: 0.25rem; /* 4px */
  --spacing-sm: 0.5rem; /* 8px */
  --spacing-md: 1rem; /* 16px */
  --spacing-lg: 1.5rem; /* 24px */
  --spacing-xl: 2rem; /* 32px */
  --spacing-2xl: 3rem; /* 48px */
  --spacing-3xl: 4rem; /* 64px */

  /* Specific spacing values (when design requires exact values) */
  --spacing-gap-sm: 0.35rem; /* Small gaps */
  --spacing-gap-md: 0.75rem; /* Medium gaps */
  --spacing-icon-gap: 20px; /* Icon spacing */
  --spacing-section: 30px; /* Section padding */
  --spacing-mega: 100px; /* Large spacing (search section) */
  --spacing-offset: 300px; /* Offset for circular icons */

  /* Typography Scale */
  --font-size-xs: 0.85rem; /* ~13.6px */
  --font-size-sm: 0.9rem; /* ~14.4px */
  --font-size-base: 1rem; /* 16px */
  --font-size-md: 1.1rem; /* ~17.6px */
  --font-size-lg: 1.25rem; /* 20px */
  --font-size-xl: 1.5rem; /* 24px */
  --font-size-2xl: 1.75rem; /* 28px */
  --font-size-3xl: 2rem; /* 32px */

  /* Font weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Line heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.3;
  --line-height-normal: 1.4;
  --line-height-relaxed: 1.6;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 25px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: all 0.2s ease;
  --transition-base: all 0.3s ease;
  --transition-opacity: opacity 0.3s ease;

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-modal: 10000;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.3);

  /* Icon sizes */
  --icon-sm: 1rem;
  --icon-md: 1.5rem;
  --icon-lg: 2rem;
  --icon-xl: 32px;

  /* Component-specific sizes */
  --logo-height: 70px;
  --logo-height-mobile: 50px;
  --social-icon-size: 45px;
  --circular-icon-lg: 80px;
  --circular-icon-md: 70px;
  --circular-icon-sm: 60px;
  --circular-item-width: 120px;

  /* Border widths */
  --border-thin: 1px;
  --border-base: 2px;
  --border-thick: 3px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Button Utilities */
.btn-outline-white {
  background-color: transparent;
  border: 2px solid var(--bc-white);
  color: var(--bc-white);
  transition: var(--transition-fast);
}

.btn-outline-white:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--bc-gold);
  color: var(--bc-gold);
}

/* Global Styles */
body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  color: var(--bc-black);
}

/* Screen Reader Only - Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--bc-black);
  text-decoration: underline;
}
a:hover {
  color: var(--bc-maroon);
  text-decoration: underline;
}


/* ========================================
   HEADER STYLES
   ======================================== */

.page-header {
  background-color: var(--bc-white);
  color: var(--bc-black);
  margin: 0;
  padding: 0;
  border: none;
}

.header-top {
  border-bottom: var(--border-thin) solid rgba(255, 255, 255, 0.2);
}

/* Header Branding - Logo and Title Side by Side */
.header-branding {
  gap: var(--spacing-md);
}

.bc-logo-link {
  flex-shrink: 0;
  padding-right: var(--spacing-md);
  border-right: var(--border-base) solid var(--bc-black);
}

.bc-logo-img {
  height: var(--logo-height);
  width: auto;
}

/* Library Heading */
.library-heading a {
  color: var(--bc-black);
  line-height: 1.2;
}

.library-title {
  font-family: 'EB Garamond', serif;
  font-size: var(--font-size-2xl);
  white-space: nowrap;
}

/* Hours */
#hours-link {
  color: var(--bc-black);
  text-decoration: none;
}
#hours-link div {
  text-align: center;
  justify-content: center;
}
#hours-icon {
  font-size: 90%;
}

.todays-hours {
  color: var(--bc-black);
}

#hours-link {
  line-height: var(--line-height-tight);
}

.hours-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-normal);
  margin-bottom: var(--spacing-xs);
}

.hours-time {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-xs);
}

.hours-label {
  font-size: 0.95rem;
  gap: var(--spacing-gap-sm);
}

.hours-label i {
  font-size: var(--icon-sm);
}

/* Header Icons */
.header-icons {
  gap: var(--spacing-icon-gap);
}

.header-icons-mobile {
  height: 100%;
}

/* Mobile icons sit on the maroon nav bar — make them readable (matches .menu-link) */
.header-icons-mobile .header-icon {
  color: var(--bc-white);
}

.header-icon {
  color: var(--bc-maroon);
  font-size: var(--icon-lg);
  transition: var(--transition-fast);
  min-width: 44px; /* WCAG touch target minimum */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Only apply hover effects on devices that support hover (not touch devices) */
@media (hover: hover) {
  .header-icon:hover {
    color: var(--bc-gold);
    transform: scale(1.1);
  }
}

/* My Library Account dropdown */
.header-account {
  position: relative;
}

/* Toggle reuses .header-icon for color/size/touch target; strip button chrome */
.account-toggle {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.account-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  margin: 0;
  padding: var(--spacing-sm) 0;
  list-style: none;
  background-color: var(--bc-white);
  /* border-top: var(--border-thick) solid var(--bc-gold); */
  box-shadow: var(--shadow-md);
  /* Overlay above the mega-menu so it never gets clipped or pushes content */
  z-index: var(--z-modal);
  display: none;
}

.account-dropdown.show {
  display: block;
}

.account-dropdown a {
  display: block;
  color: var(--bc-black);
  text-decoration: none;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.95rem;
  line-height: var(--line-height-normal);
  transition: var(--transition-fast);
}

.account-dropdown a:focus {
  color: var(--bc-maroon);
  text-decoration: underline;
}

@media (hover: hover) {
  .account-dropdown a:hover {
    color: var(--bc-maroon);
    background-color: var(--bc-gray-light);
    text-decoration: underline;
  }
}

.account-dropdown a:focus-visible {
  outline: var(--border-thick) solid var(--bc-gold);
  outline-offset: calc(-1 * var(--border-thick));
}

.account-group {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
}

.account-group-heading {
  display: block;
  padding: 0 var(--spacing-md) var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
  color: var(--bc-maroon);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-normal);
  letter-spacing: 0.05em;
  border-bottom: var(--border-base) solid var(--bc-gold);
}

.account-group-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ========================================
   NAVIGATION / MEGA MENU
   ======================================== */

.main-navigation {
  position: relative;
  background-color: var(--bc-maroon);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background-color: transparent;
  border: var(--border-base) solid var(--bc-white);
  color: var(--bc-white);
  padding: var(--spacing-sm) var(--spacing-md);
  min-width: 48px;
  min-height: 48px;
  font-size: var(--font-size-base);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  align-items: center;
  gap: var(--spacing-sm);
}

@media (hover: hover) {
  .mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--bc-gold);
    color: var(--bc-gold);
  }
}

.menu-icon {
  display: inline-block;
  width: 20px;
  height: 2px;
  background-color: currentColor;
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: currentColor;
  left: 0;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

/* Main Menu */
.main-menu {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  margin: 0;
}

.menu-item {
  position: static;
}

.menu-link {
  display: block;
  color: var(--bc-white);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  padding: var(--spacing-md) var(--spacing-lg);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.main-navigation .menu-link,
.main-navigation .menu-link:link,
.main-navigation .menu-link:visited,
.main-navigation .menu-link:active {
  color: var(--bc-white);
}

/* Page breadcrumbs (WIMS\Breadcrumbs -> updateBreadcrumbs() fills #page-breadcrumbs).
   Migrated from the legacy home_bootstrap.css, which migrated pages no longer load. */
#page-breadcrumbs {
  margin-top: 15px;
}
#page-breadcrumbs a {
  color: #666666;
  font-size: 12pt;
  text-decoration: none;
}

.menu-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--bc-gold);
}

.menu-link:focus-visible {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--bc-gold);
  outline: var(--border-base) solid var(--bc-gold);
  outline-offset: -2px;
}

.menu-link[aria-expanded='true'] {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--bc-gold);
}

/* Mega Menu Container - Full Width, Same Position for All */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background-color: var(--bc-white);
  box-shadow: var(--shadow-md);
  border-top: var(--border-thick) solid var(--bc-gold);
  padding: var(--spacing-xl) 0;
  z-index: var(--z-dropdown);
  display: none;
  opacity: 0;
  transition: var(--transition-opacity);
  will-change: opacity;
}

.mega-menu.show {
  display: block;
  opacity: 1;
}

/* Inner container to constrain and center content */
.mega-menu-inner {
  display: flex;
  gap: var(--spacing-xl);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

/* Mega Menu Columns */
.mega-menu-column {
  flex: 1;
  min-width: 180px;
}

.column-header {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--bc-maroon);
  margin: 0 0 var(--spacing-md) 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: var(--border-base) solid var(--bc-gold);
}

.column-links li {
  margin-bottom: var(--spacing-sm);
}

.column-links a {
  display: block;
  color: var(--bc-black);
  text-decoration: none;
  padding: 0.4rem var(--spacing-sm);
  font-size: 0.95rem;
  line-height: var(--line-height-normal);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

/* Keep focus styles for accessibility, but only apply hover on hover-capable devices */
.column-links a:focus {
  color: var(--bc-maroon);
  text-decoration: underline;
}

@media (hover: hover) {
  .column-links a:hover {
    color: var(--bc-maroon);
    text-decoration: underline;
  }
}

/* Focus visible for keyboard navigation */
.menu-link:focus-visible,
.column-links a:focus-visible {
  outline: var(--border-thick) solid var(--bc-gold);
  outline-offset: var(--border-base);
}

/* ========================================
   SEARCH SECTION
   ======================================== */

.search-section {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)),
    url('../img/backgrounds/Brooklyn_College_College_Libraries-40007874original.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  padding: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Search Tabs */
.search-tabs {
  width: 90%;
  margin: var(--spacing-mega) auto 0 auto;
  border: var(--border-base) solid var(--bc-black);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  background-color: var(--bc-gray-light);
}

.search-tab {
  flex: 1;
  padding: var(--spacing-md) var(--spacing-sm);
  background-color: transparent;
  border: none;
  color: var(--bc-black);
  font-size: 1.125rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: -3px;
  position: relative;
  white-space: normal; /* Allow text to wrap */
  line-height: 1.2;
  min-height: 3rem; /* Ensure consistent height */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Preserve rounded corners for end tabs */
.search-tab:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}

.search-tab:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}

@media (hover: hover) {
  .search-tab:hover {
    background-color: rgba(136, 35, 70, 0.05);
    color: var(--bc-maroon);
  }
}

.search-tab:focus {
  outline: var(--border-thick) solid var(--bc-gold);
  outline-offset: -3px;
  z-index: var(--z-base);
}

.search-tab.active {
  background-color: var(--bc-white);
  color: var(--bc-maroon);
  border-bottom: var(--border-base) solid var(--bc-white);
  margin-bottom: -2px;
  z-index: 2;
}

/* Search Form Container */
.search-form-container {
  display: flex;
  flex-direction: column;
}

.search-tab-panel {
  display: none;
  flex: 1;
  position: relative; /* For absolute positioning of child elements */
}

.search-tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* Search Form */
.search-form {
  margin: 0;
}

.search-input-group {
  width: 90%;
  position: relative;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-3xl) var(--spacing-md) 1.25rem; /* Extra right padding for the icon */
  font-size: var(--font-size-3xl);
  border: var(--border-base) solid var(--bc-black);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--bc-maroon);
  box-shadow: 0 0 0 var(--border-thick) rgba(136, 35, 70, 0.1);
}

.search-button {
  position: absolute;
  right: var(--spacing-sm);
  top: 50%;
  transform: translateY(-50%);
  padding: var(--spacing-gap-md) var(--spacing-lg);
  background-color: transparent;
  color: var(--bc-maroon);
  border: none;
  font-size: var(--icon-md);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.search-button i {
  font-size: var(--icon-md);
}

/* Search Link (Browse Popular Databases) */
.search-link {
  margin-top: var(--spacing-gap-md);
  margin-left: 5%;
}

.search-link a {
  color: var(--bc-black);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: var(--transition-fast);
}

.search-link a:hover {
  color: #6d1c38;
  text-decoration: underline;
}

.search-link a i {
  font-size: var(--font-size-xs);
}

/* Logo sizes */
.onesearch-logo {
  width: 70px;
  height: auto;
}

.fdlp-logo {
  height: 44px;
}

/* ========================================
   CIRCULAR ICON BUTTONS
   ======================================== */

/* ========================================
   EVENTS & INSTAGRAM SECTION
   ======================================== */

.events-instagram-section h3 {
  color: var(--bc-maroon);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-lg);
}

/* ========================================
   FOOTER
   ======================================== */

.page-footer {
  background-color: var(--bc-white);
  color: var(--bc-black);
}

.footer-heading {
  font-family: 'EB Garamond', serif;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-md);
  color: var(--bc-black);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-text {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-sm);
}

.footer-text a,
.footer-link {
  color: var(--bc-black);
}

@media (hover: hover) {
  .footer-text a:hover,
  .footer-link:hover {
    color: var(--bc-black);
    text-decoration: underline;
  }
}

.footer-links li {
  margin-bottom: var(--spacing-sm);
}

.footer-links a {
  color: var(--bc-black);
  text-decoration: none;
  font-size: 1.25rem;
  display: inline-block;
  min-width: 44px;
  min-height: 44px;
}

@media (hover: hover) {
  .footer-links a:hover {
    text-decoration: underline;
  }
}

/* Social Icons */
.social-icons {
  gap: var(--spacing-md);
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--social-icon-size);
  height: var(--social-icon-size);
  background-color: var(--bc-black);
  border-radius: var(--radius-full);
  color: var(--bc-white);
  font-size: var(--icon-md);
  text-decoration: none;
  transition: var(--transition-base);
  border: var(--border-base) solid var(--bc-black);
}

@media (hover: hover) {
  .social-icon:hover {
    background-color: var(--bc-white);
    color: var(--bc-black);
    transform: scale(1.1);
  }
}

/* Footer Badges */
.footer-badges {
  gap: var(--spacing-gap-md);
}

.footer-badge {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Chat Link */
.footer-chat {
  margin-top: var(--spacing-md);
}

.chat-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  background-color: var(--bc-maroon);
  border: var(--border-base) solid var(--bc-white);
  color: var(--bc-white);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-xl);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  transition: var(--transition-base);
}

@media (hover: hover) {
  .chat-link:hover {
    background-color: var(--bc-white);
    color: var(--bc-maroon);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
}

.chat-link i {
  font-size: 1.2rem;
}

.page-footer .chat-link,
.page-footer .chat-link:link,
.page-footer .chat-link:visited,
.page-footer .chat-link:active {
  color: var(--bc-white);
}
.page-footer .social-icon,
.page-footer .social-icon:link,
.page-footer .social-icon:visited,
.page-footer .social-icon:active {
  color: var(--bc-white);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 991px) {
  /* Full-width containers on tablet and mobile */
  .container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Add padding to header and footer so content doesn't touch edges */
  .page-header {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  .page-footer {
    padding-left: var(--spacing-2xl);
    padding-right: var(--spacing-md);
  }

  /* Mobile Menu Toggle */
  .mobile-menu-toggle {
    display: flex;
    margin: var(--spacing-md);
  }

  /* Hide menu by default on mobile with slide animation */
  .main-menu {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition:
      max-height 0.4s ease-out,
      opacity 0.3s ease-out,
      transform 0.3s ease-out;
  }

  .main-menu.show {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
  }

  .menu-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .menu-link {
    padding: var(--spacing-md);
    width: 100%;
  }

  /* Mobile mega menu positioning */
  .mega-menu {
    position: static;
    width: 100%;
    box-shadow: none;
  }

  .mega-menu.show {
    box-shadow: inset 0 var(--border-base) var(--radius-sm) rgba(0, 0, 0, 0.1);
    padding: var(--spacing-md) 0;
  }

  .mega-menu-inner {
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-md);
  }

  .mega-menu-column {
    min-width: auto;
  }

  /* Mobile search tabs - keep in one row */
  .search-tabs {
    flex-wrap: nowrap; /* Force single row */
  }

  .search-tab {
    font-size: 1.25rem;
    padding: 0.5rem 0.125rem;
    min-height: 3.5rem; /* Taller to accommodate wrapping */
    flex: 1 1 25%;
  }

  .onesearch-logo {
    width: 70px;
  }

  .search-form-container {
    padding: 0; /* Remove padding for seamless appearance */
  }

  .search-input-group {
    /* Match the tabs width for seamless appearance */
    width: 90%;
  }

  .search-input {
    font-size: var(--font-size-lg);
    padding: 0.875rem 3.5rem 0.875rem var(--spacing-md);
  }

  /* Touch target fix: Ensure search button is large enough */
  .search-button {
    right: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-lg);
    min-width: 44px;
    min-height: 44px;
  }

  .search-button i {
    font-size: var(--font-size-lg);
  }

  /* Circular icons: row of 4, row of 3 on tablet (staggered/centered so
     row 2 sits between row 1's icons) */
  .circular-icon-container {
    gap: var(--spacing-md);
    justify-content: center !important; /* override Bootstrap .justify-content-around */
  }

  .circular-icon-item {
    flex: 0 0 calc(25% - 16px);
    max-width: calc(25% - 16px);
  }

  /* Add padding to events and Instagram section */
  .events-instagram-section {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  /* Footer: 2 columns on tablet */
  .page-footer .col-lg-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .page-footer .col-md-3 {
    margin-bottom: var(--spacing-xl);
  }

  .footer-heading {
    font-size: var(--font-size-base);
  }

  /* Reduce header text sizes to prevent overlap on tablet */
  .library-title {
    font-size: 1.5rem;
  }

  .hours-title {
    font-size: 1.1rem;
  }

  .hours-time {
    font-size: 1rem;
  }

  .hours-label {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  /* Compact single-row mobile header */

  /* Keep header columns in one row on mobile */
  .header-top .row {
    align-items: center;
    flex-wrap: nowrap !important;
  }

  .header-top .col-md-4 {
    flex: 0 1 auto !important;
    max-width: none !important;
    width: auto !important;
  }

  /* Hours column should also have space and stay centered */
  .header-top .col-md-4:nth-child(2) {
    flex: 1 1 auto !important;
  }

  /* Icons column should take remaining space and push to right */
  .header-top .col-md-4:last-child {
    flex: 1 1 auto !important;
    margin-left: auto;
  }

  /* Logo and title section */
  .bc-logo-img {
    height: var(--logo-height-mobile);
  }

  .header-branding {
    padding-right: 0;
    border-right: none;
  }

  .library-title {
    font-size: 1rem;
    white-space: normal; /* Allow wrapping on mobile */
  }

  /* Hours section - centered and compact */
  .todays-hours {
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
  }

  #hours-link div {
    text-align: right;
    justify-content: right;
  }

  /* Reduce hours font sizes for compact layout */
  .hours-title {
    font-size: 0.85rem;
  }

  .hours-time {
    font-size: 0.8rem;
  }

  .hours-label {
    font-size: 0.75rem;
  }

  /* Icons section - right aligned */
  .header-icons {
    justify-content: flex-end;
    gap: var(--spacing-sm);
  }

  .header-icon {
    font-size: var(--icon-md);
  }

  .mega-menu {
    padding: var(--spacing-md) 0;
  }

  .mega-menu-inner {
    padding: 0 var(--spacing-md);
  }

  .column-header {
    font-size: var(--font-size-base);
  }

  /* Touch target fix: Improve footer link tap areas */
  .footer-links a {
    padding: var(--spacing-sm) 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .footer-text a {
    padding: var(--spacing-xs) 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Ensure chat link has adequate touch target */
  .chat-link {
    min-height: 48px;
    padding: var(--spacing-md) var(--spacing-lg);
  }
}

/* ----------------------- CIRCULAR ICON BUTTONS ----------------------- */

.circular-icon-container {
  align-items: flex-start;
  padding: var(--spacing-section) var(--spacing-icon-gap);
  background-color: rgba(55, 55, 55, 0.75);
  margin-top: var(--spacing-mega);
}

.circular-icon-item {
  width: var(--circular-item-width);
}

.circular-icon-item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--bc-white);
  text-decoration: none;
  transition: var(--transition-fast);
}

@media (hover: hover) {
  .circular-icon-item a:hover {
    transform: translateY(-5px);
    color: var(--bc-gold);
  }
}

.circular-icon-item a:focus-visible {
  outline: var(--border-base) solid var(--bc-gold);
  outline-offset: var(--border-thick);
  border-radius: var(--radius-full);
}

.circular-icon {
  width: var(--circular-icon-lg); /* 80px - exceeds 44px minimum */
  height: var(--circular-icon-lg); /* 80px - exceeds 44px minimum */
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--icon-xl);
  margin-bottom: 10px;
  transition: var(--transition-fast);
  border: var(--border-thick) solid var(--bc-white);
}

@media (hover: hover) {
  .circular-icon-item a:hover .circular-icon {
    background-color: var(--bc-gold);
    box-shadow: var(--shadow-md);
    border-color: var(--bc-gold);
  }
}

.circular-icon i {
  color: var(--bc-white);
}

.circular-icon-item a:hover .circular-icon i {
  color: var(--bc-maroon);
}

.circular-icon-label {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  font-family: 'ComeniaSansCondRegular', Arial, sans-serif;
  line-height: var(--line-height-tight);
  max-width: 120px;
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Consistent spacing between sections on mobile */
  .search-tabs {
    margin-top: 24px; /* Match circular icons spacing */
  }

  .circular-icon-container {
    gap: var(--spacing-sm);
    margin-top: 24px; /* Match search tabs spacing for even gaps */
    justify-content: center !important;
  }

  .circular-icon-item {
    width: calc(25% - var(--spacing-sm));
    flex: 0 0 auto;
  }

  .circular-icon {
    width: var(--circular-icon-md);
    height: var(--circular-icon-md);
    font-size: 28px;
  }

  .circular-icon-label {
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  /* Adjust header layout with hidden text */
  .header-branding {
    flex: 0 0 auto;
    padding-right: 0;
    border-right: none;
  }

  .todays-hours {
    padding: var(--spacing-sm) 0;
    flex: 1;
    text-align: center;
  }

  .hours-title,
  .hours-time {
    font-size: var(--font-size-sm);
  }

  .header-icons {
    gap: var(--spacing-md);
    flex: 0 0 auto;
  }

  .header-icon {
    font-size: var(--font-size-xl);
  }

  /* Keep search tabs in one row even on small phones */
  .search-tab {
    font-size: 1rem;
    padding: 0.5rem 0.0625rem;
    min-height: 3.5rem; /* Taller to accommodate text wrapping */
  }

  .onesearch-logo {
    width: 60px;
  }

  /* Make search input match tabs width for seamless appearance */
  .search-input-group {
    width: 90% !important;
  }

  .search-form-container {
    padding: 0 !important;
  }

  .search-tab-panel {
    padding: 0;
  }

  /* Add spacing between events and Instagram sections when stacked */
  .events-instagram-section .col-md-6:last-child {
    margin-top: 2rem;
  }

  .circular-icon-container {
    justify-content: center !important;
    gap: var(--spacing-sm);
  }

  .circular-icon-item {
    width: calc(25% - var(--spacing-sm));
    flex: 0 0 auto;
  }

  .circular-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .circular-icon-label {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  /* Simplify header even more on extra small screens */

  .library-title {
    font-size: 0.85rem;
  }

  .bc-logo-link {
    padding-right: var(--spacing-sm);
  }

  .header-branding {
    flex: 0 0 auto;
    padding-right: 0;
    border-right: none;
    gap: var(--spacing-sm);
  }

  .todays-hours {
    flex: 1;
    text-align: center;
    padding: 0 !important;
  }

  /* Make hours section more compact */
  /* #hours-link {
    gap: 0.125rem !important;
  } */

  .hours-title {
    font-size: 0.7rem !important;
  }

  .hours-time {
    font-size: 0.7rem !important;
  }

  .hours-label {
    font-size: 0.65rem !important;
  }

  .header-icons {
    flex: 0 0 auto;
    gap: 0.5rem !important;
  }

  .header-icon {
    font-size: 1.25rem !important;
  }

  .search-tab {
    font-size: 0.9rem;
    padding: 0.5rem 0.0625rem;
    min-height: 3.5rem;
  }

  .onesearch-logo {
    width: 50px;
  }

  .circular-icon-container {
    gap: 10px;
    justify-content: center !important;
  }

  .circular-icon-item {
    width: calc(25% - 10px);
    flex: 0 0 auto;
  }

  .circular-icon {
    width: 55px;
    height: 55px;
    font-size: 22px;
  }

  .circular-icon-label {
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .bc-logo-img {
    height: 32px;
  }

  .bc-logo-link {
    padding-right: 0.375rem;
  }

  .header-branding {
    gap: 0.375rem;
  }

  .library-title {
    font-size: 0.8rem;
  }
}

/* Instagram widgets side by side */
.instagram-widgets-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.instagram-media {
  min-width: 0 !important;
  max-height: 400px;
}

/* Stack Instagram widgets vertically on mobile */
@media (max-width: 768px) {
  .instagram-widgets-row {
    flex-direction: column !important;
    gap: var(--spacing-lg);
  }

  .instagram-media {
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
  }
}

.workshop-carousel-container {
  background-color: #ffffff !important;
}

.event-card {
  border-radius: 0 !important;
  border: 1px solid rgb(219, 219, 219) !important;
}

/* ========================================
   Service Alerts Banner
   ======================================== */

#service-alerts-message {
  background-color: var(--bc-gold);
  color: var(--bc-black);
  text-align: center;
}

.service-alerts-message-padded {
  padding: 15px 0;
}

.service-alerts-message-padded .alert-link {
  color: var(--bc-black);
  font-weight: var(--font-weight-bold);
}

.service-alerts-message-padded .updated {
  font-size: var(--font-size-sm);
  color: var(--bc-gray-medium);
}
