/* ===================================================================
   ALTER MEDIA — DESIGN SYSTEM
   Archetype: The Curious Storyteller · "Berat → Ringan"
   80% Modern Editorial / 20% Medieval accent
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Grenze+Gotisch:wght@500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  /* Color system */
  --color-primary: #3547A5;      /* Royal Indigo — trust, intelligence */
  --color-primary-dark: #263275;
  --color-primary-light: #6C7CC9;
  --color-secondary: #E7D6B1;    /* Parchment Cream — classic, literary warmth */
  --color-bg: #E7D6B1;           /* page background = Parchment Cream, per DESIGN.md */
  --color-surface: #FBF6EB;      /* lighter parchment tint — cards & tinted sections sit on this */
  --color-charcoal: #252422;     /* neutral text */
  --color-charcoal-soft: #55534E;
  --color-gold: #B8902E;         /* muted gold accent, ties to "literasi klasik" */
  --color-white: #FFFFFF;
  --color-border: #D8C59D;

  /* Type */
  --font-display: 'Grenze Gotisch', serif;
  --font-body: 'Poppins', system-ui, sans-serif;

  /* Layout */
  --max-width: 1200px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --space-section: clamp(3rem, 6vw, 6rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-charcoal);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* -------------------------------------------------- Typography ---- */

h1, h2, h3 { margin: 0 0 0.5em; color: var(--color-charcoal); font-weight: 600; }

.font-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.08;
  font-weight: 600;
  color: var(--color-primary-dark);
}

h2.section-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.lede {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--color-charcoal-soft);
  max-width: 46ch;
}

/* -------------------------------------------------- Navigation ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 241, 227, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(216, 197, 157, 0.4);
  box-shadow: 0 4px 30px rgba(37, 36, 34, 0.05);
  transition: all 0.3s ease;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.brand .wing-icon {
  width: 26px;
  height: 26px;
  color: var(--color-gold);
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a {
  position: relative;
  padding: 0.25rem 0;
  color: var(--color-charcoal-soft);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--color-primary); }

.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: -6px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  left: 0; right: 0;
  opacity: 1;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-primary-dark);
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--color-secondary);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.85rem clamp(1.25rem, 4vw, 2.5rem); }
  .nav-toggle { display: block; }
}

/* -------------------------------------------------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-section) 0 3.5rem;
}

.hero-wings {
  position: absolute;
  top: -20px;
  right: -40px;
  width: min(560px, 60vw);
  color: var(--color-primary);
  opacity: 0.07;
  transform: scaleX(-1);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 640px; }

/* -------------------------------------------------- Divider ------- */

.wing-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto;
  padding: 2.5rem 0;
  color: var(--color-gold);
}

.wing-divider .wing-icon { width: 34px; height: 34px; opacity: 0.55; }
.wing-divider .line { flex: 1; max-width: 120px; height: 1px; background: var(--color-border); }

/* -------------------------------------------------- Sections ------ */

section { padding: var(--space-section) 0; }
section.tinted { background: var(--color-surface); }

/* -------------------------------------------------- Book grid ------ */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: 2.5rem;
}

.book-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(216, 197, 157, 0.5);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(37, 36, 34, 0.03);
}

.book-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 40px rgba(53, 71, 165, 0.12), 0 0 0 1px rgba(53, 71, 165, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.book-card .cover {
  aspect-ratio: 3 / 4;
  width: 100%;
  display: block;
  object-fit: cover;
  background: var(--color-surface);
}

.book-card .info { padding: 1.1rem 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }

.book-card .title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-charcoal);
}

.book-card .author {
  font-size: 0.85rem;
  color: var(--color-charcoal-soft);
}

.book-card .price {
  margin-top: auto;
  padding-top: 0.6rem;
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95rem;
}

.book-card .cta-row { margin-top: 0.7rem; }

/* -------------------------------------------------- Buttons ------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary { 
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white); 
  border: none;
  box-shadow: 0 4px 15px rgba(53, 71, 165, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
}

.btn-primary:hover::after {
  left: 150%;
}

.btn-primary:hover { 
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(53, 71, 165, 0.4); 
}

.btn-secondary { 
  background: rgba(255, 255, 255, 0.5); 
  border-color: var(--color-primary); 
  color: var(--color-primary); 
  backdrop-filter: blur(4px);
}

.btn-secondary:hover { 
  background: var(--color-primary); 
  color: var(--color-white); 
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(53, 71, 165, 0.2);
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.82rem; }

/* -------------------------------------------------- Book detail --- */

