/*
Theme Name: CDD Theme
Author: SEOO 500 France
Description: Theme WordPress clair pour Comment Devenir Developpeur.
Version: 1.1
Text Domain: cddtheme
*/

:root {
  --bg: #f6f8fb;
  --bg-elevated: #ffffff;
  --surface: #eef3f8;
  --surface-strong: #e3ebf5;
  --text: #172033;
  --text-soft: #5f6b85;
  --border: #d8e1ec;
  --accent: #004182;
  --accent-strong: #00315f;
  --accent-soft: #e6eef8;
  --accent-ink: #002b57;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
  --radius: 22px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.1), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 30%, #f2f6fb 100%);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover,
a:focus {
  color: var(--accent);
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar {
  margin-top: 18px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.06);
  backdrop-filter: blur(12px);
}

.navbar.scrolled {
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.1);
}

.navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text) !important;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: linear-gradient(135deg, #dff7f2, #edf8ff);
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand-text span {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.navbar .nav-link,
.dropdown-item {
  font-family: Arial, Helvetica, sans-serif;
}

.navbar .nav-link {
  color: var(--text) !important;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
  color: var(--accent-ink) !important;
  background: var(--accent-soft);
}

.dropdown-menu {
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dropdown-item {
  border-radius: 12px;
  color: var(--text);
  padding: 10px 14px;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.navbar-toggler {
  border: 1px solid var(--border) !important;
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(23,32,51,0.85)' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.hero {
  position: relative;
  margin-top: 24px;
  padding: 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92) 38%, rgba(239, 246, 255, 0.96)),
    url('images/bg.png') center/cover no-repeat;
  opacity: 0.22;
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 28px;
  padding: 54px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(2.5rem, 4vw, 4.4rem);
  line-height: 0.98;
  color: var(--text);
}

.hero p {
  margin: 0;
  max-width: 58ch;
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-aside {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: grid;
  gap: 14px;
}

.hero-card {
  padding: 22px;
  background: linear-gradient(180deg, #ffffff, #f6fbff);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.hero-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.hero-card p,
.hero-card ul {
  margin: 0;
  color: var(--text);
}

.hero-card ul {
  padding-left: 18px;
}

.btn-custom,
.btn-custom-outline,
.search-modal-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-custom {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.2);
}

.btn-custom:hover,
.btn-custom:focus,
.search-modal-submit:hover,
.search-modal-submit:focus {
  color: #ffffff !important;
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-custom-outline {
  color: var(--accent-ink);
  background: #ffffff;
  border: 1px solid var(--border);
}

.btn-custom-outline:hover,
.btn-custom-outline:focus {
  background: var(--surface);
  color: var(--accent-ink);
}

.section-heading,
.retro-title,
.search-page-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.08;
}

.section-intro,
.blog-description {
  max-width: 72ch;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.8;
}

.blog-section {
  padding: 42px 0 24px;
}

.section-shell {
  display: grid;
  gap: 28px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.blog-card,
#articles .card {
  height: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(23, 32, 51, 0.05);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.blog-card:hover,
#articles .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(23, 32, 51, 0.09);
  border-color: #c8d6e6;
}

.blog-card > a,
#articles .card > a {
  display: block;
}

.blog-card img,
#articles .card-img-top {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
}

.blog-card-body,
#articles .card-body {
  padding: 22px;
}

.blog-card h2,
.blog-card h5,
#articles .card-title {
  margin: 0 0 10px;
  font-size: 1.22rem;
  line-height: 1.35;
}

.blog-card h2 a,
.blog-card h5 a,
#articles .card-title a {
  color: var(--text) !important;
}

.blog-card h2 a:hover,
.blog-card h5 a:hover,
#articles .card-title a:hover {
  color: var(--accent) !important;
}

.blog-card p,
#articles .date-article,
.blog-card small {
  color: var(--text-soft) !important;
}

.blog-card-body p {
  font-size: 0.92rem;
  line-height: 1.6;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.content-shell,
.archive-shell,
.search-shell,
.page-shell,
.single-shell {
  padding: 44px 0 24px;
}

.article-shell {
  padding: 36px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.entry-content,
.entry-content p,
.entry-content li {
  font-size: 1.06rem;
  line-height: 1.85;
  color: var(--text);
}

.entry-content > *:first-child {
  margin-top: 0;
}

.btc-line {
  width: 72px;
  height: 4px;
  margin: 16px 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #72cfc6);
}

.retro-categories {
  padding: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(23, 32, 51, 0.05);
  position: sticky;
  top: 110px;
}

.retro-categories h3,
.similar {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1.25rem;
  font-family: Arial, Helvetica, sans-serif;
}

.retro-categories ul,
.related-posts-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.retro-categories li,
.related-posts-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.retro-categories li:last-child,
.related-posts-list li:last-child {
  border-bottom: 0;
}

.retro-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.retro-pagination a,
.retro-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.retro-pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.others-articles a,
.category-link,
.related-posts-list a {
  color: var(--accent-strong);
}

.author,
.post-categories {
  color: var(--text-soft);
  font-family: Arial, Helvetica, sans-serif;
}

footer {
  margin: 54px 0 28px;
  padding: 30px 0 10px;
  border-top: 1px solid rgba(216, 225, 236, 0.8);
  color: var(--text-soft);
}

.search-modal[hidden] {
  display: none;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120000;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, 0.45);
}

.search-modal-dialog {
  position: relative;
  width: min(920px, calc(100% - 24px));
  margin: 70px auto 0;
  padding: 24px;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.search-modal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.search-modal-input,
.mobile-search-input,
.search-modal-trigger {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  padding: 0 18px;
  font-size: 1rem;
}

.search-modal-input:focus,
.mobile-search-input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.14);
  border-color: rgba(15, 118, 110, 0.34);
}

.mobile-search-wrap {
  position: relative;
  width: min(48vw, 240px);
}

.mobile-search-input-wrap {
  position: relative;
}

.mobile-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
}

.mobile-search-input {
  padding-left: 40px;
}

.mobile-search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1100;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(23, 32, 51, 0.08);
}

.mobile-search-suggestions li a {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  color: var(--text);
}

.mobile-search-suggestions li a:hover {
  background: var(--surface);
}

.mobile-search-suggestions li a img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
}

.mobile-search-meta {
  display: grid;
  gap: 2px;
}

.mobile-search-date,
.mobile-search-suggestions li.is-loading span {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.mobile-bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: 20px;
  box-shadow: 0 18px 36px rgba(23, 32, 51, 0.1);
  backdrop-filter: blur(10px);
}

.mobile-bottom-nav__item {
  padding: 10px 8px;
  border-radius: 14px;
  text-align: center;
  color: var(--text-soft);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.mobile-bottom-nav__item.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

@media (max-width: 991.98px) {
  .navbar {
    padding: 12px 14px;
  }

  .hero {
    padding: 28px 0 12px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    padding: 28px;
  }

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

  .article-shell,
  .retro-categories {
    padding: 24px;
  }
}

@media (max-width: 767.98px) {
  .page-container {
    padding: 0 14px 92px;
  }

  .navbar {
    margin-top: 12px;
    border-radius: 18px;
  }

  .brand-text span {
    display: none;
  }

  .hero-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-actions,
  .search-modal-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .mobile-search-wrap {
    width: min(46vw, 180px);
  }
}

.wp-block-code {
  margin: 1.5rem 0;
}

.wp-block-code code {
  display: block;
  padding: 16px 18px;
  border-radius: 16px;
  background: #050505;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.96rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
