:root {
  --apc-blue: #1f3b82;
  --apc-violet: #5b57e3;
  --apc-orange: #e56a2e;
  --apc-bg-soft: #f3f6fc;
  --apc-card: #ffffff;
  --apc-border-soft: #d8e1f0;
  --apc-text-main: #1f2f48;
  --apc-text-muted: #4a5f82;
  --apc-shadow-soft: 0 10px 24px rgba(24, 54, 94, 0.08);
  --apc-shadow-hover: 0 16px 30px rgba(24, 54, 94, 0.12);
  --apc-focus: 0 0 0 3px rgba(91, 87, 227, 0.28);
  --apc-radius-lg: 18px;
  --apc-radius-md: 14px;
  --apc-article-media-height: clamp(320px, 34vw, 500px);
}

body {
  background: var(--apc-bg-soft);
}

.apcto-article-primary {
  width: 100%;
}

.apcto-article-page {
  font-family: 'Source Sans 3', 'Inter', 'Segoe UI', sans-serif;
  color: var(--apc-text-main);
  padding-bottom: 3.2rem;
}

.apcto-article-page * {
  box-sizing: border-box;
}

.apcto-article-page h1,
.apcto-article-page h2,
.apcto-article-page h3 {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--apc-blue);
  letter-spacing: 0.01em;
}

.apcto-article-page a {
  color: var(--apc-blue);
}

.apcto-article-page a:hover,
.apcto-article-page a:focus-visible {
  color: #13306a;
}

.apcto-article-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  gap: 1.1rem;
}

.apcto-article-hero {
  background: var(--apc-card);
  border: 1px solid var(--apc-border-soft);
  border-radius: var(--apc-radius-lg);
  box-shadow: var(--apc-shadow-soft);
  padding: 1.15rem;
  display: grid;
  gap: 0.78rem;
}

.apcto-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  color: var(--apc-text-muted);
  font-size: 0.94rem;
}

.apcto-breadcrumb a {
  text-decoration: none;
  color: var(--apc-blue);
}

.apcto-hero-meta-row {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.apcto-article-hero h1 {
  margin: 0;
  font-size: clamp(1.48rem, 2.5vw, 2.12rem);
  line-height: 1.2;
}

.apcto-article-chapo {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.58;
  max-width: 78ch;
}

.apcto-hero-details {
  display: grid;
  gap: 0.34rem;
}

.apcto-hero-details p {
  margin: 0;
  line-height: 1.56;
}

.apcto-hero-details strong {
  color: var(--apc-blue);
}

.apcto-hero-body {
  display: grid;
  gap: 0.7rem;
  padding-top: 0.1rem;
}

.apcto-hero-body p {
  margin: 0;
  line-height: 1.6;
}

.apcto-hero-body ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.4rem;
}

.apcto-hero-body li {
  line-height: 1.55;
}

.apcto-hero-carousel {
  display: grid;
  gap: 0.62rem;
}

.apcto-hero-viewport {
  overflow: hidden;
  border: 1px solid #dbe4f2;
  border-radius: var(--apc-radius-md);
  background: linear-gradient(140deg, #dbe8ff, #f5f8ff);
}

.apcto-hero-track {
  display: flex;
  transition: transform 0.42s ease;
  will-change: transform;
}

.apcto-hero-slide {
  flex: 0 0 100%;
  min-width: 100%;
  margin: 0;
  position: relative;
}

.apcto-hero-slide img {
  width: 100%;
  height: var(--apc-article-media-height);
  display: block;
  object-fit: cover;
}

.apcto-hero-slide video {
  width: 100%;
  height: var(--apc-article-media-height);
  display: block;
  object-fit: cover;
}

.apcto-hero-placeholder {
  width: 100%;
  height: var(--apc-article-media-height);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  font-weight: 700;
  color: var(--apc-blue);
}

.apcto-hero-caption {
  margin: 0;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.52rem 0.72rem;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(180deg, rgba(18, 42, 88, 0), rgba(18, 42, 88, 0.78));
}

.apcto-hero-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.apcto-hero-nav {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid #d4d2ff;
  background: #fff;
  color: var(--apc-violet);
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.apcto-hero-nav:hover,
.apcto-hero-nav:focus-visible {
  outline: none;
  box-shadow: var(--apc-focus);
}

.apcto-hero-dots {
  display: inline-flex;
  gap: 0.34rem;
}

.apcto-hero-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  border: 1px solid #cfd9ea;
  background: #fff;
  padding: 0;
  cursor: pointer;
}

.apcto-hero-dot.is-active,
.apcto-hero-dot[aria-current='true'] {
  background: var(--apc-orange);
  border-color: var(--apc-orange);
}

.apcto-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--apc-card);
  border: 1px solid var(--apc-border-soft);
  border-radius: var(--apc-radius-md);
  box-shadow: var(--apc-shadow-soft);
  padding: 0.78rem;
}

