/* =========================================================
   TITIK FIKSI — High-End Professional CSS
   Codebase: V6.1 (FINAL CLEAN)
   Features: Ads Styling, Mobile Overflow Fix, Lynk.id Color
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Layout & Spacing */
  --container: 1080px;
  --header-height: 70px;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  
  /* Effects */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
  
  --blur-strong: 24px;
  --blur-soft: 12px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

  /* Fallback Colors (Overridden by themes.css) */
  --bg-1: #f8fafc;
  --bg-2: #f1f5f9;
  --bg-3: #ffffff;
  --text-1: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.15);
  --glass: rgba(255, 255, 255, 0.65);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --brand: #2563eb;
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --cta-bg: #f1f5f9;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-1); color: var(--text-1); line-height: 1.6;
  overflow-x: hidden; min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--text-1); line-height: 1.25; margin-bottom: 0.5em; }
a { text-decoration: none; color: inherit; transition: var(--transition); cursor: pointer; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* --- UTILITIES --- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 40px 0; position: relative; }
.text-center { text-align: center; }
.d-none { display: none !important; }

/* GLASSMORPHISM COMPONENTS */
.glass-panel {
  background: var(--glass); backdrop-filter: blur(var(--blur-soft)); -webkit-backdrop-filter: blur(var(--blur-soft));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.glass-card {
  background: var(--glass-strong); backdrop-filter: blur(var(--blur-strong)); -webkit-backdrop-filter: blur(var(--blur-strong));
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius-xl); overflow: hidden;
  transition: var(--transition);
}

/* --- NAVBAR (INTERACTIVE) --- */
.navbar-wrap { position: sticky; top: 10px; z-index: 1000; padding: 0 10px; }
.navbar {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 20px;
  min-height: var(--header-height); box-shadow: var(--shadow-md); transition: var(--transition); flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700;
  letter-spacing: -0.5px; color: var(--text-1); margin-right: auto;
  transition: transform 0.3s ease;
}
.brand:hover { transform: scale(1.02); }

.brand-icon {
  width: 32px; height: 32px; background: var(--brand-gradient); color: white; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 18px; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-links { display: flex; gap: 6px; background: rgba(0,0,0,0.03); padding: 4px; border-radius: 12px; }
.nav-links a {
  font-size: 14px; font-weight: 600; color: var(--text-2); padding: 8px 16px; border-radius: 8px; white-space: nowrap;
  position: relative; overflow: hidden;
}
.nav-links a:hover { color: var(--brand); background: rgba(255,255,255,0.8); transform: translateY(-1px); }
.nav-links a.active { background: var(--bg-3); color: var(--text-1); box-shadow: var(--shadow-sm); }
.nav-links a:active { transform: scale(0.95); } 

.nav-actions { margin-left: 12px; }
.theme-btn {
  background: transparent; border: 1px solid var(--border); width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); transition: var(--transition);
}
.theme-btn:hover { background: var(--bg-3); transform: rotate(15deg) scale(1.1); box-shadow: var(--shadow-sm); }
.theme-btn:active { transform: scale(0.9); }

