/* =========================================================
   Florent Dejardin — Design System V6
   Référence unique : tokens + composants réutilisables
   ========================================================= */

:root {
  --fd-cream: #fafaf8;
  --fd-ink: #121212;
  --fd-gray: #666660;
  --fd-gray-dark: #3d3d38;
  --fd-accent: #a88663;
  --fd-accent-hover: #8e7355;
  --fd-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --fd-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --fd-space-xs: 8px;
  --fd-space-sm: 16px;
  --fd-space-md: 24px;
  --fd-space-lg: 40px;
  --fd-space-xl: 64px;
  --fd-space-2xl: 96px;
  --fd-space-3xl: 128px;

  --fd-container: 1080px;
  --fd-container-narrow: 640px;
  --fd-container-text: 720px;
  --fd-gutter: clamp(var(--fd-space-sm), 4vw, var(--fd-space-lg));

  --fd-radius: 4px;
  --fd-btn-height: 48px;
  --fd-btn-padding-x: 32px;
  --fd-transition: 0.22s ease;
}

/* —— Base pages publiques —— */
body#theHomePage,
body#theAdditionalPage,
body#theArticlesPage,
body#theContactPage,
body#theCategoryPage,
body#theCategoriesPage,
body#theTagsPage,
body#theSearchPage {
  font-family: var(--fd-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--fd-ink);
  background: var(--fd-cream);
  -webkit-font-smoothing: antialiased;
}

body#theHomePage h1,
body#theHomePage h2,
body#theHomePage h3,
body#theAdditionalPage h1,
body#theAdditionalPage h2,
body#theAdditionalPage h3,
body#theArticlesPage h1,
body#theArticlesPage h2,
body#theArticlesPage h3,
body#theContactPage h1,
body#theContactPage h2,
body#theContactPage h3,
body#theCategoryPage h1,
body#theCategoryPage h2,
body#theCategoryPage h3,
body#theCategoriesPage h1,
body#theCategoriesPage h2,
body#theCategoriesPage h3 {
  font-family: var(--fd-serif);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--fd-ink);
}

/* —— Spacing utilities —— */
.fd-spacing-xs { margin-bottom: var(--fd-space-xs); }
.fd-spacing-sm { margin-bottom: var(--fd-space-sm); }
.fd-spacing-md { margin-bottom: var(--fd-space-md); }
.fd-spacing-lg { margin-bottom: var(--fd-space-lg); }
.fd-spacing-xl { margin-bottom: var(--fd-space-xl); }

/* —— Container —— */
.fd-container {
  width: 100%;
  max-width: var(--fd-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--fd-gutter);
  padding-right: var(--fd-gutter);
}

.fd-container--narrow {
  max-width: var(--fd-container-narrow);
}

.fd-container--text {
  max-width: var(--fd-container-text);
}

/* —— Section —— */
.fd-section {
  padding-top: var(--fd-space-xl);
  padding-bottom: var(--fd-space-xl);
}

.fd-section--sm {
  padding-top: var(--fd-space-lg);
  padding-bottom: var(--fd-space-lg);
}

.fd-section--dark {
  background: var(--fd-ink);
  color: var(--fd-cream);
}

.fd-section--dark .fd-title-xl,
.fd-section--dark .fd-title-lg,
.fd-section--dark .fd-title-md,
.fd-section--dark h1,
.fd-section--dark h2,
.fd-section--dark h3 {
  color: var(--fd-cream);
}

/* —— Typography —— */
.fd-title-xl {
  font-family: var(--fd-serif);
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 var(--fd-space-sm);
}

.fd-title-lg {
  font-family: var(--fd-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  margin: 0 0 var(--fd-space-sm);
}

.fd-title-md {
  font-family: var(--fd-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.25;
  margin: 0 0 var(--fd-space-sm);
}

.fd-text {
  font-family: var(--fd-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--fd-ink);
  margin: 0 0 var(--fd-space-md);
}

.fd-lead {
  font-family: var(--fd-serif);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.7;
  color: var(--fd-gray);
  margin: 0 0 var(--fd-space-md);
}

.fd-lead--emphasis {
  font-style: italic;
  font-weight: 500;
  color: var(--fd-gray-dark);
}

.fd-quote {
  font-family: var(--fd-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.75;
  color: var(--fd-gray);
}

/* —— Actions row —— */
.fd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fd-space-sm) var(--fd-space-md);
  justify-content: center;
  align-items: center;
}

.fd-actions--start {
  justify-content: flex-start;
}

/* —— Buttons (composant unique) —— */
.fd-btn,
a.fd-btn,
button.fd-btn,
input.fd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--fd-btn-height);
  padding: 12px var(--fd-btn-padding-x);
  width: auto;
  max-width: 100%;
  border-radius: var(--fd-radius);
  border: 1px solid transparent;
  font-family: var(--fd-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background var(--fd-transition), color var(--fd-transition),
    border-color var(--fd-transition), transform var(--fd-transition);
}

