/* 
 * STYLE.CSS
 * Perpustakaan Sekolah Modern & Responsif (High Density Theme)
 * Senior UI/UX Design & Front-End Architecture
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* CSS Variables for Cohesive Brand Identity */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #eab308;
  --accent-dark: #ca8a04;
  --accent-light: #fef9c3;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --bg-light: #f1f5f9;
  --bg-white: #ffffff;
  --border-color: #cbd5e1;
  
  /* High Density Sharp Borders and Crisp Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --shadow-accent: 0 8px 12px -3px rgba(234, 179, 8, 0.25);

  /* Typography Pairings */
  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions & Compact Radii */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Max Widths */
  --container-width: 1240px;
}

/* Reset & Global Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background-color: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Base Headings & Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
}

p {
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Buttons with Ripple & Gold Accents */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  user-select: none;
  z-index: 1;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--bg-white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--text-dark);
  box-shadow: var(--shadow-md);
}

.btn-accent:hover {
  background-color: var(--accent-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary-light);
  transform: translateY(-3px);
}

.btn-white-outline {
  background-color: transparent;
  border-color: var(--bg-white);
  color: var(--bg-white);
}

.btn-white-outline:hover {
  background-color: var(--bg-white);
  color: var(--primary);
  transform: translateY(-3px);
}

/* Button Ripple Effect CSS */
.ripple {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Loading Screen Animation */
#loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-white);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader {
  width: 60px;
  height: 60px;
  border: 5px solid var(--primary-light);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
  margin-bottom: 20px;
}

.loader-text {
  font-family: var(--font-heading);
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 1px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utility Containers & Sections */
.section {
  padding: 48px 20px; /* High Density Spacing */
  background-color: var(--bg-white);
}

.section-bg {
  background-color: var(--bg-light);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 32px auto; /* More compact */
}

.section-header .sub-title {
  font-family: var(--font-mono);
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 8px;
  display: inline-block;
  position: relative;
}

.section-header .sub-title::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 2px;
  background-color: var(--accent);
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.section-header h2 {
  font-size: 1.85rem; /* Shaper, more compact heading */
  margin-bottom: 10px;
  position: relative;
  letter-spacing: -0.5px;
}

.section-header p {
  font-size: 0.95rem; /* Tighter copy */
}

/* Scroll Reveal Base CSS */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: var(--transition-slow);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* 1. Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition-normal);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header.scrolled {
  background-color: rgba(15, 23, 42, 0.98); /* Deep slate */
  box-shadow: var(--shadow-sm);
  padding: 8px 0; /* High Density padding */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header.scrolled .logo-text h3 {
  color: var(--bg-white);
}

header.scrolled .logo-text p {
  color: var(--accent);
}

header:not(.scrolled) {
  background-color: rgba(15, 23, 42, 0.9); /* More authoritative backdrop */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 0; /* Tighter padding */
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  max-width: var(--container-width);
  margin: 0 auto;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  background-color: var(--accent);
  color: var(--primary-dark);
  width: 45px;
  height: 45px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.logo-wrapper:hover .logo-icon {
  transform: rotate(-10deg) scale(1.1);
  background-color: var(--bg-white);
  color: var(--primary);
}

.logo-text h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bg-white);
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.logo-text p {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  padding: 8px 0;
  letter-spacing: 0.5px;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Mobile Toggle Hamburger Button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger {
  position: relative;
  width: 26px;
  height: 20px;
}

.hamburger span {
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--bg-white);
  border-radius: 3px;
  transition: var(--transition-normal);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 8px;
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 8px;
}


/* 2. Hero Section */
.hero {
  position: relative;
  min-height: 450px; /* High Density dashboard banner style */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-white);
  padding: 110px 20px 48px 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(37, 99, 235, 0.8) 100%), 
              url('https://images.unsplash.com/photo-1568667256549-094345857637?auto=format&fit=crop&q=80&w=1200') no-repeat center center/cover;
  background-attachment: fixed;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  z-index: 2;
  opacity: 0;
  transform: translateY(20px);
  animation: hero-fade-in 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes hero-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-badge {
  background-color: rgba(234, 179, 8, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem; /* More compact */
  font-weight: 700;
  color: var(--bg-white);
  margin-bottom: 12px;
  letter-spacing: -1px;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem; /* Compact */
  margin-bottom: 24px; /* Tight */
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 300;
}

.hero-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Background Animated Waves */
.hero-waves {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 48px; /* Tighter */
  z-index: 1;
}


/* 3. Tentang Perpustakaan (About) */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px; /* High density compact gap */
  align-items: center;
}

