/* ========================================================================
   yoo_everest - Joomla 6 compatibility layer
   Joomla 4+ core views use Bootstrap 5 class names. The Everest theme
   ships a Bootstrap 2 compatibility layer (bootstrap.css); the rules
   below cover the Bootstrap 5 utility classes used by Joomla 6 views.
 ========================================================================== */

.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.float-end { float: right !important; }
.float-start { float: left !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.w-100 { width: 100% !important; }
.list-unstyled { padding-left: 0; list-style: none; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 15px !important; }
.mt-3 { margin-top: 15px !important; }
.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }

/* Forms */
.form-control,
.form-select {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  background: #fff;
  color: #444;
  border-radius: 0;
}
textarea.form-control { height: auto; }
.form-check { display: block; min-height: 1.5em; }
.form-check-input { margin-right: 5px; }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > .form-control { flex: 1 1 auto; width: 1%; }
.input-group-text,
.input-group > .btn { display: flex; align-items: center; padding: 0 10px; }
.control-group { margin-bottom: 15px; }
.control-group::after { content: ""; display: table; clear: both; }

/* Joomla alerts rendered by JavaScript */
#system-message-container joomla-alert { margin-bottom: 15px; }

/* Article edit icon */
.tm-article-edit .icons .float-end { float: none !important; }
.tm-article-edit { margin: 0 0 15px 0; }

/* ========================================================================
   Front-end editing (logged in users) - Joomla 6 components
 ========================================================================== */

