/* ============================================================
   The Author — Site Stylesheet
   Playfair Display (serif headings) + Lato (body)
   Warm editorial palette: dark charcoal + gold accent
   ============================================================ */

/* --- Base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  color: var(--text);
  background: var(--body-bg);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography -------------------------------------------- */
.heading-serif {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.brand-rect {

  fill: var(--brand-icon-color);

}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  letter-spacing: .03em;
  color: var(--brand-text-color);
}

.section-eyebrow {
  display: block;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-text-color);
  margin-bottom: .5rem;
  font-weight: 700;
}

.letter-spacing { letter-spacing: .08em; }

.text-gold        { color: var(--gold) !important; }
.text-gold-dark   { color: var(--gold-dark) !important; }

/* Clamp to 3 lines */
.text-truncate-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;

}

/* --- Navbar ------------------------------------------------- */

.nav-bg { background: var(--nav-bg); }

.navbar-brand:hover .brand-name { color: var(--brand-text-color); }

.nav-link {
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .04em;
  /* color: rgba(255,255,255,.75) !important; */
  transition: color var(--transition);
  padding: .5rem .9rem !important;
  border-radius: var(--radius-sm);
}
.nav-link:hover,
.nav-link.active {
  /* color: var(--gold) !important; */
  /* color: contrast-color(var(--nav-bg)) !important; */
  color: var(--brand-text-color);
  /* background: rgba(201,168,76,.08); */
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--nav-bg), black 25%) calc(var(--navbar-is-light) * 100%),
    color-mix(in srgb, var(--nav-bg), white 25%) calc((1 - var(--navbar-is-light)) * 100%)
  );
}

/* Right-align nav items in the mobile hamburger dropdown */
@media (max-width: 991.98px) {
  .navbar-collapse .navbar-nav {
    align-items: flex-end;   /* push items to the right */
    padding: .5rem 0;
  }

  .navbar-collapse .nav-link {
    text-align: right;
  }
}

/* --- Buttons ------------------------------------------------ */
.btn-gold {
  background: var(--gold);
  color: var(--component-text-color);
  border: 2px solid var(--gold);
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
}
.btn-gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--component-text-color-hover);
  transform: translateY(-1px);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-outline-gold:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--component-text-color-hover);
  transform: translateY(-1px);
}

.bg-gold { background-color: var(--gold) !important; }
.component-text-color { color: var(--component-text-color) !important; }
/* .component-text-color:hover { color: var(--component-text-color-hover) !important; } */

/* Add this to your custom CSS */
.btn-outline-theme {
  /* Uses the current theme's emphasis color (black in light, white in dark) */
  --bs-btn-color: var(--bs-emphasis-color);
  --bs-btn-border-color: var(--bs-emphasis-color);

  /* Hover state: background becomes the emphasis color, text becomes the body background */
  --bs-btn-hover-color: var(--bs-body-bg);
  --bs-btn-hover-bg: var(--bs-emphasis-color);
  --bs-btn-hover-border-color: var(--bs-emphasis-color);

  /* Active state */
  --bs-btn-active-color: var(--bs-body-bg);
  --bs-btn-active-bg: var(--bs-emphasis-color);
  --bs-btn-active-border-color: var(--bs-emphasis-color);
}


/* --- Hero Section ------------------------------------------ */
.hero-section {
  /* background: var(--dark); */
  /* background-color: var(--dark); */
  background-color: var(--gold-dark-banner);

  background-size: cover;
  background-position: center;
  min-height: 85vh;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  /* background: radial-gradient(ellipse at 70% 50%, rgba(201,168,76,.08) 0%, transparent 60%); */

  /* this is the background that will display the background image */
  background: rgba(0,0,0,0.55);

  z-index: 0;
  pointer-events: none;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

.hero-portrait {
  max-height: 520px;
  width: 100%;
  object-fit: cover;
  /* border: 4px solid rgba(201,168,76,.3); */
  border: 4px solid var(--gold-dark-banner);
}

.lead-text {
  font-size: 1.15rem;
  line-height: 1.8;
  /* color: rgba(255, 255, 255, 0.872); */
}

/* --- Section backgrounds ----------------------------------- */
.section-light { background: #fff; }
.section-warm  { background: var(--warm-bg); }

/* --- Section divider SVG ----------------------------------- */
.section-divider {
  overflow: hidden;
  line-height: 0;
  background: #fff;
}
.section-divider svg { display: block; width: 100%; height: 60px; }

/* --- Work (book) card -------------------------------------- */
.work-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.work-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.work-card-img-link { display: block; overflow: hidden; aspect-ratio: 5/7; }
.work-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.work-card:hover .work-card-img { transform: scale(1.04); }

.work-card-img-placeholder {
  width: 100%;
  aspect-ratio: 5/7;
  background: linear-gradient(135deg, #e9e1d4, #d5c9b8);
}

.work-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.work-card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  margin-bottom: .4rem;
}
.work-card-title a { color: inherit; text-decoration: none; }
.work-card-title a:hover { color: var(--gold-dark); }
.work-card-synopsis { font-size: .9rem; color: var(--text-body-secondary); flex: 1; }

/* --- Story card -------------------------------------------- */
.story-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  /* box-shadow: var(--shadow-sm); */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.story-card:hover {
  /* box-shadow: var(--shadow-md); */
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.26);
  transform: translateY(-3px);
}
.story-card-img-link { display: block; overflow: hidden; }
.story-card-img {
  width: 100%;
  aspect-ratio: 2/1;
  object-fit: cover;
  transition: transform .4s ease;
}
.story-card:hover .story-card-img { transform: scale(1.04); }

.story-card-body { padding: 1.25rem; flex: 1; }
.story-card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  margin-bottom: .4rem;
}
.story-card-title a { color: inherit; text-decoration: none; }
.story-card-title a:hover { color: var(--gold-dark); }

