/* =============================================================================
   UNIFIED THEME CSS - Navigation & Footer
   Modern design system for Drupal 10 & Bootstrap 5 - GitHub Style Mobile Menu
   ============================================================================= */

/* =============================================================================
   SHARED VARIABLES & BASE STYLES
   ============================================================================= */
:root {
  /* ── THG colour tokens (earthy = default) ─────────────────────────── */
  --thg-green-deep: #1c2e1e;
  --thg-green-forest: #2d5a30;
  --thg-green-sage: #6b9b4a;
  --thg-orange: #e8720c;
  --thg-orange-hover: #c9630a;
  --thg-body-bg: #f8f7f4;

  /* ── Derived / composite tokens ────────────────────────────────────── */
  --primary-gradient: linear-gradient(135deg, var(--thg-green-forest) 0%, var(--thg-green-deep) 100%);
  --accent-gradient: linear-gradient(90deg, var(--thg-orange), var(--thg-green-forest), var(--thg-green-sage));
  --hover-gradient: linear-gradient(90deg, rgba(240, 124, 0, 0.08) 0%, rgba(240, 124, 0, 0.03) 100%);
  --text-primary: #1a1a1a;
  --text-secondary: var(--thg-green-forest);
  --text-muted: var(--thg-green-sage);
  --accent-color: var(--thg-orange);
  --border-color: rgba(45, 90, 48, 0.15);
  --shadow-light: 0 2px 10px rgba(28, 46, 30, 0.08);
  --shadow-medium: 0 4px 20px rgba(28, 46, 30, 0.12);
  --shadow-hover: 0 8px 30px rgba(232, 114, 12, 0.18);
  --transition-smooth: all 0.3s ease;
  --transition-quick: all 0.2s ease;
  --border-radius: 8px;
  --border-radius-lg: 12px;
}

/* ── Light colour scheme overrides ───────────────────────────────────── */
[data-color-scheme="light"] {
  --thg-green-deep: #3a6b40;
  --thg-green-forest: #4a8a50;
  --thg-green-sage: #8ab870;
  --thg-orange: #f0923c;
  --thg-orange-hover: #d87e2e;
  --thg-body-bg: #f5f7f2;
}

/* =============================================================================
   FOOTER STYLES
   ============================================================================= */
.footer {
  background: var(--thg-green-deep);
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.footer h4 {
  color: #ffffff;
  font-weight: 600;
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.footer h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent-color);
  border-radius: 1px;
}

.footer .btn-link {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none;
  padding: 8px 0;
  display: block;
  transition: var(--transition-smooth);
  border: none;
  text-align: left;
}

footer .btn-link:hover {
  color: var(--thg-orange) !important;
  padding-left: 10px;
  transform: translateX(5px);
}

.social-btn {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: var(--transition-smooth);
  margin-right: 10px;
  font-size: 15px;
}

.social-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.social-btn.facebook:hover {
  background: #0b5fcc;
  border-color: #0b5fcc;
  color: white;
}

.social-btn.instagram:hover {
  background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
  border-color: #dc2743;
  color: white;
}

.social-btn.tiktok:hover {
  background: #000000;
  border-color: #000000;
  color: white;
}

.social-btn.telegram:hover {
  background: #26A5E4;
  border-color: #26A5E4;
  color: white;
}

.social-btn.youtube:hover {
  background: #FF0000;
  border-color: #FF0000;
  color: white;
}

.social-btn.flickr:hover {
  background: #ff0084;
  border-color: #ff0084;
  color: white;
}

/* Flickr icon polyfill — Bootstrap Icons has no bi-flickr glyph.
   Uses CSS mask so the icon inherits currentColor in all states. */
.bi.bi-flickr::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='4.5' cy='8' r='3.5'/%3E%3Ccircle cx='11.5' cy='8' r='3.5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='4.5' cy='8' r='3.5'/%3E%3Ccircle cx='11.5' cy='8' r='3.5'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.social-icons-grid {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 8px;
  justify-content: start;
}

.social-icons-grid .social-btn {
  margin-right: 0;
}

/* Zero out Drupal wrapper margins inside header region */
.region-header .block,
.region-header .field,
.region-header .field__item,
.region-header .content {
  margin-bottom: 0 !important;
}

/* =============================================================================
   HEADER SOCIAL ICONS — subtle, sketch-like on light background
   ============================================================================= */
