body {
  /* THIS is not a good way to handle this, and a proper refactoring needs to be performed
    This allows bigger images of media on listings for large screens
    It would be great to adapt to other sizes, but this requires a good refaftoring
     */

  @media screen and (min-width: 2200px) {
      --default-item-width: 342px !important;
      --default-max-item-width: 342px !important;
      --default-item-margin-right-width: 17px !important;
      --default-item-margin-bottom-width: 27px !important;
  }
}


html body.theme-sorec {
  --body-bg-color: #33363b;
  --body-text-color: #ffffff;
  --hr-color: rgba(151, 140, 94, 0.35);
  --default-theme-color: #978c5e;
  --default-brand-color: #978c5e;
  --header-bg-color: #ffffff;
  --header-circle-button-color: #1a1a1a;
  --search-field-input-text-color: #1a1a1a;
  --search-field-input-bg-color: #f4f4f5;
  --search-field-input-border-color: #d0d0d2;
  --search-field-submit-text-color: #5c5c5c;
  --search-field-submit-bg-color: #ebebec;
  --search-field-submit-border-color: #d0d0d2;
  --search-field-submit-hover-bg-color: #e2e2e4;
  --search-field-submit-hover-border-color: #c6c6c8;
  --item-bg-color: #ffffff;
  --item-title-text-color: #1f2123;
  --item-meta-text-color: #978c5e;
  --item-meta-link-text-color: #978c5e;
  --item-meta-link-hover-text-color: #c2b07c;
  --item-thumb-bg-color: #25272b;
  --item-title-font-size: 19px;
  --item-title-line-height: 25px;
  --item-title-max-lines: 2;
  --media-list-row-border-color: rgba(151, 140, 94, 0.25);
  --media-list-header-title-link-text-color: #978c5e;
  --item-list-load-more-text-color: #978c5e;
  --item-list-load-more-hover-text-color: #c2b07c;
  --sidebar-bg-color: #2c2f34;
  --sidebar-nav-border-color: rgba(255, 255, 255, 0.08);
  --sidebar-nav-item-text-color: #f2f2f2;
  --sidebar-nav-item-icon-color: #978c5e;
  --sidebar-bottom-link-color: rgba(255, 255, 255, 0.88);
  --nav-menu-active-item-bg-color: rgba(151, 140, 94, 0.15);
  --nav-menu-item-hover-bg-color: rgba(151, 140, 94, 0.12);
}

html body.theme-sorec .page-header {
  color: #1a1a1a;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: none;
}

html body.theme-sorec .page-header::after {
  display: none;
}

html body.theme-sorec .page-header a {
  color: inherit;
}

html body.theme-sorec .page-header .button-link.sign-in,
html body.theme-sorec .page-header .button-link.register-link,
html body.theme-sorec .page-header .signin-icon-link {
  color: var(--default-brand-color);
}

html body.theme-sorec .media-list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 20px 0 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid #978c5e;
}

html body.theme-sorec .media-list-header h2 {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffffff;
}

html body.theme-sorec .media-list-header h3 {
  margin: 0;
}

html body.theme-sorec .media-list-header h3 a {
  display: inline-block;
  margin: 0;
  padding: 16px 32px;
  font-size: 20px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #c2b07c !important;
  border: none;
  border-radius: 0;
  background: #000000;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

html body.theme-sorec .media-list-header h3 a:hover,
html body.theme-sorec .media-list-header h3 a:focus {
  color: #000000 !important;
  background-color: #c2b07c;
}

html body.theme-sorec .media-list-row {
  min-height: 0;
  padding-bottom: 8px;
}

html body.theme-sorec .item.video-item .item-content {
  background-color: #ffffff;
  border-radius: 0;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Hauteur de carte identique : les cartes d'une rangée s'étirent à la même
   hauteur et la zone date/vues est poussée en bas (pas de différence de longueur) */
html body.theme-sorec .items-list > .item {
  display: flex;
  align-items: stretch;
}
html body.theme-sorec .item.video-item .item-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}
html body.theme-sorec .item.video-item .item-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

html body.theme-sorec .item.video-item a.item-thumb {
  border-radius: 0;
  padding-bottom: 76% !important;
}

html body.theme-sorec .item.video-item .item-main {
  padding: 20px 22px 20px;
}

html body.theme-sorec .item.video-item a.item-thumb .item-img,
html body.theme-sorec .item.video-item a.item-thumb .item-img-preview {
  z-index: 1;
}

html body.theme-sorec .item.video-item a.item-thumb .item-duration {
  z-index: 4;
}

html body.theme-sorec .item.video-item a.item-thumb:not(.no-thumb)::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  background: rgba(15, 16, 18, 0.72);
  border: 2px solid #978c5e;
  border-radius: 4px;
  pointer-events: none;
}

