/*
Theme Name: Utulis
Theme URI: https://utulis.com
Author: Utulis
Author URI: https://utulis.com
Description: A collaborative storytelling and bookstore theme. Built for community-driven fiction with integrated monetization. Full WordPress utility with Customizer, Menus, Widgets, and Mobile-responsive design.
Version: 1.0.0
License: GPL v2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: utulis
Domain Path: /languages
Requires at least: 6.0
Requires PHP: 7.4
*/

/* ============================================
   LOCAL FONTS — @font-face
   Files go in: your-theme/fonts/
   Download woff2 files from:
   https://gwfh.madebymike.de (select "Modern Browsers")
   Spectral: 300,400,500,600 regular + italic
   Plus Jakarta Sans: 300,400,500,600,700 regular
   ============================================ */

/* Spectral — regular weights */
@font-face {
  font-family: 'Spectral';
  src: url('fonts/spectral-v15-latin-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Spectral';
  src: url('fonts/spectral-v15-latin-300italic.woff2') format('woff2');
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Spectral';
  src: url('fonts/spectral-v15-latin-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Spectral';
  src: url('fonts/spectral-v15-latin-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Spectral';
  src: url('fonts/spectral-v15-latin-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Spectral';
  src: url('fonts/spectral-v15-latin-500italic.woff2') format('woff2');
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Spectral';
  src: url('fonts/spectral-v15-latin-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Spectral';
  src: url('fonts/spectral-v15-latin-600italic.woff2') format('woff2');
  font-weight: 600; font-style: italic; font-display: swap;
}

/* Plus Jakarta Sans — UI weights */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plus-jakarta-sans-v12-latin-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plus-jakarta-sans-v12-latin-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plus-jakarta-sans-v12-latin-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plus-jakarta-sans-v12-latin-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('fonts/plus-jakarta-sans-v12-latin-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ============================================
   UTULIS THEME - BASE STYLES
   ============================================ */

/* CSS Variables */
:root {
  --u-primary: #e94560;
  --u-primary-dark: #c73e54;
  --u-dark: #1a1a2e;
  --u-dark-light: #252540;
  --u-text: #2d2d2d;
  --u-text-light: #666;
  --u-text-muted: #999;
  --u-bg: #f8f9fa;
  --u-white: #ffffff;
  --u-border: #e0e0e0;
  --u-border-light: #f0f0f0;
  --u-radius: 12px;
  --u-radius-sm: 8px;
  --u-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --u-shadow-hover: 0 8px 28px rgba(0,0,0,0.12);
  --u-transition: all 0.3s ease;
  --u-max-width: 1200px;
  --u-narrow: 800px;
  --u-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --u-font-serif: Georgia, 'Times New Roman', serif;
  --u-header-height: 72px;
  --u-top-bar-height: 40px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--u-font);
  color: var(--u-text);
  background: var(--u-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #111;
  text-decoration: none;
  transition: var(--u-transition);
}

a:hover {
  color: var(--u-primary);
}

/* ============================================
   LAYOUT
   ============================================ */

.u-container {
  max-width: var(--u-max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.u-narrow {
  max-width: var(--u-narrow);
  margin: 0 auto;
}

.u-section {
  padding: 80px 0;
}

.u-section-sm {
  padding: 40px 0;
}

/* ============================================
   TOP BAR
   ============================================ */

.u-top-bar {
  background: var(--u-dark);
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  height: var(--u-top-bar-height);
  display: flex;
  align-items: center;
}

.u-top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.u-top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.u-top-bar-text {
  color: rgba(255,255,255,0.6);
}

.u-top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.u-top-menu {
  display: flex;
  list-style: none;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.u-top-menu a {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  transition: color 0.2s;
}

.u-top-menu a:hover {
  color: var(--u-white);
}

/* Social Links */
.u-social-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.u-social-link {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--u-transition);
}

.u-social-link:hover {
  background: var(--u-primary);
  transform: translateY(-2px);
}

.u-social-icon {
  width: 14px;
  height: 14px;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.u-social-facebook .u-social-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z'/%3E%3C/svg%3E"); }
.u-social-twitter .u-social-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z'/%3E%3C/svg%3E"); }
.u-social-instagram .u-social-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='2' width='20' height='20' rx='5' ry='5'/%3E%3Cpath d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z'/%3E%3Cline x1='17.5' y1='6.5' x2='17.51' y2='6.5'/%3E%3C/svg%3E"); }
.u-social-tiktok .u-social-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5'/%3E%3C/svg%3E"); }
.u-social-youtube .u-social-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.33 29 29 0 0 0-.46-5.33z'/%3E%3Cpolygon points='9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02'/%3E%3C/svg%3E"); }
.u-social-discord .u-social-icon { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03z'/%3E%3C/svg%3E"); }

/* ============================================
   HEADER
   ============================================ */

.u-header {
  background: var(--u-white);
  border-bottom: 1px solid var(--u-border-light);
  position: relative;
  z-index: 1000;
  transition: var(--u-transition);
}

.u-header.is-sticky {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.u-header.is-transparent {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: var(--u-top-bar-height);
  left: 0;
  right: 0;
}

.u-header.is-transparent .u-logo,
.u-header.is-transparent .u-nav-menu a {
  color: var(--u-white);
}

.u-header.is-transparent .u-nav-menu a:hover {
  color: var(--u-primary);
}

.u-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--u-header-height);
  gap: 24px;
}

.u-header-brand {
  flex-shrink: 0;
}

.u-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--u-dark);
  letter-spacing: -1px;
  display: inline-flex;
  align-items: center;
}

.u-logo span {
  color: var(--u-primary);
}

.u-logo img {
  max-height: 48px;
  width: auto;
}

/* ============================================
   DESKTOP NAVIGATION
   ============================================ */

.u-nav-desktop {
  flex: 1;
  display: flex;
  justify-content: center;
}

.u-nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.u-nav-menu li {
  position: relative;
}

.u-nav-menu a {
  color: var(--u-text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: var(--u-radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--u-transition);
}

.u-nav-menu a:hover {
  color: var(--u-primary);
  background: rgba(233,69,96,0.05);
}

.u-nav-menu li.active > a {
  color: var(--u-primary);
  font-weight: 600;
}

/* Dropdown Menus */
.u-nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--u-white);
  border-radius: var(--u-radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 220px;
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 1001;
  border: 1px solid var(--u-border-light);
}

.u-nav-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.u-nav-menu .sub-menu li {
  display: block;
}

.u-nav-menu .sub-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 0.9rem;
  border-radius: 0;
  white-space: nowrap;
}

.u-nav-menu .sub-menu a:hover {
  background: var(--u-bg);
  padding-left: 24px;
}

/* Nested dropdowns */
.u-nav-menu .sub-menu .sub-menu {
  top: 0;
  left: 100%;
  margin-left: 4px;
}

/* Dropdown toggle arrow */
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  opacity: 0.6;
  transition: transform 0.2s;
}

.u-nav-menu li:hover > a .dropdown-toggle {
  transform: rotate(180deg);
  opacity: 1;
}

/* ============================================
   HEADER ACTIONS
   ============================================ */

.u-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.u-search-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--u-bg);
  color: var(--u-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--u-transition);
}

.u-search-toggle:hover {
  background: var(--u-primary);
  color: var(--u-white);
}

/* User Menu */
.u-user-menu {
  position: relative;
}

.u-user-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 24px;
  border: 1px solid var(--u-border);
  background: var(--u-white);
  cursor: pointer;
  transition: var(--u-transition);
}

.u-user-toggle:hover {
  border-color: var(--u-primary);
}

.u-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.u-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.u-user-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--u-text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.u-dropdown-chevron {
  color: var(--u-text-muted);
  transition: transform 0.2s;
}

.u-user-menu:hover .u-dropdown-chevron {
  transform: rotate(180deg);
}

.u-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--u-white);
  border-radius: var(--u-radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 200px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 1002;
  border: 1px solid var(--u-border-light);
}

.u-user-menu:hover .u-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.u-user-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.u-user-dropdown-menu li {
  display: block;
}

.u-user-dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: var(--u-text);
  transition: var(--u-transition);
}

