/* ============================================================
   Art Book Center – Modern UI  (Inter + Violet palette)
   ============================================================ */

/* ── Fonts ───────────────────────────────────────────────────── */
body {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
p, .text-muted, small, .form-label, td, th {
  font-family: 'Open Sans', 'Segoe UI', system-ui, sans-serif;
}

/* ── Design tokens ───────────────────────────────────────────── */
:root {
  /* Brand — Maroon (matching sadbhavtrust palette) */
  --primary:       #9e2a3a;
  --primary-dark:  #7a1f2d;
  --primary-light: #c0392b;
  --primary-bg:    #fdf2f3;   /* very light maroon tint */

  /* Accent */
  --accent:        #ff9800;   /* orange */
  --accent-light:  #ffcc80;

  /* Surfaces */
  --bg:            #ffffff;
  --bg-soft:       #f8f9fa;
  --bg-section:    #fdf2f3;   /* light maroon tint for sections */

  /* Text */
  --text:          #333333;
  --text-muted:    #666666;

  /* UI chrome */
  --border:        #e0e0e0;
  --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
  --shadow:        0 5px 15px rgba(0,0,0,.10);
  --shadow-lg:     0 10px 30px rgba(0,0,0,.15);
  --radius:        8px;
  --radius-lg:     12px;
  --transition:    all .3s ease;

  /* Legacy aliases */
  --brown:         var(--primary);
  --brown-dark:    var(--primary-dark);
  --brown-light:   var(--primary-light);
  --warm-bg:       var(--bg-soft);
  --warm-bg-2:     var(--bg-section);
  --text-dark:     var(--text);
  --gold:          var(--accent);
  --border-color:  var(--border);
}

/* ── Accessibility — WCAG 2.0 Level AA ───────────────────────── */

/* Skip navigation link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  background: #000;
  color: #fff !important;
  font-size: 1rem;
  font-weight: 700;
  padding: .75rem 1.5rem;
  text-decoration: none !important;
  border-bottom-right-radius: 6px;
  transition: top 0s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #ff0;
  outline-offset: 0;
}

/* Visible focus ring on ALL interactive elements (WCAG 2.4.7) */
:focus-visible {
  outline: 3px solid #0066cc;
  outline-offset: 3px;
  border-radius: 3px;
}
/* Remove default outline only when :focus-visible is supported */
:focus:not(:focus-visible) { outline: none; }

/* Buttons and links — consistent focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #0066cc;
  outline-offset: 3px;
  border-radius: 3px;
}

/* Reduced motion (WCAG 2.3.3 AAA / best practice) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
img  { max-width: 100%; height: auto; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; color: var(--text); letter-spacing: -.3px; }
a    { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
body { background: var(--bg); color: var(--text); line-height: 1.7; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-brown {
  background: var(--primary); color: #fff;
  border: 2px solid var(--primary); border-radius: 8px; font-weight: 600;
}
.btn-brown:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline-brown {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 8px; font-weight: 600;
}
.btn-outline-brown:hover { background: var(--primary); color: #fff; }

/* ── Navbar ──────────────────────────────────────────────────── */
.site-navbar {
  background: #ffffff !important;
  padding: .75rem 0;
  box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(108,43,217,.06);
}
.site-navbar .site-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.5px;
}
.site-navbar .site-tagline {
  font-size: .63rem;
  color: var(--text-muted);
  letter-spacing: .9px;
  text-transform: uppercase;
  margin-top: 1px;
}
.site-navbar .nav-link {
  color: var(--text) !important;
  font-weight: 500;
  font-size: .9rem;
  padding: .45rem .8rem !important;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.site-navbar .nav-link:hover {
  background: var(--primary-bg);
  color: var(--primary) !important;
}
.site-navbar .nav-link.active {
  background: var(--primary-bg);
  color: var(--primary) !important;
  font-weight: 600;
}
.navbar-toggler-icon { filter: none; }
.navbar-toggler      { border-color: var(--border) !important; }
.navbar-toggler:focus{ box-shadow: 0 0 0 2px rgba(108,43,217,.15); }

/* ── Fallback hero (no banners) ──────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  position: relative; overflow: hidden;
}
.hero-section::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-overlay    { position: relative; z-index: 1; padding: 90px 0; }

/* ── Hero carousel ───────────────────────────────────────────── */
.hero-slide {
  min-height: 78vh;
  background-size: cover; background-position: center;
  background-color: var(--primary-dark);
  position: relative; display: flex; align-items: center;
}
.hero-slide::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(90,26,36,.52);
}
.hero-slide-content { position: relative; z-index: 1; padding: 90px 0; width: 100%; }
#heroCarousel .carousel-indicators [data-bs-target] {
  width: 10px; height: 10px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.45); margin: 0 5px; transition: background .3s;
}
#heroCarousel .carousel-indicators .active { background: var(--accent); }
#heroCarousel .carousel-control-prev-icon,
#heroCarousel .carousel-control-next-icon { filter: drop-shadow(0 1px 4px rgba(0,0,0,.5)); }