.header-social-icons-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  color: rgba(45, 90, 48, 0.4);
  text-decoration: none !important;
  background: none;
  border: none;
  border-radius: 50%;
  transition: color 0.25s ease, transform 0.2s ease;
  background-image: none !important;
  background-size: 0 !important;
  padding-bottom: 0;
}

.header-social-icon:hover,
.header-social-icon:focus {
  color: var(--thg-orange, #e8720c);
  text-decoration: none !important;
  transform: scale(1.15);
  background-image: none !important;
}

.header-social-icon:focus-visible {
  outline: 2px solid var(--thg-orange);
  outline-offset: 2px;
}

[data-bs-theme="dark"] .header-social-icon {
  color: rgba(255, 255, 255, 0.4);
}

[data-bs-theme="dark"] .header-social-icon:hover,
[data-bs-theme="dark"] .header-social-icon:focus {
  color: rgba(255, 255, 255, 0.95);
}

.contact-info {
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.contact-info i {
  width: 20px;
  margin-right: 15px;
  margin-top: 2px;
  color: var(--thg-orange);
  flex-shrink: 0;
}

.copyright {
  background-color: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 20px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

/* Footer Accordion Styles */
.footer .accordion-button {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 15px 0;
  box-shadow: none;
}

.footer .accordion-button:not(.collapsed) {
  background: transparent;
  color: var(--accent-color);
  box-shadow: none;
}

.footer .accordion-button:focus {
  box-shadow: none;
  border: none;
}

.footer .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%233498db'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.footer .accordion-body {
  padding: 0;
  background: transparent;
}

.footer .accordion-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
}

/* =============================================================================
   NAVIGATION STYLES - GitHub Style Mobile Menu
   ============================================================================= */

/* Desktop Navigation */

.navbar-brand a.site-title {
  color: white !important;
}

.nav-link {
  color: white;
}
.nav-brand .nav-link:hover {
  font-weight: bold !important;
  color: white !important;
}

/* Pill-style nav links */
.unified-nav .desktop-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.unified-nav .desktop-nav .nav-link:hover,
.unified-nav .desktop-nav .nav-link:focus {
  color: white !important;
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.03);
}

/* Active page link — orange pill */
.unified-nav .desktop-nav .nav-link.is-active,
.unified-nav .desktop-nav .nav-link.active,
.unified-nav .desktop-nav .menu-item--active-trail > a,
.unified-nav .desktop-nav .menu-item--active-trail > .nav-link {
  color: white !important;
  background: var(--thg-orange);
  font-weight: 600;
}

/* Keep hover visible on active pill */
.unified-nav .desktop-nav .nav-link.is-active:hover,
.unified-nav .desktop-nav .nav-link.active:hover,
.unified-nav .desktop-nav .menu-item--active-trail > a:hover,
.unified-nav .desktop-nav .menu-item--active-trail > .nav-link:hover {
  background: var(--thg-orange-hover);
}

/* Dropdown toggle open state */
.unified-nav .desktop-nav .nav-link.show,
.unified-nav .desktop-nav .nav-link.show:focus {
  color: white !important;
  background: rgba(255, 255, 255, 0.15);
}

/* Last two nav item dropdowns — align to right edge to prevent off-screen overflow */
.unified-nav .desktop-nav li:nth-last-child(-n+2) .dropdown-menu,
.unified-nav .desktop-nav li:nth-last-child(-n+2) .dropdown-menu[data-bs-popper] {
  right: 0 !important;
  left: auto !important;
}