/* --- BUTTONS (VISUAL UPGRADE) --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 12px;
  font-weight: 700; font-size: 13px; cursor: pointer; border: none; gap: 8px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative; overflow: hidden;
}

.btn-primary { background: var(--brand-gradient); color: white; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25); }
.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: none;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(37, 99, 235, 0.4); }
.btn-primary:hover::after { animation: shimmer 0.7s; } 
.btn-primary:active { transform: translateY(-1px) scale(0.96); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2); }

.btn-soft { background: var(--bg-3); border: 1px solid var(--border); color: var(--text-1); }
.btn-soft:hover { border-color: var(--brand); color: var(--brand); background: rgba(37, 99, 235, 0.05); transform: translateY(-2px); }
.btn-soft:active { transform: scale(0.96); }

@keyframes shimmer { 0% { left: -100%; } 100% { left: 200%; } }

.btn-platform {
  display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: 50px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; border: 1px solid var(--border);
  background: var(--bg-3); color: var(--muted); transition: var(--transition);
}
.plat-orange:hover { border-color: #FF9F1C; color: #FF9F1C; background: rgba(255, 159, 28, 0.05); transform: translateY(-2px); }
.plat-red:hover { border-color: #E22B2D; color: #E22B2D; background: rgba(226, 43, 45, 0.05); transform: translateY(-2px); }
.plat-purple:hover { background: #7c3aed !important; color: white !important; border-color: #7c3aed !important; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }
.plat-purple { background: rgba(139, 92, 246, 0.1); color: #7c3aed; border-color: rgba(139, 92, 246, 0.3); }

.btn-platform:active { transform: scale(0.95); }

/* --- HERO & STORE --- */
.hero { padding-top: 20px; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 30px; padding: 40px; align-items: start; }
.hero-content h1 {
  font-size: clamp(28px, 4vw, 44px); margin-bottom: 12px;
  background: linear-gradient(to right, var(--text-1), var(--muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-subtitle { font-size: 16px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.hero-intro { font-size: 15px; color: var(--text-2); margin-bottom: 24px; line-height: 1.7; }
.hero-cta { display: flex; gap: 12px; margin-bottom: 30px; flex-wrap: wrap; }
.hero-side { display: flex; flex-direction: column; gap: 16px; }

.widget-card {
  padding: 18px; background: rgba(255,255,255,0.05); border-radius: var(--radius-lg); border: 1px solid var(--border);
  transition: border-color 0.3s;
}
.widget-card:hover { border-color: var(--brand); }
.widget-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; color: var(--muted);
  margin-bottom: 10px; border-bottom: 1px dashed var(--border); padding-bottom: 6px;
}

.video-promo-container {
  display: grid; grid-template-columns: 1fr; gap: 12px; background: var(--bg-3); border: 1px solid var(--border);
  padding: 12px; border-radius: var(--radius-lg); margin-top: 20px; transition: transform 0.3s, box-shadow 0.3s;
}
.video-promo-container:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); }
#hero-youtube { width: 100%; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: black; }
#hero-youtube iframe { width: 100%; height: 100%; }
.promo-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.promo-desc { font-size: 12px; color: var(--muted); line-height: 1.4; margin-bottom: 8px; }

/* --- STORE MEDIA --- */
.store-media { width: 100%; border-radius: 8px; overflow: hidden; background: black; margin-bottom: 8px; }
.store-media.video { aspect-ratio: 16/9; }
.store-media.video iframe { width: 100%; height: 100%; border: none; }
.store-media.image img { width: 100%; height: auto; max-height: 250px; object-fit: cover; }
.store-btn:hover { background: var(--brand) !important; color: white !important; border-color: var(--brand) !important; transform: translateY(-2px); }

/* --- CARD GRIDS --- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; padding-top: 10px; }
.card-work { display: block; position: relative; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); height: 100%; cursor: pointer; }
.card-work:hover { transform: translateY(-10px) scale(1.02); z-index: 10; }
.card-work:active { transform: scale(0.98); }
.card-cover {
  width: 100%; aspect-ratio: 2/3; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-md); margin-bottom: 14px; background: var(--border); position: relative;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card-work:hover .card-cover img { transform: scale(1.08); }
.card-meta { margin-bottom: 8px; display:flex; gap:6px; flex-wrap:wrap; }
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; background: var(--bg-3); border: 1px solid var(--border); color: var(--muted);
}
.card-work h4 { font-family: 'Playfair Display', serif; font-size: 18px; line-height: 1.35; color: var(--text-1); margin-bottom: 4px; }
.title-main { display: block; font-weight: 700; transition: color 0.3s; }
.card-work:hover .title-main { color: var(--brand); }
.title-sub { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-style: italic; color: var(--brand); font-weight: 500; margin-top: 2px; }

/* --- DETAIL & CHAPTERS --- */
.detail-header { display: flex; gap: 30px; margin-bottom: 40px; }
.detail-cover-img { width: 180px; border-radius: var(--radius-lg); box-shadow: 0 15px 30px rgba(0,0,0,0.15); transition: transform 0.3s; }
.detail-cover-img:hover { transform: scale(1.03) rotate(1deg); }
.chapter-list { display: grid; gap: 10px; }
.chapter-item {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-md); transition: all 0.2s ease; cursor: pointer;
}
.chapter-item:hover {
  border-color: var(--brand); transform: translateX(6px); 
  background: linear-gradient(to right, var(--bg-3), rgba(37,99,235,0.03)); box-shadow: var(--shadow-sm);
}
.chapter-item:active { transform: scale(0.98); }
.chap-number { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--border); margin-right: 14px; transition: color 0.3s; }
.chapter-item:hover .chap-number { color: var(--brand); }