.about-left h3 {
  font-size: 1.5rem; /* Tighter heading */
  color: var(--primary);
  margin-bottom: 12px;
  font-family: var(--font-heading);
}

.about-text {
  font-size: 0.95rem; /* High density size */
  margin-bottom: 20px;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.about-feat-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.about-feat-icon {
  background-color: var(--primary-light);
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.about-feat-content h4 {
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.about-feat-content p {
  font-size: 0.8rem;
}

.about-right {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.vmt-card {
  background-color: var(--bg-white);
  padding: 20px; /* High density padding */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--primary);
  transition: var(--transition-normal);
}

.vmt-card:nth-child(2) {
  border-left-color: var(--accent);
}

.vmt-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.vmt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.vmt-icon {
  font-size: 1.5rem;
}

.vmt-header h4 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vmt-card p {
  font-size: 0.88rem;
  line-height: 1.5;
}

.vmt-list {
  margin-top: 8px;
}

.vmt-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.vmt-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent);
}


/* 4. Statistik (Counters) */
.stats-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); /* Deep rich high-density slate BG */
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 20px; /* Highly condensed vertical height */
  color: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: -32px; /* Snug vertical alignment */
  position: relative;
  z-index: 10;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}

.stat-item {
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 50%;
  background-color: rgba(255, 255, 255, 0.1);
}

.stat-icon {
  font-size: 1.75rem; /* Compact */
  margin-bottom: 6px;
  display: inline-block;
}

.stat-number {
  font-family: var(--font-mono); /* Technical look */
  font-size: 2.25rem; /* Compact and precise */
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* 5. Galeri Perpustakaan */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; /* Tighter grid */
}

.gallery-item {
  position: relative;
  height: 200px; /* High Density Height */
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition-normal);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(37, 99, 235, 0.15) 100%);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px; /* Cozy padding */
  transition: var(--transition-normal);
}

.gallery-info h4 {
  color: var(--bg-white);
  font-size: 0.95rem; /* Compact text */
  transform: translateY(10px);
  transition: var(--transition-normal);
}

.gallery-info p {
  color: var(--accent);
  font-family: var(--font-mono); /* Technical look */
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: translateY(10px);
  transition: var(--transition-normal);
  transition-delay: 0.03s;
}