.unified-nav .desktop-nav {
  background: var(--primary-gradient);
  box-shadow: var(--shadow-medium);
  border-bottom: 3px solid transparent;
  border-image: var(--accent-gradient) 1;
  transition: var(--transition-smooth);
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.unified-nav .container-fluid {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.unified-nav .desktop-nav:hover {
  box-shadow: var(--shadow-hover);
}

/* Mobile Header - Fixed at top */
.mobile-header {
  background: var(--primary-gradient);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-medium);
  z-index: 1050;
  height: 70px;
}

/* Hamburger Menu Button - GitHub Style */
.mobile-menu-btn {
  color: white;
  background: transparent;
  border: none;
  padding: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
  cursor: pointer;
  border-radius: 6px;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-btn:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Hamburger Lines - GitHub Style Animation */

.hamburger-line {
  width: 18px;
  height: 2px;
  /*background: var(--text-primary);*/
  background: white;
  border-radius: 1px;
  transition: all 0.3s ease;
  display: block;
  transform-origin: center;
}

/* Hamburger to X Animation */

.mobile-menu-btn.menu-open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.mobile-menu-btn.menu-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.mobile-menu-btn.menu-open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

.brand-section {
  text-align: center;
}

.brand-logo {
  height: 32px;
  width: auto;
  transition: var(--transition-smooth);
}

.brand-link {
  /*color: var(--text-primary);*/
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.brand-link:hover {
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Mobile Off-canvas - Full Screen Coverage */
.offcanvas .nav-link,
.mobile-offcanvas .nav-link {
  color: #1a1a1a;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 14px;
}

.mobile-offcanvas {
  --bs-offcanvas-bg: #f8f9fa;
  --bs-offcanvas-width: 100vw;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  top: 0 !important;
  left: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

.mobile-offcanvas-body {
  padding: 62px 10px 0 10px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex;
  flex-direction: column;
  height: 100vh !important;
  /* Change from 100% to 100vh */
  min-height: 100vh !important;
}

.mobile-menu-content {
  flex: 1 1 auto;
  /* Allow it to grow and shrink */
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  /* Important for flex items */
  padding-bottom: 20px;
  /* Add some spacing */
}

/* Mobile Menu Items */
.mobile-offcanvas ul.menu,
.mobile-offcanvas .menu,
.mobile-offcanvas .navbar-nav {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.mobile-offcanvas .menu-item,
.mobile-offcanvas .nav-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin: 0;
}

.mobile-offcanvas .menu-item:last-child,
.mobile-offcanvas .nav-item:last-child {
  border-bottom: none;
}

.mobile-offcanvas .menu-item a,
.mobile-offcanvas .nav-item > a,
.mobile-offcanvas .nav-item > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  text-decoration: none;
  color: #1a1a1a !important;
  transition: var(--transition-quick);
  font-weight: 600;
  font-size: 15px;
  background: transparent;
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.mobile-offcanvas .menu-item a:hover,
.mobile-offcanvas .menu-item a:focus,
.mobile-offcanvas .nav-item > a:hover,
.mobile-offcanvas .nav-item > span:hover {
  background-color: #f0f4f0;
  color: var(--accent-color) !important;
  border-left-color: var(--accent-color);
}

.mobile-offcanvas .menu-item a.is-active,
.mobile-offcanvas .menu-item--active-trail > a,
.mobile-offcanvas .nav-item > a.is-active {
  background-color: rgba(45, 90, 48, 0.08);
  color: var(--accent-color) !important;
  border-left-color: var(--accent-color);
  font-weight: 700;
}

/* Dropdown Arrows */
.mobile-offcanvas .menu-item--expanded > a::after,
.mobile-offcanvas .menu-item.dropdown > a::after,
.mobile-offcanvas .dropdown-toggle::after,
.mobile-offcanvas .nav-item.dropdown > span::after {
  content: "\F285" !important;
  font-family: "bootstrap-icons" !important;
  font-size: 14px !important;
  font-weight: normal !important;
  color: #999 !important;
  border: none !important;
  vertical-align: middle !important;
  margin-left: auto !important;
  margin-right: 4px;
  transform: rotate(0deg) !important;
  transition: transform 0.25s ease, color 0.25s ease !important;
  flex-shrink: 0 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mobile-offcanvas .menu-item--expanded.show > a::after,
.mobile-offcanvas .menu-item.dropdown.show > a::after,
.mobile-offcanvas .nav-item.dropdown.show > span::after,
.mobile-offcanvas .dropdown.show .dropdown-toggle::after {
  transform: rotate(90deg) !important;
  color: var(--accent-color) !important;
}

/* Submenus - GitHub Style */
.mobile-offcanvas .dropdown-menu,
.mobile-offcanvas .menu-item .menu {
  position: static !important;
  transform: none !important;
  float: none !important;
  width: 100% !important;
  min-width: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #f6f8fa;
  display: none;
  overflow: hidden;
}

.mobile-offcanvas .dropdown-menu.show,
.mobile-offcanvas .menu-item .menu.show {
  display: block;
}

.mobile-offcanvas .menu-item .menu {
  background: #f6f8fa;
  border-left: none;
  margin: 0;
  overflow: hidden;
}

.mobile-offcanvas .menu-item .menu .menu-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-offcanvas .menu-item .menu .menu-item:last-child {
  border-bottom: none;
}

.mobile-offcanvas .menu-item .menu .menu-item a {
  padding: 9px 14px 9px 32px;
  font-size: 14px;
  font-weight: 400;
  color: #444 !important;
  border-left: none;
}

.mobile-offcanvas .menu-item .menu .menu-item a:hover {
  color: var(--accent-color) !important;
  background-color: #e7f3ff;
}

/* Bootstrap dropdown items inside mobile menu */
.mobile-offcanvas .dropdown-menu .nav-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-offcanvas .dropdown-menu .nav-item:last-child {
  border-bottom: none;
}

.mobile-offcanvas .dropdown-menu .dropdown-item {
  padding: 9px 14px 9px 32px;
  font-size: 14px;
  font-weight: 400;
  color: #444 !important;
  white-space: normal;
  border-left: none;
  transition: var(--transition-quick);
}

.mobile-offcanvas .dropdown-menu .dropdown-item:hover,
.mobile-offcanvas .dropdown-menu .dropdown-item:focus {
  color: var(--accent-color) !important;
  background-color: #f0f4f0;
}

.mobile-offcanvas .dropdown-menu .dropdown-item.is-active {
  color: var(--accent-color) !important;
  background-color: rgba(45, 90, 48, 0.08);
  font-weight: 600;
}

/* Search Footer - GitHub Style */
.mobile-search-footer {
  background: #f6f8fa;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-top: 0;
  /* Remove auto margin */
  flex-shrink: 0;
  /* Prevent it from shrinking */
  position: sticky;
  /* Make it stick to bottom */
  bottom: 0;
}

.search-container {
  position: relative;
}

.search-input {
  background: #ffffff !important;
  border: 1px solid #d1d9e0 !important;
  color: #24292f !important;
  padding: 12px 12px 12px 40px !important;
  border-radius: 6px !important;
  font-size: 14px;
  transition: var(--transition-smooth);
  width: 100%;
}

.search-input::placeholder {
  color: #656d76;
}

.search-input:focus {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
  outline: none !important;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: #656d76;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.search-input:focus + .search-icon {
  color: var(--accent-color);
}

/* Menu search filtering */
.mobile-menu-content.menu-search-active .nav-item.menu-search-hidden {
  display: none;
}

.mobile-menu-content.menu-search-active .menu-search-match {
  background-color: rgba(232, 114, 12, 0.08);
  font-weight: 600;
}

.search-message {
  padding: 20px 16px;
  text-align: center;
  color: #656d76;
  font-style: italic;
  font-size: 14px;
}

[data-bs-theme="dark"] .search-message {
  color: #6b8a6c;
}

[data-bs-theme="dark"] .mobile-menu-content.menu-search-active .menu-search-match {
  background-color: rgba(232, 114, 12, 0.12);
}

/* Body Spacer */
.mobile-body-spacer {
  padding-top: 70px;
}

/* =============================================================================
   SHARED RESPONSIVE STYLES
   ============================================================================= */
@media (max-width: 991.98px) {
  /* Hide contacts block on mobile/tablet */
  #block-hvgb5subtheme-contacts {
    display: none !important;
  }

  body {
    padding-top: 70px;
  }
  
.mobile-header {
  background: var(--primary-gradient);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-medium);
  z-index: 1050;
  height: 70px;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.mobile-header .container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}

.mobile-header .container-fluid>.d-flex {
  padding-left: 15px;
  padding-right: 15px;
}

  .contacts-mobile-top {
    order: -1;
    margin-bottom: 30px;
  }
  
  .mobile-accordion {
    display: block !important;
  }
  
  .desktop-links {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .mobile-accordion {
    display: none !important;
  }
  
  .desktop-links {
    display: block !important;
  }
}

/* =============================================================================
   ACCESSIBILITY & PERFORMANCE
   ============================================================================= */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for better accessibility */
.mobile-menu-btn:focus-visible,
.brand-link:focus-visible,
.search-input:focus-visible,
.mobile-offcanvas .menu-item a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Hide elements properly from screen readers when needed */
.mobile-offcanvas .block-system-branding-block {
  display: none;
}

/* Ensure proper overflow handling */
#modernMobileMenu {
  overflow-x: hidden !important;
}

mobile-offcanvas .menu-item a {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
}

/* Block spacing */
.mobile-offcanvas .block {
  margin-bottom: 0;
}

/* Override Bootstrap offcanvas backdrop */
.offcanvas-backdrop {
  background-color: rgba(0, 0, 0, 0.5) !important;
}