.fd-btn-primary,
a.fd-btn-primary,
button.fd-btn-primary,
input.fd-btn-primary {
  background: transparent;
  color: var(--fd-ink) !important;
  border-color: var(--fd-accent);
}

.fd-btn-primary:hover,
.fd-btn-primary:focus-visible,
a.fd-btn-primary:hover,
a.fd-btn-primary:focus-visible,
button.fd-btn-primary:hover,
button.fd-btn-primary:focus-visible,
input.fd-btn-primary:hover,
input.fd-btn-primary:focus-visible {
  background: var(--fd-ink);
  color: var(--fd-cream) !important;
  border-color: var(--fd-ink);
  text-decoration: none;
  transform: translateY(-1px);
}

.fd-btn-primary:focus-visible,
a.fd-btn-primary:focus-visible,
button.fd-btn-primary:focus-visible,
input.fd-btn-primary:focus-visible {
  outline: 2px solid var(--fd-accent);
  outline-offset: 3px;
}

.fd-btn-secondary,
a.fd-btn-secondary {
  background: transparent;
  color: var(--fd-ink) !important;
  border-color: var(--fd-ink);
}

.fd-btn-secondary:hover,
.fd-btn-secondary:focus-visible,
a.fd-btn-secondary:hover,
a.fd-btn-secondary:focus-visible {
  background: var(--fd-ink);
  color: var(--fd-cream) !important;
  border-color: var(--fd-ink);
  text-decoration: none;
  transform: translateY(-1px);
}

.fd-btn-secondary:focus-visible,
a.fd-btn-secondary:focus-visible {
  outline: 2px solid var(--fd-accent);
  outline-offset: 3px;
}

.fd-section--dark .fd-btn-primary,
.fd-section--dark a.fd-btn-primary {
  background: var(--fd-cream);
  color: var(--fd-ink) !important;
  border-color: var(--fd-cream);
}

.fd-section--dark .fd-btn-primary:hover,
.fd-section--dark .fd-btn-primary:focus-visible,
.fd-section--dark a.fd-btn-primary:hover,
.fd-section--dark a.fd-btn-primary:focus-visible {
  background: transparent;
  color: var(--fd-cream) !important;
  border-color: var(--fd-cream);
}

/* —— Boutons sur fond sombre (hero, overlays) —— */
.fd-on-dark .fd-btn-primary,
.fd-on-dark a.fd-btn-primary {
  color: #ffffff !important;
  border-color: var(--fd-accent);
  background: transparent;
}

.fd-on-dark .fd-btn-primary:hover,
.fd-on-dark .fd-btn-primary:focus-visible,
.fd-on-dark a.fd-btn-primary:hover,
.fd-on-dark a.fd-btn-primary:focus-visible {
  background: var(--fd-accent);
  color: var(--fd-ink) !important;
  border-color: var(--fd-accent);
}

.fd-on-dark .fd-btn-secondary,
.fd-on-dark a.fd-btn-secondary {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.75);
  background: transparent;
}

.fd-on-dark .fd-btn-secondary:hover,
.fd-on-dark .fd-btn-secondary:focus-visible,
.fd-on-dark a.fd-btn-secondary:hover,
.fd-on-dark a.fd-btn-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  border-color: var(--fd-accent);
}

/* —— Bootstrap / thème : neutraliser boutons noirs résiduels —— */
body#theHomePage #fd-v5 a.btn-primary,
body#theHomePage #fd-v5 a.btn-dark,
body#theAdditionalPage #content a.btn-dark,
body#theContactPage #content a.btn-dark,
body#theCategoryPage #content a.btn-dark,
#fd-portfolio a.btn-dark,
#fd-portfolio-masonry a.btn-dark {
  all: unset;
  box-sizing: border-box;
}

/* —— Grid / card (minimal) —— */
.fd-grid {
  display: grid;
  gap: var(--fd-space-md);
}

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