.u-user-dropdown-menu a:hover {
  background: var(--u-bg);
  color: var(--u-primary);
  padding-left: 24px;
}

.u-user-dropdown-menu .u-divider {
  height: 1px;
  background: var(--u-border-light);
  margin: 8px 16px;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */

.u-search-wrap {
  position: relative;
}

.u-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--u-white);
  border-radius: var(--u-radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: 1px solid var(--u-border-light);
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 1002;
}

.u-search-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.u-search-panel .search-form {
  width: 100%;
}

.u-search-panel .search-field {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  border: 1px solid var(--u-border);
  border-radius: var(--u-radius-sm);
  background: var(--u-bg);
  color: var(--u-dark);
  outline: none;
  transition: border-color 0.3s;
}

.u-search-panel .search-field::placeholder {
  color: var(--u-text-muted);
}

.u-search-panel .search-field:focus {
  border-color: var(--u-primary);
}

.u-search-panel .search-submit {
  display: none;
}

/* ============================================
   MOBILE MENU
   ============================================ */

.u-mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--u-bg);
  border-radius: var(--u-radius-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  transition: var(--u-transition);
}

.u-mobile-toggle:hover {
  background: var(--u-primary);
}

.u-mobile-toggle:hover .u-hamburger span {
  background: var(--u-white);
}

.u-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.u-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--u-text);
  border-radius: 2px;
  transition: var(--u-transition);
}

.u-mobile-toggle.is-active .u-hamburger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.u-mobile-toggle.is-active .u-hamburger span:nth-child(2) {
  opacity: 0;
}

.u-mobile-toggle.is-active .u-hamburger span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Overlay */
.u-mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.u-mobile-overlay.is-active {
  visibility: visible;
  opacity: 1;
}

.u-mobile-overlay-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.u-mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: var(--u-white);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
}

.u-mobile-overlay.is-active .u-mobile-menu-panel {
  transform: translateX(0);
}

.u-mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--u-border-light);
}

.u-mobile-menu-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--u-dark);
}

.u-mobile-close {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--u-bg);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--u-text);
  transition: var(--u-transition);
}