/* ── Hero text ───────────────────────────────────────────────── */
.hero-title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 900; color: #fff; line-height: 1.15; margin-bottom: 1.25rem; letter-spacing: -.5px;
}
.hero-subtitle {
  font-size: 1.15rem; color: rgba(255,255,255,.87);
  margin-bottom: 2rem; max-width: 600px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-actions .btn { min-width: 155px; font-weight: 600; }
.min-vh-75 { min-height: 75vh; }

/* ── Section helpers ─────────────────────────────────────────── */
.section-label {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--primary); margin-bottom: .5rem;
}
.section-title   { font-size: clamp(1.5rem, 4vw, 2.3rem); margin-bottom: .5rem; }
.section-subtitle{ color: var(--text-muted); font-size: 1rem; }
.bg-light-warm   { background: var(--bg-soft) !important; }
.bg-brown-light  { background: var(--primary) !important; }

/* ── Page banner (inner pages) ───────────────────────────────── */
.page-banner {
  min-height: 260px; display: flex; align-items: center;
  position: relative; overflow: hidden;
  background-color: var(--primary);
  background-size: cover; background-position: center;
}
.page-banner::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(135deg,
    rgba(90,26,36,.92) 0%,
    rgba(122,31,45,.78) 50%,
    rgba(158,42,58,.58) 100%);
}
.page-banner::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; z-index: 2;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
}
.page-banner .container { position: relative; z-index: 3; }
.page-banner-overlay { /* compat stub */ }
.page-banner-title {
  font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 900;
  color: #fff; text-align: center; margin-bottom: .6rem;
  letter-spacing: -.3px; text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.breadcrumb-item a         { color: rgba(255,255,255,.72); font-size: .87rem; }
.breadcrumb-item a:hover   { color: var(--accent-light); }
.breadcrumb-item.active    { color: rgba(255,255,255,.9); font-size: .87rem; }
.breadcrumb-item+.breadcrumb-item::before { color: rgba(255,255,255,.4); }

/* ── Book card ───────────────────────────────────────────────── */
.book-card {
  background: var(--bg); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
}
.book-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.book-cover-wrap { position: relative; overflow: hidden; aspect-ratio: 3/4; background: var(--bg-soft); }
.book-cover      { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.book-card:hover .book-cover { transform: scale(1.05); }
.book-cover-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--primary-light); background: var(--bg-soft);
}
.book-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.book-category {
  font-size: .68rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--primary); margin-bottom: .35rem;
}
.book-title { font-size: .97rem; font-weight: 700; line-height: 1.4; margin-bottom: .35rem; flex: 1; }
.book-title a       { color: var(--text); }
.book-title a:hover { color: var(--primary); }
.book-author { font-size: .78rem; color: var(--text-muted); margin-bottom: .35rem; }
.book-price  { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.book-badge  {
  position: absolute; top: 10px; left: 10px;
  padding: .22rem .6rem; border-radius: 20px;
  font-size: .68rem; font-weight: 700; z-index: 2;
}
.badge-new      { background: #10B981; color: #fff; }
.badge-featured { background: var(--accent); color: var(--text); }
.book-overlay {
  position: absolute; inset: 0; background: rgba(74,26,155,.65);
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; opacity: 0; transition: opacity var(--transition); z-index: 3;
}
.book-card:hover .book-overlay { opacity: 1; }

/* ── Book detail ─────────────────────────────────────────────── */
.book-detail-title  { font-size: clamp(1.5rem,4vw,2.4rem); margin-bottom: .5rem; }
.book-detail-price  { font-size: 2rem; font-weight: 800; color: var(--primary); }
.book-category-tag  {
  display: inline-block; background: var(--primary-bg); color: var(--primary);
  font-size: .78rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: .25rem .75rem; border-radius: 20px;
}
.spec-item   { background: var(--bg-soft); border-radius: 8px; padding: .75rem; }
.spec-label  { font-size: .73rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.spec-value  { font-weight: 700; }
.book-cover-placeholder-lg {
  aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); border-radius: var(--radius); color: var(--primary-light);
}

/* ── Testimonial card ────────────────────────────────────────── */
.testimonial-card {
  background: var(--bg); border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.testimonial-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.testimonial-quote { font-size: 3rem; line-height: 1; color: var(--primary); opacity: .15; margin-bottom: .5rem; }
.testimonial-text  { color: var(--text); font-style: italic; line-height: 1.8; flex: 1; }
.testimonial-author {
  display: flex; align-items: center; gap: .75rem;
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
}
.testimonial-avatar,
.testimonial-avatar-placeholder { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.testimonial-avatar-placeholder {
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
}
.testimonial-name { font-weight: 700; }
.testimonial-role { font-size: .8rem; color: var(--text-muted); }

/* ── Feature section ─────────────────────────────────────────── */
.feature-item { padding: 1.5rem; }
.feature-icon {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255,255,255,.14);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.7rem; color: #fff;
}
.text-white-75 { color: rgba(255,255,255,.75); }

/* ── CTA section ─────────────────────────────────────────────── */
.cta-section { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }

/* ── Contact info ────────────────────────────────────────────── */
.contact-info-card  { display: flex; flex-direction: column; gap: 1.25rem; }
.contact-info-item  { display: flex; align-items: flex-start; gap: 1rem; }
.contact-info-icon  {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.1rem; flex-shrink: 0;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { background: #1a1a2e; color: rgba(255,255,255,.75); padding: 60px 0 0; }
.footer-heading {
  color: #fff; font-size: .95rem; font-weight: 700;
  margin-bottom: 1.25rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--primary-light); display: inline-block;
}
.footer-text { color: rgba(255,255,255,.58); font-size: .88rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a { color: rgba(255,255,255,.58); font-size: .88rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent-light); }
.footer-contact { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.footer-contact li { color: rgba(255,255,255,.65); font-size: .88rem; display: flex; align-items: flex-start; gap: .5rem; }
.footer-contact a  { color: rgba(255,255,255,.65); }
.footer-contact a:hover { color: var(--accent-light); }
.social-links { display: flex; gap: .5rem; }
.social-link  {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.75);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.social-link:hover { background: var(--primary); color: #fff; }
.footer-bottom { background: rgba(0,0,0,.35); margin-top: 40px; padding: 1rem 0; }

/* ── Page content (unified rich text layout) ─────────────────── */
.page-content {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
}

/* Headings */
.page-content h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  color: var(--primary);
  margin: 2.25rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--border);
  letter-spacing: -.2px;
}
.page-content h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: var(--text);
  margin: 1.75rem 0 .6rem;
}
.page-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1.4rem 0 .5rem;
}

/* Paragraph */
.page-content p {
  color: #374151;
  margin-bottom: 1.1rem;
}
.page-content p:last-child { margin-bottom: 0; }

/* Lists */
.page-content ul,
.page-content ol {
  padding-left: 1.6rem;
  margin-bottom: 1.1rem;
}
.page-content ul { list-style: none; padding-left: 0; }
.page-content ul li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: .4rem;
  color: #374151;
}
.page-content ul li::before {
  content: '';
  position: absolute;
  left: 0; top: .65em;
  width: 7px; height: 7px;
  background: var(--accent, #c9a84c);
  border-radius: 50%;
}
.page-content ol li {
  margin-bottom: .4rem;
  color: #374151;
}
.page-content ol li::marker { color: var(--primary); font-weight: 700; }

/* Links */
.page-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-content a:hover { color: var(--primary-dark); }

/* Blockquote */
.page-content blockquote {
  border-left: 4px solid var(--accent, #c9a84c);
  background: #faf8f3;
  margin: 1.5rem 0;
  padding: 1rem 1.4rem;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #4a4a5a;
}

/* Tables */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.page-content th {
  background: var(--primary);
  color: #fff;
  padding: .6rem 1rem;
  text-align: left;
  font-weight: 600;
}
.page-content td {
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--border);
  color: #374151;
}
.page-content tr:hover td { background: #faf8f3; }

/* Images */
.page-content img {
  max-width: 100%;
  border-radius: 8px;
  height: auto;
  margin: .75rem 0;
}

/* Horizontal rule */
.page-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2rem 0;
}

/* First h2 — no top margin */
.page-content > h2:first-child,
.page-content > h3:first-child { margin-top: 0; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp { animation: fadeInUp .6s ease both; }
.delay-1 { animation-delay: .15s; }
.delay-2 { animation-delay: .30s; }

/* ── Filter form ─────────────────────────────────────────────── */
.filter-form .form-control,
.filter-form .form-select { border-radius: 8px; border-color: var(--border); padding: .6rem 1rem; }
.filter-form .form-control:focus,
.filter-form .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(108,43,217,.12);
}

/* ── Pagination ──────────────────────────────────────────────── */
.page-link { color: var(--primary); border-radius: 8px !important; border-color: var(--border); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-link:hover { background: var(--bg-soft); color: var(--primary-dark); }

/* ── Dark theme ──────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #1a1a2e;
  --bg-soft:   #2a2a3e;
  --bg-section:#2a2a3e;
  --text:      #f0f0f0;
  --text-muted:#c0c0c0;
  --border:    #404050;
  --shadow:    0 5px 15px rgba(0,0,0,.30);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.40);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] h1,[data-theme="dark"] h2,[data-theme="dark"] h3,
[data-theme="dark"] h4,[data-theme="dark"] h5,[data-theme="dark"] h6 { color: var(--text); }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .bg-light,
[data-theme="dark"] section.bg-light,
[data-theme="dark"] .bg-light-warm { background: var(--bg-soft) !important; }
[data-theme="dark"] .book-card,
[data-theme="dark"] .testimonial-card { background: #252535; border-color: var(--border); }
[data-theme="dark"] .book-card .book-body { background: #252535; }
[data-theme="dark"] .book-cover-placeholder,
[data-theme="dark"] .spec-item,
[data-theme="dark"] .book-category-tag { background: #2e2e42; }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select { background: #252535; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .contact-info-icon { background: #2e2e42; }
/* Dark navbar */
[data-theme="dark"] .site-navbar {
  background: #14141f !important;
  box-shadow: 0 1px 0 #404050, 0 4px 16px rgba(0,0,0,.3);
}
[data-theme="dark"] .site-navbar .site-name   { color: #e8a0a8; }
[data-theme="dark"] .site-navbar .site-tagline { color: var(--text-muted); }
[data-theme="dark"] .site-navbar .nav-link     { color: #f0f0f0 !important; }
[data-theme="dark"] .site-navbar .nav-link:hover,
[data-theme="dark"] .site-navbar .nav-link.active {
  background: rgba(158,42,58,.25); color: #e8a0a8 !important;
}
[data-theme="dark"] .navbar-toggler   { border-color: #404050 !important; }
[data-theme="dark"] #themeToggle      { border-color: #404050 !important; color: #c0c0c0 !important; }
[data-theme="dark"] #themeToggle:hover {
  background: rgba(158,42,58,.25) !important; color: #e8a0a8 !important;
}

/* ── Theme toggle ────────────────────────────────────────────── */
#themeToggle {
  width: 34px; height: 34px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
  background: transparent;
  transition: background var(--transition), color var(--transition);
}
#themeToggle:hover {
  background: var(--primary-bg) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767px) {
  .hero-overlay       { padding: 55px 0; }
  .hero-title         { font-size: 1.9rem; }
  .hero-slide         { min-height: 58vh; }
  .hero-slide-content { padding: 60px 0; }
  .page-banner        { min-height: 180px; }
  .page-banner-title  { font-size: 1.7rem; }
  .book-body          { padding: .75rem; }
}
