/*
Theme Name: Umalis Blog v2
Theme URI: https://blog.umalis.pro/
Author: Umalis Group
Author URI: https://umalis.pro/
Description: Thème custom du blog Umalis (portage salarial B2B). Palette bleu corporate, Montserrat/Lato auto-hébergées, Gutenberg natif, featured image obligatoire avec fallback Umalis. Basé sur une architecture from-scratch (pas Twenty Twenty-Five).
Version: 2.0.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.0
License: Propriétaire (© Umalis Group)
Text Domain: umalis-blog
Domain Path: /languages
Tags: blog, custom-colors, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, block-templates, wide-blocks
*/

/* ==========================================================================
   0. RESET MODERNE
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.7;
  color: var(--umalis-text);
  background: var(--umalis-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

a { color: var(--umalis-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--umalis-accent); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--umalis-navy);
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.25em; }

/* ==========================================================================
   1. VARIABLES UMALIS
   ========================================================================== */
:root {
  /* Palette */
  --umalis-primary: #0c71c3;
  --umalis-accent: #04b0ee;
  --umalis-navy: #0a2540;
  --umalis-secondary: #2ea3f2;
  --umalis-text: #1f2937;
  --umalis-muted: #5b6b7b;
  --umalis-bg: #ffffff;
  --umalis-bg-soft: #f7f9fc;
  --umalis-border: #e5e9f0;

  /* Ombres */
  --umalis-shadow-sm: 0 1px 2px rgba(10,37,64,.05);
  --umalis-shadow: 0 4px 12px rgba(10,37,64,.08);
  --umalis-shadow-lg: 0 12px 32px rgba(10,37,64,.12);

  /* Rayons */
  --umalis-radius-sm: 6px;
  --umalis-radius: 10px;
  --umalis-radius-lg: 16px;

  /* Espacement */
  --umalis-container: 1200px;
  --umalis-container-narrow: 760px;
  --umalis-gap: 24px;
}

/* ==========================================================================
   2. LAYOUT GLOBAUX
   ========================================================================== */
.container { max-width: var(--umalis-container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--umalis-container-narrow); margin: 0 auto; padding: 0 24px; }

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; padding: 32px 0 64px; }

@media (min-width: 900px) {
  .site-main { padding: 48px 0 96px; }
}