.u-mobile-close:hover {
  background: var(--u-primary);
  color: var(--u-white);
}

.u-mobile-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.u-mobile-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.u-mobile-nav li {
  border-bottom: 1px solid var(--u-border-light);
}

.u-mobile-nav a {
  display: block;
  padding: 16px 24px;
  color: var(--u-text);
  font-weight: 500;
  font-size: 1rem;
  transition: var(--u-transition);
}

.u-mobile-nav a:hover {
  background: var(--u-bg);
  color: var(--u-primary);
  padding-left: 28px;
}

.u-mobile-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 24px;
  background: var(--u-bg);
  display: none;
}

.u-mobile-nav li.has-dropdown > a::after {
  content: '+';
  float: right;
  font-size: 1.2rem;
  color: var(--u-text-muted);
}

.u-mobile-nav li.has-dropdown.is-open > a::after {
  content: '−';
}

.u-mobile-nav li.has-dropdown.is-open > .sub-menu {
  display: block;
}

.u-mobile-nav .sub-menu a {
  padding: 12px 24px;
  font-size: 0.9rem;
  color: var(--u-text-light);
  border-bottom: none;
}

.u-mobile-actions {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--u-border-light);
  margin-top: auto;
}

/* ============================================
   HERO
   ============================================ */

.u-hero {
  background: var(--u-dark);
  color: var(--u-white);
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

.u-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(233,69,96,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.u-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--u-white);
}

.u-hero p {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin-bottom: 32px;
}

/* ============================================
   BUTTONS
   ============================================ */

.u-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: var(--u-transition);
  font-family: var(--u-font);
}

.u-btn-primary {
  background: var(--u-primary);
  color: var(--u-white);
}

.u-btn-primary:hover {
  background: var(--u-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--u-shadow-hover);
  color: var(--u-white);
}

.u-btn-outline {
  background: transparent;
  color: var(--u-white);
  border: 2px solid rgba(255,255,255,0.3);
}

.u-btn-outline:hover {
  border-color: var(--u-white);
  color: var(--u-white);
  transform: translateY(-2px);
}

.u-btn-dark {
  background: var(--u-dark);
  color: var(--u-white);
}

.u-btn-dark:hover {
  background: var(--u-dark-light);
  color: var(--u-white);
}

.u-btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.u-btn-block {
  width: 100%;
}

.u-btn-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.u-link-simple {
  display: inline-block;
  color: var(--u-primary);
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: underline;
  background: none;
  padding: 0;
}

.u-link-simple:hover {
  color: var(--u-primary-dark);
}

.search-lang-toggle {
  display: flex;
  gap: 16px;
  align-items: center;
}

.search-lang-toggle label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--u-text-light);
  font-size: 0.85rem;
  cursor: pointer;
}

.search-lang-toggle label:has(input:checked) {
  color: var(--u-primary);
  font-weight: 600;
}

.search-lang-toggle input[type="radio"] {
  accent-color: var(--u-primary);
  width: 14px;
  height: 14px;
  margin: 0;
}

.u-search-panel .search-lang-toggle {
  margin: 10px 0 0;
  gap: 12px;
}

/* Search page hero override — scoped, does not affect other .u-hero usage */
.u-search-hero {
  background: var(--u-white);
  padding: 32px 0;
  border-bottom: 1px solid var(--u-border);
}

.u-search-hero h1 {
  color: var(--u-dark);
}

.u-search-hero p {
  color: var(--u-text-light);
  margin-bottom: 0;
}

/* Search page book results — cover left, info right */
.u-book-card--row {
  display: flex;
  flex-direction: row;
}

.u-book-card--row .u-book-cover {
  width: 115px;
  flex: 0 0 115px;
  aspect-ratio: 2/3;
  align-self: start;
}

.u-book-card--row .u-book-info {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}

