/*
Theme Name: Data Suisse
Theme URI: https://datasuisse.ch/
Author: Data Suisse
Description: Thème bloc WordPress sobre, moderne et responsive pour un site de données civiques. Compatible avec l’éditeur de site, les modèles modifiables, les patterns et les carousels natifs.
Version: 0.2.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: datasuisse
Tags: full-site-editing, block-patterns, block-styles, editor-style, custom-logo, featured-images, wide-blocks, education, blog
*/

:root {
  --ds-bg: #f6f7f8;
  --ds-surface: #ffffff;
  --ds-surface-soft: #eef2f4;
  --ds-text: #172027;
  --ds-muted: #5f6e78;
  --ds-faint: #d9e0e4;
  --ds-accent: #1f6f78;
  --ds-accent-dark: #164f56;
  --ds-accent-soft: #dcecee;
  --ds-warning: #9a6418;
  --ds-danger: #9e2a2b;
  --ds-success: #28784c;
  --ds-radius-sm: 8px;
  --ds-radius: 16px;
  --ds-radius-lg: 28px;
  --ds-shadow: 0 16px 50px rgba(18, 31, 38, .08);
  --ds-shadow-soft: 0 8px 24px rgba(18, 31, 38, .06);
  --ds-container: 1120px;
  --ds-readable: 760px;
  --ds-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ds-serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--ds-font);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
a { color: var(--ds-accent); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--ds-accent-dark); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.wp-site-blocks { min-height: 100vh; display: flex; flex-direction: column; }
.wp-site-blocks > main { flex: 1; }

.wp-block-group.alignwide,
.alignwide { max-width: var(--ds-container); margin-left: auto; margin-right: auto; }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }

.wp-block-post-content > *,
.entry-content > * { margin-block-start: 1.25rem; margin-block-end: 1.25rem; }
.wp-block-post-content > :first-child { margin-block-start: 0; }
.wp-block-post-content > :last-child { margin-block-end: 0; }

.ds-site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 247, 248, .88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(217, 224, 228, .76);
}
.admin-bar .ds-site-header { top: 32px; }
.ds-site-header a { text-decoration: none; }
.ds-header-inner { min-height: 76px; }
.ds-brand-row .wp-block-site-title { font-weight: 800; letter-spacing: -.03em; }
.ds-brand-row .wp-block-site-title a { color: var(--ds-text); }
.ds-brand-row .wp-block-site-tagline { color: var(--ds-muted); font-size: .86rem; margin: 0; }
.wp-block-navigation a { color: var(--ds-text); }
.wp-block-navigation a:hover { color: var(--ds-accent); }

.ds-site-footer {
  background: #111a20;
  color: rgba(255,255,255,.78);
  margin-top: 56px;
}
.ds-site-footer a { color: #fff; }
.ds-site-footer .wp-block-navigation a { color: rgba(255,255,255,.82); }
.ds-site-footer .wp-block-navigation a:hover { color: #fff; }

.ds-hero {
  padding: clamp(46px, 8vw, 96px) 0;
  background:
    radial-gradient(circle at 80% 10%, rgba(31,111,120,.16), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--ds-bg) 100%);
}
.ds-hero-card {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--ds-faint);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow);
  padding: clamp(24px, 5vw, 56px);
}
.ds-kicker,
.ds-hero-kicker {
  color: var(--ds-accent);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
}
.ds-hero h1,
.ds-hero-title,
.wp-block-post-title {
  letter-spacing: -.045em;
  line-height: 1.06;
}
.ds-muted { color: var(--ds-muted); }

.ds-button,
.wp-block-button .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--ds-accent);
  color: #fff;
  border: 1px solid var(--ds-accent);
  padding: 11px 18px;
  text-decoration: none;
  font-weight: 760;
  box-shadow: 0 10px 24px rgba(31, 111, 120, .18);
}
.ds-button:hover,
.wp-block-button .wp-block-button__link:hover { background: var(--ds-accent-dark); color: #fff; }
.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--ds-accent);
  box-shadow: none;
}

