/* =============================================================================
   Carlo G. Santoro — Custom Styles
   ============================================================================= */

/* ----- Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ----- Root Variables (Dark Mode — default) ----- */
:root,
[data-theme="dark"] {
  /* Space-separated RGB channels — rgb(var(--x) / alpha) requires space-separated values */
  --cs-dark-rgb:       8 13 20;
  --cs-card-rgb:       14 21 32;
  --cs-surface-rgb:    20 30 46;
  --cs-border-rgb:     30 45 66;
  --cs-gold-rgb:       201 150 58;
  --cs-gold-light-rgb: 228 181 88;
  --cs-muted-rgb:      122 136 153;
  /* Hex — used in custom CSS (borders, shadows, gradients) */
  --cs-dark:       #080D14;
  --cs-card:       #0E1520;
  --cs-surface:    #141E2E;
  --cs-border:     #1E2D42;
  --cs-gold:       #C9963A;
  --cs-gold-light: #E4B558;
  --cs-muted:      #7A8899;
  --cs-text:       #E8EDF5;
}

/* ----- Light Mode Variables ----- */
[data-theme="light"] {
  --cs-dark-rgb:       245 247 250;
  --cs-card-rgb:       255 255 255;
  --cs-surface-rgb:    238 241 246;
  --cs-border-rgb:     209 217 230;
  --cs-gold-rgb:       181 130 30;
  --cs-gold-light-rgb: 201 150 58;
  --cs-muted-rgb:      90 106 126;
  --cs-dark:       #F5F7FA;
  --cs-card:       #FFFFFF;
  --cs-surface:    #EEF1F6;
  --cs-border:     #D1D9E6;
  --cs-gold:       #B5821E;
  --cs-gold-light: #C9963A;
  --cs-muted:      #5A6A7E;
  --cs-text:       #1A2535;
}