.u-book-card--row .u-book-title {
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u-book-card--row .u-book-desc {
  color: var(--u-text-light);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 8px;
  min-height: 2.88rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.u-book-card--row .u-book-price {
  font-size: 1rem;
  margin-bottom: 8px;
}

/* Search results: link + meta share one row to shorten card height. */
.u-search-results .u-card-body {
  flex: 0 1 auto;
  padding: 16px;
}

.u-search-results .u-card-excerpt {
  margin-bottom: 8px;
  min-height: 4.32rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.u-search-results .u-card-image {
  aspect-ratio: 16/9;
}

.u-search-results .u-card-title {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u-card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.u-card-footer-row .u-card-meta {
  margin-bottom: 0;
}

/* ============================================
   CARDS (Story Grid)
   ============================================ */

.u-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.u-card {
  background: var(--u-white);
  border-radius: var(--u-radius);
  overflow: hidden;
  box-shadow: var(--u-shadow);
  border: 1px solid var(--u-border-light);
  transition: var(--u-transition);
  display: flex;
  flex-direction: column;
}

.u-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--u-shadow-hover);
  border-color: var(--u-border);
}

.u-card-image {
  aspect-ratio: 16/10;
  background: var(--u-dark-light);
  position: relative;
  overflow: hidden;
}

.u-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.u-card:hover .u-card-image img {
  transform: scale(1.05);
}

.u-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.u-card-badge--standalone {
  position: static;
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 6px;
  padding: 0;
  background: none;
  border-radius: 0;
  color: var(--u-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.u-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.u-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  color: var(--u-dark);
}

.u-card-title a {
  color: inherit;
}

.u-card-title a:hover {
  color: var(--u-primary);
}

.u-card-excerpt {
  color: var(--u-text-light);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.u-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--u-text-muted);
  margin-bottom: 16px;
}

.u-card-footer {
  padding: 0 20px 20px;
}

/* ============================================
   GENRE BADGES
   ============================================ */

.u-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #eeeeee;
  color: #555555;
}

.u-badge-fiction { background: #e3f2fd; color: #1565c0; }
.u-badge-mystery { background: #f3e5f5; color: #7b1fa2; }
.u-badge-romance { background: #fce4ec; color: #c2185b; }
.u-badge-scifi { background: #e0f2f1; color: #00695c; }
.u-badge-fantasy { background: #fff3e0; color: #e65100; }
.u-badge-horror { background: #efebe9; color: #4e342e; }

/* ============================================
   STORY SINGLE PAGE
   ============================================ */

.u-story-hero {
  background: #ffffff;
  color: #111111;
  padding: 48px 0 36px;
  position: relative;
  border-bottom: 1px solid #e4e4e4;
}

.u-story-hero h1 {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 600;
  font-style: normal;
  margin: 10px 0 16px;
  color: #111111;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.u-story-meta {
  display: flex;
  gap: 16px;
  color: #888888;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

.u-story-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Chapter Reader */
.u-chapter {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--u-border);
}

.u-chapter:last-child {
  border-bottom: none;
}

.u-chapter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.u-chapter-num {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.68rem;
  color: #6B7B8D;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.u-chapter-author {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  color: #888888;
}

.u-chapter-body {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.4;
  color: #333333;
}

.u-chapter-body p {
  margin-bottom: 1.4em;
}

.sbp-chapter {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 16px !important;
}

/* ============================================
   RATING
   ============================================ */

.u-rating-section {
  background: var(--u-bg);
  border-radius: var(--u-radius);
  padding: 32px;
  margin-top: 48px;
  text-align: center;
}

.u-rating-stars {
  display: flex;
  gap: 8px;
  justify-content: center;
  font-size: 2rem;
  margin-top: 16px;
}

.u-star {
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s;
}

.u-star:hover,
.u-star.filled {
  color: #f5a623;
}

/* ============================================
   VOTING
   ============================================ */

.u-voting-section {
  background: var(--u-bg);
  border-radius: var(--u-radius);
  padding: 32px;
  margin-top: 48px;
}

.u-voting-timer {
  color: var(--u-text-light);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.u-countdown {
  color: var(--u-primary);
  font-weight: 700;
  font-family: monospace;
  font-size: 1.1rem;
}

.u-submission-card {
  background: var(--u-white);
  border-radius: var(--u-radius-sm);
  padding: 20px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--u-transition);
  margin-bottom: 12px;
}

.u-submission-card:hover {
  border-color: var(--u-primary);
  box-shadow: var(--u-shadow);
}

.u-submission-card.selected {
  border-color: var(--u-primary);
  background: rgba(233,69,96,0.03);
}

/* ============================================
   SUBMISSION FORM
   ============================================ */

.u-form-wrap {
  background: var(--u-white);
  border-radius: var(--u-radius);
  padding: 40px;
  box-shadow: var(--u-shadow);
  margin-top: 48px;
}

.u-form-group {
  margin-bottom: 20px;
}

.u-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--u-dark);
}

.u-form-group input,
.u-form-group textarea,
.u-form-group select {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--u-border);
  border-radius: var(--u-radius-sm);
  font-size: 1rem;
  transition: var(--u-transition);
  font-family: var(--u-font);
  background: var(--u-white);
}

.u-form-group input:focus,
.u-form-group textarea:focus,
.u-form-group select:focus {
  outline: none;
  border-color: var(--u-primary);
}

.u-char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--u-text-muted);
  margin-top: 6px;
}

.u-notice {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 14px;
  border-radius: var(--u-radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #1565c0;
}

/* ============================================
   BOOKSTORE
   ============================================ */

.u-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.u-book-card {
  background: var(--u-white);
  border-radius: var(--u-radius);
  overflow: hidden;
  box-shadow: var(--u-shadow);
  transition: var(--u-transition);
}

.u-book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--u-shadow-hover);
}

.u-book-cover {
  display: block;
  aspect-ratio: 2/3;
  background: var(--u-dark-light);
  position: relative;
}

.u-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.u-book-info {
  padding: 20px;
}

.u-book-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--u-dark);
}

.u-book-author {
  font-size: 0.85rem;
  color: var(--u-text-muted);
  margin-bottom: 12px;
}

.u-book-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--u-primary);
  margin-bottom: 16px;
}

.u-buy-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.u-buy-btn-secondary {
  background: var(--u-bg);
  color: var(--u-text);
  border: 1px solid var(--u-border);
  flex: 1;
}

