/*
Theme Name: The Patriarchs Trilogy
Theme URI: https://thepatriarchstrilogy.com
Author: Dr. Krešimir Šimić & OpenBot
Description: Bespoke literary editorial theme for The Patriarchs Trilogy by Dr. Krešimir Šimić.
Version: 1.3.0
License: GNU General Public License v2 or later
Text Domain: patriarchs
*/

:root {
  --bg-dark: #0a0c0f;
  --bg-surface: #12151b;
  --bg-card: #181c24;
  --text-main: #f5f2eb;
  --text-muted: #9e998f;
  --text-faint: #635f56;
  --gold-primary: #c5a059;
  --gold-light: #f0e2b6;
  --gold-border: rgba(197, 160, 89, 0.20);
  --gold-border-hover: rgba(212, 175, 55, 0.45);
  --font-serif-display: 'Cormorant Garamond', Georgia, serif;
  --font-serif-body: 'EB Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-serif-body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-serif-display);
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.2;
}

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--gold-light);
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 12, 15, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gold-border);
  padding: 14px 0;
  width: 100%;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-serif-display);
  font-size: 21px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 500;
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  border-left: 1px solid var(--gold-border);
  padding-left: 10px;
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.nav-links a {
  white-space: nowrap;
}

.nav-links a {
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--text-main);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.switcher-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 2px 4px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  gap: 4px;
}

.switcher-group a {
  color: var(--text-faint);
  padding: 3px 6px;
  border-radius: 3px;
  transition: all 0.2s ease;
  line-height: 1;
}

.switcher-group a.active {
  color: var(--gold-light);
  background: rgba(197, 160, 89, 0.22);
  font-weight: 600;
}

.switcher-group a:hover:not(.active) {
  color: var(--text-muted);
}

.btn-checkout {
  border: 1px solid var(--gold-border);
  color: var(--text-main) !important;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-checkout:hover {
  border-color: var(--gold-primary);
  background: rgba(197, 160, 89, 0.10);
  color: var(--gold-light) !important;
}

/* Common Buttons */
.btn-gold {
  background: linear-gradient(135deg, #c5a059, #e6c587);
  color: #0a0c0f !important;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 4px;
  display: inline-block;
  transition: all 0.25s ease;
  border: none;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #d4af37, #fdf1c2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
}

.btn-outline {
  border: 1px solid var(--gold-border);
  color: var(--text-main) !important;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 11px 22px;
  border-radius: 4px;
  display: inline-block;
  transition: all 0.25s ease;
  text-align: center;
  white-space: nowrap;
}

.btn-outline:hover {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-light) !important;
}

/* Hero Section */
.hero {
  padding: 85px 0 75px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -240px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(197, 160, 89, 0.09) 0%, rgba(10, 12, 15, 0) 70%);
  pointer-events: none;
}