/* Grille 2 colonnes (contenu + sidebar) */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 960px) {
  .layout-with-sidebar { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* Grille 3 colonnes pour les cards articles */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

/* ==========================================================================
   2.5 TOP SIMULATOR BAR
   ========================================================================== */
.top-simulator-bar {
  position: relative;
  z-index: 200;
  background: linear-gradient(135deg, var(--umalis-navy) 0%, #0d3b6e 100%);
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.top-simulator-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  color: #fff;
  text-decoration: none;
  transition: background .2s;
}

.top-simulator-bar a:hover {
  background: rgba(255,255,255,.08);
}

.top-simulator-bar__icon {
  font-size: 18px;
  line-height: 1;
}

.top-simulator-bar__text {
  white-space: nowrap;
}

.top-simulator-bar__arrow {
  color: var(--umalis-accent);
  font-size: 16px;
  transition: transform .2s;
}

.top-simulator-bar a:hover .top-simulator-bar__arrow {
  transform: translateX(4px);
}

@media (max-width: 600px) {
  .top-simulator-bar { font-size: 12px; }
  .top-simulator-bar a { padding: 8px 14px; gap: 6px; }
  .top-simulator-bar__icon { font-size: 15px; }
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  z-index: 100;
  background: var(--umalis-bg);
  border-bottom: 1px solid var(--umalis-border);
  box-shadow: var(--umalis-shadow-sm);
  backdrop-filter: saturate(180%) blur(8px);
  background-color: rgba(255,255,255,.92);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--umalis-container);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header__logo img { max-height: 44px; width: auto; }

.site-header__logo a { display: inline-flex; align-items: center; }

.site-header__nav { display: flex; align-items: center; gap: 28px; }

.site-header__nav a {
  color: var(--umalis-navy);
  font-weight: 600;
  font-size: 15px;
  font-family: var(--wp--preset--font-family--heading);
}

.site-header__nav a:hover { color: var(--umalis-primary); }

.site-header__cta {
  background: var(--umalis-primary);
  color: #fff !important;
  padding: 10px 18px;
  border-radius: var(--umalis-radius);
  font-size: 14px;
  transition: background .2s ease;
}
.site-header__cta:hover { background: var(--umalis-navy); color: #fff !important; }

@media (max-width: 720px) {
  .site-header__nav { display: none; }
  .site-header__cta { display: none; }
}

/* ==========================================================================
   4. HERO FEATURED (front-page)
   ========================================================================== */
.hero-featured {
  position: relative;
  margin-bottom: 56px;
  border-radius: var(--umalis-radius-lg);
  overflow: hidden;
  background: var(--umalis-bg-soft);
  box-shadow: var(--umalis-shadow);
}

.hero-featured__media {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.hero-featured__media img,
.hero-featured__media .wp-block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-featured__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--umalis-primary) 0%, var(--umalis-navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
  font-size: 28px;
}

.hero-featured__body {
  padding: 32px 28px;
}

@media (min-width: 768px) {
  .hero-featured {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: stretch;
  }
  .hero-featured__body { padding: 48px 44px; align-self: center; }
  .hero-featured__media { aspect-ratio: auto; height: 100%; }
}

.hero-featured__title {
  font-size: clamp(28px, 4vw, 44px);
  margin: 12px 0 16px;
  line-height: 1.15;
}

.hero-featured__excerpt {
  font-size: 17px;
  color: var(--umalis-muted);
  margin-bottom: 24px;
}

.hero-featured__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--umalis-muted);
  margin-bottom: 24px;
}

.hero-featured__meta .dot { color: var(--umalis-border); }

/* ==========================================================================
   5. BADGE CATÉGORIE
   ========================================================================== */
.badge-category {
  display: inline-block;
  background: var(--umalis-accent);
  color: #fff;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}
.badge-category:hover { background: var(--umalis-primary); color: #fff; transform: translateY(-1px); }

/* ==========================================================================
   6. CARTE ARTICLE
   ========================================================================== */
.card-article {
  background: var(--umalis-bg);
  border: 1px solid var(--umalis-border);
  border-radius: var(--umalis-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-article:hover {
  transform: translateY(-3px);
  box-shadow: var(--umalis-shadow-lg);
  border-color: transparent;
}

.card-article__media {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--umalis-bg-soft);
}
.card-article__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card-article:hover .card-article__media img { transform: scale(1.04); }

.card-article__placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--umalis-secondary) 0%, var(--umalis-primary) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-family: var(--wp--preset--font-family--heading);
}

.card-article__body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }

.card-article__title {
  font-size: 20px;
  line-height: 1.3;
  margin: 12px 0 10px;
}
.card-article__title a { color: var(--umalis-navy); }
.card-article__title a:hover { color: var(--umalis-primary); }

.card-article__excerpt {
  color: var(--umalis-muted);
  font-size: 15px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-article__meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--umalis-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   7. SIDEBAR
   ========================================================================== */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.widget {
  background: var(--umalis-bg-soft);
  border: 1px solid var(--umalis-border);
  border-radius: var(--umalis-radius);
  padding: 22px 22px 24px;
}

.widget__title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--umalis-navy);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--umalis-border);
}

.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--umalis-border); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--umalis-text); font-size: 15px; }
.widget a:hover { color: var(--umalis-primary); }

.widget-newsletter p { font-size: 14px; color: var(--umalis-muted); margin-bottom: 14px; }
.widget-newsletter input[type=email] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--umalis-border);
  border-radius: var(--umalis-radius-sm); font-size: 14px; margin-bottom: 10px;
}
.widget-newsletter button,
.btn-primary {
  display: inline-block; padding: 12px 22px; border: 0; cursor: pointer;
  background: var(--umalis-primary); color: #fff;
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700; font-size: 14px; border-radius: var(--umalis-radius);
  text-decoration: none; transition: background .2s ease;
}
.widget-newsletter button:hover,
.btn-primary:hover { background: var(--umalis-navy); color: #fff; }

/* ==========================================================================
   8. SINGLE ARTICLE
   ========================================================================== */
.article-header { text-align: center; margin-bottom: 40px; }

.article-header__meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px;
  font-size: 13px; color: var(--umalis-muted); margin-bottom: 16px;
  font-family: var(--wp--preset--font-family--heading);
  text-transform: uppercase; letter-spacing: .06em;
}