/* Gallery hover effects */
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.gallery-item:hover .gallery-img {
  transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-item:hover .gallery-info h4,
.gallery-item:hover .gallery-info p {
  transform: translateY(0);
}

/* Lightbox Styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.lightbox.active {
  display: flex;
  animation: lightbox-fade 0.25s ease-out;
}

@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  position: relative;
  max-width: 80%;
  max-height: 70vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 3px solid rgba(255, 255, 255, 0.1);
}

.lightbox-caption {
  color: var(--bg-white);
  font-family: var(--font-heading);
  margin-top: 12px;
  font-size: 1.1rem;
  text-align: center;
}

.lightbox-caption p {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-top: 2px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: var(--bg-white);
  font-size: 2rem;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.lightbox-close:hover {
  background-color: var(--accent);
  color: var(--text-dark);
  transform: rotate(90deg);
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bg-white);
  font-size: 1.75rem;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.1);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-fast);
  user-select: none;
}

.lightbox-btn:hover {
  background-color: var(--primary);
  color: var(--bg-white);
}

.lightbox-prev {
  left: 32px;
}

.lightbox-next {
  right: 32px;
}


/* 6. Koleksi Buku Terbaik */
.collection-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.search-bar {
  position: relative;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 42px; /* Slimmer height */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  background-color: var(--bg-white);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.search-icon-btn {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.filter-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 6px 14px; /* Cozy padding */
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-sm); /* Crisp modern border radius */
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.filter-btn.active {
  background-color: var(--primary);
  color: var(--bg-white);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Books Grid & Cards */
.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; /* High Density Gap */
}

.book-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.book-img-box {
  position: relative;
  height: 200px; /* Highly compact height */
  background-color: var(--bg-light);
  overflow: hidden;
}

.book-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: var(--transition-normal);
}

.book-card:hover .book-img {
  transform: scale(1.05);
}

.book-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--primary);
  color: var(--bg-white);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.book-info {
  padding: 14px; /* Tighter padding */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-rating {
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.book-title {
  font-size: 0.95rem; /* Slimmer text */
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
  /* Multi-line clamp */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 38px;
}

.book-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.book-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 6px;
}

.book-btn {
  margin-top: auto;
  width: 100%;
  padding: 8px;
  font-size: 0.8rem;
}

/* Book Detail Modal */
.book-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2050;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.book-modal.active {
  display: flex;
  animation: modal-fade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-fade {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.book-modal-box {
  background-color: var(--bg-white);
  max-width: 640px; /* High density size */
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

.book-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--text-dark);
  font-size: 1.2rem;
  cursor: pointer;
  background-color: var(--bg-light);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 10;
  transition: var(--transition-fast);
}

.book-modal-close:hover {
  background-color: var(--primary);
  color: var(--bg-white);
}

.book-modal-left {
  background-color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.book-modal-img {
  max-height: 240px; /* Shorter image height */
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.book-modal-right {
  padding: 24px; /* Reduced padding */
  display: flex;
  flex-direction: column;
}

.book-modal-cat {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.book-modal-title {
  font-size: 1.35rem; /* Tighter heading */
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
}

.book-modal-author {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.book-modal-desc {
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.book-modal-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background-color: var(--bg-light);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.book-modal-specs span {
  font-weight: 600;
  color: var(--text-dark);
}


/* 7. Struktur Organisasi */
.org-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px; /* Spacing density */
}

/* Highlight the major roles for structural balance */
@media (min-width: 1024px) {
  .org-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .org-card-headmaster {
    grid-column: span 3;
  }
  .org-card-libraryhead {
    grid-column: span 3;
  }
  .org-card-staff {
    grid-column: span 2;
  }
}

.org-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  text-align: center;
}

.org-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.org-img-box {
  position: relative;
  height: 180px; /* High density height */
  overflow: hidden;
  background-color: var(--primary-light);
}

.org-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.org-card:hover .org-img {
  transform: scale(1.06);
}

.org-info {
  padding: 12px; /* High density padding */
}

.org-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.org-role {
  color: var(--primary);
  font-family: var(--font-mono); /* High density mono look */
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.org-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* 8. Layanan Perpustakaan */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px; /* Spacing density */
}

.service-card {
  background-color: var(--bg-white);
  padding: 24px 20px; /* Reduced padding for high density */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px; /* Slimmer border highlight */
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition-normal);
}

.service-card:hover::after {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.service-icon-box {
  background-color: var(--primary-light);
  color: var(--primary);
  width: 44px; /* Highly compact icon boxes */
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 16px;
  transition: var(--transition-normal);
}

.service-card:hover .service-icon-box {
  background-color: var(--primary);
  color: var(--bg-white);
  transform: rotateY(180deg);
}

.service-card h3 {
  font-size: 1.1rem; /* Compact */
  margin-bottom: 8px;
}

.service-card p {
  font-size: 0.85rem;
}


/* 9. Testimoni Slider */
.testi-container {
  max-width: 640px; /* Slimmer width for density */
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.testi-slider {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.testi-slide {
  min-width: 100%;
  box-sizing: border-box;
  padding: 12px;
}

.testi-card {
  background-color: var(--bg-white);
  padding: 24px; /* Tighter padding */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  position: relative;
  border: 1px solid var(--border-color);
}

.testi-quote-icon {
  font-size: 2rem; /* Compact */
  color: var(--primary-light);
  line-height: 1;
  position: absolute;
  top: 10px;
  left: 20px;
}

.testi-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem; /* Highly readable size */
  color: var(--text-dark);
  margin-bottom: 16px;
  line-height: 1.6;
}

.testi-author {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.testi-img {
  width: 48px; /* Slimmer profile */
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid var(--accent);
}

.testi-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.testi-class {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Testi Dots Controls */
.testi-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.testi-dot {
  width: 8px;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-fast);
}

.testi-dot.active {
  background-color: var(--primary);
  transform: scale(1.2);
}


/* 10. FAQ Accordion */
.faq-grid {
  max-width: 700px; /* High density width */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.faq-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.faq-header {
  padding: 12px 18px; /* Highly compact padding */
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background-color: var(--bg-white);
  transition: var(--transition-fast);
}

.faq-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.faq-icon-box {
  background-color: var(--bg-light);
  color: var(--primary);
  width: 26px; /* Reduced button size */
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  transition: var(--transition-normal);
}

.faq-item.active {
  border-color: var(--primary);
}

.faq-item.active .faq-header {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.faq-item.active .faq-icon-box {
  background-color: var(--primary);
  color: var(--bg-white);
  transform: rotate(180deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: var(--bg-white);
}

.faq-content-inner {
  padding: 12px 18px 16px 18px; /* Condensed inner content */
  font-size: 0.88rem;
  border-top: 1px solid var(--border-color);
}


/* 11. Kontak & Google Maps */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px; /* Reduced gap */
}

.contact-left {
  background-color: var(--bg-white);
  padding: 24px; /* Cozy padding */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.contact-left h3 {
  font-size: 1.35rem; /* Tighter heading */
  margin-bottom: 16px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px; /* Tight inputs */
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-dark);
}

.form-input {
  padding: 8px 12px; /* Slimmer inputs */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.form-error {
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 500;
  margin-top: 4px;
  display: none;
}

/* Map & Details Right Box */
.contact-right {
  display: flex;
  flex-direction: column;
  gap: 16px; /* High Density Gap */
}

.contact-details {
  background-color: var(--primary-dark);
  color: var(--bg-white);
  padding: 24px; /* Tighter padding */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.contact-details h3 {
  color: var(--bg-white);
  font-size: 1.35rem;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  display: inline-block;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.info-icon {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  width: 32px; /* Compact icons */
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.info-text h4 {
  color: var(--bg-white);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.info-text p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
}

.map-container {
  height: 200px; /* Slimmer map wrapper */
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.map-iframe {
  width: 100%;
  height: 100%;
  border: none;
}


/* 12. Footer */
footer {
  background-color: #0f172a;
  color: var(--bg-white);
  padding: 48px 20px 24px 20px; /* Highly compact footer spacing */
  border-top: 4px solid var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1.2fr;
  gap: 24px;
  max-width: var(--container-width);
  margin: 0 auto 32px auto;
}

.footer-col h3, .footer-col h4 {
  color: var(--bg-white);
  margin-bottom: 16px;
  font-size: 1.05rem;
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 24px;
  height: 2px;
  background-color: var(--accent);
}

.footer-about .logo-wrapper {
  margin-bottom: 12px;
}

.footer-about p {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.social-links {
  display: flex;
  gap: 8px;
}

.social-btn {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--bg-white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.social-btn:hover {
  background-color: var(--accent);
  color: var(--text-dark);
  transform: translateY(-2px);
}

.footer-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links-list li a {
  color: #94a3b8;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links-list li a::before {
  content: '›';
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
}

.footer-links-list li a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-hours-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-hours-list li {
  display: flex;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 0.8rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.footer-hours-list li span:last-child {
  color: var(--accent);
  font-weight: 600;
}

.footer-newsletter p {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-input {
  flex-grow: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--bg-white);
  font-size: 0.85rem;
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--accent);
}

.newsletter-btn {
  padding: 10px 16px;
  font-size: 0.85rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-width);
  margin: 0 auto;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: #64748b;
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  color: #64748b;
}

.footer-bottom-links a:hover {
  color: var(--accent);
}


/* Back To Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--accent);
  color: var(--text-dark);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  z-index: 900;
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--primary);
  color: var(--bg-white);
  transform: translateY(-5px);
  box-shadow: var(--shadow-accent);
}


/* Notification System for Form Validations */
.notification {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background-color: #10b981;
  color: var(--bg-white);
  padding: 15px 25px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition-normal);
  z-index: 3000;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
}

.notification.active {
  transform: translateY(0);
  opacity: 1;
}

.notification-error {
  background-color: #ef4444;
}


/* ==================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ================================== */

@media (max-width: 1200px) {
  .nav-container {
    padding: 0 30px;
  }
}

@media (max-width: 1024px) {
  /* Layout Adjustments */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .books-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .org-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  /* Navigation Menu Toggle */
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--primary-dark);
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 20px;
    gap: 24px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-xl);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    font-size: 1.15rem;
    color: var(--bg-white);
  }

  /* Hero Section */
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .hero-btns {
    flex-direction: column;
    gap: 12px;
  }

  .hero-btns .btn {
    width: 100%;
  }

  /* Stats Counter Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 20px;
  }

  .stat-item:nth-child(2)::after {
    display: none;
  }

  /* Gallery Lightbox Details */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Books Grid */
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .book-modal-box {
    grid-template-columns: 1fr;
  }

  .book-modal-left {
    padding: 20px;
  }

  .book-modal-img {
    max-height: 200px;
  }

  .book-modal-right {
    padding: 25px;
  }

  /* Org Grid */
  .org-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* FAQ */
  .faq-header {
    padding: 16px 20px;
  }

  .faq-header h4 {
    font-size: 0.95rem;
  }

  /* Footer Section */
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 60px 15px;
  }

  .section-header h2 {
    font-size: 1.75rem;
  }

  /* Hero */
  .hero {
    padding-top: 140px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  /* Stats Counter Grid */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-item::after {
    display: none !important;
  }

  /* Gallery Grid */
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  /* Books Grid */
  .books-grid {
    grid-template-columns: 1fr;
  }

  /* Org Grid */
  .org-grid {
    grid-template-columns: 1fr;
  }

  /* Services Grid */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* News Letter Form */
  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-btn {
    width: 100%;
  }
}