.fd-grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.fd-card {
  overflow: hidden;
  background: transparent;
}

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

.fd-card__body {
  padding: var(--fd-space-sm) 0 var(--fd-space-md);
}

.fd-card__body h2,
.fd-card__body h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin: 0;
}

.fd-card a {
  color: inherit;
  text-decoration: none;
}

/* —— Pages éditoriales (Additional Pages) —— */
body#theAdditionalPage #content {
  max-width: var(--fd-container-text);
  margin: 0 auto;
  padding: var(--fd-space-xl) var(--fd-gutter) var(--fd-space-2xl);
}

body.fd-additional-page-shell #content.content-grid,
body#theAdditionalPage #content.content-grid:not(:has(> *)) {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
}

body#theAdditionalPage #content h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  margin-bottom: var(--fd-space-md);
  text-align: center;
}

body#theAdditionalPage #content h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  margin-top: var(--fd-space-xl);
  margin-bottom: var(--fd-space-md);
}

body#theAdditionalPage #content p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--fd-gray-dark);
  margin-bottom: var(--fd-space-md);
}

body#theAdditionalPage #content p a[href*="contact"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--fd-btn-height);
  padding: 12px var(--fd-btn-padding-x);
  margin: var(--fd-space-sm) 0 var(--fd-space-lg);
  border-radius: var(--fd-radius);
  border: 1px solid var(--fd-accent);
  background: transparent;
  color: var(--fd-ink) !important;
  font-family: var(--fd-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--fd-transition), color var(--fd-transition),
    border-color var(--fd-transition);
}

body#theAdditionalPage #content p a[href*="contact"]:hover,
body#theAdditionalPage #content p a[href*="contact"]:focus-visible {
  background: var(--fd-ink);
  color: var(--fd-cream) !important;
  border-color: var(--fd-ink);
  text-decoration: none;
}

body#theAdditionalPage #content p a[href*="contact"] strong {
  font-weight: 500;
  font-size: inherit;
  font-family: inherit;
}

body#theAdditionalPage #content span[style*="Arial"] {
  font-family: inherit !important;
}

/* —— Contact (monocolonne volontaire — FdSiteCustom, page only) ——
 * Labels au-dessus des champs sur desktop et mobile.
 * Pas de display:grid sur les <tr> du tableau ContactForm.
 */
body#theContactPage #content {
  max-width: 920px; /* marge pour gutters → formulaire utile ~800 px */
  margin: 0 auto;
  padding: var(--fd-space-xl) var(--fd-gutter) var(--fd-space-2xl);
}

/* Annule la largeur fixe 540px du plugin ContactForm. */
body#theContactPage #content .contact {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}

body#theContactPage #content .contact.desc {
  margin-bottom: var(--fd-space-md);
}

body#theContactPage #content form[action*="contact"] {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

body#theContactPage #content form[action*="contact"] table,
body#theContactPage #content form[action*="contact"] tbody,
body#theContactPage #content form[action*="contact"] tr,
body#theContactPage #content form[action*="contact"] td {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body#theContactPage #content form[action*="contact"] tr {
  margin: 0 0 18px;
  padding: 0;
}

body#theContactPage #content form[action*="contact"] td {
  padding: 0;
  text-align: left;
  vertical-align: top;
}

/* !important : ContactForm impose text-align:right !important + width:120px */
body#theContactPage #content form[action*="contact"] td.title {
  width: auto !important;
  max-width: none;
  margin: 0 0 8px;
  padding: 0;
  font-family: var(--fd-sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fd-ink);
  text-align: left !important;
  line-height: 1.35;
}

body#theContactPage #content form[action*="contact"] td.title label {
  display: inline-block;
  margin: 0;
  cursor: pointer;
}

/* Cellule titre vide de la ligne bouton */
body#theContactPage #content form[action*="contact"] tr:last-child td.title {
  display: none;
}

body#theContactPage #content form[action*="contact"] tr:last-child {
  margin-bottom: 0;
  margin-top: 4px;
}

body#theContactPage #content form[action*="contact"] input[type="text"],
body#theContactPage #content form[action*="contact"] input[type="email"],
body#theContactPage #content form[action*="contact"] textarea {
  width: 100% !important; /* bat les style="width:400px" inline du plugin */
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid rgba(18, 18, 18, 0.18);
  border-radius: var(--fd-radius);
  font-family: var(--fd-sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--fd-ink);
  background: #fff;
  transition: border-color var(--fd-transition), box-shadow var(--fd-transition);
}

