/* ========================================
   CardVieu — Main Stylesheet
   ======================================== */

:root {
  --color-primary: #1a56db;
  --color-primary-dark: #1e429f;
  --color-primary-light: #ebf5ff;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #f9fafb;
  --color-white: #ffffff;
  --color-success: #059669;
  --color-warning: #d97706;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --max-width: 1200px;
  --content-width: 820px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--color-text); background: var(--color-bg); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 700; color: var(--color-text); margin-bottom: 0.5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; }
h4 { font-size: 1.1rem; margin-top: 1.25rem; }
p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.25rem; }
strong { font-weight: 600; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* ---- Header ---- */
.site-header { background: var(--color-white); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-logo { font-size: 1.5rem; font-weight: 800; color: var(--color-primary); letter-spacing: -0.5px; }
.site-logo:hover { text-decoration: none; color: var(--color-primary-dark); }
.main-nav { display: flex; align-items: center; }
.nav-list { display: flex; list-style: none; padding: 0; margin: 0; gap: 0.25rem; }
.nav-item a { display: block; padding: 0.4rem 0.7rem; font-size: 0.9rem; font-weight: 500; color: var(--color-text); border-radius: var(--radius); transition: background 0.15s, color 0.15s; }
.nav-item a:hover, .nav-item.active a { background: var(--color-primary-light); color: var(--color-primary); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--color-text); padding: 0.25rem; }

/* ---- Hero ---- */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #1a56db 60%, #3b82f6 100%); color: #fff; padding: 5rem 1.25rem 4rem; text-align: center; }
.hero h1 { font-size: 2.75rem; color: #fff; max-width: 720px; margin: 0 auto 1rem; line-height: 1.15; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 560px; margin: 0 auto 2rem; }
.hero-cta { display: inline-flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.btn { display: inline-block; padding: 0.75rem 1.75rem; border-radius: var(--radius); font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn-primary { background: var(--color-white); color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-light); text-decoration: none; }
.btn-outline { border: 2px solid rgba(255,255,255,0.7); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.15); text-decoration: none; }

/* ---- Section title ---- */
.section-title { font-size: 1.75rem; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--color-border); }

/* ---- Card grid ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; margin-bottom: 2.5rem; }
.card-tile { background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.2s; display: flex; flex-direction: column; }
.card-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-tile h3 { font-size: 1.05rem; margin-top: 0; }
.card-tile p { font-size: 0.9rem; color: var(--color-text-muted); flex: 1; }
.card-tile a.card-link { display: inline-block; margin-top: 1rem; font-size: 0.9rem; font-weight: 600; color: var(--color-primary); }

/* ---- Category grid ---- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.category-card { background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem 1.25rem; text-align: center; box-shadow: var(--shadow); transition: all 0.2s; color: var(--color-text); display: block; }
.category-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); text-decoration: none; color: var(--color-primary); }
.category-card .cat-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.category-card h3 { font-size: 1rem; margin: 0; }

/* ---- Page layout ---- */
.page-wrap { padding: 2.5rem 1.25rem; max-width: var(--max-width); margin: 0 auto; }
.content-with-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: start; }
.article-content, .sidebar { min-width: 0; }