html body.theme-sorec .item.video-item a.item-thumb:not(.no-thumb)::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-42%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #978c5e;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

html body.theme-sorec .item.video-item .item-main h3 {
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0;
  min-height: 50px;
  max-height: none;
}

html body.theme-sorec .item.video-item .item-content h3,
html body.theme-sorec .item.video-item .item-content h3 span {
  max-height: calc(2 * var(--item-title-line-height));
}

html body.theme-sorec .item.video-item .item-content h3 span {
  background-color: #ffffff;
  color: var(--item-title-text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

html body.theme-sorec .item.video-item .item-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #ececec;
  font-weight: 500;
  font-size: 17px;
}


html body.theme-sorec .item.video-item .item-meta .item-author {
  display: none;
}

html body.theme-sorec .item.video-item .item-meta .item-date {
  order: 1;
  color: var(--item-meta-text-color);
}

html body.theme-sorec .item.video-item .item-meta .item-views {
  order: 2;
  margin-left: auto;
  color: var(--item-meta-text-color);
}

html body.theme-sorec .item.video-item .item-views + .item-date::before {
  display: none;
  content: none;
}

html body.theme-sorec .item.video-item .item-duration > * {
  background-color: #0f1012;
  color: #fff;
  opacity: 1;
}

html body.theme-sorec .item.video-item a.item-thumb .item-badge-gratuit {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  display: inline-block;
  padding: 9px 20px;
  font-size: 16px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.2px;
  color: #ffffff;
  background-color: #000000;
  border: none;
}

html body.theme-sorec .item.video-item a.item-thumb:not(.no-thumb)::before {
  width: 66px;
  height: 66px;
  margin: -33px 0 0 -33px;
  background: #000000;
  border: none;
  border-radius: 0;
}

html body.theme-sorec .item.video-item a.item-thumb:not(.no-thumb)::after {
  transform: translate(-38%, -50%);
  border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent #c2b07c;
}


html body.theme-sorec .page-footer {
  color: #ffffff;
  padding: 30px 0;
  margin-top: 48px;
  background-color: #2d2d37;
  background-image: linear-gradient(rgba(40, 50, 64, 0.42), rgba(40, 50, 64, 0.42)),
    url("/static/images/footer-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

html body.theme-sorec .page-footer .page-footer-inner {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

html body.theme-sorec .page-footer .page-footer-logo img {
  max-height: 54px;
  width: auto;
}

html body.theme-sorec .page-footer .page-footer-nav {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 860px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

html body.theme-sorec .page-footer .page-footer-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  transition: color 0.2s ease;
}

html body.theme-sorec .page-footer .page-footer-nav a:hover {
  color: #978c5e;
}

html body.theme-sorec .page-footer .page-footer-copyright {
  font-size: 13px;
  color: #ffffff;
  opacity: 0.9;
}


/* Positionné en absolu pour ne pas chevaucher le burger/logo
   (le .page-header est en display:table avec left/right en absolu) */
html body.theme-sorec .header-nav {
  position: absolute;
  top: 0;
  left: 280px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 38px;
  margin: 0;
  padding: 0;
}

html body.theme-sorec .header-nav .header-nav-link {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 22px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease;
  position: relative;
  height: 100%;
  display: inline-flex;
  align-items: center;
}

html body.theme-sorec .header-nav .header-nav-link:hover {
  color: #978c5e;
}

html body.theme-sorec .header-nav .header-nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #978c5e;
}

html body.theme-sorec .header-nav .header-nav-search {
  display: inline-flex;
  align-items: center;
}

html body.theme-sorec .header-nav .header-nav-search .material-icons {
  font-size: 30px;
  line-height: 1;
}

@media screen and (max-width: 1023px) {
  html body.theme-sorec .header-nav {
    display: none;
  }
}

/* Le tiroir sidebar (et son bouton hamburger) est reserve au mobile :
   au-dela de 1023px MediaCMS l'ouvre automatiquement par defaut
   (LayoutContext.js), ce qui le fait chevaucher le logo/la navbar du
   haut si on ne le force pas a rester cache sur desktop. */
@media screen and (min-width: 1024px) {
  html body.theme-sorec .page-sidebar,
  html body.theme-sorec .toggle-sidebar {
    display: none !important;
  }
}

/* ============================================
   PAGE VIDÉO SOREC - Styles spécifiques
   ============================================ */

html body.theme-sorec .viewer-section {
  background-color: #2d333b;
}

html body.theme-sorec .viewer-info {
  background-color: #2d333b;
  padding: 0 24px;
}

html body.theme-sorec .sorec-video-title {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 700;
  font-style: italic;
  color: #978c5e;
  margin: 0 0 20px 0;
  line-height: 1.25;
}

html body.theme-sorec .sorec-price-badge {
  margin-bottom: 24px;
}

html body.theme-sorec .badge-gratuit {
  display: inline-block;
  padding: 10px 22px;
  background-color: #000000;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  border: 1px solid #978c5e;
}

html body.theme-sorec .sorec-course-info {
  margin-bottom: 28px;
}

html body.theme-sorec .info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.2;
}

html body.theme-sorec .info-label {
  color: #978c5e;
  font-weight: 600;
  min-width: 0;
}

html body.theme-sorec .info-value {
  color: #ffffff;
  font-weight: 500;
}

html body.theme-sorec .sorec-description {
  margin-bottom: 32px;
  line-height: 1.6;
}

html body.theme-sorec .desc-label {
  color: #978c5e;
  font-weight: 600;
  font-size: 26px;
}

html body.theme-sorec .desc-text {
  color: #ffffff;
  font-size: 23px;
  line-height: 1.7;
}

html body.theme-sorec .sorec-data-table {
  margin-bottom: 40px;
}

html body.theme-sorec .table-title {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 700;
  font-style: italic;
  color: #ffffff;
  margin: 0 0 20px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #978c5e;
  text-transform: uppercase;
}

html body.theme-sorec .table-container {
  overflow-x: auto;
}

html body.theme-sorec .sorec-data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
}

html body.theme-sorec .sorec-data-table thead {
  background-color: #978c5e;
}

html body.theme-sorec .sorec-data-table th {
  padding: 14px 16px;
  text-align: center;
  font-weight: 600;
  color: #ffffff;
  background-color: #978c5e;
  text-transform: uppercase;
  font-size: 20px;
  border: 2px solid #303539;
}

html body.theme-sorec .sorec-data-table tbody tr {
  background-color: #ffffff;
}

html body.theme-sorec .sorec-data-table tbody tr:nth-child(even) {
  background-color: #f8f8f8;
}

html body.theme-sorec .sorec-data-table td {
  padding: 18px 16px;
  text-align: center;
  color: #33363b;
  font-weight: 500;
  border: 1px solid #d4d4d4;
}

html body.theme-sorec .sorec-data-table td:first-child {
  font-weight: 600;
}

@media screen and (max-width: 768px) {
  html body.theme-sorec .sorec-data-table th,
  html body.theme-sorec .sorec-data-table td {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  html body.theme-sorec .info-row {
    flex-direction: column;
    gap: 4px;
  }
  
  html body.theme-sorec .info-label {
    min-width: auto;
  }
}

html body.theme-sorec .viewer-info-title-banner {
  display: none;
}

html body.theme-sorec .sorec-video-info {
  display: block;
}

html body.theme-sorec .media-page {
  background-color: #2d333b;
}

/* ============================================
   FORMULAIRES - Correction couleur du texte
   ============================================ */

html body.theme-sorec input,
html body.theme-sorec textarea,
html body.theme-sorec select {
  color: #33363b !important;
  background-color: #ffffff;
}

html body.theme-sorec input::placeholder,
html body.theme-sorec textarea::placeholder {
  color: #666666 !important;
}

html body.theme-sorec .edit-media-form input,
html body.theme-sorec .edit-media-form textarea,
html body.theme-sorec .edit-media-form select,
html body.theme-sorec form input[type="text"],
html body.theme-sorec form input[type="email"],
html body.theme-sorec form input[type="password"],
html body.theme-sorec form input[type="url"],
html body.theme-sorec form input[type="number"],
html body.theme-sorec form input[type="date"],
html body.theme-sorec form textarea {
  color: #33363b !important;
  background-color: #ffffff !important;
  border: 1px solid #cccccc;
}

html body.theme-sorec form label,
html body.theme-sorec .form-field label {
  color: #33363b !important;
}

html body.theme-sorec .edit-media-page,
html body.theme-sorec .edit-media-form {
  background-color: #f5f5f5;
}

html body.theme-sorec .edit-media-form .form-section {
  background-color: #ffffff;
  border: 1px solid #dddddd;
}

html body.theme-sorec .admin-form input,
html body.theme-sorec .admin-form textarea,
html body.theme-sorec .admin-form select {
  color: #33363b !important;
}

/* Widget de sélection des catégories (page Publier) :
   les lignes sont sur fond blanc, le texte héritait du blanc du thème */
html body.theme-sorec .category-widget,
html body.theme-sorec .category-widget .category-item,
html body.theme-sorec .category-widget .category-item span,
html body.theme-sorec .category-widget .category-panel h3,
html body.theme-sorec .category-widget .category-search {
  color: #33363b !important;
}

html body.theme-sorec .user-action-form-wrap,
html body.theme-sorec .user-action-form-wrap .helptext,
html body.theme-sorec .user-action-form-wrap .form-help,
html body.theme-sorec .user-action-form-wrap small,
html body.theme-sorec .user-action-form-wrap legend,
html body.theme-sorec .user-action-form-wrap h1,
html body.theme-sorec .user-action-form-wrap h2,
html body.theme-sorec .user-action-form-wrap h3,
html body.theme-sorec .user-action-form-wrap p {
  color: #33363b;
}

/* ============================================
   CACHER LE JSON BRUT DANS LA DESCRIPTION
   ============================================ */

html body.theme-sorec .sorec-description .desc-text {
  white-space: pre-wrap;
}

html body.theme-sorec .sorec-description .desc-text:contains("<!--COURSE_DATA") {
  display: none;
}


/* ============================================================
   PAGE RECHERCHE SOREC
   ============================================================ */

.sorec-search-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.sorec-search-page-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  font-style: italic;
  color: #ffffff;
  letter-spacing: 0.04em;
  margin: 0 0 16px 0;
}

.sorec-search-divider,
.sorec-search-inner-divider {
  border: none;
  border-top: 1px solid rgba(151, 140, 94, 0.4);
  margin: 0 0 24px 0;
}

.sorec-search-form-wrap {
  background-color: #ffffff;
  border-radius: 4px;
  padding: 32px 40px 40px;
  margin-bottom: 48px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

.sorec-search-description {
  text-align: center;
  color: #33363b;
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.sorec-search-inner-divider {
  border-top: 1px solid #d0d0d0;
  margin: 0 0 28px 0;
}

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

.sorec-form-field {
  position: relative;
  display: flex;
  align-items: center;
}

.sorec-form-field input[type="text"],
.sorec-form-field input[type="date"] {
  width: 100%;
  padding: 13px 40px 13px 16px;
  font-size: 14px;
  color: #33363b;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.sorec-form-field input[type="text"]::placeholder,
.sorec-form-field input[type="date"]::placeholder {
  color: #999999;
}

.sorec-form-field input[type="text"]:focus,
.sorec-form-field input[type="date"]:focus {
  border-color: #978c5e;
  box-shadow: 0 0 0 2px rgba(151, 140, 94, 0.18);
}

.sorec-field-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaaaaa;
  font-size: 14px;
  pointer-events: none;
  line-height: 1;
}

.sorec-field-select {
  position: relative;
}

.sorec-field-select select {
  width: 100%;
  padding: 13px 40px 13px 16px;
  font-size: 14px;
  color: #33363b;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 2px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.sorec-field-select select:focus {
  border-color: #978c5e;
  box-shadow: 0 0 0 2px rgba(151, 140, 94, 0.18);
}

.sorec-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #4a90d9;
  font-size: 12px;
  pointer-events: none;
  line-height: 1;
}

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

.sorec-field-half {
  width: 100%;
}

.sorec-field-half input {
  width: 100%;
}

.sorec-form-place {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.place-label {
  color: #33363b;
  font-size: 14px;
  font-weight: 500;
}

.place-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.place-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.place-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #978c5e;
  cursor: pointer;
  flex-shrink: 0;
}

.place-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 2px;
  color: #ffffff;
  white-space: nowrap;
}

.place-gold    { background-color: #978c5e; }
.place-silver  { background-color: #8a8a8a; }
.place-bronze  { background-color: #9e6840; }
.place-neutral { background-color: #bdbdbd; color: #33363b; }

.sorec-search-submit-wrap {
  margin-top: 28px;
}

.sorec-search-submit {
  display: block;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #978c5e;
  background-color: #000000;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sorec-search-submit:hover {
  background-color: #222222;
}

.sorec-results-section {
  margin-top: 8px;
}

.sorec-results-header {
  padding-bottom: 14px;
  margin-bottom: 24px;
  border-bottom: 1px solid #978c5e;
}

.sorec-results-count {
  font-size: 1.1rem;
  font-weight: 600;
  font-style: italic;
  color: #ffffff;
  margin: 0;
}

.sorec-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.src-card {
  background-color: #ffffff;
  border-radius: 10px 10px 10px 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.src-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.src-card-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #1a1d21;
  border-radius: 10px 10px 0 0;
}

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

.src-card-no-thumb {
  width: 100%;
  height: 100%;
  background-color: #25272b;
}

.src-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.src-card-play {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 16, 18, 0.82);
  border: 2px solid #978c5e;
  border-radius: 4px;
  color: #978c5e;
  font-size: 18px;
}

.src-card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.82);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
}

.src-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: #000000;
  border: 1px solid #978c5e;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.src-card-body {
  padding: 12px 14px 14px;
}

.src-card-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.src-card-title a {
  color: #1f2123;
  text-decoration: none;
  transition: color 0.15s ease;
}

.src-card-title a:hover {
  color: #978c5e;
}

.src-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #978c5e;
  font-weight: 500;
}