/* Light mode — override hardcoded Tailwind colour utilities */
[data-theme="light"] body               { color: #1A2535; }
[data-theme="light"] .text-white        { color: #1A2535 !important; }
[data-theme="light"] .text-gray-100     { color: #1A2535 !important; }
[data-theme="light"] .text-gray-200     { color: #2D3748 !important; }
[data-theme="light"] .text-gray-300     { color: #4A5568 !important; }
[data-theme="light"] .text-gray-400     { color: #718096 !important; }
[data-theme="light"] nav .text-gray-300 { color: #2D3748 !important; }
[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(181,130,30,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(181,130,30,0.07) 1px, transparent 1px);
}
[data-theme="light"] ::-webkit-scrollbar-track { background: #F5F7FA; }
[data-theme="light"] .cs-input { color: #1A2535; background: #EEF1F6; border-color: #D1D9E6; }
[data-theme="light"] .cs-input::placeholder { color: #5A6A7E; }
[data-theme="light"] .cs-card:hover { box-shadow: 0 20px 40px rgba(181,130,30,0.12); }
[data-theme="light"] .text-gradient-gold {
  background: linear-gradient(135deg, #B5821E 0%, #8B6014 50%, #C9963A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Page hero — always dark so white text remains readable */
[data-theme="light"] .page-hero {
  background: linear-gradient(135deg, #080D14 0%, #0D1B2F 50%, #080D14 100%);
}
[data-theme="light"] .page-hero h1 { color: #fff; }
[data-theme="light"] .page-hero .text-cs-muted { color: #94a3b8 !important; }
[data-theme="light"] .page-hero .text-white { color: #fff !important; }

/* ----- Base ----- */
html { scroll-behavior: smooth; }

body {
  background-color: var(--cs-dark);
  color: var(--cs-text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-display { font-family: 'Playfair Display', serif; }

/* ----- Custom Scrollbar ----- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cs-dark); }
::-webkit-scrollbar-thumb { background: var(--cs-gold); border-radius: 3px; }

/* ----- Selection ----- */
::selection { background: var(--cs-gold); color: var(--cs-dark); }

/* ----- Hero Background Grid ----- */
.hero-grid {
  background-image:
    linear-gradient(rgba(201,150,58,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,150,58,0.06) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* ----- Gold Gradient Text ----- */
.text-gradient-gold {
  background: linear-gradient(135deg, #E4B558 0%, #C9963A 50%, #F0C060 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----- Section Decorative Line ----- */
.section-line {
  display: inline-block;
  width: 48px;
  height: 3px;
  background: var(--cs-gold);
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 12px;
}

/* ----- Cards ----- */
.cs-card {
  background: var(--cs-card);
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.cs-card:hover {
  border-color: var(--cs-gold);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(201,150,58,0.1);
}

/* ----- Buttons ----- */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--cs-gold);
  color: var(--cs-dark);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: background 0.3s ease, transform 0.2s ease;
  text-decoration: none;
}
.btn-gold:hover { background: var(--cs-gold-light); transform: translateY(-1px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  border: 1.5px solid rgba(255,255,255,0.25);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: border-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
}
.btn-outline:hover { border-color: var(--cs-gold); color: var(--cs-gold); }

.btn-outline-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  border: 1.5px solid var(--cs-gold);
  color: var(--cs-gold);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: background 0.3s ease, color 0.3s ease;
  text-decoration: none;
}
.btn-outline-gold:hover { background: var(--cs-gold); color: var(--cs-dark); }

/* ----- Page Hero Banners ----- */
.page-hero {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, var(--cs-dark) 0%, #0D1B2F 50%, var(--cs-dark) 100%);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,150,58,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,150,58,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
}
.page-hero-tag {
  display: inline-block;
  color: var(--cs-gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.page-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
}

/* ----- Testimonial Cards ----- */
.testimonial-card {
  background: var(--cs-card);
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  padding: 32px;
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  line-height: 0;
  color: var(--cs-gold);
  opacity: 0.2;
  position: absolute;
  top: 24px;
  left: 24px;
}

/* ----- Stat Counter ----- */
.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--cs-gold);
  line-height: 1;
}

/* ----- Service Icon Boxes ----- */
.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(201,150,58,0.1);
  border: 1px solid rgba(201,150,58,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cs-gold);
  margin-bottom: 20px;
  transition: background 0.3s ease;
}
.cs-card:hover .service-icon {
  background: rgba(201,150,58,0.2);
}

/* ----- Form Inputs ----- */
.cs-input {
  width: 100%;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: 8px;
  padding: 14px 18px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.cs-input:focus { border-color: var(--cs-gold); }
.cs-input::placeholder { color: var(--cs-muted); }
.cs-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--cs-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ----- Book Cards ----- */
.book-card {
  background: var(--cs-card);
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.4);
  border-color: var(--cs-gold);
}

/* ----- Divider ----- */
.cs-divider {
  border: none;
  height: 1px;
  background: var(--cs-border);
  margin: 0;
}

/* ----- Glow Effects ----- */
.glow-gold {
  box-shadow: 0 0 40px rgba(201,150,58,0.15), 0 0 80px rgba(201,150,58,0.05);
}

/* ----- Nav Active State ----- */
.nav-active { color: var(--cs-gold) !important; }

/* ----- Timeline ----- */
.timeline-item { position: relative; padding-left: 32px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cs-gold);
  border: 2px solid var(--cs-dark);
  box-shadow: 0 0 0 3px rgba(201,150,58,0.2);
}
.timeline-item::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 22px;
  width: 2px;
  bottom: -8px;
  background: var(--cs-border);
}
.timeline-item:last-child::after { display: none; }

/* ----- Responsive Video/Audio ----- */
.audio-player-wrapper {
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ----- Scroll to Top ----- */
#scrollTop {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: var(--cs-gold);
  color: var(--cs-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
  border: none;
}
#scrollTop.visible { opacity: 1; transform: translateY(0); }
#scrollTop:hover { background: var(--cs-gold-light); }

/* ----- Animations ----- */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}
.float-anim { animation: float 4s ease-in-out infinite; }

@keyframes pulse-gold {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
.pulse-gold { animation: pulse-gold 3s ease-in-out infinite; }

/* ----- Mobile / Responsive Fixes ----- */

/* Prevent horizontal overflow on all screens */
html, body { overflow-x: hidden; max-width: 100%; }

/* Hero image full-width on small screens */
@media (max-width: 1023px) {
  .hero-profile-img { max-width: 280px !important; height: 340px !important; }
}

/* Stats strip — single column on mobile */
@media (max-width: 639px) {
  .stat-number { font-size: 2rem; }
  .page-hero { padding: 120px 0 60px; }
  .page-hero h1 { font-size: clamp(1.75rem, 9vw, 3rem); }
  .btn-gold, .btn-outline, .btn-outline-gold { padding: 12px 22px; font-size: 0.8rem; }
  #scrollTop { bottom: 20px; right: 16px; width: 38px; height: 38px; }
  .testimonial-card { padding: 22px 18px; }
}

/* Touch targets — minimum 44px tap area */

/* =============================================================================
   Blog post — reusable inner card classes (replaces inline styles in body HTML)
   ============================================================================= */
.blog-inner-card {
  background: #111c2d;
  border: 1px solid #1e2d45;
  border-radius: 8px;
  padding: 0.75rem;
}
.blog-inner-card strong, .blog-inner-card .bic-title {
  color: #E4B558;
  font-size: 0.78rem;
  display: block;
  margin-bottom: 0.25rem;
}
.blog-inner-card span, .blog-inner-card .bic-desc {
  color: #94a3b8;
  font-size: 0.75rem;
  line-height: 1.5;
}
.blog-inner-card-green {
  background: #1a2d15;
  border: 1px solid #2a4a25;
  border-radius: 8px;
  padding: 0.75rem;
}
.blog-inner-card-green strong, .blog-inner-card-green .bic-title {
  color: #E4B558;
  font-size: 0.72rem;
  display: block;
  margin-bottom: 0.4rem;
}
.blog-inner-card-green li {
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1.6;
}
.blog-inner-card-center {
  text-align: center;
  padding: 0.75rem;
  background: #111c2d;
  border: 1px solid #1e2d45;
  border-radius: 8px;
}
.blog-inner-card-center .bic-value {
  color: #E4B558;
  font-size: 0.9rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.35rem;
}
.blog-inner-card-center .bic-desc {
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1.5;
}
.blog-inner-card-center .bic-note {
  color: #64748b;
  font-size: 0.68rem;
  font-style: italic;
  margin-top: 0.35rem;
}
.blog-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.blog-grid-2-lg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.blog-diagram-note {
  color: #64748b;
  font-size: 0.72rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Light mode overrides for inner cards */
[data-theme="light"] .blog-inner-card {
  background: #ffffff;
  border-color: #D1D9E6;
}
[data-theme="light"] .blog-inner-card strong,
[data-theme="light"] .blog-inner-card .bic-title {
  color: #B5821E;
}
[data-theme="light"] .blog-inner-card span,
[data-theme="light"] .blog-inner-card .bic-desc {
  color: #4A5568;
}
[data-theme="light"] .blog-inner-card-green {
  background: #f0f7ee;
  border-color: #b8d4b2;
}
[data-theme="light"] .blog-inner-card-green strong,
[data-theme="light"] .blog-inner-card-green .bic-title {
  color: #B5821E;
}
[data-theme="light"] .blog-inner-card-green li {
  color: #4A5568;
}
[data-theme="light"] .blog-inner-card-center {
  background: #ffffff;
  border-color: #D1D9E6;
}
[data-theme="light"] .blog-inner-card-center .bic-value {
  color: #B5821E;
}
[data-theme="light"] .blog-inner-card-center .bic-desc {
  color: #4A5568;
}
[data-theme="light"] .blog-inner-card-center .bic-note {
  color: #5A6A7E;
}
[data-theme="light"] .blog-diagram-note {
  color: #5A6A7E;
}

/* =============================================================================
   Blog post — light mode overrides
   All .prose-carlo and .blog-* components use hardcoded dark hex values;
   these rules reverse them when data-theme="light" is active.
   ============================================================================= */
[data-theme="light"] .prose-carlo {
  color: #1A2535;
}
[data-theme="light"] .prose-carlo h2 {
  color: #0f1929;
}
[data-theme="light"] .prose-carlo h3 {
  color: #B5821E;
}
[data-theme="light"] .prose-carlo strong {
  color: #0f1929;
}
[data-theme="light"] .prose-carlo em {
  color: #B5821E;
}
[data-theme="light"] .prose-carlo blockquote {
  background: #EEF1F6;
  border-left-color: #B5821E;
  color: #2D3748;
}

/* Podcast player */
[data-theme="light"] .blog-podcast {
  background: #EEF1F6;
  border-color: #D1D9E6;
}
[data-theme="light"] .blog-podcast__label {
  color: #B5821E;
}
[data-theme="light"] .blog-podcast__sub {
  color: #5A6A7E;
}

/* Stats bar */
[data-theme="light"] .blog-stats {
  background: #EEF1F6;
  border-color: #D1D9E6;
}
[data-theme="light"] .blog-stats__item {
  border-right-color: #D1D9E6;
}
[data-theme="light"] .blog-stats__value {
  color: #B5821E;
}
[data-theme="light"] .blog-stats__label {
  color: #5A6A7E;
}

/* KPI grid */
[data-theme="light"] .blog-kpi-card {
  background: #EEF1F6;
  border-color: #D1D9E6;
}
[data-theme="light"] .blog-kpi-card__label {
  color: #5A6A7E;
}
[data-theme="light"] .blog-kpi-card__value {
  color: #B5821E;
}
[data-theme="light"] .blog-kpi-card__desc {
  color: #4A5568;
}
[data-theme="light"] .blog-kpi-section__title {
  color: #0f1929;
}
[data-theme="light"] .blog-kpi-section__sub {
  color: #5A6A7E;
}

/* Diagrams */
[data-theme="light"] .blog-diagram {
  background: #EEF1F6;
  border-color: #D1D9E6;
}
[data-theme="light"] .blog-diagram__title {
  color: #B5821E;
}
[data-theme="light"] .blog-diagram__sub {
  color: #5A6A7E;
}

/* Spectrum */
[data-theme="light"] .blog-spectrum__step {
  background: #ffffff;
  border-right-color: #D1D9E6;
}
[data-theme="light"] .blog-spectrum__step:last-child {
  background: #e8f5e9;
}
[data-theme="light"] .blog-spectrum__label {
  color: #B5821E;
}
[data-theme="light"] .blog-spectrum__desc {
  color: #4A5568;
}

/* Two-col leaders */
[data-theme="light"] .blog-two-col__heading {
  color: #B5821E;
}
[data-theme="light"] .blog-leader-content__name {
  color: #0f1929;
}
[data-theme="light"] .blog-leader-content__desc {
  color: #4A5568;
}
[data-theme="light"] .blog-leader-num {
  color: #B5821E;
}

/* 5% framework */
[data-theme="light"] .blog-five-pct__item {
  background: #EEF1F6;
  border-left-color: #B5821E;
}
[data-theme="light"] .blog-five-pct__num {
  color: #B5821E;
}
[data-theme="light"] .blog-five-pct__text {
  color: #2D3748;
}

/* Forum chain */
[data-theme="light"] .blog-chain {
  border-color: #D1D9E6;
}
[data-theme="light"] .blog-chain__step {
  background: #ffffff;
  border-right-color: #D1D9E6;
}
[data-theme="light"] .blog-chain__step .step-num {
  color: #B5821E;
}
[data-theme="light"] .blog-chain__step .step-label {
  color: #2D3748;
}

/* Timing cards */
[data-theme="light"] .blog-timing__card {
  background: #EEF1F6;
  border-color: #D1D9E6;
}
[data-theme="light"] .blog-timing__time {
  color: #B5821E;
}
[data-theme="light"] .blog-timing__event {
  color: #0f1929;
}
[data-theme="light"] .blog-timing__desc {
  color: #5A6A7E;
}
nav a, .mobile-nav-link { min-height: 44px; display: flex; align-items: center; }

/* Gallery grid on mobile */
@media (max-width: 639px) {
  .gallery-img-wrap { aspect-ratio: 1/1; }
}

/* Scroll to top — keep away from mobile browser chrome */
@media (max-width: 639px) {
  #scrollTop { bottom: 72px; }
}

/* ----- Dark/Light Mode Toggle ----- */
#themeToggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--cs-border);
  background: var(--cs-surface);
  color: var(--cs-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}
#themeToggle:hover { border-color: var(--cs-gold); color: var(--cs-gold); }

/* Gallery image overlay (ensure works in light mode) */
.gallery-img-wrap { position: relative; overflow: hidden; }
.gallery-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 1;
}