.article-header__title {
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.15;
  margin: 0 auto 16px;
  max-width: 820px;
}

.article-featured-image {
  aspect-ratio: 21/9;
  border-radius: var(--umalis-radius-lg);
  overflow: hidden;
  margin: 32px 0 48px;
  box-shadow: var(--umalis-shadow);
}
.article-featured-image img { width: 100%; height: 100%; object-fit: cover; }

.article-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--umalis-text);
}
.article-content h2 { font-size: 30px; margin-top: 2em; }
.article-content h3 { font-size: 24px; margin-top: 1.6em; }
.article-content a { color: var(--umalis-primary); text-decoration: underline; text-underline-offset: 3px; }
.article-content blockquote {
  border-left: 4px solid var(--umalis-primary);
  margin: 2em 0; padding: 8px 0 8px 24px;
  font-size: 22px; font-style: italic; color: var(--umalis-navy);
  font-family: var(--wp--preset--font-family--heading);
}
.article-content img { border-radius: var(--umalis-radius); margin: 2em auto; }
.article-content ul, .article-content ol { padding-left: 1.4em; }
.article-content li { margin-bottom: .5em; }

/* CTA inline dans article */
.inline-cta {
  background: linear-gradient(135deg, var(--umalis-primary) 0%, var(--umalis-navy) 100%);
  color: #fff;
  padding: 32px 28px;
  border-radius: var(--umalis-radius);
  text-align: center;
  margin: 40px 0;
}
.inline-cta h3 { color: #fff; margin: 0 0 8px; font-size: 22px; }
.inline-cta p { color: rgba(255,255,255,.9); margin-bottom: 20px; }
.inline-cta a.btn {
  background: #fff; color: var(--umalis-primary); padding: 12px 24px;
  border-radius: var(--umalis-radius); font-weight: 700; font-size: 15px;
  display: inline-block;
}

/* Articles similaires */
.related-posts { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--umalis-border); }
.related-posts__title { font-size: 24px; margin-bottom: 28px; }

/* ==========================================================================
   9. PAGINATION
   ========================================================================== */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.pagination a, .pagination span {
  display: inline-block; padding: 10px 16px; min-width: 44px; text-align: center;
  border: 1px solid var(--umalis-border); border-radius: var(--umalis-radius-sm);
  color: var(--umalis-navy); font-weight: 600; font-size: 14px;
}
.pagination a:hover { background: var(--umalis-primary); color: #fff; border-color: var(--umalis-primary); }
.pagination .current { background: var(--umalis-primary); color: #fff; border-color: var(--umalis-primary); }

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.site-footer {
  background: var(--umalis-navy);
  color: rgba(255,255,255,.85);
  padding: 56px 0 24px;
  margin-top: 64px;
}
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: var(--umalis-accent); }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.5fr repeat(3, 1fr); } }

.footer-brand__logo { max-height: 40px; margin-bottom: 16px; filter: brightness(0) invert(1); }
.footer-brand__text { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.7); }

.footer-col h4 {
  color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .08em;
  margin: 0 0 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; font-size: 14px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: 13px; color: rgba(255,255,255,.6);
}

/* ==========================================================================
   11. UTILITAIRES
   ========================================================================== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.visually-hidden {
  position: absolute !important; clip: rect(1px, 1px, 1px, 1px);
  width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}

/* Skip link accessibilité */
.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--umalis-primary); color: #fff; padding: 12px 20px;
  z-index: 9999; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   12. RESPONSIVE FIN
   ========================================================================== */
@media (max-width: 480px) {
  .hero-featured__body { padding: 24px 20px; }
  .card-article__body { padding: 18px; }
  .inline-cta { padding: 24px 20px; }
  .site-footer { padding: 40px 0 20px; }
}