.apcto-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #d7d4ff;
  border-radius: 999px;
  padding: 0.35rem 0.68rem;
  font-size: 0.92rem;
  color: var(--apc-blue);
  background: #fff;
}

.apcto-meta-chip::before {
  content: '';
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--apc-orange);
}

.apcto-meta-chip strong {
  font-weight: 700;
}

.apcto-article-layout {
  display: grid;
}

.apcto-article-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.apcto-nav-card {
  background: var(--apc-card);
  border: 1px solid var(--apc-border-soft);
  border-radius: 12px;
  box-shadow: var(--apc-shadow-soft);
  padding: 0.8rem;
  text-decoration: none;
  display: grid;
  gap: 0.32rem;
}

.apcto-nav-card small {
  font-size: 0.83rem;
  color: var(--apc-text-muted);
}

.apcto-nav-card strong {
  color: var(--apc-blue);
  line-height: 1.38;
}

.apcto-nav-card.is-disabled {
  opacity: 0.72;
}

.apcto-nav-card--back {
  border-color: #d7d4ff;
}

.apcto-related {
  display: grid;
  gap: 0.75rem;
}

.apcto-related-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.62rem);
}

.apcto-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.apcto-related-card {
  background: var(--apc-card);
  border: 1px solid var(--apc-border-soft);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--apc-shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apcto-related-card:hover,
.apcto-related-card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--apc-shadow-hover);
}

.apcto-related-media {
  display: block;
  aspect-ratio: 16 / 10;
  background: linear-gradient(140deg, #dbe7ff 0%, #f6f9ff 100%);
}

.apcto-related-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apcto-related-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.apcto-related-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--apc-blue);
  font-weight: 700;
  padding: 0.8rem;
  text-align: center;
}

.apcto-related-body {
  padding: 0.82rem;
  display: grid;
  gap: 0.55rem;
}

.apcto-related-body h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.34;
}

.apcto-related-body h3 a {
  text-decoration: none;
}

.apcto-related-body p {
  margin: 0;
  line-height: 1.52;
}

.apcto-follow-strip {
  background: var(--apc-card);
  border: 1px solid var(--apc-border-soft);
  border-radius: 12px;
  box-shadow: var(--apc-shadow-soft);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.apcto-follow-strip p {
  margin: 0;
  font-weight: 600;
  color: var(--apc-blue);
}

.apcto-follow-actions {
  display: inline-flex;
  gap: 0.5rem;
}

.apcto-follow-actions a {
  border: 1px solid #d7d4ff;
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  text-decoration: none;
  font-weight: 700;
}

.apcto-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.81rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: #fff;
}

.apcto-badge::before {
  content: '';
  width: 0.39rem;
  height: 0.39rem;
  border-radius: 999px;
  background: currentColor;
}

.apcto-badge--voirie {
  color: var(--apc-blue);
  background: #eff4ff;
}

.apcto-badge--urbanisme {
  color: var(--apc-violet);
  background: #f4f2ff;
}

.apcto-badge--hygiene {
  color: #2f6e57;
  background: #eef9f4;
}

.apcto-badge--social {
  color: #8d4d27;
  background: #fff4eb;
}

.apcto-badge--municipale {
  color: #2a4b7c;
  background: #eef2ff;
}

.apcto-date {
  color: var(--apc-text-muted);
  font-size: 0.89rem;
  white-space: nowrap;
}

.apcto-read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--apc-blue);
  text-decoration: none;
}

.apcto-read-link::after {
  content: '→';
  color: var(--apc-orange);
}

@media (max-width: 1080px) {
  .apcto-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 767px) {
  .apcto-article-shell {
    width: calc(100% - 1rem);
  }

  .apcto-article-hero,
  .apcto-article-content {
    padding: 0.95rem;
  }

  .apcto-related-grid,
  .apcto-article-nav {
    grid-template-columns: 1fr;
  }

  .apcto-hero-slide img,
  .apcto-hero-placeholder {
    height: 220px;
  }

  .apcto-meta-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .apcto-follow-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .apcto-hero-nav {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .apcto-related-card,
  .apcto-hero-track {
    transition: none !important;
  }
}