/* Inline tooltips ("Verrouillé par...", "Modifier l'article"...) */
[role="tooltip"]:not(.show) {
  display: none;
  z-index: 1070;
  max-width: 300px;
  margin: .5em;
  padding: .5em;
  color: #444;
  text-align: left;
  font-size: 12px;
  line-height: 1.4;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
[role="tooltip"][id^="editarticle-"],
[role="tooltip"][id^="editcontact-"] { margin-left: -10em; }
:focus + [role="tooltip"],
:hover + [role="tooltip"],
a:hover > [role="tooltip"],
a:focus > [role="tooltip"] { display: block; position: absolute; }
.tm-article-edit { position: relative; }

/* Bootstrap 5 uses .show where the theme Bootstrap 2 layer uses .in */
.fade.show { opacity: 1; }
.collapse.show { height: auto; overflow: visible; }
.collapse:not(.show):not(.in) { display: none; }
[hidden] { display: none !important; }

/* Buttons used by Joomla 6 views */
.btn-secondary { color: #444; background: #f5f5f5; border: 1px solid #ddd; }
.btn-secondary:hover, .btn-secondary:focus { background: #ebebeb; color: #444; }
.btn-sm { padding: 2px 8px; font-size: 12px; line-height: 20px; }
.btn .icon-fw, .btn [class^="icon-"] { margin-right: 3px; }
.d-grid { display: grid !important; }
.gap-2 { gap: 8px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mt-0 { margin-top: 0 !important; }
.pt-3 { padding-top: 15px !important; }
.pe-2 { padding-right: 8px !important; }
.me-3 { margin-right: 15px !important; }
@media (min-width: 576px) { .d-sm-block { display: block !important; } }

/* Form fields */
.form-text { display: block; margin-top: 4px; font-size: 12px; color: #999; }
.form-check-inline { display: inline-block; margin-right: 15px; }
.form-check-inline .form-check-input { margin: 0 4px 0 0; }
.form-vertical .control-label { float: none; width: auto; padding-top: 0; text-align: left; margin-bottom: 5px; }
.form-vertical .controls { margin-left: 0; }
.control-label label { font-weight: bold; }
.star { color: #d85030; }
.input-group > .form-control,
.input-group > .form-select { height: 30px; }
.input-group > .btn,
.input-group > .input-group-text {
  height: 30px;
  box-sizing: border-box;
  border-radius: 0;
  margin: 0;
  background: #f5f5f5;
  border: 1px solid #ddd;
  color: #444;
}
.input-group > .btn-primary { background: #44a2c7; border-color: #44a2c7; color: #fff; }
.input-group > .btn-danger { background: #d85030; border-color: #d85030; color: #fff; }
.input-group > .btn-success { background: #8cc14c; border-color: #8cc14c; color: #fff; }
.input-group > :not(:first-child) { margin-left: -1px; }
select.form-select { padding: 4px 24px 4px 6px; }
.field-media-wrapper .field-media-preview { margin-bottom: 8px; }
.field-media-wrapper .field-media-preview img { max-width: 100%; height: auto; }

/* Editor toolbar / buttons below TinyMCE */
.toggle-editor.btn-toolbar { margin: 8px 0; }
.editor-xtd-buttons, #editor-xtd-buttons { margin-top: 8px; }
.editor-xtd-buttons .btn, #editor-xtd-buttons .btn { margin: 0 4px 4px 0; }

/* Category list view (front-end) */
.com-content-category__table { width: 100%; }
.com-content-category__pagination { margin-bottom: 15px; }
.com-content-category__pagination .form-select { width: auto; display: inline-block; }
.com-content-categories__item-title-wrapper { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #eee; }
.com-content-categories__children { margin-left: 20px; }

/* Joomla dialogs (media manager, editor buttons) above the theme */
joomla-dialog dialog { z-index: 1050; }

/* Front-end module editing button (Joomla 4+ "jmodedit") */
.uk-panel, .tm-headerbar, .tm-footer > div { position: relative; }
.btn.jmodedit {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  z-index: 900;
  padding: 0 6px;
  line-height: 22px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid #58595a;
  border-radius: 3px;
  color: #44a2c7;
  opacity: .4;
}
.btn.jmodedit:hover, .btn.jmodedit:focus { opacity: 1; }
.btn.jmodedit + [role="tooltip"] { right: 0; top: 24px; }
.jmenuedit { margin-right: 4px; font-size: 11px; }

/* ========================================================================
   Front-end forms (article edit, module edit, profile...) - v2.0.2
 ========================================================================== */

/* Bootstrap 2 ".row" has a -20px margin: Joomla 6 forms use BS5 rows */
.tm-content .row { margin-left: 0; margin-right: 0; }
.tm-content .row::before, .tm-content .row::after { content: ""; display: table; }
.tm-content .row::after { clear: both; }

/* Tabs (joomla-tab) have a white background: use dark text inside */
.tm-content joomla-tab,
.tm-content joomla-tab-element { color: #444; }
.tm-content joomla-tab label,
.tm-content joomla-tab legend,
.tm-content joomla-tab .control-label,
.tm-content joomla-tab h1, .tm-content joomla-tab h2,
.tm-content joomla-tab h3, .tm-content joomla-tab h4 { color: #444; }
.tm-content joomla-tab legend { border-bottom-color: #e5e5e5; }
.tm-content joomla-tab a:not(.btn) { color: #2a86ab; }
.tm-content joomla-tab .form-text { color: #777; }

/* Visible field borders */
.tm-content .form-control,
.tm-content .form-select,
.tm-content textarea {
  border: 1px solid #c8c8c8;
  color: #444;
  background-color: #fff;
}
.tm-content .form-control:focus,
.tm-content .form-select:focus { border-color: #44a2c7; outline: 0; }
.tm-content .form-control[readonly] { background-color: #f5f5f5; }
.tm-content .form-select { height: 30px; }

/* Choices.js (fancy select: "Position", tags...) */
.choices { color: #444; margin-bottom: 0; }
.choices__inner { min-height: 30px; padding: 3px 6px; border: 1px solid #c8c8c8; border-radius: 0; background: #fff; }
.choices__list--single { padding: 2px 16px 2px 2px; }
.choices__list--dropdown, .choices__list[aria-expanded] { color: #444; z-index: 1060; }
.choices__input { color: #444; background: #fff; }
.choices__button,
.choices[data-type*="select-one"] .choices__button {
  text-indent: -9999px !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background-color: transparent !important;
  min-height: 0 !important;
  line-height: 1 !important;
  padding: 0 !important;
  color: transparent !important;
}
.choices__list--multiple .choices__item { background-color: #44a2c7; border-color: #3b92b4; color: #fff; }

/* Switcher (Afficher / Masquer) keeps the label readable on the dark panel */
.switcher label { color: inherit; }

/* Badges used by com_config views */
.badge.bg-secondary { background-color: #44a2c7; color: #fff; }

/* mod_login: passkey button (Joomla 5+) - icon kept small, button in the theme style */
.tm-login-extra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: auto;
    min-height: 30px;
    padding: 4px 10px;
    line-height: 1.3;
    white-space: normal;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: none;
    text-shadow: none;
}
.tm-login-extra:hover,
.tm-login-extra:focus {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.tm-login-extra svg,
.tm-login-extra img {
    flex: 0 0 auto;
    width: 18px !important;
    height: 18px !important;
    max-width: 18px;
    fill: currentColor;
}
.tm-login-extra [class^="icon-"],
.tm-login-extra [class*=" icon-"] {
    font-size: 16px;
}

/* Navbar dropdown: attached directly under the menu bar (no 15px gap) */
.tm-navbar .uk-dropdown-navbar {
    margin-top: 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}
.tm-navbar .uk-dropdown-navbar .uk-dropdown-navbar {
    border-radius: 12px;
}