.src-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.src-page-btn {
  padding: 10px 22px;
  background-color: transparent;
  color: #978c5e;
  border: 1px solid #978c5e;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.src-page-btn:hover {
  background-color: #978c5e;
  color: #ffffff;
}

.src-page-info {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.sorec-results-loading {
  text-align: center;
  padding: 60px 0;
  color: #978c5e;
}

.sorec-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(151, 140, 94, 0.25);
  border-top-color: #978c5e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.sorec-results-empty {
  text-align: center;
  padding: 60px 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
}

@media screen and (max-width: 768px) {
  .sorec-search-form-wrap {
    padding: 24px 20px 28px;
  }
  .sorec-search-grid {
    grid-template-columns: 1fr;
  }
  .sorec-search-grid-split {
    grid-template-columns: 1fr;
  }
  .sorec-form-place {
    align-items: flex-start;
  }
  .sorec-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  .src-card-play {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* ============================================
   PAGE VIDEO - Layout général
   ============================================ */

html body.theme-sorec .viewer-container {
  background-color: #1a1d21;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 24px;
}

html body.theme-sorec .media-title-section {
  background-color: #2d333b;
  padding: 20px 24px;
  border-bottom: 1px solid #978c5e;
}

html body.theme-sorec .sorec-data-table-section {
  margin-top: 32px;
}


/* ============================================
   SOREC — Page CONTACTEZ-NOUS (image 7)
   ============================================ */
html body.theme-sorec .sorec-contact-page {
  padding: 28px 0 60px;
}
html body.theme-sorec .sorec-contact-heading {
  color: #ffffff;
  font-size: 30px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid #978c5e;
}
html body.theme-sorec .sorec-contact-card {
  background: #ffffff;
  padding: 56px clamp(20px, 8vw, 130px);
  margin-top: 30px;
}
html body.theme-sorec .sorec-contact-form p {
  margin: 0 0 24px;
}
html body.theme-sorec .sorec-contact-form label {
  display: block;
  color: #1f2123;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
}
html body.theme-sorec .sorec-contact-form input[type="text"],
html body.theme-sorec .sorec-contact-form input[type="email"],
html body.theme-sorec .sorec-contact-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #c8c8c8;
  border-radius: 0;
  font-size: 15px;
  color: #1f2123;
  background: #fff;
  outline: none;
}
html body.theme-sorec .sorec-contact-form input:focus,
html body.theme-sorec .sorec-contact-form textarea:focus {
  border-color: #978c5e;
}
html body.theme-sorec .sorec-contact-form textarea {
  min-height: 120px;
  resize: vertical;
}
html body.theme-sorec .sorec-contact-form .helptext,
html body.theme-sorec .sorec-contact-form ul.errorlist {
  font-size: 12px;
}
html body.theme-sorec .sorec-contact-submit {
  display: block;
  width: 100%;
  background: #000000;
  color: #c2b07c;
  border: none;
  padding: 16px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
html body.theme-sorec .sorec-contact-submit:hover {
  background: #978c5e;
  color: #000000;
}
html body.theme-sorec .sorec-contact-success {
  color: #1f2123;
  font-size: 18px;
  text-align: center;
  margin: 0;
  padding: 20px;
}


.src-page-btn.active,
.src-page-num.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}
.src-page-btn.src-page-next {
  background: #978c5e;
  color: #ffffff;
  border-color: #978c5e;
}
.src-page-btn.src-page-next:hover {
  background: #a0915d;
}

/* ============================================
   SOREC — Bannière carrousel page d'accueil (image 2)
   (placé dans _extra.css car la home ne charge pas index.css)
   ============================================ */
.home-banner { width: 100%; margin: 0 0 8px; background: #16181b; }
.home-banner .home-banner-stage {
  position: relative; width: 100%; min-height: 560px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  display: flex; align-items: flex-end; overflow: hidden;
}
.home-banner .home-banner-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(0,0,0,0.80) 0%, rgba(0,0,0,0.5) 38%, rgba(0,0,0,0.15) 70%, rgba(0,0,0,0.35) 100%);
}
.home-banner .home-banner-content { position: relative; z-index: 2; padding: 0 0 56px 56px; max-width: 60%; }
.home-banner .home-banner-title {
  color: #fff; font-size: 38px; line-height: 1.1; font-weight: 800;
  text-transform: uppercase; margin: 0 0 10px; text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.home-banner .home-banner-subtitle { color: #e8e8e8; font-size: 18px; margin: 0 0 22px; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.home-banner .home-banner-play {
  display: inline-flex; align-items: center; gap: 10px; background: #000; color: #fff;
  text-decoration: none; font-size: 20px; font-weight: 600; padding: 14px 26px;
  border: 1px solid rgba(255,255,255,0.15); transition: background .15s ease, color .15s ease;
}
.home-banner .home-banner-play .material-icons { color: #978c5e; font-size: 28px; }
.home-banner .home-banner-play:hover { background: #978c5e; color: #000; }
.home-banner .home-banner-play:hover .material-icons { color: #000; }
.home-banner .home-banner-thumbs {
  position: absolute; z-index: 2; top: 16px; right: 16px; bottom: auto; width: 220px;
  margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column;
  justify-content: flex-start; gap: 8px; overflow: hidden;
}
.home-banner .home-banner-thumb {
  flex: 0 0 auto; width: 100%; aspect-ratio: 219 / 137; background-size: cover; background-position: center;
  background-color: #25272b; cursor: pointer; border: 1px solid transparent; border-radius: 3px;
  opacity: 0.85; transition: opacity .15s ease, border-color .15s ease;
}
.home-banner .home-banner-thumb:hover { opacity: 1; }
.home-banner .home-banner-thumb.active { opacity: 1; border-color: #978c5e; }
@media (max-width: 900px) {
  .home-banner .home-banner-stage { min-height: 240px; }
  .home-banner .home-banner-content { max-width: 100%; padding: 0 0 28px 20px; }
  .home-banner .home-banner-title { font-size: 24px; }
  .home-banner .home-banner-subtitle { font-size: 15px; margin-bottom: 14px; }
  .home-banner .home-banner-play { font-size: 16px; padding: 10px 18px; }
  .home-banner .home-banner-thumbs { display: none; }
}


.page-main-wrap { padding-left: 0 !important; }


html body.theme-sorec { --logo-height: 46px; --header-height: 75px; }
html body.theme-sorec .page-header { padding-top: 5px; }
html body.theme-sorec .header-nav { margin-left: 0; }
html body.theme-sorec .page-header .logo img {
  max-width: 183px;
  max-height: none;
  width: auto;
  height: auto;
  margin: 2px 0;
}
html body.theme-sorec .page-header-left { padding-left: 48px; }
@media (max-width: 768px) {
  html body.theme-sorec .page-header-left { padding-left: 16px; }

  /* Bouton menu (toggle sidebar) deplace a droite du header en mobile.
     height:40px override la regle .page-header-left > * > * { height:100% }
     heritee du layout tableau du header : en position:fixed ce 100% se
     calculerait sur la hauteur de l'ecran entier (pas celle du header),
     ce qui faisait sortir le bouton hors-champ via le translateY(-50%).
     right:60px (et pas 8px) pour laisser la place au bouton recherche
     existant (.page-header-right, colle a right:0) : les deux boutons
     se superposaient exactement au meme endroit sinon, le hamburger
     (z-index plus eleve) bloquait les clics sur la recherche. */
  html body.theme-sorec .toggle-sidebar {
    position: fixed;
    top: calc(var(--header-height) / 2);
    left: auto;
    right: 60px;
    height: 40px;
    transform: translateY(-50%);
    z-index: 10000;
  }
}
html body.theme-sorec .page-footer .page-footer-logo img {
  max-height: 70px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* ============================================
   SOREC — Police de la charte vod.sorec.ma
   TOUT le site est en "Saira Extra Condensed"
   (menu, titres, cartes, dates, tableaux, boutons…)
   ============================================ */
html body.theme-sorec,
html body.theme-sorec a,
html body.theme-sorec p,
html body.theme-sorec span,
html body.theme-sorec h1,
html body.theme-sorec h2,
html body.theme-sorec h3,
html body.theme-sorec h4,
html body.theme-sorec h5,
html body.theme-sorec h6,
html body.theme-sorec li,
html body.theme-sorec td,
html body.theme-sorec th,
html body.theme-sorec label,
html body.theme-sorec input,
html body.theme-sorec textarea,
html body.theme-sorec button,
html body.theme-sorec select,
html body.theme-sorec .header-nav-link {
  font-family: "Saira Extra Condensed", "Helvetica Neue", Arial, sans-serif;
}

html body.theme-sorec .media-list-header h2,
html body.theme-sorec .sorec-contact-heading,
html body.theme-sorec .home-banner-title {
  font-family: "Saira Extra Condensed", "Helvetica Neue", Arial, sans-serif;
  font-style: italic;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ============================================
   SOREC — Page vidéo : infos à droite de la vidéo,
   description + tableau des gagnants en pleine largeur dessous
   (image cible vod.sorec.ma)
   ============================================ */
@media (min-width: 1024px) {
  html body.theme-sorec .viewer-section.viewer-wide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas:
      "player side"
      "below  below";
    column-gap: 24px;
    align-items: start;
    max-width: 1320px;
  }
  html body.theme-sorec .viewer-section.viewer-wide > .viewer-container {
    grid-area: player;
    min-width: 0;
    width: 100% !important;
  }
  html body.theme-sorec .viewer-section.viewer-wide > .viewer-section-nested,
  html body.theme-sorec .viewer-section.viewer-wide .viewer-info,
  html body.theme-sorec .viewer-section.viewer-wide .viewer-info-inner,
  html body.theme-sorec .viewer-section.viewer-wide .sorec-video-info { display: contents; }
  html body.theme-sorec .viewer-section.viewer-wide .sorec-side { grid-area: side; min-width: 0; padding-right: 24px; }
  html body.theme-sorec .viewer-section.viewer-wide .sorec-below { grid-area: below; min-width: 0; padding: 8px 24px 0; }

  html body.theme-sorec .viewer-section.viewer-wide .viewer-sidebar { display: none; }
}

html body.theme-sorec .sorec-video-title,
html body.theme-sorec .sorec-data-table .table-title {
  font-family: "Saira Extra Condensed", "Helvetica Neue", Arial, sans-serif;
  font-style: italic;
}
/* le titre de la vidéo garde sa casse d'origine (comme vod.sorec.ma) ;
   seuls les titres de tableaux sont en majuscules */
html body.theme-sorec .sorec-data-table .table-title {
  text-transform: uppercase;
}
html body.theme-sorec .sorec-video-title {
  text-transform: none;
}

/* ============================================
   SOREC — Lecteur vidéo : fond noir, vidéo contenue
   (letterbox, comme vod.sorec.ma), coins droits
   ============================================ */
html body.theme-sorec .viewer-container .player-container,
html body.theme-sorec .viewer-container .player-container-inner,
html body.theme-sorec .video-js,
html body.theme-sorec .video-js .vjs-tech,
html body.theme-sorec .video-js video,
html body.theme-sorec .video-js .vjs-poster {
  background-color: #000 !important;
}
html body.theme-sorec .video-js .vjs-tech,
html body.theme-sorec .video-js video {
  object-fit: contain !important;
}
html body.theme-sorec .video-js .vjs-poster {
  background-size: contain !important;
}
html body.theme-sorec .video-js,
html body.theme-sorec .video-js.video-js-rounded-corners,
html body.theme-sorec .viewer-container .player-container {
  border-radius: 0 !important;
}

/* ============================================
   SOREC — Grille d'accueil calée sur vod.sorec.ma :
   contenu centré (~1760px), 4 cartes par ligne, gaps réguliers.
   (On force une grille CSS car MediaCMS afficherait 8 colonnes à 1900px.)
   ============================================ */
@media (min-width: 1024px) {
  /* !important necessaire : le coeur de MediaCMS a une regle plus
     specifique, .visible-sidebar .media-list-wrapper.items-list-ver
     { padding: 0; }, qui s'active des que body a la classe
     visible-sidebar (vestige du systeme de sidebar par defaut sur
     desktop, meme si on la garde invisible) et annulerait sinon cette
     marge exterieure. 25px = meme espacement que le gap entre cartes. */
  html body.theme-sorec .media-list-wrapper {
    max-width: 100%;
    margin: 0;
    padding: 0 25px !important;
    box-sizing: border-box;
  }
  html body.theme-sorec .media-list-row {
    width: 100% !important;
    max-width: 100% !important;
  }
  html body.theme-sorec .items-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    width: 100% !important;
  }
  html body.theme-sorec .items-list > .item {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html body.theme-sorec .items-list-outer.list-slider { margin: 0 !important; }
  html body.theme-sorec .previous-slide,
  html body.theme-sorec .next-slide { display: none !important; }
  html body.theme-sorec .items-list-outer.list-slider .items-list { transform: none !important; left: 0 !important; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  html body.theme-sorec .items-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
  }
  html body.theme-sorec .items-list > .item {
    width: 100% !important; max-width: 100% !important; min-width: 0 !important; margin: 0 !important;
  }
  html body.theme-sorec .previous-slide,
  html body.theme-sorec .next-slide { display: none !important; }
}

/* ============================================
   SOREC — Pagination numérotée (1 2 3 4 >) comme vod.sorec.ma / image 6
   ============================================ */
html body.theme-sorec .sorec-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 34px 0 10px;
  padding: 16px 0;
}
html body.theme-sorec .sorec-page-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #c2b07c;
  border: 1px solid #c2b07c;
  border-radius: 2px;
  font-family: "Saira Extra Condensed", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
html body.theme-sorec .sorec-page-btn:hover {
  background: rgba(194, 176, 124, 0.15);
}
html body.theme-sorec .sorec-page-btn.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}
html body.theme-sorec .sorec-page-btn.sorec-page-next {
  background: #c2b07c;
  color: #ffffff;
  border-color: #c2b07c;
}
html body.theme-sorec .sorec-page-btn.sorec-page-next:hover {
  background: #978c5e;
  border-color: #978c5e;
}


html body.theme-sorec .sorec-cat-banner {
  background: #000000;
  color: #ffffff;
  font-family: "Saira Extra Condensed", "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
  font-weight: 500;
  padding: 16px 50px;
}
