/* ==========================================================================
   Unilib Classical Academic Design System
   Traditional University Press & Academic Library Aesthetics
   ========================================================================== */

:root {
  --font-serif: 'Lora', 'Georgia', 'Cambria', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --bg-page: #faf9f6;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f2ee;
  
  --border-color: #e7e5e0;
  --border-dark: #d6d3cc;
  
  --oxford-blue: #162e4a;
  --oxford-dark: #0f2035;
  --oxford-light: #f0f4f9;
  
  --antique-gold: #b45309;
  --antique-gold-light: #fef3c7;
  
  --text-main: #1c1917;
  --text-secondary: #44403c;
  --text-muted: #78716c;
  --text-light: #a8a29e;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: #faf9f6;
  color: #1c1917;
}

/* Classical Headings */
h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #f4f2ee;
}

::-webkit-scrollbar-thumb {
  background: #d6d3cc;
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a29e;
}

/* Classical Library Card */
.classic-card {
  background: #ffffff;
  border: 1px solid #e7e5e0;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.classic-card:hover {
  border-color: #d6d3cc;
  box-shadow: 0 4px 10px -2px rgba(22, 46, 74, 0.06);
}

/* Classical Form Inputs */
.input-classic {
  background: #ffffff;
  border: 1px solid #d6d3cc;
  color: #1c1917;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-classic:focus {
  border-color: #162e4a;
  box-shadow: 0 0 0 2px rgba(22, 46, 74, 0.12);
  outline: none;
}

.input-classic::placeholder {
  color: #a8a29e;
}

/* Semester Tabstrip (Classical Library Index Tabs) */
.semester-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 0.375rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #57534e;
  background: #ffffff;
  border: 1px solid #e7e5e0;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-family: var(--font-sans);
}

.semester-tab:hover {
  color: #162e4a;
  border-color: #bad0e4;
  background: #f0f4f9;
}

.semester-tab.active {
  color: #ffffff;
  background: #162e4a;
  border-color: #162e4a;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Layout Engine for Grid vs List View */
#catalogContainer.view-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (min-width: 640px) {
  #catalogContainer.view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  #catalogContainer.view-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  #catalogContainer.view-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

#catalogContainer.view-grid .item-list-row {
  display: none !important;
}

#catalogContainer.view-grid .item-grid-card {
  display: flex !important;
}

#catalogContainer.view-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#catalogContainer.view-list .item-grid-card {
  display: none !important;
}

#catalogContainer.view-list .item-list-row {
  display: flex !important;
}

/* Quick View Slide-over & Modal */
.quick-view-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.55);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quick-view-modal {
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* Semester Chips Selector (Creator Studio) */
.semester-chip-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #d6d3cc;
  background: #ffffff;
  color: #44403c;
  cursor: pointer;
  transition: all 0.15s ease;
}

.semester-chip-btn:hover {
  border-color: #162e4a;
  color: #162e4a;
  background: #f0f4f9;
}

.semester-chip-btn.selected {
  background: #f0f4f9;
  border-color: #162e4a;
  color: #162e4a;
  font-weight: 600;
}

/* Lazy Load */
img.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.lazy-load.loaded {
  opacity: 1;
}