.u-buy-btn-secondary:hover {
  background: var(--u-border-light);
  color: var(--u-dark);
}

.u-buy-btn-stripe {
  flex: 1;
}

.u-buy-btn {
  padding: 10px 16px;
  border-radius: var(--u-radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
  transition: var(--u-transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.u-buy-btn-stripe {
  background: var(--u-primary);
  color: var(--u-white);
}

.u-buy-btn-stripe:hover {
  background: var(--u-primary-dark);
  color: var(--u-white);
}

.u-buy-btn-external {
  background: var(--u-bg);
  color: var(--u-text);
  border: 1px solid var(--u-border);
}

.u-buy-btn-external:hover {
  background: var(--u-border-light);
  color: var(--u-dark);
}

/* ============================================
   PPV / CHAPTER UNLOCK
   ============================================ */

.u-lock-overlay {
  background: linear-gradient(to bottom, transparent 0%, var(--u-white) 60%);
  padding: 60px 20px 20px;
  text-align: center;
  margin-top: -40px;
  position: relative;
}

.u-lock-message {
  background: var(--u-white);
  border: 2px dashed var(--u-border);
  border-radius: var(--u-radius);
  padding: 32px;
}

.u-lock-message h3 {
  margin-bottom: 8px;
  color: var(--u-dark);
}

.u-lock-message p {
  color: var(--u-text-light);
  margin-bottom: 20px;
}

/* ============================================
   ADS
   ============================================ */

.u-ad-slot {
  margin: 12px 0 0; 
}
.u-ad-slot + .u-section {
  padding-top: 24px;
}
/* ============================================
   FOOTER WIDGETS
   ============================================ */

.u-footer-widgets {
  background: var(--u-bg);
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--u-border);
}

.u-footer-widgets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.u-footer-widget-area {
  color: var(--u-text-light);
}

.u-footer-widget-area .widget-title {
  color: var(--u-dark);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  font-weight: 600;
}

.u-footer-widget-area .widget {
  margin-bottom: 24px;
}

.u-footer-widget-area a {
  color: var(--u-text-light);
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.u-footer-widget-area a:hover {
  color: var(--u-primary);
}

.u-footer-widget-area ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.u-footer-widget-area li {
  margin-bottom: 8px;
}

/* ============================================
   FOOTER
   ============================================ */

.u-footer {
  background: var(--u-bg);
  color: var(--u-text-light);
  padding: 40px 0 30px;
  margin-top: 60px;
}

.u-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.u-footer-brand-col {
  max-width: 300px;
}

.u-footer-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--u-dark);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
}

.u-footer-brand span {
  color: var(--u-primary);
}

.u-footer-brand img {
  max-height: 40px;
  width: auto;
}

.u-footer-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--u-text-light);
  margin-bottom: 20px;
}

.u-footer-social {
  display: flex;
  gap: 12px;
}

.u-footer-social .u-social-link {
  background: var(--u-border);
}

.u-footer-social .u-social-link:hover {
  background: var(--u-primary);
}

.u-footer-links-col h4 {
  color: var(--u-dark);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  font-weight: 600;
}

