/*
 * Vivre La Roche - Accessible Light Theme
 * WCAG AA compliant with high contrast ratios
 * Designed for readability and visual accessibility
 */

:root {
  /* Light theme colors - WCAG AA compliant */
  --bg-primary: #fafaf9; /* Warm off-white background */
  --bg-secondary: #ffffff; /* Pure white for cards */
  --text-primary: #1f2937; /* Dark gray - excellent contrast */
  --text-secondary: #4b5563; /* Medium gray for secondary text */
  --text-muted: #6b7280; /* Light gray for hints */

  /* Accent colors - accessible and warm */
  --accent-primary: #059669; /* Green - represents nature, community */
  --accent-light: #d1fae5; /* Light green for backgrounds */
  --accent-hover: #047857; /* Darker green for hover */

  /* Semantic colors */
  --success: #059669;
  --success-bg: #d1fae5;
  --success-border: #6ee7b7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;

  /* UI elements */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Focus outline for accessibility */
  --focus-ring: 0 0 0 3px rgba(5, 150, 105, 0.3);

  /* Background gradient */
  --bg-gradient: linear-gradient(135deg, #fafaf9 0%, #f3f4f6 100%);
}

/* Dark theme colors */
[data-theme='dark'] {
  --bg-primary: #0f172a; /* Dark slate background */
  --bg-secondary: #1e293b; /* Lighter slate for cards */
  --text-primary: #f1f5f9; /* Light gray - excellent contrast */
  --text-secondary: #cbd5e1; /* Medium gray for secondary text */
  --text-muted: #94a3b8; /* Muted gray for hints */

  /* Accent colors adjusted for dark mode */
  --accent-primary: #10b981; /* Brighter green for dark bg */
  --accent-light: #064e3b; /* Dark green for backgrounds */
  --accent-hover: #34d399; /* Lighter green for hover */

  /* Semantic colors for dark mode */
  --success: #10b981;
  --success-bg: #064e3b;
  --success-border: #047857;
  --danger: #ef4444;
  --danger-bg: #7f1d1d;
  --info: #3b82f6;
  --info-bg: #1e3a8a;

  /* UI elements for dark mode */
  --border-light: #334155;
  --border-medium: #475569;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);

  /* Focus outline for dark mode */
  --focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.4);

  /* Background gradient for dark mode */
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Base styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 24px;
  line-height: 1.6;
  overflow-x: hidden;
}

body:has(#theme-toggle) {
  --theme-toggle-size: 48px;
  --theme-toggle-offset: 20px;
}

.wrap {
  width: 100%;
  max-width: 980px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-banner {
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  margin: 4px 0 12px;
}

.hero-banner img {
  width: 100%;
  height: clamp(160px, 22vw, 240px);
  display: block;
  object-fit: cover;
  object-position: center;
}

.section-heading {
  padding-left: 28px;
}

@media (max-width: 640px) {
  .section-heading {
    padding-left: 20px;
  }
}

.back-to-top {
  display: none !important;
}

@media (max-width: 640px) {
  .back-to-top {
    display: inline-flex !important;
  }
}

.site-brand {
  display: none;
}

.site-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 20px;
}

.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  padding-left: 4px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.nav-toggle i {
  font-size: 18px;
}

/* Typography */
h1 {
  margin: 18px 0 12px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-weight: 800;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(20px, 3vw, 24px);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-weight: 700;
}

h3 {
  margin: 16px 0 8px;
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 600;
}

p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  max-width: 78ch;
}

ul {
  margin: 0;
  padding-left: 24px;
  color: var(--text-secondary);
}

li {
  margin: 10px 0;
  line-height: 1.6;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-light);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Navigation */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 24px;
  align-items: center;
}

