html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

html,
body {
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

:root {
  --primary-accent: #191970;
  --bg-color: #ffffff;
  --bg-secondary: #fafafa;
  --text-main: #111111;
  --text-muted: #666666;
  --border-light: #eaeaea;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.08);
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

.btn-primary {
  background-color: var(--primary-accent);
  border-color: var(--primary-accent);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #121255;
  border-color: #121255;
}

.btn-outline-primary {
  color: var(--primary-accent);
  border-color: var(--border-light);
}

.btn-outline-primary:hover {
  background-color: var(--bg-secondary);
  color: var(--primary-accent);
  border-color: var(--border-light);
}
.transition-hover {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-light) !important;
  background: white;
}

.transition-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover) !important;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card,
.announcement-card,
.gallery-card {
  border-radius: 1rem;
}
a {
  color: var(--primary-accent);
  transition: opacity 0.2s ease;
}

a:hover {
  color: var(--primary-accent);
  opacity: 0.8;
}

.site-header {
  transition: all 0.4s ease;
}

.site-header .navbar {
  transition: padding 0.4s ease;
}

.site-header.scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.site-header.scrolled .navbar {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

body:has(.hero-parallax-section) .site-header:not(.scrolled) {
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid transparent !important;
}

@media (max-width: 767.98px) {
  .navbar-collapse {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    margin-top: 0.5rem;
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    z-index: 1060;
  }
  
  .navbar-collapse .nav-link-custom {
    color: var(--text-main) !important;
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid var(--border-light) !important;
  }
  
  .navbar-collapse .nav-item:last-child .nav-link-custom {
    border-bottom: none !important;
  }
}

.navbar-brand {
  color: var(--primary-accent) !important;
  letter-spacing: -0.04em;
  padding: 0;
  margin: 0;
}

.nav-link-custom {
  color: var(--text-muted) !important;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 0.5rem 0 !important;
  position: relative;
  transition: color 0.3s ease;
  background: transparent !important;
  border: none !important;
}

.nav-link-custom:hover,
.nav-link-custom.active {
  color: var(--text-main) !important;
}

@media (min-width: 768px) {
  .nav-link-custom::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-link-custom:hover::after,
  .nav-link-custom.active::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .navbar-nav {
    gap: 3rem !important;
  }
}
html {
  scrollbar-color: #e0e0e0 #ffffff;
  scrollbar-width: thin;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 10px;
  border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}
.bookmark-ribbon {
  position: absolute;
  top: 0;
  width: 50px;
  height: 180px;
  background-color: #d82329;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 25px), 0 100%);
  z-index: 10;
  box-shadow: inset 0px 5px 15px rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px) {
  .bookmark-ribbon {
    width: 60px;
    height: 220px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 30px), 0 100%);
  }
}

.bookmark-right {
  right: max(1rem, calc(50% - 630px));
}

.bookmark-left {
  left: max(1rem, calc(50% - 850px));
}

.bookmark-ribbon-footer {
  height: 90px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 15px), 0 100%);
}

@media (min-width: 992px) {
  .bookmark-ribbon-footer {
    height: 110px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 20px), 0 100%);
  }
}

.nav-link-custom, .navbar-brand {
    transition: color 0.3s ease;
}

/* Make links white when transparent, dark when scrolled - only if on a dark hero page like index */
body:has(.hero-parallax-section) .site-header:not(.scrolled) .nav-link-custom {
    color: rgba(255, 255, 255, 0.9) !important;
}

body:has(.hero-parallax-section) .site-header:not(.scrolled) .navbar-brand {
    color: #ffffff !important;
}

body:has(.hero-parallax-section) .site-header:not(.scrolled) .navbar-toggler i {
    color: #ffffff !important;
}

/* --- Books Page Enhancements --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

mark.highlight-match {
  background-color: rgba(255, 215, 0, 0.4);
  color: inherit;
  padding: 0 0.1em;
  border-radius: 2px;
}

.typeahead-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border-light);
}

.typeahead-item {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text-main);
}

.typeahead-item:hover {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

.skeleton-card {
  border-radius: 1.25rem;
  overflow: hidden;
  background-color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

.skeleton-cover {
  height: 320px;
  background-color: #f5f5f7;
  display: flex;
  align-items: stretch;
  padding: 1.25rem;
}

.skeleton-imprint {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.6);
  flex: 1;
}

.btn-group-view .btn.active {
  background-color: var(--primary-accent);
  color: white;
  border-color: var(--primary-accent);
}

.btn-group-view .btn {
  color: var(--text-muted);
  border-color: var(--border-light);
}

.btn-group-view .btn:hover:not(.active) {
  background-color: var(--bg-secondary);
}

/* List View Overrides */
.view-list .col {
  width: 100%;
  flex: 0 0 100%;
}
.view-list .card {
  flex-direction: row;
  height: auto !important;
}
.view-list .cover-fallback {
  width: 280px;
  height: auto;
  min-height: 200px;
  border-bottom: none;
  border-right: 1px solid rgba(0,0,0,0.04);
}
.view-list .card-body {
  justify-content: center;
  flex: 1;
  padding: 2rem !important;
}
@media (max-width: 767.98px) {
  .view-list .card {
    flex-direction: column;
  }
  .view-list .cover-fallback {
    width: 100%;
    min-height: 250px;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.04);
  }
  .view-list .card-body {
    padding: 1.5rem !important;
  }
}