@media (max-width: 991.98px) {
  .story-card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  }

  .story-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.26);
  }
}

/* --- Page header band -------------------------------------- */
.page-header {
  /* background: var(--dark); */
  background: var(--gold-dark-banner);
  border-bottom: 3px solid rgba(201,168,76,.2);
}
.breadcrumb-light .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.4); }
.breadcrumb-light .breadcrumb-item.active { color: rgba(255,255,255,.5); }

/* --- Book detail ------------------------------------------ */
.book-cover-img { max-width: 100%; border-radius: var(--radius); }
.book-cover-placeholder {
  width: 100%;
  aspect-ratio: 5/7;
  background: linear-gradient(135deg, #e9e1d4, #d5c9b8);
  border-radius: var(--radius);
}

.synopsis-box {
  background: var(--warm-bg);
  border-left: 4px solid var(--gold);
}

/* --- Story detail ----------------------------------------- */
.story-hero-img-wrap {
  position: relative;
  max-height: 520px;
  overflow: hidden;
}
.story-hero-img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
}
.story-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 30%, rgba(0,0,0,.2) 80%);
}
.story-hero-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding-bottom: 2.5rem;
}

/* --- Prose content ---------------------------------------- */
.prose-content {
  font-size: 1.05rem;
  line-height: 1.85;
}
.prose-paragraph p { margin-bottom: 1.25rem; }
.prose-blockquote {
  border-color: var(--gold) !important;
  color: #555;
}

/* --- CTA band ---------------------------------------------- */
.cta-band {
  /* background: var(--dark); */
  background: var(--gold-dark-banner);
  /* color: #fff; */
}
/* .cta-band h2 { color: #fff; } */

/* --- Footer ------------------------------------------------ */
.site-footer { border-top: 1px solid rgba(255,255,255,.08); }
.footer-link {
  /* color: rgba(255,255,255,.55); */
  text-decoration: none;
  transition: color var(--transition);
}
.footer-link:hover { color: var(--gold); }

/* --- Empty state ------------------------------------------ */
.empty-state {
  padding: 4rem 0;
}

/* --- Utility ----------------------------------------------- */
.z-2 { z-index: 2; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 767px) {
  .hero-section { min-height: auto; padding: 3rem 0 4rem; }
  .story-hero-img { height: 300px; }
}

/* ---- Audio player ----------------------------------------- */
.audio-player-wrap {
  background: var(--warm-bg);
  border-left: 4px solid var(--gold);
}

/* Style the native player consistently across browsers */
audio {
  accent-color: var(--gold);
  height: 48px;
}

/* ----- COOKIE CONSENT -------------------------------------- */

/* ===== Cookie Consent Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  /* background: var(--dark); */
  background: var(--gold-dark-banner);
  border-top: 2px solid rgba(201, 168, 76, 0.3);
  padding: 1rem 0;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  display: block; /* always in DOM, hidden via transform */
}

.cookie-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-banner-text {
  /* color: rgba(255, 255, 255, 0.85); */
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
  min-width: 260px;
  color: color-contrast(var(--gold-dark-banner));
}

/* .cookie-banner-text strong {
  color: #fff;
} */

.cookie-link {
  color: var(--gold);
  text-decoration: underline;
  white-space: nowrap;
}

.cookie-link:hover {
  /* color: #e2c06a; */
  color: var(--gold-dark);
}

