/* ===================================
   Finlegal - Legal Blog Stylesheet
   Fintech Blue/Gray Color Scheme
   =================================== */

/* CSS Variables for Color Scheme */
:root {
  /* Primary Blues */
  --primary-dark: #1e3a8a;
  --primary-main: #3b82f6;
  --primary-light: #60a5fa;
  --primary-lighter: #93c5fd;

  /* Grays */
  --gray-darkest: #1f2937;
  --gray-dark: #374151;
  --gray-medium: #6b7280;
  --gray-light: #9ca3af;
  --gray-lighter: #d1d5db;
  --gray-lightest: #f3f4f6;

  /* Backgrounds */
  --bg-white: #ffffff;
  /* Blue-Gray Color Palette */
  --primary-blue-gray: #475569;
  --primary-dark: #1e293b;
  --primary-light: #64748b;
  --accent-blue: #0ea5e9;
  --accent-teal: #06b6d4;

  /* Neutral Grays */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic Colors */
  --background: #ffffff;
  --background-alt: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e2e8f0;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===================================
   Reset & Base Styles
   =================================== */
/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-900);
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.02em;
}

/* ===================================
   Typography
   =================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-darkest);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: 2rem;
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 3px solid var(--primary-main);
}

h3 {
  font-size: 1.5rem;
  margin-top: var(--spacing-lg);
  color: var(--primary-dark);
}

h4 {
  font-size: 1.25rem;
  margin-top: var(--spacing-md);
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
}

a {
  color: var(--primary-main);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===================================
   Layout Container
   =================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.content-wrapper {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-xl);
  margin: var(--spacing-lg) 0;
}

/* ===================================
   Header & Navigation
   ===================================*/
/* Header */
header {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover {
  color: var(--accent-teal);
  transform: translateY(-1px);
}

.logo::before {
  content: "⚖";
  font-size: 1.5rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: var(--spacing-lg);
  margin: 0;
  padding: 0;
}

nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 250px;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-md);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  z-index: 1000;
}

.dropdown.active .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  color: var(--gray-800);
  padding: 0.75rem 1.25rem;
  display: block;
  transition: all 0.2s ease;
  border-radius: 0;
}

.dropdown-menu a:hover {
  background: var(--gray-100);
  color: var(--accent-blue);
  transform: translateX(4px);
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-toggle .fa-chevron-down {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.dropdown.active .fa-chevron-down {
  transform: rotate(180deg);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--spacing-xs);
}

/* ===================================
   Hero Section
   ===================================*/
/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--gray-800) 0%, var(--primary-blue-gray) 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: white;
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.95);
  max-width: 800px;
  margin: 0 auto var(--spacing-lg);
}

/* ===================================
   Featured Image
   =================================== */

.featured-image {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
}

.featured-placeholder {
  width: 100%;
  height: 350px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-main) 100%);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

/* ===================================
   Breadcrumb Navigation
   =================================== */

.breadcrumb {
  padding: var(--spacing-md) 0;
  font-size: 0.9rem;
}

.breadcrumb ul {
  list-style: none;
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: '›';
  margin-left: var(--spacing-xs);
  color: var(--gray-light);
}

.breadcrumb a {
  color: var(--primary-main);
}

/* ===================================
   Table of Contents
   =================================== */

/* Table of Contents */
.toc {
  padding: var(--spacing-xl) var(--spacing-md);
  background: var(--gray-50);
}

.toc h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: var(--spacing-xl);
  color: var(--gray-900);
  font-weight: 800;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.toc-item {
  background: white;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.toc-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-teal) 100%);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.toc-item:hover::before {
  transform: scaleY(1);
}

.toc-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent-blue);
}

.toc-item h3 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--gray-900);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toc-item h3::before {
  content: "📄";
  font-size: 1.5rem;
  transition: transform 0.3s ease;
}

.toc-item:hover h3::before {
  transform: scale(1.1);
}

.toc-item p {
  color: var(--text-muted);
}

/* ===================================
   FAQ Section
   ===================================*/
/* FAQ Section */
.faq {
  padding: var(--spacing-xl) var(--spacing-md);
  background: white;
}

.faq h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: var(--spacing-xl);
  color: var(--gray-900);
  font-weight: 800;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
}

.faq-question {
  padding: 1.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  background: var(--gray-50);
}

.faq-question:hover {
  background: var(--gray-100);
  color: var(--accent-blue);
}

.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent-blue);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: white;
}

.faq-answer-content {
  padding: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--gray-200);
}

/* TOC Box for Topic Pages */
.toc-box {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin: var(--spacing-xl) 0;
  box-shadow: var(--shadow-md);
}