/* --- READER & CTA --- */
.back-btn {
  position: fixed; top: 20px; left: 20px; z-index: 100; width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); color: var(--text-1); transition: all 0.3s;
}
.back-btn:hover { transform: scale(1.1) rotate(-90deg); color: var(--brand); border-color: var(--brand); }
.read-container { max-width: 720px; margin: 0 auto; }
.read-header { text-align: center; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.read-area { font-family: 'Georgia', serif; font-size: 18px; line-height: 1.9; color: var(--text-1); }
.read-area p { margin-bottom: 24px; text-align: justify; }

.cta-premium-card {
  margin: 50px auto 30px; padding: 24px; border-radius: 16px; background: var(--cta-bg); border: 1px solid var(--border);
  text-align: center; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); backdrop-filter: blur(10px);
  transition: transform 0.3s;
}
.cta-premium-card:hover { transform: translateY(-5px); border-color: var(--brand); }
.cta-premium-card h4 { font-size: 16px; margin-bottom: 8px; color: var(--text-1); }
.cta-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn-cta {
  padding: 12px 24px; border-radius: 50px; font-weight: 700; font-size: 13px; text-decoration: none; color: white !important;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-cta:hover { transform: translateY(-3px) scale(1.05); filter: brightness(1.1); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.cta-wattpad { background: linear-gradient(135deg, #FF9F1C, #FF6B6B); }
.cta-karyakarsa { background: linear-gradient(135deg, #E22B2D, #C62828); }
.cta-goodnovel { background: linear-gradient(135deg, #2D68C4, #1E40AF); }
.cta-generic { background: var(--text-1); }

/* --- SOCIAL & FOOTER --- */
.footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--border); background: var(--bg-2); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.footer-links a { margin-left: 15px; position: relative; }
.footer-links a::after { content: ''; position: absolute; width: 0; height: 1px; bottom: -2px; left: 0; background: var(--brand); transition: width 0.3s; }
.footer-links a:hover { color: var(--brand); }
.footer-links a:hover::after { width: 100%; }

.btn-contact {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 12px;
  font-size: 13px; font-weight: 600; text-decoration: none; margin: 4px; transition: all 0.3s; border: 1px solid var(--border);
}
.btn-wa { background: #25D366; color: white; border-color: #25D366; }
.btn-wa:hover { box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); transform: translateY(-2px); }
.btn-email { background: var(--bg-3); color: var(--text-1); }
.btn-email:hover { border-color: var(--text-1); transform: translateY(-2px); }

/* --- MOBILE OPTIMIZATIONS (FIXED CLIP & CUT-OFF) --- */
@media (max-width: 768px) {
  .container { padding: 0 16px; width: 100%; max-width: 100%; }
  .section { padding: 24px 0; }
  .navbar-wrap { padding: 0; top: 0; }
  
  /* Navbar Mobile Layout */
  .navbar { 
    padding: 10px 16px; border-radius: 0 0 20px 20px; 
    display: grid; grid-template-columns: 1fr auto; gap: 12px; 
  }
  .brand { font-size: 18px; }

  /* FIX: Nav Links Scrolling Container */
  .nav-links {
    grid-column: 1 / -1; order: 3; width: 100%;
    /* Display */
    display: flex; flex-wrap: nowrap; gap: 8px; justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    /* Spacing Fixes to prevent cut-off */
    padding: 8px 10px 15px 10px; /* Bawah ditambah agar shadow tidak terpotong */
    margin: 0 -16px; /* Agar scroll mentok ke pinggir layar */
    width: calc(100% + 32px); /* Kompensasi margin negatif */
    padding-left: 20px; /* Jarak aman awal */
    padding-right: 20px; /* Jarak aman akhir */
    background: transparent;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  
  /* Nav Item Mobile Styling */
  .nav-links a {
    font-size: 13px; padding: 8px 18px; 
    background: var(--bg-3); border: 1px solid var(--border); 
    border-radius: 24px; /* Lebih bulat di mobile */
    flex-shrink: 0; /* Jangan menyusut */
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  }
  .nav-links a.active { 
    background: var(--text-1); color: var(--bg-1); border-color: var(--text-1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); 
  }
  
  .hero-inner { grid-template-columns: 1fr; gap: 24px; padding: 20px; }
  .hero-content h1 { font-size: 28px; }
  .grid-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-work h4 { font-size: 15px; }
  .title-sub { font-size: 11px; }
  .detail-header { flex-direction: column; align-items: center; text-align: center; gap: 20px; }
  .detail-cover-img { width: 140px; margin: 0 auto; }
  #work-title { font-size: 24px !important; }
  .btn, .nav-links a, .chapter-item { min-height: 48px; } 
  .footer-inner { flex-direction: column; gap: 10px; }
}