.ds-card,
.wp-block-query .wp-block-post,
.wp-block-post-template .wp-block-post {
  background: var(--ds-surface);
  border: 1px solid var(--ds-faint);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow-soft);
}
.wp-block-post-template .wp-block-post { padding: 24px; }
.wp-block-post-featured-image img { border-radius: var(--ds-radius); }
.wp-block-post-title a { text-decoration: none; color: var(--ds-text); }
.wp-block-post-title a:hover { color: var(--ds-accent); }
.wp-block-post-excerpt { color: var(--ds-muted); }

.ds-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface);
  border: 1px solid var(--ds-faint);
  box-shadow: var(--ds-shadow);
  margin: 24px auto;
}
.ds-carousel__viewport { overflow: hidden; }
.ds-carousel__track { display: flex; transition: transform .45s ease; will-change: transform; }
.ds-carousel__slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  min-height: 410px;
}
.ds-carousel__media { display: block; min-height: 100%; background: var(--ds-accent-soft); overflow: hidden; }
.ds-carousel__image,
.ds-carousel__media img { width: 100%; height: 100%; object-fit: cover; }
.ds-fallback-visual {
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ds-accent-soft), #f8fafb);
  color: var(--ds-accent-dark);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 900;
  letter-spacing: -.08em;
}
.ds-carousel__content {
  padding: clamp(24px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ds-carousel__kicker {
  margin: 0 0 8px;
  color: var(--ds-accent);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .76rem;
}
.ds-carousel__title { margin: 0; font-size: clamp(1.8rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -.045em; }
.ds-carousel__title a { color: var(--ds-text); text-decoration: none; }
.ds-carousel__excerpt { color: var(--ds-muted); margin-top: 18px; }
.ds-carousel__controls {
  position: absolute;
  inset: auto 20px 20px auto;
  display: flex;
  gap: 10px;
}
.ds-carousel__button,
.ds-carousel__dot {
  border: 1px solid var(--ds-faint);
  background: rgba(255,255,255,.92);
  color: var(--ds-text);
}
.ds-carousel__button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}
.ds-carousel__dots {
  position: absolute;
  left: 22px;
  bottom: 28px;
  display: flex;
  gap: 8px;
}
.ds-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  padding: 0;
}
.ds-carousel__dot[aria-current="true"] { background: var(--ds-accent); border-color: var(--ds-accent); }

.ds-fsq-section,
.sfq-quiz,
.sfq-question {
  background: var(--ds-surface);
  border: 1px solid var(--ds-faint);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-soft);
  padding: clamp(18px, 3vw, 30px);
  margin: 24px 0;
}
.sfq-question button,
.sfq-quiz button { border-radius: 999px; }
.sfq-feedback,
.sfq-correction,
.sfq-source,
.sfq-explanation {
  border-radius: var(--ds-radius);
  background: var(--ds-surface-soft);
  border: 1px solid var(--ds-faint);
  padding: 14px 16px;
}
.sfq-chart,
.sfq-chart-wrap {
  background: var(--ds-surface);
  border: 1px solid var(--ds-faint);
  border-radius: var(--ds-radius);
  padding: 16px;
}
.sfq-card,
.sfq-option,
.sfq-answer-option { border-radius: var(--ds-radius) !important; }

.wp-block-separator { border-color: var(--ds-faint); opacity: 1; }
.wp-block-table table { border-collapse: separate; border-spacing: 0; border: 1px solid var(--ds-faint); border-radius: var(--ds-radius); overflow: hidden; background: #fff; }
.wp-block-table td,
.wp-block-table th { border-color: var(--ds-faint); padding: 12px 14px; }

.pagination,
.nav-links { display: flex; gap: 8px; justify-content: center; margin-top: 34px; }
.nav-links a,
.nav-links span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ds-surface);
  border: 1px solid var(--ds-faint);
  text-decoration: none;
}
.nav-links .current { background: var(--ds-accent); color: #fff; border-color: var(--ds-accent); }

@media (max-width: 880px) {
  .admin-bar .ds-site-header { top: 0; }
  .ds-carousel__slide { grid-template-columns: 1fr; min-height: auto; }
  .ds-carousel__media { min-height: 240px; }
  .ds-carousel__controls { inset: 16px 16px auto auto; }
  .ds-carousel__dots { left: 18px; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