.book-detail {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 760px) {
  .book-detail { grid-template-columns: 1fr; }
}

.book-detail .cover-wrap { position: sticky; top: 6.5rem; }

.book-detail .cover-wrap .cover {
  aspect-ratio: 3 / 4;
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 48px -24px rgba(37,36,34,0.4);
}

.book-detail .meta { color: var(--color-charcoal-soft); font-size: 0.95rem; margin-bottom: 1.2rem; }
.book-detail .synopsis { max-width: 62ch; margin-bottom: 2rem; }
.book-detail .synopsis p { margin: 0 0 1em; }

/* -------------------------------------------------- Cover slider --- */

.cover-slider {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(37, 36, 34, 0.4);
  background: var(--color-secondary);
}

.cover-slider .slider-image {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: cover;
  display: block;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-charcoal);
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 36, 34, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
}

.slider-arrow:hover { background: var(--color-white); transform: translateY(-50%) scale(1.06); }
.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }

.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.slider-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.slider-dots .dot.active { background: var(--color-white); transform: scale(1.25); }

.slider-thumbs {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.slider-thumbs img {
  width: 56px;
  height: 74px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.slider-thumbs img:hover { opacity: 0.9; }
.slider-thumbs img.active { opacity: 1; border-color: var(--color-primary); }

/* -------------------------------------------------- Cards/blocks -- */

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem;
  margin-top: 2.5rem;
}

.value-card {
  padding: 1.75rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(216, 197, 157, 0.5);
  border-radius: var(--radius-md);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(37, 36, 34, 0.02);
}

.value-card:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(37, 36, 34, 0.08), 0 0 0 1px rgba(216, 197, 157, 0.8);
}

.value-card h3 { font-size: 1.05rem; }
.value-card p { color: var(--color-charcoal-soft); font-size: 0.94rem; margin: 0; }

/* -------------------------------------------------- Forms --------- */

.form-field { margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.form-field label { font-size: 0.88rem; font-weight: 600; color: var(--color-charcoal); }

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-charcoal);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 1px;
  border-color: var(--color-primary);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-channel {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.contact-channel:last-child { border-bottom: none; }
.contact-channel .icon { color: var(--color-primary); flex-shrink: 0; margin-top: 0.15rem; }
.contact-channel .label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-charcoal-soft); }
.contact-channel .value { font-weight: 600; }

/* -------------------------------------------------- Footer --------- */

.site-footer {
  background: var(--color-charcoal);
  color: #D8D6D0;
  padding: 3rem 0 2rem;
  margin-top: var(--space-section);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.footer-brand { font-family: var(--font-display); font-size: 1.3rem; color: var(--color-secondary); }
.footer-tagline { max-width: 32ch; font-size: 0.88rem; color: #ADAAA3; margin-top: 0.5rem; }

.footer-links { display: flex; gap: 2rem; font-size: 0.9rem; }
.footer-links a { color: #C8C5BD; }
.footer-links a:hover { color: var(--color-secondary); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.4rem;
  font-size: 0.8rem;
  color: #86837C;
}

/* -------------------------------------------------- Utilities ----- */

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-charcoal-soft);
}

.skeleton {
  background: linear-gradient(90deg, #EFE9DA 25%, #F6F1E6 37%, #EFE9DA 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* -------------------------------------------------- Animations ----- */

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------- Page Transition -- */
.page-transition-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: var(--color-bg); /* Menggunakan warna dasar Parchment Cream */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.page-transition-overlay.is-loading {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}
.page-transition-overlay .icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(53, 71, 165, 0.2);
  animation: pulse-spin 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.9;
}
@keyframes pulse-spin {
  0% { transform: scale(0.85) translateY(0); opacity: 0.4; }
  50% { transform: scale(1) translateY(-10px); opacity: 1; }
  100% { transform: scale(0.85) translateY(0); opacity: 0.4; }
}

/* -------------------------------------------------- Form alerts --- */

.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.alert-error { background: #FBE7E5; color: #A32E27; border: 1px solid #F0BEB8; }
.alert-success { background: #E6F0E6; color: #2E6B2E; border: 1px solid #BEDCBE; }
