/* MobilePro Blog — Premium Tech Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --primary: #146ee4;
  --primary-hover: #1672e9;
  --secondary: #0d3366;
  --secondary-deep: #0f2e5c;
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(20, 110, 228, 0.12);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow: 0 8px 32px rgba(13, 51, 102, 0.08);
  --shadow-lg: 0 20px 50px rgba(13, 51, 102, 0.12);
  --radius: 1rem;
  --radius-lg: 1.25rem;
  --header-h: 4.5rem;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-hero: linear-gradient(135deg, #0d3366 0%, #146ee4 50%, #1672e9 100%);
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

[data-theme='dark'] {
  --bg: #0b0f19;
  --bg-elevated: #0f172a;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(20, 110, 228, 0.2);
  --glass: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(20, 110, 228, 0.25);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

.container {
  width: min(1200px, 100% - 2rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-link img { height: 2.25rem; width: auto; }
[data-theme='dark'] .logo-light { display: none; }
[data-theme='light'] .logo-dark,
:root:not([data-theme]) .logo-dark { display: none; }

.nav-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-main a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-main a:hover { color: var(--primary); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn-icon:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

.btn-icon svg { width: 1.15rem; height: 1.15rem; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 110, 228, 0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(20, 110, 228, 0.45);
  color: #fff !important;
}

.menu-toggle { display: none; }

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 3.5rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  opacity: 0.95;
  z-index: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../images/hero-bg.webp') center/cover no-repeat;
  opacity: 0.15;
  z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

.hero-content {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 2rem;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero p {
  color: rgba(248, 250, 252, 0.9);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.search-box {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  box-shadow: var(--shadow-lg);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  min-width: 0;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box button {
  padding: 0.65rem 1.1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: calc(var(--radius-lg) - 4px);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.search-box button:hover { background: var(--primary-hover); }

/* Featured carousel */
.featured-section { padding: 2.5rem 0 1rem; }

.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease-out;
}

.featured-card img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.featured-body { padding: 2rem 2rem 2rem 0; }

.featured-tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: rgba(20, 110, 228, 0.15);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.35rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.featured-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.featured-body h2 a { color: var(--text); }
.featured-body h2 a:hover { color: var(--primary); }

.featured-body p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Filters */
.filters-section { padding: 1.5rem 0; }

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Article grid */
.articles-section { padding: 1rem 0 3rem; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeInUp 0.5s ease-out backwards;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.article-card.hidden { display: none; }

.card-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .card-image img { transform: scale(1.05); }

.card-category {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: rgba(13, 51, 102, 0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 0.35rem;
}

.card-body { padding: 1.25rem; }

.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--primary); }

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  display: none;
}

.no-results.visible { display: block; }

/* Newsletter */
.newsletter-section {
  padding: 3rem 0 4rem;
}

.newsletter-box {
  text-align: center;
  padding: 2.5rem;
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.newsletter-box::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  top: -100px;
  right: -80px;
}

.newsletter-box h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.newsletter-box p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 440px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
}

.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.newsletter-form button:hover { background: var(--secondary-deep); }

.newsletter-success {
  display: none;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  margin-top: 1rem;
  animation: fadeInUp 0.4s ease;
}

.newsletter-success.visible { display: block; }

.newsletter-error {
  color: #fecaca;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

.newsletter-error.visible { display: block; }

/* Footer */
.site-footer {
  background: var(--secondary);
  color: #e2e8f0;
  padding: 3rem 0 1.5rem;
}

[data-theme='dark'] .site-footer { background: #060a12; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h4 {
  font-family: var(--font-display);
  color: #fff;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.footer-grid a {
  display: block;
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.footer-grid a:hover { color: #fff; }

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Article page */
.article-page { padding-bottom: 3rem; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 1.25rem 0;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-muted); }

.article-header {
  margin-bottom: 2rem;
}

.article-header .article-category {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: rgba(20, 110, 228, 0.12);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 0.35rem;
  margin-bottom: 0.75rem;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  aspect-ratio: 21/9;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
}

.article-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.toc-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.toc-sidebar h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toc-list { list-style: none; }

.toc-list a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  padding-left: 0.65rem;
  transition: all var(--transition);
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--primary);
  border-left-color: var(--primary);
}

.article-content {
  font-size: 1.05rem;
  max-width: 72ch;
}

.article-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 2rem 0 0.85rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.article-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 1.5rem 0 0.65rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.article-content p { margin-bottom: 1.15rem; }

.article-content ul,
.article-content ol {
  margin: 0 0 1.15rem 1.5rem;
}

.article-content li { margin-bottom: 0.4rem; }

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(20, 110, 228, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.share-bar span {
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  align-self: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.share-btn.copied {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.article-cta {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--gradient-hero);
  border-radius: var(--radius-lg);
  color: #fff;
  text-align: center;
}

.article-cta h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.article-cta p {
  opacity: 0.9;
  margin-bottom: 1.25rem;
}

.article-cta .btn-primary {
  background: #fff;
  color: var(--secondary) !important;
  box-shadow: var(--shadow);
}

.article-cta .btn-primary:hover {
  color: var(--primary) !important;
}

/* Boutons d'achat catalogue */
.shop-actions {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.shop-actions-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.shop-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.shop-loading {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn-shop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff !important;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(20, 110, 228, 0.3);
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: left;
}

.btn-shop:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(20, 110, 228, 0.4);
  color: #fff !important;
}

.btn-shop-name {
  flex: 1;
  line-height: 1.3;
}

.btn-shop-price {
  white-space: nowrap;
  font-size: 0.95rem;
}

.btn-shop-price s {
  opacity: 0.75;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 0.35rem;
}

.btn-shop-catalog {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.btn-shop-catalog:hover {
  color: var(--primary-hover);
}

.btn-shop-primary {
  justify-content: center;
}

.shop-actions--inline .shop-actions-list {
  flex-direction: row;
  flex-wrap: wrap;
}

.shop-actions--inline .btn-shop {
  flex: 1 1 220px;
  flex-direction: column;
  align-items: flex-start;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-toggle-icon {
  transition: transform 0.4s ease;
}

[data-theme='dark'] .theme-toggle-icon { transform: rotate(180deg); }

/* Responsive */
@media (max-width: 900px) {
  .featured-card { grid-template-columns: 1fr; }
  .featured-body { padding: 1.5rem; }
  .article-layout { grid-template-columns: 1fr; }
  .toc-sidebar { position: static; order: -1; }
}

@media (max-width: 768px) {
  .nav-main { display: none; }
  .nav-main.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .menu-toggle { display: flex; }
  .hero { padding: 2.5rem 0 2rem; }
}

@media (max-width: 480px) {
  .articles-grid { grid-template-columns: 1fr; }
  .search-box { flex-direction: column; padding: 0.75rem; }
  .search-box button { width: 100%; }
}
