/*
 * startpage-brand.css - Header center branding bar
 *
 * Company logo, site name, MENU/EDIT buttons, and menu dropdown.
 * Separated from startpage.css for independent editing.
 * Requires CSS variables from startpage.css :root (--panel-bg, --panel-color,
 * --panel-font, --panel-font-size).
 */


/* Header center: branding bar with white background */
.header-center {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 8px;
  padding: 0 calc(var(--row-height) * 11 / 36);  /* 11px at 36px row-height */
  gap: calc(var(--row-height) * 5 / 18);          /* 10px at 36px row-height */
}

.header-brand-icon {
  width: calc(var(--row-height) * 5 / 3);
  height: calc(var(--row-height) * 5 / 3);
  flex-shrink: 0;
  object-fit: contain;
}

/* Brand logo container: flex-absorbs remaining width, container query context */
.header-brand-text {
  flex: 1;
  min-width: 0;
  height: calc(var(--row-height) * 5 / 3);        /* 60px at 36px row-height */
  container-type: size;
  overflow: hidden;
}

/* Brand logo images: only one visible at a time based on container width */
.header-brand-logo {
  display: none;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

/* Default: square logo (narrowest container) */
.header-brand-logo.logo-square { display: block; }

@container (min-aspect-ratio: 2 / 1) {
  .header-brand-logo.logo-square { display: none; }
  .header-brand-logo.logo-mid { display: block; }
}

@container (min-aspect-ratio: 4 / 1) {
  .header-brand-logo.logo-mid { display: none; }
  .header-brand-logo.logo-wide { display: block; }
}

/* Button group: MENU stacked over EDIT, sized to mirror favicon on left */
.header-btn-group {
  width: calc(var(--row-height) * 5 / 3);
  height: calc(var(--row-height) * 5 / 3);         /* 60px at 36px row-height */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  position: relative;
}

.header-btn {
  display: block;
  width: 100%;
  padding: 2px 0;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #f0f0f0;
  color: #333;
  font-size: 10px;
  font-family: sans-serif;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.header-btn:hover {
  background: #ddd;
}

/* Menu dropdown panel */
#menu-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 140px;
  background: var(--panel-bg);
  color: var(--panel-color);
  border: 1px solid #555;
  border-radius: 6px;
  padding: 8px;
  z-index: 1500;
  font-family: var(--panel-font);
  font-size: var(--panel-font-size);
}

#menu-panel.visible {
  display: block;
}

#menu-panel button,
#menu-panel a {
  display: block;
  width: 100%;
  text-align: center;
  margin-right: 0;
  margin-bottom: 4px;
  text-decoration: none;
  color: inherit;
}

#menu-panel a {
  padding: 6px 14px;
  border: 1px solid #555;
  border-radius: 3px;
  background: #2a2a2e;
  font-size: 13px;
  cursor: pointer;
  box-sizing: border-box;
}

#menu-panel a:hover {
  background: #3a3a3e;
  color: #fff;
}

#menu-panel > :last-child {
  margin-bottom: 0;
}