body#theContactPage #content form[action*="contact"] input[type="text"],
body#theContactPage #content form[action*="contact"] input[type="email"] {
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  padding: 0 16px;
}

body#theContactPage #content form[action*="contact"] textarea {
  height: 280px;
  min-height: 200px;
  padding: 14px 16px;
  resize: vertical;
  overflow: auto;
}

body#theContactPage #content form[action*="contact"] input[type="text"]:focus,
body#theContactPage #content form[action*="contact"] input[type="email"]:focus,
body#theContactPage #content form[action*="contact"] textarea:focus {
  outline: none;
  border-color: var(--fd-accent);
  box-shadow: 0 0 0 3px rgba(168, 134, 99, 0.22);
}

body#theContactPage #content form[action*="contact"] input[type="text"]:focus-visible,
body#theContactPage #content form[action*="contact"] input[type="email"]:focus-visible,
body#theContactPage #content form[action*="contact"] textarea:focus-visible,
body#theContactPage #content form[action*="contact"] input.submit:focus-visible,
body#theContactPage #content form[action*="contact"] input[type="submit"]:focus-visible,
body#theContactPage #content form[action*="contact"] button[type="submit"]:focus-visible {
  outline: 2px solid var(--fd-ink);
  outline-offset: 2px;
}

body#theContactPage #content form[action*="contact"] .LV_validation_message {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
}

body#theContactPage #content form[action*="contact"] input.submit,
body#theContactPage #content form[action*="contact"] input[type="submit"],
body#theContactPage #content form[action*="contact"] button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: var(--fd-btn-height);
  height: auto;
  max-height: none;
  padding: 12px var(--fd-btn-padding-x);
  margin: 0;
  border-radius: var(--fd-radius);
  border: 1px solid var(--fd-accent);
  background: transparent;
  color: var(--fd-ink) !important;
  font-family: var(--fd-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--fd-transition), color var(--fd-transition),
    border-color var(--fd-transition);
}

body#theContactPage #content form[action*="contact"] input.submit:hover,
body#theContactPage #content form[action*="contact"] input[type="submit"]:hover,
body#theContactPage #content form[action*="contact"] button[type="submit"]:hover,
body#theContactPage #content form[action*="contact"] input.submit:focus-visible,
body#theContactPage #content form[action*="contact"] input[type="submit"]:focus-visible,
body#theContactPage #content form[action*="contact"] button[type="submit"]:focus-visible {
  background: var(--fd-ink);
  color: var(--fd-cream) !important;
  border-color: var(--fd-ink);
}

@media (max-width: 720px) {
  body#theContactPage #content {
    padding-top: var(--fd-space-lg);
  }

  body#theContactPage #content form[action*="contact"] textarea {
    height: 220px;
  }
}

/* Bouton pleine largeur uniquement sur mobile étroit */
@media (max-width: 520px) {
  body#theContactPage #content form[action*="contact"] input.submit,
  body#theContactPage #content form[action*="contact"] input[type="submit"],
  body#theContactPage #content form[action*="contact"] button[type="submit"] {
    width: 100%;
    min-height: 48px;
  }
}

/* —— Portfolio catégories Piwigo —— */
body#theCategoryPage #content-description {
  max-width: var(--fd-container-text);
  margin: 0 auto;
  padding: var(--fd-space-lg) var(--fd-gutter) var(--fd-space-sm);
  text-align: center;
}

body#theCategoryPage #content-description h5,
body#theCategoryPage #content-description p {
  font-family: var(--fd-serif);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.65;
  color: var(--fd-gray);
  font-weight: 400;
  margin: 0;
}

body#theCategoryPage #content.content-grid {
  padding-left: var(--fd-gutter);
  padding-right: var(--fd-gutter);
  padding-bottom: var(--fd-space-xl);
}

/* Neutraliser boutons Bootstrap hérités sur pages FD */
body#theHomePage #fd-v5 a.btn,
body#theHomePage #fd-v5 .btn,
#fd-portfolio a.btn,
#fd-portfolio .btn:not(.fd-btn) {
  all: unset;
  box-sizing: border-box;
}

