/*
 * Joomla core output compat for a UIkit-only template.
 * Core layouts (com_users, com_finder, com_contact, system messages, edit icons, forms)
 * emit Bootstrap 5 class names. Loading Bootstrap/Cassiopeia CSS next to UIkit would fight
 * over base styles, so this file maps the few classes core actually uses onto the UIkit look.
 * (C) 2026 ADA Agency, GPL-2.0-or-later
 */

/* Utilities */
.visually-hidden, .visually-hidden-focusable:not(:focus):not(:focus-within), .sr-only, .element-invisible {
  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, .hidden { display: none !important; }
.float-start { float: left; }
.float-end { float: right; }
.text-end { text-align: right; }
.text-center { text-align: center; }
.clearfix::after { content: ""; display: table; clear: both; }
.list-unstyled { padding-left: 0; list-style: none; }
.list-inline { padding-left: 0; list-style: none; }
.list-inline-item { display: inline-block; margin-right: 10px; }
.mb-3 { margin-bottom: 15px; }
.mt-3 { margin-top: 15px; }
.w-100 { width: 100%; }
.small, small { font-size: 85%; }

/* Forms */
.form-control, .form-select, .inputbox,
.tm-content input[type="text"], .tm-content input[type="email"], .tm-content input[type="password"],
.tm-content input[type="search"], .tm-content input[type="tel"], .tm-content input[type="url"],
.tm-content input[type="number"], .tm-content input[type="date"], .tm-content select, .tm-content textarea {
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  margin: 0;
  font: inherit;
  color: #666;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 0;
  transition: border-color .2s;
}
.tm-content textarea, textarea.form-control { height: auto; min-height: 120px; padding: 8px 10px; }
.form-select, .tm-content select { padding-right: 24px; }
.form-control:focus, .form-select:focus, .tm-content input:focus, .tm-content select:focus, .tm-content textarea:focus {
  outline: none;
  border-color: #2a51a3;
}
.form-control.invalid, .invalid { border-color: #ef3742 !important; }
label.invalid, .form-control-feedback { color: #ef3742; }
.control-group, .form-group { margin-bottom: 15px; }
.control-label, .form-label { display: block; margin-bottom: 5px; font-size: 14px; color: #464646; }
.star { color: #ef3742; }
.form-check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.form-check-input { width: 16px; height: 16px; margin: 0; }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > .form-control { flex: 1; min-width: 0; }
.input-group > .btn, .input-group > .input-group-text { flex: none; }
.input-group-text { display: flex; align-items: center; padding: 0 10px; background: #f8f9fb; border: 1px solid #e5e5e5; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-size: 1.2rem; color: #464646; margin-bottom: 15px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 40px;
  padding: 0 24px;
  margin: 0;
  font: inherit;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1;
  color: #464646;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .1s, color .1s, border-color .1s;
}
.btn:hover { color: #2a51a3; border-color: #b2b2b2; }
.btn-primary, .btn-success { color: #fff; background: #2a51a3; border-color: transparent; }
.btn-primary:hover, .btn-success:hover { color: #fff; background: #1f3e80; }
.btn-danger { color: #fff; background: #ef3742; border-color: transparent; }
.btn-danger:hover { color: #fff; background: #d42430; }
.btn-secondary, .btn-light, .btn-outline-secondary { color: #464646; background: #f8f9fb; }
.btn-link { border: 0; background: none; color: #2a51a3; }
.btn-sm { min-height: 30px; padding: 0 12px; font-size: 12px; }

/* Alerts (fallback when markup is not a joomla-alert element) */
.alert {
  position: relative;
  margin-bottom: 20px;
  padding: 15px 29px 15px 15px;
  background: #d8eafc;
  color: #1e87f0;
}
.alert-success { background: #edfbf6; color: #32d296; }
.alert-warning { background: #fef5ee; color: #faa05a; }
.alert-danger, .alert-error { background: #fef4f6; color: #ef3742; }
joomla-alert { margin-bottom: 20px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.table th, .table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #e5e5e5; }
.table th { font-size: 13px; font-weight: 400; text-transform: uppercase; color: #999; }
.table-striped tbody tr:nth-of-type(odd) { background: #f8f9fb; }

/* Badges / labels */
.badge {
  display: inline-block;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #fff;
  background: #2a51a3;
  vertical-align: middle;
}
.bg-warning { background: #faa05a !important; }
.bg-info, .bg-secondary { background: #999 !important; }

/* Cards (com_finder, com_contact use them) */
.card { background: #fff; box-shadow: 0 5px 15px rgba(0, 0, 0, .08); margin-bottom: 20px; }
.card-header { padding: 14px 20px; background: #f8f9fb; }
.card-body { padding: 20px; }

/* Article info / icons */
.article-info { display: flex; flex-wrap: wrap; gap: 4px 15px; margin: 0 0 15px; font-size: 13px; color: #999; }
.article-info dd { margin: 0; }
.article-info-term { display: none; }
.icons { float: right; }
.icons .dropdown-menu { display: none; }
[class^="icon-"]:empty, [class*=" icon-"]:empty { display: none; }

/* com_users */
.com-users-login, .com-users-registration, .com-users-reset, .com-users-remind, .com-users-profile {
  padding: 30px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
}
.com-users-login__options { margin-top: 20px; padding-left: 0; list-style: none; }
.com-users-login__options .list-group-item { display: block; padding: 4px 0; }
.password-group .input-group .btn { min-height: 40px; }

/* com_finder */
.com-finder { padding: 30px; background: #fff; box-shadow: 0 5px 15px rgba(0, 0, 0, .08); }
.com-finder__search .form-inline, .com-finder__search .input-group { margin-bottom: 20px; }
.com-finder__results-list { list-style: none; padding: 0; }
.com-finder__results-list > li { padding: 15px 0; border-bottom: 1px solid #e5e5e5; }
.result__title-text { font-size: 18px; }
.result__title-url, .result__taxonomy, .result__date { font-size: 13px; color: #999; }
.com-finder__counter { font-size: 13px; color: #999; }

/* Pagination fallback for components that do not use the layout override */
ul.pagination { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; justify-content: center; }
ul.pagination .page-link { display: block; padding: 5px 10px; color: #5c5c5c; }
ul.pagination .active .page-link { color: #fff; background: #2a51a3; }

/* Tooltips / popovers that would require Bootstrap JS */
.tooltip, .popover { display: none; }

/* ---------- Visforms (bt5 layout) ---------- */
.visform .row { display: flex; flex-wrap: wrap; margin: 0; }
.visform [class*="col-"] { flex: 0 0 100%; max-width: 100%; padding: 0; box-sizing: border-box; }
.visform .col-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
.visform .offset-sm-0, .visform .offset-md-0 { margin-left: 0; }
.visform .justify-content-center { justify-content: flex-start; }
.visform .form-group { margin-bottom: 12px; }
.visform .vf-button-container, .visform .vf-button-container .form-group { margin-bottom: 0; }
.visform label { font-size: 14px; color: #464646; margin-bottom: 5px; }
.visform .asterix-ancor::after { color: #ef3742; }
.visform .vis_mandatory { font-size: 12px; font-weight: 400; color: #999; margin-bottom: 4px; }
.visform .visCustomText:empty, .visform .visCustomText:not(:has(*)):not(:has(+ *)) { margin: 0; }
.visform .visCustomText h3 { margin: 30px 0 15px; font-size: 20px; color: #464646; border-bottom: 1px solid #e5e5e5; padding-bottom: 6px; }
.visform .form-control { height: 46px; padding: 0 14px; border-color: #e5e5e5; }
.visform textarea.form-control { height: 160px; min-height: 0; padding: 10px 14px; resize: vertical; }
.visform .form-control::placeholder { color: #aaa; }
.visform .form-check-input, .visform input[type="checkbox"], .visform input[type="radio"] { width: 16px; height: 16px; }
.visform .btn-primary {
  min-height: 46px;
  padding: 0 40px;
  font-size: 13px;
  letter-spacing: 1px;
  background: #2a51a3;
}
.visform .btn-primary:hover:not(:disabled) { background: #1f3e80; }
.visform .btn:disabled { opacity: .85; cursor: not-allowed; }
.visform label.error, .visform [class^="fc-tbx"] label { color: #ef3742; font-size: 12px; }
.visform .form-control.error { border-color: #ef3742; }
.visforms .error-note.vishidden, .vishidden { display: none; }

/* Compact forms (sidebar contact, newsletter): placeholders only, no "Required" line. */
.tm-sidebar .visform .vis_mandatory, .tm-bottom-c .visform .vis_mandatory,
.tm-sidebar .visform label.asterix-ancor:has(> .visually-hidden),
.tm-bottom-c .visform label.asterix-ancor:has(> .visually-hidden) { display: none; }
.tm-sidebar .visform .form-control { height: 42px; font-size: 13px; }
.tm-sidebar .visform textarea.form-control { height: 130px; }

/* Full forms in the content area (contact, job application) */
.tm-content .visforms-form {
  padding: 30px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
}
.tm-content .visform .btn-primary { background: #ef3742; }
.tm-content .visform .btn-primary:hover:not(:disabled) { background: #d42430; }

/* Newsletter (bottom-c): field and button in one row on wide screens. */
.tm-bottom-c .mod-visforms { padding: 30px; background: #fff; box-shadow: 0 5px 15px rgba(0, 0, 0, .08); }
@media (min-width: 640px) {
  .tm-bottom-c .visform .vffieldset.active { display: flex; align-items: flex-start; gap: 20px; }
  .tm-bottom-c .visform .vffieldset > .row { flex: 1; }
  .tm-bottom-c .visform .vffieldset > .clearfix, .tm-bottom-c .visform .vffieldset > .form-group:first-child { display: none; }
  .tm-bottom-c .visform .vffieldset > .col-12 { flex: 0 0 auto; width: auto; }
  .tm-bottom-c .visform .form-group { margin-bottom: 0; }
}

/* Password field: core puts the "Show" text in .visually-hidden next to a Font Awesome icon we do not load. */
.input-password-toggle .visually-hidden { position: static !important; width: auto !important; height: auto !important; margin: 0 !important; clip: auto !important; overflow: visible !important; white-space: nowrap !important; }

.tm-error .tm-error-code { font-size: 64px; line-height: 1; color: #ef3742; margin-bottom: 10px; }