.hero-quote {
  font-family: var(--font-serif-display);
  font-size: 24px;
  font-style: italic;
  color: var(--gold-light);
  max-width: 720px;
  margin: 0 auto 20px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.hero-headline {
  font-size: 50px;
  font-weight: 400;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
  line-height: 1.15;
}

.hero-subhead {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Books Grid Section */
.section-header {
  text-align: center;
  margin-bottom: 44px;
}

.section-title {
  font-size: 38px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.section-sub {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 70px;
}

.book-card {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  border-color: var(--gold-border-hover);
}

.book-card-cover {
  padding: 24px 24px 10px;
  text-align: center;
  background: #08090c;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 290px;
}

.book-card-cover img {
  max-width: 185px;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.book-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-vol {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 6px;
  font-weight: 600;
}

.book-title {
  font-size: 23px;
  margin-bottom: 10px;
  color: #fff;
  line-height: 1.25;
}

.book-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-grow: 1;
  line-height: 1.6;
}

.book-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.book-price {
  font-size: 24px;
  font-family: var(--font-serif-display);
  color: var(--gold-light);
  line-height: 1;
}

/* Bundle Section */
.bundle-banner {
  background: linear-gradient(145deg, #13161d, #0b0d11);
  border: 1px solid var(--gold-primary);
  border-radius: 10px;
  padding: 38px 36px;
  margin-bottom: 80px;
  position: relative;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.bundle-badge {
  position: absolute;
  top: 0;
  left: 36px;
  background: var(--gold-primary);
  color: #0a0c0f;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 0 0 4px 4px;
}

.bundle-content {
  display: grid;
  grid-template-columns: 280px 1fr 270px;
  gap: 32px;
  align-items: center;
  margin-top: 8px;
}

.bundle-image-wrap {
  text-align: center;
  display: flex;
  justify-content: center;
}

.bundle-image-wrap img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--gold-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.bundle-info h2 {
  font-size: 30px;
  margin-bottom: 10px;
  color: var(--gold-light);
  line-height: 1.2;
}

.bundle-info p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.bundle-perks {
  list-style: none;
  margin: 16px 0 0;
}

.bundle-perks li {
  padding: 5px 0;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #d8d4cb;
}

.bundle-perks li::before {
  content: '✓';
  color: var(--gold-primary);
  font-weight: bold;
}

.bundle-pricing-card {
  text-align: center;
  background: #08090c;
  padding: 28px 20px;
  border-radius: 6px;
  border: 1px solid var(--gold-border);
}

/* Author Section */
.author-section {
  padding: 70px 0;
  border-top: 1px solid var(--gold-border);
  background: #0e1015;
}

.author-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 44px;
  align-items: center;
}

.author-photo img {
  width: 100%;
  max-width: 260px;
  border-radius: 6px;
  border: 1px solid var(--gold-border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.author-bio h2 {
  font-size: 36px;
  margin-bottom: 14px;
  color: #fff;
}

.author-bio p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 14px;
  line-height: 1.65;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--gold-border);
  padding: 36px 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .bundle-content { grid-template-columns: 1fr; text-align: center; }
  .bundle-image-wrap img { max-width: 240px; margin: 0 auto; }
  .bundle-perks li { justify-content: center; }
  .author-content { grid-template-columns: 1fr; text-align: center; }
  .author-photo { margin: 0 auto; }
  .brand-sub, .nav-links { display: none; }
  .header-controls { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .books-grid { grid-template-columns: 1fr; }
  .hero-headline { font-size: 36px; }
  .hero-quote { font-size: 20px; }
  .container { padding: 0 16px; }
}

/* ===== WooCommerce inner pages (Cart, Checkout, Order) ===== */
.woocommerce { color: var(--text-main); font-family: var(--font-serif-body); }
.woocommerce h2, .woocommerce h3 { font-family: var(--font-serif-display); color: var(--gold-light); }
body { color-scheme: dark; }

/* Notice banners */
.woocommerce .woocommerce-info::before, .woocommerce .woocommerce-message::before, .woocommerce .woocommerce-error::before {
  content: none !important;
  display: none !important;
}
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  position: relative;
  font-family: var(--font-sans);
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  border-left-width: 4px;
  padding: 14px 18px !important;
  list-style: none outside;
  color: var(--text-main) !important;
  background: #161a20 !important;
  border-color: var(--gold-border);
}
.woocommerce-message { border-left: 4px solid #2e7d32; background: #14231b !important; color: #a5d6a7 !important; }
.woocommerce-error { border-left: 4px solid #d32f2f; background: #2b1212 !important; color: #ef9a9a !important; }
.woocommerce-message a, .woocommerce-info a, .woocommerce-error a { color: var(--gold-light) !important; }
.woocommerce-message a.button, .woocommerce-info a.button, .woocommerce-error a.button { float: right; }

/* Product / checkout buttons */
.woocommerce a.button, .woocommerce button.button,
.woocommerce input.button, .woocommerce #respond input#submit {
  background: linear-gradient(135deg, #c5a059, #e6c587) !important;
  color: #0a0c0f !important;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 11px 22px !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer;
  transition: all 0.25s ease;
}
.woocommerce a.button:hover, .woocommerce button.button:hover,
.woocommerce input.button:hover {
  background: linear-gradient(135deg, #d4af37, #fdf1c2) !important;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.3);
}
.woocommerce a.button.alt:disabled, .woocommerce button.button:disabled { opacity: 0.65; }

/* Coupon + checkout form input rows */
.woocommerce form .form-row { margin-bottom: 18px; }
.woocommerce form .form-row label { color: #cfcac0; font-size: 14px; font-family: var(--font-sans); }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row .input-text,
.woocommerce form .form-row select,
.woocommerce input[type="email"], .woocommerce input[type="tel"], .woocommerce input[type="text"],
.woocommerce textarea, .woocommerce select {
  background: #181b20 !important;
  border: 1px solid var(--gold-border) !important;
  color: #f3efe6 !important;
  font-family: var(--font-serif-body) !important;
  padding: 10px 14px !important;
  border-radius: 4px;
  outline: none;
  color-scheme: dark;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus,
.woocommerce .select2-container--focus .select2-selection--single {
  border-color: var(--gold-primary) !important;
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.18);
}
.woocommerce form .form-row ::placeholder { color: #8a857b; opacity: 1; }
.woocommerce form .form-row .required { color: #e08585; }

/* Select2 dropdowns */
.woocommerce .select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--single {
  background: #181b20 !important;
  border: 1px solid var(--gold-border) !important;
  border-radius: 4px;
  height: 40px !important;
}
.woocommerce .select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #f3efe6 !important;
  font-family: var(--font-serif-body);
  font-size: 15px;
  line-height: 38px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #8a857b transparent transparent transparent;
}
.select2-container--open .select2-dropdown,
.select2-dropdown {
  background: #181b20 !important;
  border: 1px solid var(--gold-border-hover) !important;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  background: #0d0f12 !important;
  border: 1px solid var(--gold-border) !important;
  color: #f3efe6 !important;
}
.select2-container--default .select2-results__option {
  background: #181b20;
  color: #cfcac0;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: rgba(197, 160, 89, 0.25) !important;
  color: var(--gold-light) !important;
}

/* Order review table */
.woocommerce table.shop_table {
  border: 1px solid var(--gold-border) !important;
  border-radius: 6px;
  background: #0d0f12;
  color: var(--text-main);
  border-collapse: separate !important;
  border-spacing: 0;
  overflow: hidden;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
  border-top: 1px solid var(--gold-border) !important;
  padding: 14px 16px;
  font-family: var(--font-serif-body);
}
.woocommerce table.shop_table thead th,
.woocommerce table.shop_table th { font-family: var(--font-serif-display); font-size: 18px; color: var(--gold-light); font-weight: 500; }
.woocommerce table.shop_table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.woocommerce table.shop_table tfoot th, .woocommerce table.shop_table tfoot td { font-size: 15px; vertical-align: middle; }
.woocommerce table.shop_table tfoot .order-total th, .woocommerce table.shop_table tfoot .order-total td { color: var(--gold-light); }
.woocommerce table.shop_table tfoot .order-total .amount { font-family: var(--font-serif-display); font-size: 20px; color: var(--gold-light); }
.woocommerce table.shop_table img { border-radius: 4px; border: 1px solid var(--gold-border); }
.woocommerce .quantity input.qty {
  background: #181b20 !important; border: 1px solid var(--gold-border) !important; color: #f3efe6 !important;
}

/* Cart totals */
.woocommerce .cart_totals { color: var(--text-main); }
.woocommerce .cart_totals h2 { color: var(--gold-light); }

/* Payment section */
.woocommerce-checkout #payment {
  background: #0d0f12 !important;
  border: 1px solid var(--gold-border) !important;
  border-radius: 6px;
  color: var(--text-main);
}
.woocommerce-checkout #payment ul.payment_methods {
  border-bottom: 1px solid var(--gold-border) !important;
  padding: 16px !important;
}
.woocommerce-checkout #payment ul.payment_methods li {
  background: transparent !important;
}
.woocommerce-checkout #payment div.payment_box {
  background: transparent !important;
  color: #cfcac0 !important;
}
.woocommerce-checkout #payment div.payment_box::before { display: none !important; }
.woocommerce-checkout #payment div.payment_box.payment_method_stripe {
  background: #111317 !important;
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 18px;
}
#add_payment_method #payment, .woocommerce-cart #payment, .woocommerce-checkout #payment { color: var(--text-main) !important; }
.form-row.place-order { margin-top: 18px; }

/* Coupon toggle details marker */
.woocommerce .woocommerce-info summary { display: flex; align-items: center; gap: 8px; }
.woocommerce .woocommerce-info summary::marker, .woocommerce .woocommerce-info summary::-webkit-details-marker { content: none; }
.woocommerce .woocommerce-info .details-open-icon,
.woocommerce .woocommerce-info img { object-fit: contain; filter: invert(76%) sepia(64%) saturate(470%) hue-rotate(350deg) brightness(95%) opacity(1); }

/* Responsive guard */
.main, .page-container { overflow-x: hidden; }
@media (max-width: 768px) {
  .woocommerce { padding: 18px 16px !important; }
  .woocommerce table.shop_table th, .woocommerce table.shop_table td { padding: 10px 12px; font-size: 14px; }
  #place_order, .woocommerce button[type="submit"] { width: 100%; }
  .woocommerce-message a.button, .woocommerce-info a.button, .woocommerce-error a.button { float: none; margin-top: 8px; }
}