/* —— Responsive —— */
@media (max-width: 768px) {
  .fd-grid--2 {
    grid-template-columns: 1fr;
  }

  .fd-actions {
    flex-direction: column;
    width: 100%;
  }

  .fd-actions .fd-btn,
  .fd-actions a.fd-btn {
    width: 100%;
    max-width: 280px;
  }

  .fd-section {
    padding-top: var(--fd-space-lg);
    padding-bottom: var(--fd-space-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fd-btn,
  a.fd-btn,
  button.fd-btn,
  input.fd-btn {
    transition: none;
  }
}

/* —— Socle responsive pages personnalisées (hors galeries natives) —— */
body.fd-homepage,
body.fd-additional-page-shell,
body.fd-prestations-page,
body.fd-about-page,
body.fd-articles-list-page,
body.fd-article-page,
body#theContactPage,
body.fdpz-page {
  box-sizing: border-box;
}

body.fd-homepage *,
body.fd-homepage *::before,
body.fd-homepage *::after,
body.fd-additional-page-shell *,
body.fd-additional-page-shell *::before,
body.fd-additional-page-shell *::after,
body.fd-prestations-page *,
body.fd-prestations-page *::before,
body.fd-prestations-page *::after,
body.fd-about-page *,
body.fd-about-page *::before,
body.fd-about-page *::after,
body.fd-articles-list-page *,
body.fd-articles-list-page *::before,
body.fd-articles-list-page *::after,
body.fd-article-page *,
body.fd-article-page *::before,
body.fd-article-page *::after,
body#theContactPage *,
body#theContactPage *::before,
body#theContactPage *::after,
body.fdpz-page *,
body.fdpz-page *::before,
body.fdpz-page *::after {
  box-sizing: border-box;
}

body.fd-homepage img,
body.fd-homepage video,
body.fd-homepage canvas,
body.fd-homepage iframe,
body.fd-additional-page-shell img,
body.fd-additional-page-shell video,
body.fd-additional-page-shell iframe,
body.fd-prestations-page img,
body.fd-about-page img,
body.fd-articles-list-page img,
body.fd-article-page img,
body#theContactPage img,
body.fdpz-page img,
body.fdpz-page video,
body.fdpz-page canvas,
body.fdpz-page iframe {
  max-width: 100%;
}

body.fd-homepage .fd-container,
body.fd-additional-page-shell .fd-container,
body.fd-prestations-page .fd-container,
body.fd-about-page .fd-container,
body.fd-articles-list-page .fd-container,
body.fd-article-page .fd-container,
body.fdpz-page .fdpz-shell {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 768px) {
  body.fd-homepage,
  body.fd-additional-page-shell,
  body.fd-prestations-page,
  body.fd-about-page,
  body.fd-articles-list-page,
  body.fd-article-page,
  body#theContactPage,
  body.fdpz-page {
    overflow-x: clip;
  }

  body.fd-additional-page-shell .jumbotron,
  body.fd-prestations-page .jumbotron,
  body.fd-about-page .jumbotron,
  body.fd-articles-list-page .jumbotron,
  body.fd-article-page .jumbotron {
    display: none !important;
  }

  body.fd-homepage h1,
  body.fd-additional-page-shell h1,
  body.fd-prestations-page h1,
  body.fd-about-page h1,
  body.fd-articles-list-page h1,
  body.fd-article-page h1,
  body#theContactPage h1,
  body.fdpz-page h1 {
    font-size: clamp(1.65rem, 7vw, 2.4rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  body.fd-homepage a.fd-btn,
  body.fd-homepage .fd-btn,
  body.fd-additional-page-shell a.fd-btn,
  body.fd-additional-page-shell .fd-btn,
  body.fd-prestations-page a.fd-btn,
  body.fd-prestations-page .fd-btn,
  body.fd-about-page a.fd-btn,
  body.fd-about-page .fd-btn,
  body.fd-articles-list-page a.fd-btn,
  body.fd-articles-list-page .fd-btn,
  body.fd-article-page a.fd-btn,
  body.fd-article-page .fd-btn,
  body.fdpz-page .fdpz-btn {
    min-height: 48px;
  }

  body#theContactPage #content form[action*="contact"] table {
    table-layout: fixed;
  }

  /* Galeries natives : titres de cartes nowrap qui dépassent à 320–360 px */
  body#theCategoriesPage #content .card-title,
  body#theCategoriesPage #content .card-title.ellipsis,
  body#theCategoryPage #content .card-title,
  body#theCategoryPage #content .card-title.ellipsis {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  body#theCategoriesPage #content .card-title a,
  body#theCategoryPage #content .card-title a {
    display: inline;
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
}
