/**
 * @file
 * Deao subtheme: layout and header.
 */

/* -------------------------------------------------------------------------- */
/* Site header bar: search (left) · branding (center) · language (right)       */
/* -------------------------------------------------------------------------- */

header#header.deao-header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.deao-site-header__bar {
  padding: 0.75rem 0;
}

.deao-site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1rem;
}

.deao-site-header__search {
  justify-self: start;
  min-width: 0;
}

.deao-site-header__brand {
  justify-self: center;
  text-align: center;
  min-width: 0;
}

.deao-site-header__brand .block {
  margin: 0;
}

.deao-site-header__brand .block-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.deao-site-header__brand a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #222;
  font-weight: 600;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  line-height: 1.2;
}

.deao-site-header__brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.deao-site-header__tools {
  justify-self: end;
  min-width: 0;
}

/* Header search: scoped to `deao-search-block-form` only (not `search-block-form`). Left padding = icon gutter. */
.deao-site-header__search form.deao-search-block-form {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  margin: 0;
  padding: 0 0 0 1.75rem;
}

.deao-site-header__search form.deao-search-block-form::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.125rem;
  height: 1.125rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}

.deao-site-header__search .block:not(:first-child) form.deao-search-block-form::before {
  content: none;
}

.deao-site-header__search .form-item,
.deao-site-header__search .js-form-item {
  display: flex;
  align-items: center;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.deao-site-header__search input.deao-search-input {
  width: 100%;
  max-width: 12rem;
  border: none;
  background: transparent;
  box-shadow: none;
  margin: 0;
  padding: 0.4rem 0;
  color: #333;
  line-height: 1.25;
  vertical-align: middle;
}

.deao-site-header__search input.deao-search-input::placeholder {
  color: #888;
}

.deao-site-header__search input.deao-search-input:focus {
  outline: none;
  box-shadow: none;
}

.deao-site-header__search .form-actions {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Language switcher (globe dropdown)                                         */
/* -------------------------------------------------------------------------- */

.deao-lang-switcher {
  position: relative;
}

.deao-lang-switcher__toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f5f5f5;
  color: #222;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.deao-lang-switcher__toggle:hover,
.deao-lang-switcher__toggle:focus-visible {
  background: #eee;
  border-color: #ccc;
}

.deao-lang-switcher__toggle:focus-visible {
  outline: 2px solid #1a9b57;
  outline-offset: 2px;
}

.deao-lang-switcher__globe svg {
  display: block;
}

.deao-lang-switcher__caret {
  display: block;
  width: 0;
  height: 0;
  margin-top: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #444;
}

.deao-lang-switcher__menu {
  min-width: 9rem;
  padding: 0.35rem 0;
  margin-top: 0.35rem !important;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.deao-lang-switcher__menu .deao-lang-switcher__item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.deao-lang-switcher__link.dropdown-item {
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
  color: #222;
}

.deao-lang-switcher__link.dropdown-item:hover,
.deao-lang-switcher__link.dropdown-item:focus {
  background: #f7f7f7;
  color: #111;
}

/* Active language: green label + checkmark */
.deao-lang-switcher__item.is-active .deao-lang-switcher__link {
  color: #1a9b57;
  font-weight: 600;
  background: #f7fcf9;
}

.deao-lang-switcher__item.is-active .deao-lang-switcher__link::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.4rem;
  vertical-align: -0.1em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231a9b57'%3E%3Cpath d='M13.485 3.485a.75.75 0 010 1.06l-6.5 6.5a.75.75 0 01-1.06 0l-3-3a.75.75 0 111.06-1.06l2.47 2.47 5.97-5.97a.75.75 0 011.06 0z'/%3E%3C/svg%3E") no-repeat center / contain;
}

@media (max-width: 575.98px) {
  .deao-site-header__inner {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .deao-site-header__search,
  .deao-site-header__brand,
  .deao-site-header__tools {
    justify-self: stretch;
  }

  .deao-site-header__tools {
    display: flex;
    justify-content: flex-end;
  }

  .deao-site-header__brand .block-content {
    justify-content: center;
  }

  .deao-site-header__search input.deao-search-input {
    max-width: none;
  }
}
