/*
Theme Name: ECRtech
Theme URI: https://ecrtech.example
Author: ECRtech
Description: Thème WordPress sur-mesure pour ECRtech — chaîne YouTube tech, smart home & énergie. Actus, tests avec score EcoRadinMalin, guides & DIY, liens affiliés.
Version: 1.0.5
Requires PHP: 7.4
Text Domain: ecrtech
*/

:root {
  --navy: #0C1B30;
  --navy-2: #0F213B;
  --blue: #1E5A96;
  --accent: #DC2F2F;
  --accent-dark: #A82418;
  --green: #2E9E52;
  --amber: #E4A93D;
  --bg: #F5F6F8;
  --text: #101826;
  --muted: #5E6B80;
  --muted-2: #7C8CA3;
  --border: #ECEDF1;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Public Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; display: block; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600;
  font-size: 15px; cursor: pointer; white-space: nowrap; border: none;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); }

.tag {
  display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.tag-test { background: #FEEAE7; color: var(--accent); }
.tag-guide { background: #E9F1FB; color: var(--blue); }
.tag-energie { background: #EAF7EE; color: var(--green); }

.card {
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(16,24,38,.06), 0 1px 1px rgba(16,24,38,.04);
  border: 1px solid var(--border);
}

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 20; background: var(--navy);
  padding: 0 40px; display: flex; align-items: center; justify-content: space-between;
  height: 76px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.site-header .brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-header .brand a { min-width: 0; }
.site-header .brand img { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.site-header .brand-name { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.site-header .brand-tagline { color: #8CA0BE; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 36px; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: #B9C4D4; font-size: 14.5px; font-weight: 600; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: #fff; }

/* ===== Hero (front page) ===== */
.hero { position: relative; background: var(--navy); overflow: hidden; padding: 68px 40px 84px; }
.hero-inner { position: relative; max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: 44px; line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
.hero p.lede { color: #A9B7CB; font-size: 17px; line-height: 1.6; max-width: 480px; }
.hero-video-card { border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); }
.hero-stats { display: flex; gap: 32px; margin-top: 18px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); flex-wrap: wrap; }
.hero-stats .num { color: #fff; font-size: 22px; font-weight: 700; }
.hero-stats .lbl { color: #7C8CA3; font-size: 13px; }

/* ===== Category strip ===== */
.category-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); padding: 6px; }
.category-strip a { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 14px; color: var(--text); min-width: 0; }
.category-strip .ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ===== Cards grid ===== */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 10px; }
.section-title h2 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.grid-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; }
.post-card-img { aspect-ratio: 16/10; background-size: cover; background-position: center; background-color: var(--blue); }
.post-card-body { padding: 20px; display: flex; flex-direction: column; gap: 9px; }
.post-card-body h3 { font-size: 16.5px; line-height: 1.32; color: var(--text); }
.post-card-meta { font-size: 12.5px; color: var(--muted); }

/* ===== Video grid (dark) ===== */
.video-section { background: var(--navy); padding: 56px 40px; }
.video-section h2 { color: #fff; }
.video-thumb { position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background-size: cover; background-position: center; background-color: var(--navy-2); }
.video-thumb .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-thumb .play span { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; }
.video-thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px; }
.video-title { color: #fff; font-size: 14px; font-weight: 600; line-height: 1.35; margin-top: 10px; }
.video-meta { color: #7C8CA3; font-size: 12.5px; }

/* ===== Newsletter ===== */
.newsletter { border-radius: 24px; padding: 44px 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; background: var(--accent); }
.newsletter h2 { color: #fff; font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.newsletter p { color: rgba(255,255,255,.85); font-size: 14.5px; margin: 0; }
.newsletter form { display: flex; gap: 10px; flex: 1; min-width: 280px; max-width: 420px; }
.newsletter input[type="email"] { flex: 1; padding: 14px 18px; border-radius: 999px; border: none; font-size: 14.5px; font-family: inherit; min-width: 0; }

/* ===== Footer ===== */
.site-footer { margin-top: 80px; background: var(--navy); padding: 56px 40px 28px; }
.footer-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid h3 { color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.footer-grid a { color: #8CA0BE; font-size: 14px; display: block; margin-bottom: 12px; }
.footer-bottom { max-width: 1280px; margin: 40px auto 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.08); color: #5E7089; font-size: 12.5px; }

/* ===== Single test page ===== */
.breadcrumb { max-width: 1180px; margin: 0 auto; padding: 22px 40px 0; font-size: 13px; color: var(--muted); }
.article-header { max-width: 1180px; margin: 0 auto; padding: 18px 40px 0; }
.article-header h1 { font-size: 34px; line-height: 1.2; font-weight: 700; margin: 14px 0 10px; max-width: 820px; letter-spacing: -.01em; }
.affiliate-disclosure { max-width: 1180px; margin: 16px auto 0; padding: 0 40px; }
.affiliate-disclosure .box { display: flex; align-items: center; gap: 10px; background: #FFF8E8; border: 1px solid #F3E3B8; border-radius: 12px; padding: 11px 16px; }
.affiliate-disclosure .box p { font-size: 13px; color: #7A5F17; margin: 0; }
.test-hero-img { max-width: 1180px; margin: 20px auto 0; padding: 0 40px; }
.test-hero-img .ph { border-radius: 20px; aspect-ratio: 21/9; background-size: cover; background-position: center; background-color: var(--blue); }
.test-body { max-width: 1180px; margin: 0 auto; padding: 40px 40px 90px; display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; }
.test-body p { font-size: 15.5px; line-height: 1.75; color: #33404F; margin: 0 0 18px; }
.test-body h2 { font-size: 21px; font-weight: 700; margin: 34px 0 14px; }

/* ===== Tables dans le contenu des articles ===== */
.wp-block-table { overflow-x: auto; margin: 26px 0; }
.wp-block-table table, .wrap table { width: 100%; border-collapse: collapse; table-layout: auto; }
.wp-block-table th, .wp-block-table td, .wrap table th, .wrap table td { padding: 11px 16px; border: 1px solid var(--border); text-align: left; font-size: 14.5px; line-height: 1.5; }
.wp-block-table thead th, .wrap table thead th { background: #F5F6F8; font-weight: 700; white-space: nowrap; }
.wp-block-table tbody tr:nth-child(even), .wrap table tbody tr:nth-child(even) { background: #FAFBFC; }
.video-embed-card .head { padding: 16px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 700; }
.video-embed-card .thumb { position: relative; display: block; aspect-ratio: 16/9; background-size: cover; background-position: center; background-color: var(--navy-2); }
.video-embed-card .thumb .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-embed-card .thumb .play span { width: 64px; height: 64px; border-radius: 50%; background: rgba(220,63,48,.92); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(220,63,48,.4); }
.affiliate-inline { padding: 22px 24px; margin: 28px 0; }
.affiliate-inline .row { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 10px; }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 30px 0; }
.pros-cons .card { padding: 20px 22px; }
.sidebar-sticky { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 18px; }
.score-total { font-size: 40px; font-weight: 700; color: var(--accent); }
.bottom-cta { margin-top: 32px; border-radius: 18px; background: var(--navy); padding: 30px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .hero-inner, .grid-3, .grid-4, .test-body, .pros-cons { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .wrap { padding: 0 20px; }

  .site-header { padding: 0 20px; }
  .site-header .brand-tagline { display: none; }
  .site-header .brand-name { font-size: 15.5px; }
  .site-header .brand img { width: 36px; height: 36px; }
  .site-header .btn { padding: 10px 16px; font-size: 13.5px; }
  .site-header .btn svg { width: 14px; height: 14px; }

  .hero { padding: 40px 20px 56px; }
  .hero h1 { font-size: 30px; }
  .hero p.lede { max-width: 100%; font-size: 15.5px; }
  .hero-stats { gap: 22px; }
  .hero-stats .num { font-size: 19px; }

  .category-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }

  .video-section { padding: 40px 20px; }

  .newsletter { padding: 28px 24px; }
  .newsletter form { min-width: 0; width: 100%; }

  .breadcrumb, .article-header, .affiliate-disclosure, .test-hero-img, .test-body {
    padding-left: 20px; padding-right: 20px;
  }
  .article-header h1 { font-size: 26px; }

  .wp-block-table th, .wp-block-table td, .wrap table th, .wrap table td { padding: 9px 10px; font-size: 13px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 25px; }
  .hero p.lede { font-size: 14.5px; }
  .btn { padding: 11px 18px; font-size: 13.5px; }
  .hero-stats { gap: 16px; }
  .hero-stats .num { font-size: 17px; }
  .category-strip { grid-template-columns: 1fr; }
  .newsletter form { flex-direction: column; }
  .bottom-cta { flex-direction: column; align-items: flex-start; }
}


/* Carrousel "À la une" (page d'accueil) — 2026-09-04 */
.news-carousel-wrap { position: relative; margin-top: 8px; }
.news-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 4px 10px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.news-carousel::-webkit-scrollbar { display: none; }
.news-carousel .card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.news-carousel-viewall {
  flex: 0 0 200px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: var(--navy);
  color: #fff;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
  padding: 20px;
}
.news-carousel-viewall svg { flex-shrink: 0; }
.news-carousel-viewall:hover { background: var(--navy-2); }
.news-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(16,24,38,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  padding: 0;
}
.news-carousel-arrow.prev { left: -14px; }
.news-carousel-arrow.next { right: -14px; }
.news-carousel-arrow:hover { background: var(--bg); }
@media (max-width: 640px) {
  .news-carousel-arrow { display: none; }
  .news-carousel .card { flex-basis: 240px; }
}