/* ---- Article ---- */
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.article-meta { font-size: 0.875rem; color: var(--color-text-muted); display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.prose h2 { font-size: 1.4rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.4rem; }
.prose h3 { font-size: 1.15rem; }
.prose blockquote { border-left: 4px solid var(--color-primary); padding: 0.75rem 1.25rem; background: var(--color-primary-light); border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0; font-style: italic; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--color-white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th { background: var(--color-primary); color: #fff; padding: 0.75rem 1rem; text-align: left; font-weight: 600; white-space: nowrap; }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-primary-light); }
/* Markdown-generated tables inside .prose — make scrollable on mobile */
.prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose table th { white-space: nowrap; }
.prose table td { min-width: 100px; }

/* ---- Verdict box ---- */
.verdict-box { background: var(--color-primary-light); border: 1px solid var(--color-primary); border-radius: var(--radius-lg); padding: 1.5rem; margin: 1.5rem 0; }
.verdict-box .verdict-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-primary); margin-bottom: 0.5rem; }
.verdict-best { color: var(--color-success); font-weight: 600; }
.verdict-worst { color: var(--color-warning); font-weight: 600; }

/* ---- Breadcrumbs ---- */
.breadcrumbs { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .sep { color: var(--color-border); }

/* ---- Article list ---- */
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list-item { background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow); transition: box-shadow 0.2s; }
.article-list-item:hover { box-shadow: var(--shadow-md); }
.article-list-item h2 { font-size: 1.15rem; margin: 0 0 0.35rem; }
.article-list-item p { font-size: 0.9rem; color: var(--color-text-muted); margin: 0; }
.article-list-item .meta { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.5rem; }

/* ---- Sidebar ---- */
.sidebar-widget { background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.sidebar-widget h4 { font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 0.75rem; margin-top: 0; }
.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget ul li { padding: 0.35rem 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.sidebar-widget ul li:last-child { border-bottom: none; }

/* ---- Disclaimer ---- */
.disclaimer-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 1rem 1.25rem; font-size: 0.85rem; color: #92400e; margin: 2rem 0; }

/* ---- FAQ ---- */
.faq-item { margin-bottom: 1.5rem; }
.faq-item dt { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.35rem; }
.faq-item dd { margin-left: 0; }

/* ---- Hub ---- */
.hub-intro { max-width: var(--content-width); margin-bottom: 2.5rem; font-size: 1.05rem; }
.cluster-list { list-style: none; padding: 0; margin: 0 0 2.5rem; }
.cluster-item { border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
.cluster-item:last-child { border-bottom: none; }
.cluster-item a { font-weight: 600; font-size: 1.05rem; }
.cluster-item p { font-size: 0.9rem; color: var(--color-text-muted); margin: 0.25rem 0 0; }

/* ---- Prose page (legal/about/contact — no sidebar) ---- */
.prose-page { max-width: var(--content-width); margin: 0 auto; }

/* ---- Footer ---- */
.site-footer { background: #111827; color: #d1d5db; padding: 3rem 1.25rem 1.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-col h3 { color: #fff; font-size: 1.2rem; margin-bottom: 0.75rem; margin-top: 0; }
.footer-col h4 { color: #9ca3af; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; margin-top: 0; }
.footer-col p { font-size: 0.9rem; margin: 0; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { color: #9ca3af; font-size: 0.9rem; }
.footer-col ul li a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid #374151; padding-top: 1.5rem; font-size: 0.8rem; color: #6b7280; }
.footer-bottom p { margin-bottom: 0.5rem; }
.footer-bottom a { color: #9ca3af; }
.footer-bottom a:hover { color: #fff; }
.disclaimer { line-height: 1.5; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .content-with-sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2rem; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 640px) {
  .nav-list { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--color-white); border-bottom: 1px solid var(--color-border); padding: 1rem; box-shadow: var(--shadow-md); z-index: 99; }
  .nav-list.open { display: flex; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero { padding: 2.5rem 1.25rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .page-wrap { padding: 1.5rem 1rem; }
  .section-title { font-size: 1.3rem; }
  .article-header h1 { font-size: 1.5rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-cta .btn { width: 100%; max-width: 300px; text-align: center; }
  .cluster-item a { font-size: 1rem; }
  .footer-bottom { font-size: 0.78rem; }
}
@media (max-width: 400px) {
  .hero h1 { font-size: 1.45rem; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.2rem; }
  .hero p { font-size: 0.95rem; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .btn { padding: 0.65rem 1.25rem; font-size: 0.95rem; }
  .nav-item a { font-size: 0.95rem; padding: 0.6rem 0.5rem; }
}
