/*
 * ui.css - the few things the Angular app got from the Angular runtime rather than from CSS
 * (visibility of hidden widgets, inline styles PrimeNG sets from JS, server-side validation hints).
 * Everything else comes from styles.css + primeng.css (the Aura theme captured from the Angular app).
 */
[hidden] { display: none !important; }

/* p-dialog: the mask centres the dialog (inline styles in PrimeNG) */
.p-dialog-mask { display: flex; align-items: center; justify-content: center; z-index: 1101; }
.p-dialog-mask .p-dialog { display: flex; flex-direction: column; pointer-events: auto; z-index: 1102; }

/* p-tabs / p-select helpers */
.p-tablist-tab-list { position: relative; }
.p-select { cursor: pointer; }
.p-select-overlay { box-sizing: border-box; }

/* form validation (server side) */
.ui-error { color: #d9534f; display: block; margin-top: 4px; }
.p-inputtext.ng-invalid, .p-textarea.ng-invalid { border-color: #d9534f; }
.p-message-success, .p-message-error { margin-bottom: 1rem; }

/* clients AJAX results */
#clients-results { transition: opacity 0.2s; }
#clients-results.is-loading { opacity: 0.45; pointer-events: none; }
.filter-section { margin-bottom: 1rem; }
.filter-tag .close a { color: inherit; }

/* raw CMS html (see tools/add_html_p.py): behaves like the <p> the Angular app injects it into */
div.html-p { display: block; }

/* p-accordion: the toggle icon flips when a panel is open (PrimeNG swaps the svg) */
.p-accordionpanel-active > .p-accordionheader .p-accordionheader-toggle-icon { transform: rotate(180deg); }

/*
 * Mobile menu on tablets / narrow windows too.
 * styles.css only swaps the menu bar for the hamburger below 600px, so between 601px and ~1100px the
 * menu wraps onto two lines and there is no hamburger at all. Use the drawer up to 1024px.
 */
@media (max-width: 1024px) {
  .header .menu,
  .header .hidden-mobile { display: none !important; }
  a.icon { display: block !important; visibility: visible !important; }
}

/* desktop menu: 20px from the top (more specific than the generic .menu rule, so nothing overrides it) */
.header ul.menu { margin-top: 20px; }
