/*
 * Matshi Sauce — Custom Theme Styles
 * Complements TailwindCSS utility classes
 */

/* ========== BASE RESET & TYPOGRAPHY ========== */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  color: #1f2937;
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  line-height: 1.25;
}

/* ========== HERO ========== */

.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(15, 15, 15, 0.72) 0%,
    rgba(30, 20, 10, 0.55) 50%,
    rgba(15, 15, 15, 0.65) 100%
  );
}

.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, #faf8f5, transparent);
  pointer-events: none;
}

/* ========== NAVIGATION ========== */

/* Default (inner pages) — dark text on white bg */
.nav-scrolled {
  background-color: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nav-scrolled .header-title {
  color: #111827;
}

.nav-scrolled .nav-link {
  color: #4b5563;
}

.nav-scrolled .nav-link:hover,
.nav-scrolled .nav-link.active {
  color: #111827;
}

.nav-scrolled #mobile-menu-btn {
  color: #4b5563;
}

.nav-scrolled #mobile-menu a {
  color: #4b5563;
}

/* Homepage hero state — white text on transparent bg */
.header-hero .header-title {
  color: #ffffff;
}

.header-hero .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.header-hero .nav-link:hover,
.header-hero .nav-link.active {
  color: #ffffff;
}

.header-hero #mobile-menu-btn {
  color: rgba(255, 255, 255, 0.85);
}

.header-hero #mobile-menu a {
  color: rgba(255, 255, 255, 0.85);
}

.nav-link {
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #ea580c;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ========== CARDS ========== */

.card-article {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
}

.card-article:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.card-article img {
  transition: transform 0.5s ease;
}

.card-article:hover img {
  transform: scale(1.05);
}

.card-rubrique {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.35s ease;
}

.card-rubrique:hover {
  transform: translateY(-6px);
}

.card-rubrique::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.15) 60%,
    transparent 100%
  );
  z-index: 1;
}

/* ========== ARTICLE SINGLE ========== */

.article-hero {
  height: 50vh;
  min-height: 340px;
  max-height: 560px;
}

.article-hero-overlay {
  background: linear-gradient(
    to top,
    #faf8f5 0%,
    rgba(250, 248, 245, 0.6) 25%,
    transparent 55%
  );
}

.article-header {
  position: relative;
}

/* ========== TAG PILLS ========== */

.tag-pill {
  display: inline-block;
  padding: 5px 14px;
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 0.8rem;
  color: #6b7280;
  background-color: #f3f4f6;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a.tag-pill:hover {
  background-color: rgba(20, 184, 166, 0.12);
  color: #0d9488;
}

/* ========== PROSE (Article content) ========== */

.prose-custom {
  max-width: 68ch;
  font-size: 1.05rem;
  line-height: 1.75;
}

.prose-custom > *:first-child {
  margin-top: 0;
}

/* H2 — accent bar left */
.prose-custom h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  color: #111827;
  border-bottom: 2px solid #f3f4f6;
  position: relative;
}

.prose-custom h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, #ea580c, #14b8a6);
  border-radius: 1px;
}

/* H3 — subtle, distinct from body */
.prose-custom h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  color: #1f2937;
  letter-spacing: -0.01em;
}

.prose-custom p {
  margin-bottom: 1.3rem;
  color: #374151;
}

/* Lists — custom bullets */
.prose-custom ul {
  margin-bottom: 1.3rem;
  padding-left: 0;
  list-style: none;
}

.prose-custom ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
  color: #374151;
}

.prose-custom ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ea580c;
  opacity: 0.5;
}

.prose-custom ol {
  margin-bottom: 1.3rem;
  padding-left: 1.75rem;
}

.prose-custom ol li {
  margin-bottom: 0.6rem;
  color: #374151;
}

.prose-custom ol li::marker {
  color: #ea580c;
  font-weight: 600;
}

.prose-custom strong {
  color: #111827;
  font-weight: 600;
}

.prose-custom a {
  color: #ea580c;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(234, 88, 12, 0.3);
  transition: text-decoration-color 0.2s ease;
}

.prose-custom a:hover {
  text-decoration-color: #ea580c;
}

/* Blockquote — editorial callout */
.prose-custom blockquote {
  border-left: 3px solid #14b8a6;
  padding: 1.25rem 1.75rem;
  margin: 2.5rem 0;
  background-color: #f0fdfa;
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: #475569;
  position: relative;
}

.prose-custom blockquote::before {
  content: '\201C';
  position: absolute;
  top: -6px;
  left: 12px;
  font-size: 3rem;
  font-family: 'Playfair Display', Georgia, serif;
  color: rgba(20, 184, 166, 0.2);
  line-height: 1;
}

.prose-custom blockquote p {
  margin-bottom: 0;
  padding-left: 0.5rem;
}

.prose-custom table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.925rem;
}

.prose-custom thead th {
  background-color: #faf8f5;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  border-bottom: 2px solid #e5e7eb;
}

.prose-custom tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.prose-custom tbody tr:hover {
  background-color: #faf8f5;
}

.prose-custom img {
  border-radius: 12px;
  margin: 2rem auto;
}

.prose-custom hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2.5rem 0;
}

/* ========== LINE CLAMP ========== */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== DECORATIVE ========== */

.section-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #ea580c, #14b8a6);
  border-radius: 2px;
}

.gradient-text {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== FOCUS & ACCESSIBILITY ========== */

a:focus-visible,
button:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ========== TRANSITIONS ========== */

a, button {
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* ========== MOBILE MENU ========== */

.mobile-menu-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-menu-closed {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
}

/* ========== FEATURED ARTICLE ========== */

.featured-gradient {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    transparent 100%
  );
}

/* ========== CATEGORY BADGE ========== */

.badge-category {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 50px;
  background-color: rgba(234, 88, 12, 0.1);
  color: #ea580c;
}

/* ========== PRINT ========== */

@media print {
  header, footer, nav, .no-print {
    display: none !important;
  }
  .prose-custom {
    max-width: 100%;
  }
  body {
    color: #000;
  }
}

/* ========== SCROLLBAR (subtle) ========== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ========== HEADING ANCHORS (SEO) ========== */

.heading-anchor {
  margin-left: 0.4em;
  font-size: 0.75em;
  color: #d1d5db;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.group:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor {
  opacity: 1;
}

.heading-anchor:hover {
  color: #ea580c;
}

/* ========== TABLE OF CONTENTS (SEO) ========== */

.toc-wrapper {
  background-color: #faf8f5;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
}

.toc-wrapper summary {
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-wrapper summary::-webkit-details-marker {
  display: none;
}

.toc-wrapper summary::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, #ea580c, #14b8a6);
  border-radius: 2px;
  flex-shrink: 0;
}

.toc-wrapper nav {
  margin-top: 1rem;
}

.toc-wrapper nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc-wrapper nav ul li {
  padding: 0;
}

.toc-wrapper nav ul li::before {
  display: none;
}

.toc-wrapper nav a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: #6b7280;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.15s;
}

.toc-wrapper nav a:hover {
  color: #ea580c;
}

.toc-wrapper nav ul ul {
  padding-left: 1.25rem;
}

.toc-wrapper nav ul ul a {
  font-size: 0.85rem;
  color: #9ca3af;
}