@media (min-width: 840px) {
  .nav {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .nav .btn {
    flex: 1 1 0;
    justify-content: center;
  }

  .nav .btn.primary {
    white-space: nowrap;
    min-width: 0;
  }
}

/* Theme Toggle Button */
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

#theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

#theme-toggle:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

#theme-toggle:active .theme-icon {
  transform: scale(0.9);
}

@media (max-width: 640px) {
  #theme-toggle {
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-width: 1px;
    box-shadow: var(--shadow-sm);
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px 12px 20px;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--bg-primary);
    padding: 10px 0 6px;
    border-bottom: 1px solid var(--border-light);
    isolation: isolate;
  }

  [data-theme='dark'] .site-header {
    background: var(--bg-secondary);
  }

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

  .site-header-row {
    padding-right: 40px;
  }

  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    z-index: 800;
  }

  .nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 910;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    transform-origin: bottom center;
    --nav-peek: 36px;
    transform: translateY(calc(100% - var(--nav-peek)));
    transition: transform 0.25s ease;
  }

  .nav-open .nav {
    transform: translateY(0);
  }

  .nav .btn:hover {
    transform: none;
  }

  .nav .btn:active {
    transform: scale(0.98);
  }

  .nav .btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
  }

  .nav-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 0 6px;
    cursor: pointer;
  }

  .nav-handle::before {
    content: '';
    height: 6px;
    width: 56px;
    border-radius: 999px;
    background: var(--border-medium);
  }

  @supports (padding: max(0px)) {
    .nav {
      padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
  }

  .hero-banner {
    margin: 0 0 10px;
    border-radius: 18px;
  }

  .hero-banner img {
    height: clamp(140px, 28vw, 200px);
  }

  .site-header {
    margin: 8px 0 14px;
  }

  .card {
    padding: 18px 18px 20px;
    margin-top: 16px;
  }

  .section-heading {
    padding-left: 12px;
  }

  .share-banner {
    justify-content: flex-start;
    gap: 10px;
  }

  .share-label {
    width: 100%;
  }
}

body.modal-open {
  overflow: hidden;
}

.news-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.news-modal.is-open {
  display: flex;
}

