/* ==========================================================================
   Yvelines Médiation Territoriale — Theme styles
   Palette : bleu institutionnel apaisant + vert-bleu "médiation"
   ========================================================================== */

:root {
  --color-primary: #1f3a5f;
  --color-primary-dark: #16293f;
  --color-primary-light: #3a5d85;
  --color-accent: #5fa88f;
  --color-accent-dark: #468673;
  --color-accent-light: #e7f3ef;
  --color-bg: #faf9f6;
  --color-surface: #ffffff;
  --color-text: #2b2e33;
  --color-text-muted: #6b7280;
  --color-border: #e3e1da;

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container-width: 1140px;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(31, 58, 95, 0.08);
}

/* ----- Reset & base ----- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

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

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

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary-dark);
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ----- Header ----- */
.site-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
}

.logo {
  max-height: 48px;
  width: auto;
}

.main-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu__item {
  display: inline-flex;
}

.nav-menu__link {
  color: var(--color-primary);
  font-weight: 600;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-menu__link:hover {
  color: var(--color-accent-dark);
  border-bottom-color: var(--color-accent);
}

/* ----- Hero / page intro ----- */
.hero {
  padding: 40px 0 24px;
}

.page-title {
  font-size: 2.1rem;
  margin: 0 0 20px;
}

.hero-thumbnail {
  width: 100%;
  min-height: 240px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  background-color: var(--color-accent-light);
  margin-bottom: 24px;
}

.page-content {
  font-size: 1.05rem;
  color: var(--color-text);
  max-width: 760px;
}

.page-content p {
  margin: 0 0 1em;
}

/* ----- Sections ----- */
.section-title {
  font-size: 1.5rem;
  margin: 0 0 20px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.showcase-section,
.related-section {
  padding-bottom: 40px;
}

/* ----- Post grid & cards ----- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 28px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(31, 58, 95, 0.12);
}

.post-card__thumb-link {
  display: block;
}

.post-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background-color: var(--color-accent-light);
}

.post-card__body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-card__date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.post-card__title {
  font-size: 1.15rem;
  margin: 0;
}

.post-card__title a {
  color: var(--color-primary-dark);
}

.post-card__excerpt {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ----- Pagination ----- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-weight: 600;
}

.pagination__item--active {
  background-color: var(--color-primary);
  color: #fff !important;
  border-color: var(--color-primary);
}

/* ----- Breadcrumb ----- */
.breadcrumb,
[class*="breadcrumb"] {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 24px 0 12px;
}

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

/* ----- Single post ----- */
.post-title {
  font-size: 2rem;
  margin: 8px 0 16px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.post-meta__category {
  background-color: var(--color-accent-light);
  color: var(--color-accent-dark);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.post-thumbnail {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 32px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-layout {
  display: flex;
  flex-direction: column-reverse;
  gap: 32px;
}

.post-toc {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.9rem;
}

.post-content {
  font-size: 1.05rem;
  max-width: 760px;
}

.post-content h2 {
  font-size: 1.5rem;
  margin: 2em 0 0.6em;
}

.post-content h3 {
  font-size: 1.2rem;
  margin: 1.6em 0 0.5em;
}

.post-content p {
  margin: 0 0 1.2em;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
}

.post-content img {
  border-radius: var(--radius);
  margin: 1.5em 0;
}

.post-signatory {
  margin: 40px 0;
  padding: 20px;
  border-radius: var(--radius);
  background-color: var(--color-accent-light);
}

/* ----- Footer ----- */
.site-footer {
  background-color: var(--color-primary-dark);
  color: #e8edf3;
  margin-top: 48px;
}

.footer-inner {
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.footer-tagline {
  margin: 0;
  font-size: 1rem;
  color: #cdd9e6;
}

.footer-copyright {
  margin: 0;
  font-size: 0.85rem;
  color: #9fb1c4;
}

.site-footer a {
  color: #e8edf3;
  text-decoration: underline;
}

/* ==========================================================================
   Responsive breakpoints
   xs: 320px / sm: 480px / md: 720px / lg: 992px / xl: 1200px / xxl: 1400px
   ========================================================================== */

/* sm */
@media (min-width: 480px) {
  .page-title {
    font-size: 2.3rem;
  }
}

/* md */
@media (min-width: 720px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-layout {
    flex-direction: row;
  }

  .post-toc {
    flex: 0 0 240px;
    align-self: flex-start;
    position: sticky;
    top: 20px;
  }

  .post-content {
    flex: 1 1 auto;
  }
}

/* lg */
@media (min-width: 992px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .post-title {
    font-size: 2.4rem;
  }
}

/* xl */
@media (min-width: 1200px) {
  .container {
    padding: 0 32px;
  }

  .hero-thumbnail {
    min-height: 320px;
  }
}

/* xxl */
@media (min-width: 1400px) {
  :root {
    --container-width: 1280px;
  }
}
