/* Firma Theme Modernized Styles */

:root {
  --primary-color: #e3722e;
  --secondary-color: #3d3f3f;
  --text-color: #777777;
  --heading-color: #444444;
}

/* --- Layout & Base --- */
html, body {
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #fff; /* Primary page background */
}

/* Fix Drupal's tendency to add bottom padding for the toolbar */
body.toolbar-horizontal, 
body.toolbar-fixed,
body.toolbar-tray-open {
  padding-bottom: 0 !important;
}

/* Ensure footer has no margin that could collapse and create space */
.site-footer {
  flex-shrink: 0;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* NUCLEAR OPTION: Hide anything that might be rendered after the footer in the DOM */
footer.site-footer ~ * {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.main-content, 
main#main-content {
  flex: 1 0 auto;
}

/* Transitions */
.site-header #top-header {
  font-size: 0.875rem;
}

.uk-logo img {
  max-height: 45px;
  transition: transform 0.3s ease;
}

.uk-logo:hover img {
  transform: scale(1.05);
}

.main-content {
  padding: 60px 0;
}

/* --- Navigation & Header Hover --- */
.uk-navbar-nav > li > a {
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
  position: relative;
}

.uk-navbar-nav > li > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: right;
}

.uk-navbar-nav > li:hover > a::after,
.uk-navbar-nav > li.uk-active > a::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-header #top-header a:hover {
  color: #fff !important;
  opacity: 0.8;
  text-decoration: none;
}

/* Social Icon Button Hover */
.uk-icon-button:hover {
  background-color: var(--secondary-color) !important;
  color: #fff !important;
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* --- Component Overrides --- */
.uk-button-primary {
  background-color: var(--primary-color);
  border: 1px solid transparent;
}

.uk-button-primary:hover {
  background-color: var(--heading-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(227, 114, 46, 0.2);
}

.uk-section-primary {
  background-color: var(--primary-color);
}

/* --- Custom Widgets --- */
.title-section {
  margin-bottom: 50px;
  text-align: center;
}

.title-section h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 20px;
  color: var(--heading-color);
}

.title-section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

/* --- Footer Hover --- */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid rgba(0,0,0,0.05);
  font-size: 0.95rem;
}

.site-footer a:not(.uk-icon-button) {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease, padding 0.3s ease;
}

.site-footer a:not(.uk-icon-button):hover {
  color: var(--primary-color) !important;
  padding-left: 8px;
}

/* Scroll to Top Hover */
[uk-totop]:hover {
  background-color: var(--secondary-color) !important;
  color: #fff !important;
}

.site-footer .uk-section-secondary {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Helper Classes */
.border-bottom {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* --- Drupal Admin Toolbar Support --- */
/* Lower z-index to stay below admin menus (Drupal toolbar uses 501+) */
.site-header, 
#top-header, 
#main-header {
  z-index: 500 !important;
}

.uk-sticky-fixed {
  z-index: 510 !important;
}

/* UIkit Sticky offset adjustment for admin toolbar */
.toolbar-fixed .uk-sticky-fixed {
  top: 39px !important;
}

.toolbar-fixed.toolbar-tray-open.toolbar-horizontal .uk-sticky-fixed {
  top: 79px !important;
}

/* --- Typography (Dynamic Fonts) --- */
body {
  font-family: var(--firma-base-font), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .uk-h1, .uk-h2, .uk-h3, .uk-h4, .uk-h5, .uk-h6, .uk-heading-2xlarge, .uk-heading-xlarge, .uk-heading-large, .uk-heading-medium, .uk-heading-small {
  font-family: var(--firma-headings-font), sans-serif;
}

/* --- UIkit & Drupal Form Compatibility Fixes --- */
/* Checkbox and Radio alignment fix */
.uk-checkbox, .uk-radio {
  margin-top: -4px; /* Vertical centering with text */
}

/* Fix for standard Drupal form element layout where label follows input */
.uk-checkbox + label, 
.uk-radio + label,
.form-type-checkbox label,
.form-type-radio label {
  display: inline-block;
  vertical-align: middle;
  padding-left: 8px;
  cursor: pointer;
}

.form-item-checkboxes .form-item,
.form-item-radios .form-item {
  margin-bottom: 5px;
}

/* Ensure inputs take full width if needed, but not checkboxes */
.uk-input, .uk-select, .uk-textarea {
  border-radius: 4px;
}