.news-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.news-modal__panel {
  position: relative;
  width: min(92vw, 860px);
  max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.news-modal__content {
  padding: 24px;
  overflow-y: auto;
}

.news-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.news-modal__loading {
  color: var(--text-secondary);
  text-align: center;
  padding: 3rem 1rem;
}

@media (max-width: 640px) {
  .news-modal__panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .news-modal__content {
    padding: 20px 18px 28px;
  }
}

/* Buttons */
a.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

a.btn:hover,
button.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

a.btn:focus,
button.btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

a.btn:focus-visible,
button.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

a.btn.primary,
button.btn.primary {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: white;
}

a.btn.primary:hover,
button.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

a.btn.secondary,
button.btn.secondary {
  background: transparent;
  border-color: var(--border-medium);
}

a.btn.secondary:hover,
button.btn.secondary:hover {
  border-color: var(--accent-primary);
}

a.btn.cta,
button.btn.cta {
  padding: 14px 22px;
  font-size: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.nav .btn.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.nav .btn.active:not(.primary) {
  background: var(--accent-light);
}

.nav-handle {
  display: none;
}

/* Cards */
.card {
  margin-top: 20px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.share-row {
  display: flex;
  gap: 8px;
  margin-top: 0;
  flex-wrap: wrap;
  align-items: center;
}

.share-banner {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.share-label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.share-btn.link.copied {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.share-btn:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.share-btn:focus-visible {
  box-shadow: var(--focus-ring);
}

[data-theme='dark'] .share-btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.6);
}

.share-btn i {
  font-size: 16px;
}

@media (max-width: 640px) {
  .share-btn {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }

  .share-btn i {
    font-size: 12px;
  }
}

.share-btn.facebook {
  color: #1877f2;
}
.share-btn.x {
  color: #111827;
}
[data-theme='dark'] .share-btn.x {
  color: #e5e7eb;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 840px) {
  .grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* Callout boxes */
.callout {
  border: 1px solid var(--border-medium);
  background: var(--accent-light);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.info-box {
  border: 1px solid var(--border-medium);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
}

[data-theme='dark'] .info-box {
  background: rgba(59, 130, 246, 0.12);
}

.info-box-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.info-icon {
  font-size: 1rem;
}

.callout .tag {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 10px;
}

.tag .mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

/* Forms */
form {
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--focus-ring);
}

.field.error input,
.field.error textarea,
.field.error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.field.has-error-msg {
  position: relative;
  padding-bottom: 22px;
}

.error-msg {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--danger, #d33);
  min-height: 1.1em;
}

input[aria-invalid='true'],
select[aria-invalid='true'],
textarea[aria-invalid='true'] {
  border-color: var(--danger, #d33);
}

.field input:invalid:not(:focus):not(:placeholder-shown),
.field textarea:invalid:not(:focus):not(:placeholder-shown) {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 840px) {
  .row2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Checkboxes */
.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.checkbox input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.checkbox label {
  font-weight: 400;
  cursor: pointer;
}

/* Hints */
.hint {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

/* Actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn.is-loading,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.is-loading {
  background: var(--border-medium);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Success message */
.success {
  border: 1.5px solid var(--success-border);
  background: var(--success-bg);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 16px;
  margin-top: 1rem;
  display: none;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.success-actions {
  margin-top: 12px;
}

/* Bureau/Team */
.people {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.person {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.person:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  background: var(--accent-light);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: var(--accent-primary);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.person .name {
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 16px;
}

.person .role {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* News/Post Cards */
.post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 22px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.post-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.post-excerpt {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 15px;
}

.post-author {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.post-meta .post-author {
  margin-top: 0;
}

.post-date-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.post-excerpt {
  margin: 0 0 8px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 15px;
}

.post-excerpt.preview-ellipsis {
  position: relative;
  padding-right: 1.4em;
}

.post-excerpt.preview-ellipsis::after {
  content: '…';
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--text-muted);
  font-weight: 700;
  line-height: 1;
}

.news-card.is-expanded .news-preview {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}

.news-card.is-expanded .news-preview::after {
  content: none;
}

.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 {
  -webkit-line-clamp: 2;
}
.clamp-3 {
  -webkit-line-clamp: 3;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}

.tag-pill {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
}

.tag-filter {
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.tag-filter.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.actus-filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
  padding: 0;
  list-style: none;
}

.actus-filtre-btn {
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.actus-filtre-btn.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-auteur {
  color: var(--text-secondary);
  font-weight: 600;
}

.meta-tags {
  color: var(--text-muted);
}

.titre-actu {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

@media (max-width: 640px) {
  .share-banner {
    justify-content: flex-start;
  }

  .post-details > summary {
    width: 100%;
  }
}

.post-details {
  margin: 6px 0 4px;
}

.post-summary {
  list-style: none;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.post-summary::-webkit-details-marker {
  display: none;
}

.chevron-toggle {
  margin-left: auto;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chevron-toggle.open i {
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.post-content {
  margin: 1rem 0;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 15px;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  color: var(--text-primary);
  margin: 12px 0 8px;
  font-size: 18px;
}

@media (max-width: 640px) {
  .post-title {
    font-size: 18px;
  }

  .post-content {
    font-size: 14px;
  }
}

.news-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 840px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Footer */
footer {
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 640px) {
  footer {
    display: none;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
}

.footer-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 600;
}

.footer-link:hover {
  color: var(--accent-primary);
}

.pill {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  font-size: 13px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}

/* Links */
a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Responsive improvements */
@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .card {
    padding: 20px;
  }

  h1 {
    margin-top: 12px;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .nav,
  .actions {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #1f2937;
    --border-medium: #4b5563;
  }

  .card,
  .btn {
    border-width: 2px;
  }
}