.u-footer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.u-footer-nav a {
  color: var(--u-text-light);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.u-footer-nav a:hover {
  color: var(--u-primary);
}

.u-footer-bottom {
  border-top: 1px solid var(--u-border);
  padding-top: 0px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.u-footer-bottom-left {
  font-size: 0.85rem;
  color: var(--u-text-muted);
}

.u-footer-bottom-right {
  display: flex;
  gap: 20px;
}

.u-footer-bottom-nav {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.u-footer-bottom-nav a {
  color: var(--u-text-muted);
  font-size: 0.85rem;
}

.u-footer-bottom-nav a:hover {
  color: var(--u-primary);
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.u-notification {
  position: fixed;
  top: 90px;
  right: 24px;
  padding: 16px 24px;
  border-radius: var(--u-radius-sm);
  background: var(--u-white);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.4s ease;
  max-width: 400px;
  border-left: 4px solid var(--u-primary);
}

.u-notification.show {
  transform: translateX(0);
}

.u-notification.success { border-left-color: #27ae60; }
.u-notification.error { border-left-color: #e74c3c; }

/* ============================================
   WIDGETS (Sidebar)
   ============================================ */

.widget {
  margin-bottom: 32px;
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--u-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--u-border-light);
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget li {
  padding: 8px 0;
  border-bottom: 1px solid var(--u-border-light);
}

.widget li:last-child {
  border-bottom: none;
}

.widget a {
  color: var(--u-text);
  font-size: 0.9rem;
}

.widget a:hover {
  color: var(--u-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .u-footer-widgets-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .u-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .u-footer-brand-col {
    grid-column: 1 / -1;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --u-header-height: 64px;
  }

  .u-top-bar {
    display: none;
  }

  .u-header.is-transparent {
    top: 0;
  }

  .u-nav-desktop {
    display: none;
  }

  .u-mobile-toggle {
    display: flex;
  }

  .u-header-actions {
    gap: 8px;
  }

  .u-user-name {
    display: none;
  }

  .u-hero h1 {
    font-size: 2rem;
  }

  .u-grid {
    grid-template-columns: 1fr;
  }

  .u-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 16px 0;
  }

  .u-section {
    padding: 40px 0;
  }

  .u-story-hero h1 {
    font-size: 1.3rem;
  }

  .u-chapter-body {
    font-size: 1rem;
  }

  .u-footer-widgets-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .u-footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .u-footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .u-form-wrap {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .u-book-grid {
    grid-template-columns: 1fr;
  }

  .u-hero h1 {
    font-size: 1.6rem;
  }

  .u-hero p {
    font-size: 1rem;
  }

  .u-btn-lg {
    padding: 14px 28px;
    font-size: 0.95rem;
  }

  .u-mobile-menu-panel {
    max-width: 100%;
  }
}

/* Print styles */
@media print {
  .u-header,
  .u-top-bar,
  .u-footer,
  .u-mobile-toggle,
  .u-search-toggle,
  .u-user-menu,
  .u-mobile-overlay,
  .u-search-panel,
  .u-notification,
  .u-ad-slot {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .u-chapter-body {
    font-size: 12pt;
    line-height: 1.5;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--u-primary);
    color: var(--u-white);
    padding: 8px 16px;
    z-index: 100000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ==========================================================
   UTULIS — HOMEPAGE REDESIGN
   Black/White literary aesthetic · Spectral + Plus Jakarta Sans
   Slate accent #6B7B8D · Clean borders · Right-column layout
   ========================================================== */

/* ── Variable overrides for homepage ─────────────────────── */
.utulis-homepage,
.utulis-homepage * {
  --u-font-serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --u-font-ui:    'Plus Jakarta Sans', system-ui, sans-serif;
  --u-black:      #111111;
  --u-slate:      #6B7B8D;
  --u-slate-lt:   #8fa0b0;
  --u-border:     #e4e4e4;
  --u-border-lt:  #f0f0f0;
  --u-muted:      #777777;
  --u-bg:         #ffffff;
}

/* ── Global header override (white/clean) ─────────────────── */
.u-top-bar {
  display: none; /* hide dark top bar on clean theme */
}

.u-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e4e4e4;
  box-shadow: none !important;
}

.u-header .u-logo,
.u-header .u-logo span {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 600;
  font-style: italic;
  color: #111111 !important;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.u-header .u-nav-menu a,
.u-header .u-nav-default a {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #333333 !important;
  letter-spacing: 0.02em;
  text-transform: none;
}

.u-header .u-nav-menu a:hover,
.u-header .u-nav-default a:hover {
  color: #6B7B8D !important;
}

.u-header .u-btn-primary,
.u-header .u-btn-sm {
  background: #111111 !important;
  color: #ffffff !important;
  border: 1px solid #111111 !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 3px;
  padding: 6px 16px;
}

.u-header .u-btn-primary:hover,
.u-header .u-btn-sm:hover {
  background: #333333 !important;
  border-color: #333333 !important;
}

/* ── Site main bg ─────────────────────────────────────────── */
.site-main,
body {
  background: #ffffff;
}

/* ==========================================================
   INTRO SECTION
   ========================================================== */

.uh-intro {
  padding: 16px 0 12px;
  border-bottom: 1px solid #e4e4e4;
}

.uh-intro-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.uh-intro-promo-col {
  min-width: 0;
}

@media (max-width: 768px) {
  .uh-intro-grid { grid-template-columns: 1fr; }
}

.uh-headline {
  font-family: 'Spectral', Georgia, serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  font-style: normal;
  color: #111111;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.uh-tagline {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: #6B7B8D;
  margin-bottom: 16px;
  line-height: 1.5;
}

.uh-intro-text {
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: #555555;
  max-width: 620px;
  line-height: 1.75;
}

/* ==========================================================
   FEATURED BOOKS
   ========================================================== */

.uh-featured {
  padding: 16px 0;
  border-bottom: 1px solid #e4e4e4;
}

.uh-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.uh-section-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111111;
}

.uh-see-all {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  color: #6B7B8D;
  text-decoration: none;
  white-space: nowrap;
}
.uh-see-all:hover { color: #111111; text-decoration: underline; }

/* Books grid — 6 cols desktop, swipe-scroll on mobile */
.uh-books-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

@media (max-width: 1100px) { .uh-books-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px)  {
  .uh-books-grid {
    grid-template-columns: repeat(3, 160px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    gap: 16px;
  }
  .uh-book-card { scroll-snap-align: start; }
}

.uh-book-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uh-book-cover-link {
  display: block;
  aspect-ratio: 2/3;
  overflow: hidden;
  border: 1px solid #e4e4e4;
  border-radius: 2px;
  background: #f5f5f5;
}

.uh-book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.uh-book-cover-link:hover .uh-book-cover-img { transform: scale(1.03); }

.uh-book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.5rem;
  font-style: italic;
  color: #aaaaaa;
}

.uh-book-meta { display: flex; flex-direction: column; gap: 4px; }

.uh-genre-tag {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6B7B8D;
}

.uh-book-title {
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
}
.uh-book-title a { color: #111111; text-decoration: none; }
.uh-book-title a:hover { color: #6B7B8D; }

.uh-book-author {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  color: #888888;
  margin: 0;
}

.uh-book-price {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #111111;
  margin: 0;
}

.uh-book-buy {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6B7B8D;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.uh-book-buy:hover { color: #111111; text-decoration: underline; }

/* ==========================================================
   GENRE BAR
   ========================================================== */

.uh-genre-bar {
  border-bottom: 1px solid #e4e4e4;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 99;
}

.uh-genre-nav {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
}
.uh-genre-nav::-webkit-scrollbar { display: none; }

.uh-genre-label {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aaaaaa;
  padding: 14px 20px 14px 0;
  white-space: nowrap;
  border-right: 1px solid #e4e4e4;
  margin-right: 4px;
}

.uh-genre-link {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #555555;
  text-decoration: none;
  padding: 14px 16px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: inline-block;
}
.uh-genre-link:hover  { color: #111111; border-bottom-color: #6B7B8D; }
.uh-genre-link.is-active { color: #111111; border-bottom-color: #111111; font-weight: 600; }

/* Sembang / Confab — non-fiction discussion genres */
.uh-genre-link--alt { color: #7C6FAE; }
.uh-genre-link--alt:hover { color: #5a4f8a; border-bottom-color: #7C6FAE; }
.uh-genre-link--alt.is-active { color: #5a4f8a; border-bottom-color: #5a4f8a; font-weight: 600; }

/* ==========================================================
   HOMEPAGE BODY: 2-COLUMN LAYOUT
   ========================================================== */

.uh-body {
  padding: 8px 0 64px;
  background: #ffffff;
}

.uh-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .uh-layout { grid-template-columns: 1fr; }
  .uh-sidebar { order: -1; } /* sidebar above on mobile */
}

.uh-archive-layout {
  grid-template-columns: 200px 1fr 200px;
}

@media (max-width: 1100px) {
  .uh-archive-layout { grid-template-columns: 1fr 260px; }
  .uh-sidebar-left { display: none; }
}

/* ==========================================================
   STORY GRID
   ========================================================== */

.uh-story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid #e4e4e4;
}

@media (max-width: 700px) { .uh-story-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) and (min-width: 701px) { .uh-story-grid { grid-template-columns: repeat(2, 1fr); } }
.uh-story-grid-promo { margin: 4px 0; }

.uh-story-card {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e4e4e4;
  border-bottom: 1px solid #e4e4e4;
  padding: 0 0 0 0;
  background: #ffffff;
  transition: background 0.15s;
}
.uh-story-card:hover { background: #fafafa; }

/* Remove right border on last in each row */
.uh-story-grid { position: relative; }
.uh-story-card:nth-child(3n) { border-right: none; }
@media (max-width: 700px)  { .uh-story-card { border-right: none; } }
@media (max-width: 900px) and (min-width: 701px) {
  .uh-story-card:nth-child(3n)   { border-right: 1px solid #e4e4e4; }
  .uh-story-card:nth-child(2n)   { border-right: none; }
}

/* Thumbnail */
.uh-story-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 3/2;
  border-bottom: 1px solid #e4e4e4;
}
.uh-story-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.uh-story-card:hover .uh-story-thumb-img { transform: scale(1.02); }

/* Card body */
.uh-story-body {
  padding: 20px 20px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uh-genre-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.uh-genre-badge {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 3px;
  color: #fff;
  background: #6B7B8D;
}
/* 8-color palette cycled by data-color-index */
.uh-genre-badge[data-ci="0"] { background: #5C7CFA; }
.uh-genre-badge[data-ci="1"] { background: #7950F2; }
.uh-genre-badge[data-ci="2"] { background: #E64980; }
.uh-genre-badge[data-ci="3"] { background: #F76707; }
.uh-genre-badge[data-ci="4"] { background: #2F9E44; }
.uh-genre-badge[data-ci="5"] { background: #1098AD; }
.uh-genre-badge[data-ci="6"] { background: #D6336C; }
.uh-genre-badge[data-ci="7"] { background: #846B00; }

.uh-story-title {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}
.uh-story-title a { color: #111111; text-decoration: none; }
.uh-story-title a:hover { color: #6B7B8D; }

.uh-story-author {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  color: #888888;
  margin: 0;
  font-weight: 400;
}
.uh-story-author span { color: #555555; font-weight: 500; }

.uh-story-excerpt {
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #444444;
  margin: 0;
  flex: 1;
}

.uh-read-on {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6B7B8D;
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-top: 4px;
}
.uh-read-on:hover { color: #111111; text-decoration: underline; }

/* Card footer */
.uh-story-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  margin-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.uh-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #888888;
  transition: color 0.15s;
  line-height: 1;
}
.uh-like-btn:hover,
.uh-like-btn.is-liked { color: #c0392b; }
.uh-like-btn:disabled { opacity: 0.6; cursor: wait; }
.uh-heart { flex-shrink: 0; }

.uh-contributors {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  color: #888888;
  font-weight: 500;
  line-height: 1;
}

.uh-footer-sep { color: #cccccc; font-size: 0.7rem; }

.uh-story-date {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.7rem;
  color: #aaaaaa;
  margin-left: auto;
}

/* ==========================================================
   PAGINATION
   ========================================================== */

.uh-pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 32px 0 0;
}

.uh-pagination .page-numbers {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #555555;
  padding: 6px 12px;
  border: 1px solid #e4e4e4;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.15s;
}
.uh-pagination .page-numbers:hover,
.uh-pagination .page-numbers.current {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

/* ==========================================================
   EMPTY STATE
   ========================================================== */

.uh-empty {
  padding: 48px 0;
  text-align: center;
  font-family: 'Spectral', Georgia, serif;
  font-style: italic;
  color: #888888;
}

.uh-btn-primary {
  display: inline-block;
  margin-top: 16px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  background: #111111;
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s;
}
.uh-btn-primary:hover { background: #333333; color: #ffffff; }

/* ==========================================================
   AD BLOCK (main content)
   ========================================================== */

.uh-ad-block {
  margin-top: 40px;
  border-top: 1px solid #e4e4e4;
  padding-top: 24px;
}

.uh-ad-placeholder {
  min-height: 90px;
  border: 1px dashed #cccccc;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cccccc;
}

/* ==========================================================
   RIGHT SIDEBAR
   ========================================================== */

.uh-sidebar {
  position: sticky;
  top: 48px; /* below genre bar */
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Story quick links */
.uh-sidebar-stories {
  border: 1px solid #e4e4e4;
  border-radius: 2px;
  padding: 20px;
}

.uh-sidebar-head {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaaaaa;
  margin: 0 0 16px;
}

.uh-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.uh-sidebar-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.uh-sidebar-item:last-child { border-bottom: none; padding-bottom: 4px; }

.uh-sidebar-genre {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6B7B8D;
}

.uh-sidebar-title {
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: #111111;
  text-decoration: none;
  line-height: 1.35;
}
.uh-sidebar-title:hover { color: #6B7B8D; text-decoration: underline; }

.uh-sidebar-excerpt {
  font-family: 'Spectral', Georgia, serif;
  font-size: 0.78rem;
  color: #888888;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
}

.uh-sidebar-more {
  display: inline-block;
  margin-top: 14px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6B7B8D;
  text-decoration: none;
}
.uh-sidebar-more:hover { color: #111111; text-decoration: underline; }

/* Sidebar ad slot */
.uh-sidebar-panel {
  border: 1px solid #e4e4e4;
  border-radius: 2px;
  overflow: hidden;
}
.uh-sidebar-panel .uh-ad-placeholder {
  min-height: 250px;
  border: none;
  border-radius: 0;
}

/* Sidebar widget title */
.u-sidebar-widget-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaaaaa;
  margin: 0 0 12px;
  padding: 16px 20px 0;
}

/* ==========================================================
   MOBILE: sticky genre bar offset
   ========================================================== */

@media (max-width: 900px) {
  .uh-sidebar { position: static; }
  .uh-genre-bar { position: relative; }
}

@media (max-width: 600px) {
  .uh-intro   { padding: 32px 0 16px; }
  .uh-featured { padding: 28px 0; }
  .uh-body    { padding: 16px 0 40px; }
  .uh-story-body { padding: 16px 16px 0; }
  .uh-story-footer { padding: 10px 16px; }
  .uh-layout  { gap: 32px; }
}

/* ==========================================================
   MOBILE MENU overrides (keep readable)
   ========================================================== */

.u-mobile-menu-panel {
  background: #ffffff;
  color: #111111;
}

.u-mobile-nav a {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: #111111;
}

/* ── Utulis: Spectral headings site-wide ── */
.utulis-homepage h1,
.utulis-homepage h2,
.utulis-homepage h3,
.utulis-homepage h4 {
  font-family: 'Spectral', Georgia, serif;
  color: #111111;
}

/* ── u-chapter-body: page content typography ── */
.u-chapter-body {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #2d2d2d;
}
.u-chapter-body h1,
.u-chapter-body h2,
.u-chapter-body h3,
.u-chapter-body h4 {
  font-family: 'Spectral', Georgia, serif;
  color: #111111;
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.u-chapter-body p { margin-bottom: 1.4em; }
.u-chapter-body a { color: #e94560; }
.u-chapter-body a:hover { color: #c73e54; }

.uh-genre-nav li { display: inline-flex !important; align-items: center !important; border-right: 1px solid #ddd !important; }
.uh-genre-nav li:last-child { border-right: none !important; }
.uh-genre-nav li a { padding: 8px 16px !important; color: #555 !important; text-decoration: none !important; font-size: 0.85rem !important; }
.uh-genre-nav li a:hover { color: #111 !important; }
.uh-genre-nav li.current-menu-item a { color: #111 !important; font-weight: 600 !important; }

/* ============================================
   BREADCRUMB
   ============================================ */
.u-breadcrumb {
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
    font-size: 0.8rem;
    color: #999;
}
.u-breadcrumb a {
    color: #999 !important;
    text-decoration: none;
}
.u-breadcrumb a:hover { color: #111 !important; }
.u-breadcrumb span { color: #111; }
.u-breadcrumb-sep { color: #ccc; margin: 0 4px; }