/*
Theme Name: Remorque KG
Theme URI: https://remorque-kg.fr
Author: Metin
Author URI: https://remorque-kg.fr
Description: Thème blog clair et lisible, centré sur les articles, pour remorque-kg.fr (remorques voiture, tracteur, etc.)
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: remorque-kg
*/

:root {
  --bg-body: #f5f5f7;
  --bg-card: #ffffff;
  --bg-hero: #0f172a;
  --accent: #f97316;    /* orange remorque / signalisation */
  --accent-soft: rgba(249, 115, 22, 0.1);
  --accent-dark: #ea580c;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius-lg: 18px;
  --radius-md: 10px;
  --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-body);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  line-height: 1.7;
}

/* ====================== */
/* LAYOUT GLOBAL          */
/* ====================== */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.15fr);
  gap: 1.8rem;
}

@media (max-width: 900px) {
  .site-main {
    grid-template-columns: 1fr;
  }
}

/* ====================== */
/* HEADER                 */
/* ====================== */

.site-header {
  background: var(--bg-hero);
  color: #e5e7eb;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: radial-gradient(circle at 20% 20%, #f97316, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fefce8;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.site-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.site-title a {
  color: #e5e7eb;
  text-decoration: none;
}

.site-description {
  margin: 0.1rem 0 0;
  font-size: 0.85rem;
  color: #cbd5f5;
}

/* Navigation */

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  color: #e5e7eb;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  transition: 0.18s ease;
}

.primary-nav a::before {
  content: "> ";
  font-size: 0.85rem;
  color: var(--accent);
}

.primary-nav a:hover,
.primary-nav .current-menu-item a {
  border-color: rgba(249, 115, 22, 0.65);
  background: rgba(15, 23, 42, 0.9);
}

@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-nav {
    width: 100%;
  }

  .primary-nav ul {
    gap: 0.5rem;
  }
}

/* ====================== */
/* LISTE D'ARTICLES       */
/* ====================== */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Carte article */

.post-card {
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Image à la une */

.post-card-thumb {
  position: relative;
  overflow: hidden;
}

.post-card-thumb img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.03);
}

/* Contenu carte */

.post-card-body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.post-meta span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.6);
}

.post-card-title {
  margin: 0;
  font-size: 1.25rem;
}

.post-card-title a {
  color: var(--text-main);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--accent-dark);
}

.post-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Pagination */

.pagination {
  margin-top: 1.5rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  margin-right: 0.25rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.85rem;
  text-decoration: none;
}

.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ====================== */
/* PAGE ARTICLE (single)  */
/* ====================== */

.single .site-main {
  max-width: 900px;
  grid-template-columns: minmax(0, 1fr);
}

.post-single {
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 1.6rem 1.5rem 1.5rem;
}

.post-single-header {
  margin-bottom: 1rem;
}

.post-single-header .post-meta {
  margin-bottom: 0.4rem;
}

.post-single-title {
  margin: 0;
  font-size: 1.8rem;
}

/* Image à la une de l'article, réduite et centrée */

.single-thumb {
  width: 70%;
  margin: 1rem auto 1.6rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  line-height: 0;
  display: flex;
  justify-content: center;
}

.single-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Contenu article */

.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #111827;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-single .post-content {
  max-width: 70ch;
}

/* Titres dans l'article */

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5 {
  margin-top: 2rem;
  margin-bottom: 0.7rem;
  line-height: 1.3;
  color: var(--accent-dark);
  font-weight: 600;
}

.post-content h2 {
  font-size: 1.4rem;
  position: relative;
  padding-bottom: 0.3rem;
}

.post-content h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.post-content h3 {
  font-size: 1.2rem;
}

.post-content h4 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-content h5 {
  font-size: 0.95rem;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Listes */

.post-content ul,
.post-content ol {
  margin: 0 0 1rem 1.4rem;
  padding: 0;
}

.post-content li {
  margin-bottom: 0.35rem;
}

/* Blockquote */

.post-content blockquote {
  margin: 1.2rem 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--accent);
  background: #fef3c7;
  border-radius: 0 10px 10px 0;
  color: #78350f;
}

/* Liens dans l'article */

.post-content a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.post-content a:hover {
  text-decoration-thickness: 2px;
}

/* Code */

pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

pre {
  background: #0f172a;
  color: #e5e7eb;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  overflow-x: auto;
}

/* Bloc articles récents sous un article ou une page */

.recent-posts {
  max-width: 900px;
  margin: 2rem auto 0;
  padding: 1.2rem 1.3rem 1.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.recent-posts-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
}

.recent-posts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.recent-post-item {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f9fafb;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.recent-post-thumb img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.recent-post-content {
  padding: 0.7rem 0.8rem 0.9rem;
}

.recent-post-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.recent-post-title {
  margin: 0 0 0.4rem;
  font-size: 0.96rem;
}

.recent-post-title a {
  color: var(--text-main);
  text-decoration: none;
}

.recent-post-title a:hover {
  color: var(--accent-dark);
}

.recent-post-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-height: 3.6em;
  overflow: hidden;
}

/* ====================== */
/* PAGES (Mentions, etc.) */
/* ====================== */

.page .site-main {
  max-width: 900px;
  grid-template-columns: minmax(0, 1fr);
}

.page-single {
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 1.6rem 1.5rem 1.5rem;
}

.page-content {
  font-size: 1rem;
  line-height: 1.8;
}

.page-content p {
  margin-bottom: 1rem;
}

/* ====================== */
/* SIDEBAR                */
/* ====================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

@media (max-width: 900px) {
  .sidebar {
    order: -1;
  }
}

.widget {
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0.9rem 1rem 1rem;
  box-shadow: var(--shadow-soft);
}

.widget-title {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
}

.widget-title::before {
  content: "0x";
  color: var(--accent);
  margin-right: 0.4rem;
  font-family: ui-monospace, monospace;
}

/* Liens sidebar */

.sidebar a {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  background: rgba(249, 250, 251, 0.85);
  border: 1px solid rgba(229, 231, 235, 0.9);
  font-size: 0.9rem;
  transition: 0.18s ease;
}

.sidebar a:hover {
  background: var(--accent-soft);
  border-color: rgba(249, 115, 22, 0.4);
  color: var(--accent-dark);
}

/* Liste des derniers articles (widget Gutenberg) */

.wp-block-latest-posts__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-block-latest-posts__post-title {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  background: rgba(249, 250, 251, 0.9);
  border: 1px solid rgba(229, 231, 235, 0.9);
  color: var(--text-main);
  text-decoration: none !important;
  font-size: 0.9rem;
  transition: 0.18s ease;
}

.wp-block-latest-posts__post-title::after {
  content: "↗";
  margin-left: auto;
  opacity: 0.3;
  font-size: 0.8rem;
}

.wp-block-latest-posts__post-title:hover {
  background: var(--accent-soft);
  border-color: rgba(249, 115, 22, 0.4);
  color: var(--accent-dark);
}

/* Catégories */

.widget_categories ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.widget_categories li {
  margin: 0;
}

.widget_categories a {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

/* ====================== */
/* FOOTER                 */
/* ====================== */

.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 1rem 1.2rem 1.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.footer-inner a {
  color: var(--accent-dark);
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
}

/* Liens généraux */

a {
  color: var(--accent-dark);
}

a:hover {
  text-decoration: underline;
}