.cookie-banner-actions {
  flex-shrink: 0;
}

@media (max-width: 575px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-banner-actions .btn {
    width: 100%;
  }
}


/* ----- Contact Us Form --------------------------------------------- */

.contact-form-wrap {
  background: var(--warm-bg);
  border-left: 4px solid var(--gold);
}

.contact-form-wrap .form-control {
  border-radius: var(--radius-sm);
  border: 1px solid #ddd;
  padding: .75rem 1rem;
  font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form-wrap .form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
  outline: none;
}

.contact-form-wrap .form-control.is-invalid {
  border-color: #dc3545;
}

.char-counter {
  min-height: 1.4rem;
}

.char-count-text {
  font-size: .8rem;
  transition: color .2s ease;
}

/* ----- Advanced Story Search --------------------------------------------- */
.filter-panel {
  background: var(--warm-bg);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-left: 4px solid var(--gold);
}

.filter-panel .form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

/* ----- Captcha--------------------------------------------- */
/* Captcha image */
.captcha {
  border-radius: var(--radius-sm);
  border: 1px solid #ddd;
  display: block;
  margin-bottom: .5rem;
}

/* Refresh link */
.captcha ~ a {
  font-size: .85rem;
  color: var(--gold-dark);
}

/* Input box next to image */
#id_captcha_1 {
  max-width: 160px;
}

/* ----- Like Button --------------------------------------------- */
/* Like button */
.like-btn {
  border-radius: 999px;
  font-size: .85rem;
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
  z-index: 1;           /* sit above stretched-link overlay on cards */
}

.like-btn:hover {
  transform: scale(1.08);
}

.like-btn .bi-heart-fill {
  color: #e05c5c;
}

/* Pulse animation on click */
@keyframes like-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.like-pulse {
  animation: like-pulse .3s ease;
}

/* ----- theme settings ------------------------------ */

/* In your author.css or theme_settings page <style> block */

.theme-swatch-label input[type="radio"] {
  /* Truly hide the radio but keep it functional */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.theme-swatch-label {
  display: inline-flex;
  align-items: center;
  padding: .4rem 1.2rem;
  border: 2px solid var(--gold-light, #eee);
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: border-color .2s, background .2s, color .2s;
  user-select: none;
  background: #000000;
  color: #ffffff;
}

.theme-swatch-label:hover {
  border-color: var(--gold);
  /* background: rgba(201,168,76,.08); */
  background: var(--gold-dark);
}

/* Active state — set by JS on click, and server-rendered via current_theme */
.theme-swatch-label.active,
.theme-swatch-label:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--component-text-color);
}

/* ----- Override Bootstrap's components ------------------------------ */
/* --- Override Bootstrap's .text-body-secondary to respect the active theme --- */
.text-body-secondary {
  color: var(--text-body-secondary) !important;
}

.form-label {
  color: var(--form-label-color) !important;
}

/* ---- Pretty Select ------- */
.pretty-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 260px;
  padding: 12px 44px 12px 16px;
  border: 1px solid #cfd4dc;
  border-radius: 12px;
  background-color: #fff;
  color: #212529;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pretty-select:focus {
  border-color: #7eb8d4;
  box-shadow: 0 0 0 4px rgba(126, 184, 212, 0.18);
}

/* hr horizontal rule divider */
hr {
  border: 0;
  border-top: 1px solid var(--gold-dark);
  opacity: 0.2; /* softer line */
}

/* ---- Story Comment Styles ------- */
.story-comments .comment-item {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 1rem;
    /* background: var(--bs-body-bg, #fff); */
    background: var(--body-bg);
}
.story-comments .comment-meta {
  font-size: 0.95rem;
  /* color: var(--bs-secondary-color, #6c757d); */
  color: var(--text);
  margin-bottom: 0.5rem;
}
.story-comments .comment-body {
  white-space: pre-wrap;
  word-break: break-word;
}
.story-comments .comment-children {
  margin-top: 0.75rem;
}
.story-comments .comment-children > .comment-item,
.story-comments .comment-children > .comment-thread > .comment-item {
  margin-left: 20px;
  margin-top: 0.75rem;
}
.reply-form-container {
  display: none;
  margin-top: 0.75rem;
}
.reply-form-container.open {
  display: block;
}

/* Collapsible comments panel */
.comments-panel {
  overflow: hidden;
  max-height: 5000px;
  opacity: 1;
  transition: max-height 0.28s ease, opacity 0.2s ease;
}

.comments-panel.is-collapsed {
  max-height: 0;
  opacity: 0;
}

.comment-children.is-collapsed {
  display: none;
}