.toc-box h2 {
  color: var(--primary-blue-gray);
  font-size: 1.3rem;
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: none;
  margin-top: 0;
  padding-bottom: 0;
}

.toc-box ul {
  list-style: none;
  padding-left: 0;
}

.toc-box>ul>li {
  margin-bottom: var(--spacing-sm);
}

.toc-box ul ul {
  padding-left: var(--spacing-lg);
  margin-top: var(--spacing-xs);
}

.toc-box a {
  color: var(--gray-700);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  padding: 0.25rem 0;
}

.toc-box a:hover {
  color: var(--accent-blue);
  transform: translateX(4px);
}

/* FAQ Section on Topic Pages */
.faq-section {
  margin: var(--spacing-xl) 0;
}

.faq-section h2 {
  color: var(--primary-blue-gray);
  font-size: 1.8rem;
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  overflow: hidden;
}

.faq-question {
  padding: 1rem;
  background-color: var(--gray-50);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  transition: background-color 0.2s;
}

.faq-question:hover {
  background-color: var(--gray-100);
}

.faq-answer {
  display: none;
  padding: 1rem;
  background-color: white;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent-blue);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* ===================================
   Book Recommendation
   =================================== */

.book-recommendation {
  background: linear-gradient(135deg, var(--bg-lighter) 0%, var(--bg-light) 100%);
  border-left: 4px solid var(--accent-blue);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  margin: var(--spacing-xl) 0;
}

.book-recommendation h4 {
  color: var(--primary-dark);
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.book-recommendation h4::before {
  content: '📚';
  font-size: 1.5rem;
}

.book-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
  margin: var(--spacing-sm) 0;
}

.book-author {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

/* ===================================
   Featured Images
   =================================== */
.featured-image {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-md);
}

/* ===================================
   Publications Section
   =================================== */

.publications {
  padding: var(--spacing-xl) 0;
  background-color: var(--gray-50);
}

.publications h2 {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  font-size: 2.5rem;
  color: var(--gray-900);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: var(--spacing-lg);
}

.book-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.book-cover {
  padding: 1.5rem;
  background: var(--gray-100);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 250px;
}

.book-cover img {
  max-height: 100%;
  max-width: 100%;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.book-card:hover .book-cover img {
  transform: scale(1.05);
}

.book-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.book-info h3 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
  line-height: 1.4;
}

.book-author {
  font-size: 0.9rem;
  color: var(--accent-blue);
  font-weight: 600;
  margin-bottom: 1rem;
}

.book-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===================================
   Disclaimer
   =================================== */

.disclaimer {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-left: 4px solid var(--accent-warning);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  margin: var(--spacing-xl) 0;
}

.disclaimer h3 {
  color: #856404;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.disclaimer h3::before {
  content: '⚠️';
  font-size: 1.5rem;
}

.disclaimer p {
  color: #856404;
  margin-bottom: 0;
}

/* ===================================
   Footer
   ===================================*/
footer {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
  color: rgba(255, 255, 255, 0.9);
  padding: 2.5rem var(--spacing-md);
  margin-top: var(--spacing-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  text-align: left;
}

.footer-column h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 0.5rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-nav a:hover {
  color: var(--accent-teal);
  transform: translateX(4px);
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright p {
  margin: 0;
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablet */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .header-content {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  nav ul {
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
    display: none;
  }

  nav ul.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
    position: absolute;
    right: var(--spacing-md);
    top: var(--spacing-md);
  }

  .toc-grid {
    grid-template-columns: 1fr;
  }

  .content-wrapper {
    padding: var(--spacing-md);
  }

  .footer-nav {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

/* Mobile */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  .hero {
    padding: var(--spacing-lg) 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .featured-image,
  .featured-placeholder {
    height: 250px;
  }

  .content-wrapper {
    padding: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
  }
}

/* ===================================
   Utility Classes
   =================================== */

.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.hidden {
  display: none;
}

/* ===================================
   Print Styles
   =================================== */

@media print {

  header,
  footer,
  .breadcrumb,
  .menu-toggle {
    display: none;
  }

  body {
    background-color: white;
  }


  .content-wrapper {
    box-shadow: none;
  }
}

/* ===================================
   Article Elements
   =================================== */

.collaboration-cite {
  margin: 2rem 0;
  padding: 1.5rem;
  border-left: 4px solid var(--accent-blue);
  background-color: var(--gray-50);
  font-style: italic;
  color: var(--gray-700);
  font-weight: 500;
  text-align: center;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.note-box {
  background-color: #e0f2fe;
  /* Light blue */
  border-left: 4px solid var(--primary-main);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border-radius: var(--radius-md);
  color: var(--primary-dark);
}

.note-box strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}