/*
Theme Name: GénieÉlectro
Theme URI: https://genieelectromecanique.com
Author: Génie Électromécanique
Description: Thème WordPress léger, rapide et optimisé SEO pour sites de livres et cours techniques PDF.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: genieelectro
Tags: news, blog, education, two-columns, right-sidebar, custom-menu, featured-images, translation-ready
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #2d8cf0;
  --blue-dark: #185fa5;
  --blue-bg: #e8f1fd;
  --blue-text: #0c447c;
  --navy: #0a1628;
  --navy-mid: #0d2040;
  --font-main: 'Segoe UI', Arial, sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-main); font-size: 15px; line-height: 1.7; color: #222; background: #f4f6f9; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.site-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  padding: 20px 0 32px;
}

@media (max-width: 860px) {
  .site-content { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* TOP BAR */
.top-bar { background: var(--navy); padding: 5px 0; font-size: 11px; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar span { color: #aaa; }
.top-bar a { color: var(--blue); }

/* HEADER */
#masthead { background: #fff; border-bottom: 3px solid var(--blue); padding: 12px 0; }
#masthead .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-branding .site-title { font-size: 22px; font-weight: 700; line-height: 1.1; margin: 0; }
.site-branding .site-title a { color: var(--navy); }
.site-branding .site-title a span { color: var(--blue); }
.site-branding .site-description { font-size: 10px; color: #888; letter-spacing: 0.8px; text-transform: uppercase; margin-top: 2px; }
.header-ad-zone { flex-shrink: 0; }
.ad-placeholder { background: #f0f4f8; border: 1px dashed #b5d4f4; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: #888; font-size: 10px; text-align: center; }
.ad-placeholder.leaderboard { width: 300px; height: 50px; }
.ad-placeholder.rectangle { width: 300px; height: 250px; }
.ad-placeholder.banner { width: 100%; height: 90px; }

/* NAVIGATION */
#site-navigation { background: var(--navy); }
#site-navigation .container { display: flex; align-items: center; }

ul.main-navigation {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
}

ul.main-navigation > li { position: relative; list-style: none; }

ul.main-navigation li a {
  display: block;
  padding: 10px 15px;
  color: #ccc;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

ul.main-navigation li a:hover,
ul.main-navigation li.current-menu-item > a,
ul.main-navigation li.current_page_item > a {
  background: var(--blue);
  color: #fff;
}

ul.main-navigation li > ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--navy-mid);
  min-width: 200px;
  z-index: 99999;
  border-top: 2px solid var(--blue);
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.main-navigation li > ul > li { display: block; position: relative; width: 100%; }
ul.main-navigation li > ul li a { padding: 9px 16px; font-size: 12px; border-bottom: 0.5px solid #1e3a5f; color: #ccc; }
ul.main-navigation li > ul li a:hover { background: var(--blue); color: #fff; }
.menu-toggle { display: none; }

/* BREADCRUMB */
.breadcrumb-wrap { background: #fff; border-bottom: 0.5px solid #e0e8f0; padding: 7px 0; font-size: 11px; color: #888; }
.breadcrumb-wrap a { color: var(--blue); }
.breadcrumb-wrap span.sep { margin: 0 5px; color: #ccc; }

/* SECTION TITLES */
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-heading .bar { width: 4px; height: 22px; background: var(--blue); border-radius: 2px; flex-shrink: 0; }
.section-heading h2 { font-size: 16px; font-weight: 600; color: #111; }
.section-heading .see-all { margin-left: auto; font-size: 12px; color: var(--blue); }

/* AD ZONES */
.ad-zone-wrap { margin: 16px 0; text-align: center; }
.ad-zone-label { font-size: 9px; color: #bbb; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }

/* PDF GRID */
.pdf-featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 6px; }
@media (max-width: 640px) { .pdf-featured-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .pdf-featured-grid { grid-template-columns: 1fr; } }

.pdf-card { background: #fff; border: 0.5px solid #dde5f0; border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow 0.15s; }
.pdf-card:hover { box-shadow: var(--shadow); border-color: var(--blue); }
.pdf-card-thumb { height: 120px; background: var(--blue-bg); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.pdf-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdf-pages-badge { position: absolute; bottom: 6px; right: 8px; background: var(--blue); color: #fff; font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 3px; }
.pdf-card-body { padding: 12px; }
.pdf-card-cat { display: inline-block; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; background: var(--blue-bg); color: var(--blue-text); padding: 2px 8px; border-radius: 3px; margin-bottom: 6px; }
.pdf-card-title { font-size: 13px; font-weight: 600; color: #111; line-height: 1.35; margin-bottom: 10px; }
.pdf-card-title a { color: inherit; }
.pdf-card-title a:hover { color: var(--blue); }
.pdf-download-btn { display: block; width: 100%; background: var(--blue); color: #fff; border: none; padding: 8px; border-radius: var(--radius); font-size: 12px; font-weight: 600; text-align: center; cursor: pointer; transition: background 0.15s; text-decoration: none; }
.pdf-download-btn:hover { background: var(--blue-dark); color: #fff; }

/* ARTICLES GRID */
.articles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 500px) { .articles-grid { grid-template-columns: 1fr; } }

.article-card { background: #fff; border: 0.5px solid #dde5f0; border-radius: var(--radius-lg); overflow: hidden; display: flex; transition: box-shadow 0.15s; }
.article-card:hover { box-shadow: var(--shadow); border-color: var(--blue); }
.article-card-thumb { width: 90px; min-height: 90px; flex-shrink: 0; background: var(--blue-bg); overflow: hidden; }
.article-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card-body { padding: 10px 12px; flex: 1; min-width: 0; }
.article-card-cat { display: inline-block; font-size: 9px; font-weight: 600; text-transform: uppercase; background: var(--blue-bg); color: var(--blue-text); padding: 2px 7px; border-radius: 3px; margin-bottom: 4px; }
.article-card-title { font-size: 13px; font-weight: 600; color: #111; line-height: 1.3; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-card-title a { color: inherit; }
.article-card-title a:hover { color: var(--blue); }
.article-card-meta { font-size: 10px; color: #888; }

/* SINGLE POST */
.single-article { background: #fff; border-radius: var(--radius-lg); border: 0.5px solid #dde5f0; padding: 24px; }
.single-post-header { margin-bottom: 22px; border-bottom: 2px solid var(--blue); padding-bottom: 18px; }
.single-post-cat { display: inline-block; background: var(--blue); color: #fff; font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 3px 10px; border-radius: 3px; margin-bottom: 12px; }
.single-post-title { font-size: 24px; font-weight: 700; color: #111; line-height: 1.3; margin-bottom: 12px; }
.single-post-meta { font-size: 12px; color: #888; display: flex; gap: 16px; flex-wrap: wrap; }
.single-post-featured { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); margin-bottom: 22px; }

.pdf-download-box { background: var(--navy); border: 1px solid var(--blue); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; align-items: center; gap: 16px; margin: 24px 0; }
.pdf-download-box .pdf-icon { width: 44px; height: 44px; background: var(--blue); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pdf-download-box .pdf-icon svg { width: 22px; height: 22px; fill: #fff; }
.pdf-download-box .pdf-dl-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 3px; }
.pdf-download-box .pdf-dl-sub { font-size: 11px; color: #aaa; }
.pdf-download-box .pdf-dl-info { flex: 1; }
.pdf-download-box .pdf-dl-btn { background: var(--blue); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.pdf-download-box .pdf-dl-btn:hover { background: var(--blue-dark); color: #fff; }

.entry-content { font-size: 15px; line-height: 1.8; color: #333; }
.entry-content h2 { font-size: 19px; font-weight: 700; color: #111; margin: 28px 0 12px; padding-left: 12px; border-left: 4px solid var(--blue); }
.entry-content h3 { font-size: 16px; font-weight: 700; color: #111; margin: 22px 0 10px; }
.entry-content p { margin-bottom: 16px; }
.entry-content ul, .entry-content ol { margin-bottom: 16px; padding-left: 1.4rem; }
.entry-content li { margin-bottom: 6px; }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 14px; }
.entry-content table th { background: var(--blue); color: #fff; padding: 9px 12px; text-align: left; font-weight: 600; }
.entry-content table td { padding: 8px 12px; border-bottom: 0.5px solid #e0e8f0; }
.entry-content table tr:nth-child(even) td { background: var(--blue-bg); }
.entry-content .info-box { background: var(--blue-bg); border-left: 4px solid var(--blue); padding: 14px 16px; margin: 20px 0; border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; color: var(--blue-text); }

.post-tags { margin-top: 20px; padding-top: 16px; border-top: 0.5px solid #e0e8f0; }
.post-tags span { font-size: 12px; color: #888; margin-right: 8px; }
.post-tag { display: inline-block; font-size: 11px; background: #f0f4f8; color: #555; padding: 3px 10px; border-radius: 3px; border: 0.5px solid #dde5f0; margin: 2px; }
.post-tag:hover { border-color: var(--blue); color: var(--blue); }
.post-share { margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-share span { font-size: 12px; color: #888; }
.share-btn { padding: 7px 16px; border-radius: var(--radius); font-size: 12px; font-weight: 600; cursor: pointer; border: none; color: #fff; }
.share-fb { background: #1877f2; }
.share-wa { background: #25d366; }

/* SIDEBAR */
.sidebar .widget { background: #fff; border: 0.5px solid #dde5f0; border-radius: var(--radius-lg); padding: 16px; margin-bottom: 20px; }
.sidebar .widget-title { font-size: 12px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 0.5px solid #e0e8f0; }
.sb-pdf-item { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.sb-pdf-item:last-child { margin-bottom: 0; }
.sb-pdf-thumb { width: 40px; height: 50px; background: var(--blue-bg); border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-pdf-thumb svg { width: 18px; height: 18px; }
.sb-pdf-title { font-size: 12px; color: #111; line-height: 1.35; font-weight: 500; }
.sb-pdf-dl { font-size: 11px; color: var(--blue); display: block; margin-top: 3px; }
.sidebar .cat-item { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #333; padding: 6px 0; border-bottom: 0.5px solid #f0f4f8; }
.sidebar .cat-item:last-child { border-bottom: none; }
.sidebar .cat-item:hover { color: var(--blue); }
.sidebar .cat-item a { color: inherit; flex: 1; }
.sidebar .cat-count { font-size: 10px; background: #f0f4f8; color: #888; padding: 2px 7px; border-radius: 8px; }
.newsletter-widget input[type="email"] { width: 100%; padding: 9px 12px; border: 0.5px solid #dde5f0; border-radius: var(--radius); font-size: 13px; margin-bottom: 8px; background: #f8fafc; }
.newsletter-widget input[type="email"]:focus { outline: none; border-color: var(--blue); }
.newsletter-widget button { width: 100%; background: var(--blue); color: #fff; border: none; padding: 9px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; }
.newsletter-widget p { font-size: 12px; color: #888; margin-bottom: 10px; line-height: 1.5; }

/* PAGINATION */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 28px 0; flex-wrap: wrap; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0.5px solid #dde5f0; border-radius: var(--radius); font-size: 13px; color: #333; background: #fff; }
.page-numbers:hover, .page-numbers.current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* FOOTER */
#colophon { background: var(--navy); margin-top: 8px; }
.footer-widgets { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; padding: 32px 0 24px; border-bottom: 0.5px solid #1e3a5f; }
@media (max-width: 760px) { .footer-widgets { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .footer-widgets { grid-template-columns: 1fr; } }
.footer-col-title { font-size: 13px; font-weight: 700; color: var(--blue); margin-bottom: 12px; padding-bottom: 6px; border-bottom: 0.5px solid #1e3a5f; }
.footer-col p { font-size: 12px; color: #888; line-height: 1.7; }
.footer-col a { display: block; font-size: 12px; color: #aaa; margin-bottom: 6px; }
.footer-col a:hover { color: var(--blue); }
.footer-bottom { padding: 14px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-bottom p { font-size: 11px; color: #555; }
.footer-bottom a { color: #888; font-size: 11px; }
.footer-bottom a:hover { color: var(--blue); }

/* ACCESSIBILITY */
.screen-reader-text { clip: rect(1px,1px,1px,1px); position: absolute; height: 1px; width: 1px; overflow: hidden; }
a:focus, button:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
